/* ========================================
   VIEUX BUYING TRIP -- Design System
   Apple-minimal aesthetic
   ======================================== */

:root {
  /* Brand */
  --color-brand: #86775c;
  --color-brand-light: #a89a7e;
  --color-brand-dark: #6b5f48;

  /* Pin colors */
  --pin-default: #86775c;
  --pin-favorite: #c4a243;
  --pin-dealer: #d4762c;
  --pin-flea-market: #8b5e3c;
  --pin-unvisited: #999999;
  --pin-current-location: #3478f6;

  /* Tag colors */
  --tag-favorite: #c4a243;
  --tag-target: #4a9e6f;
  --tag-excluded: #d32f2f;
  --tag-unvisited: #999999;

  /* UI */
  --color-text: #333;
  --color-text-secondary: #888;
  --color-text-tertiary: #aaa;
  --color-bg: #f5f5f0;
  --color-bg-secondary: #f0ede8;
  --color-bg-hover: rgba(134, 119, 92, 0.04);
  --color-card: #fff;
  --color-surface: #fff;
  --color-border: #e8e4de;
  --color-accent: #86775c;
  --color-danger: #d32f2f;

  /* Layout */
  --header-height: 52px;
  --sidebar-width: 280px;
  --bottom-sheet-peek: 80px;

  /* Typography */
  --font-family: -apple-system, 'Helvetica Neue', 'Segoe UI', sans-serif;
  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-base: 15px;
  --font-size-md: 16px;
  --font-size-lg: 20px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* ========================================
   Reset & Base
   ======================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ========================================
   Header
   ======================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-height) + env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  z-index: 500;
  gap: var(--space-sm);
}

.hamburger-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text);
  flex-shrink: 0;
}

.hamburger-btn:active {
  background: var(--color-bg);
}

.header-location-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text);
  flex-shrink: 0;
}

.header-location-btn:active {
  background: var(--color-bg);
}

.header-title {
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--color-brand);
  white-space: nowrap;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  gap: var(--space-xs);
  margin-left: auto;
  flex-shrink: 1;
  min-width: 0;
}

.filter-select {
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  padding: 4px 22px 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card);
  color: var(--color-text);
  max-width: 120px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px 6px;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--color-brand);
  outline: none;
}

/* ========================================
   Sidebar
   ======================================== */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-card);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.25, 0.1, 0.25, 1);
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

.sidebar.open {
  transform: translateX(0);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.sidebar-brand {
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--color-brand);
}

.sidebar-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
}

.sidebar-nav {
  list-style: none;
  padding: var(--space-sm) 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px var(--space-lg);
  font-size: var(--font-size-base);
  color: var(--color-text);
  transition: background 0.15s ease;
}

.sidebar-link:active {
  background: var(--color-bg);
  color: var(--color-brand);
}

.sidebar-link.active {
  background: var(--color-bg);
  color: var(--color-brand);
  border-left: 3px solid var(--color-brand);
}

.sidebar-link.disabled {
  color: var(--color-text-secondary);
  opacity: 0.5;
  pointer-events: none;
}

.sidebar-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-sm) var(--space-lg);
}

/* ========================================
   Map Container
   ======================================== */

#map-container {
  position: fixed;
  top: calc(var(--header-height) + env(safe-area-inset-top));
  left: 0;
  right: 0;
  bottom: 0;
}

#map {
  width: 100%;
  height: 100%;
}

/* ========================================
   Map Search
   ======================================== */

.map-search {
  position: fixed;
  top: calc(var(--header-height) + env(safe-area-inset-top) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 480px;
  z-index: 400;
  display: flex;
  align-items: center;
  background: var(--color-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 0 var(--space-md);
}

.search-icon {
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px var(--space-sm);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  background: transparent;
  color: var(--color-text);
}

.search-input::placeholder {
  color: #bbb;
}

/* ========================================
   Bottom Sheet
   ======================================== */

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08);
  z-index: 450;
  transform: translateY(calc(100% - var(--bottom-sheet-peek)));
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.bottom-sheet.half {
  transform: translateY(calc(100% - 45vh));
}

.bottom-sheet.expanded,
.bottom-sheet.full {
  transform: translateY(0);
}

.bottom-sheet-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  cursor: grab;
}

.handle-bar {
  width: 40px;
  height: 5px;
  background: #d0d0d0;
  border-radius: 3px;
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg) var(--space-sm);
}

.bottom-sheet-title {
  font-size: var(--font-size-md);
  font-weight: 600;
}

.shop-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.bottom-sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-md) var(--space-lg);
  -webkit-overflow-scrolling: touch;
}

/* Scrollbar styling for bottom-sheet-content */
.bottom-sheet-content::-webkit-scrollbar {
  width: 3px;
}

.bottom-sheet-content::-webkit-scrollbar-track {
  background: transparent;
}

.bottom-sheet-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

/* ========================================
   Shop List Item
   ======================================== */

.shop-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  transition: background 0.15s ease, transform 0.1s ease;
  cursor: pointer;
}

.shop-list-item:active {
  background: var(--color-bg);
  transform: scale(0.97);
}

.shop-list-item + .shop-list-item {
  border-top: 1px solid var(--color-border);
}

.shop-pin-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.shop-list-info {
  flex: 1;
  min-width: 0;
}

.shop-list-name {
  font-size: var(--font-size-base);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-list-address {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.shop-list-meta {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

/* ========================================
   Tag Badges
   ======================================== */

.tag-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: capitalize;
}

.tag-badge-favorite {
  background: rgba(196, 162, 67, 0.12);
  color: var(--tag-favorite);
}

.tag-badge-target {
  background: rgba(74, 158, 111, 0.12);
  color: var(--tag-target);
}

.tag-badge-excluded {
  background: rgba(211, 47, 47, 0.12);
  color: var(--tag-excluded);
}

.tag-badge-unvisited {
  background: rgba(153, 153, 153, 0.12);
  color: var(--tag-unvisited);
}

/* ========================================
   Modal
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--font-size-md);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: var(--space-sm);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.modal-close:active {
  background: var(--color-bg);
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Scrollbar styling for modal-body */
.modal-body::-webkit-scrollbar {
  width: 3px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

/* ========================================
   Detail Sections
   ======================================== */

.detail-photos {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -24px 16px;
  padding: 0 24px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.detail-photos:empty {
  display: none;
}

.detail-photos img {
  flex-shrink: 0;
  width: 220px;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  scroll-snap-align: start;
  background: var(--color-border);
}

.detail-section {
  margin-bottom: var(--space-lg);
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-address {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.detail-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-xs);
}

.detail-section-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.3px;
}

.detail-notes {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  resize: vertical;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.detail-notes:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(134, 119, 92, 0.08);
}

.detail-actions {
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

/* ========================================
   Tag Actions
   ======================================== */

.tag-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.btn-tag {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: 500;
  border: 1px solid var(--color-border);
  transition: all 0.15s ease;
}

.btn-tag:active {
  opacity: 0.7;
}

.btn-tag[data-tag="favorite"] { border-color: var(--tag-favorite); color: var(--tag-favorite); }
.btn-tag[data-tag="target"] { border-color: var(--tag-target); color: var(--tag-target); }
.btn-tag[data-tag="excluded"] { border-color: var(--tag-excluded); color: var(--tag-excluded); }
.btn-tag[data-tag="unvisited"] { border-color: var(--tag-unvisited); color: var(--tag-unvisited); }

.btn-tag.active-tag {
  color: #fff;
}

.btn-tag.active-tag[data-tag="favorite"] { background: var(--tag-favorite); }
.btn-tag.active-tag[data-tag="target"] { background: var(--tag-target); }
.btn-tag.active-tag[data-tag="excluded"] { background: var(--tag-excluded); }
.btn-tag.active-tag[data-tag="unvisited"] { background: var(--tag-unvisited); }

.btn-tag-remove {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

/* ========================================
   Social Links
   ======================================== */

.social-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.social-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.social-platform {
  font-weight: 500;
  text-transform: capitalize;
  min-width: 70px;
}

.social-username {
  color: var(--color-brand);
}

.social-delete {
  color: var(--color-text-secondary);
  padding: 4px;
}

.social-delete:hover {
  color: var(--color-danger);
}

.social-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.social-add-form .form-input {
  flex: 1;
  min-width: 100px;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 500;
  font-family: var(--font-family);
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn:active {
  opacity: 0.8;
}

.btn-primary {
  background: var(--color-brand);
  color: #fff;
  box-shadow: 0 1px 3px rgba(134, 119, 92, 0.3);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-brand);
  color: var(--color-brand);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: var(--font-size-sm);
}

.btn-full {
  width: 100%;
}

/* ========================================
   Forms
   ======================================== */

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-card);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(134, 119, 92, 0.08);
}

textarea.form-input {
  resize: vertical;
}

.form-row {
  display: flex;
  gap: var(--space-md);
}

.form-row .form-group {
  flex: 1;
}

/* ========================================
   Cards
   ======================================== */

.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* ========================================
   Utility
   ======================================== */

.hidden {
  display: none !important;
}

.loading-text {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.empty-state {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

/* ========================================
   Responsive
   ======================================== */

@media (min-width: 768px) {
  .header-title {
    font-size: var(--font-size-base);
  }

  .map-search {
    width: 400px;
  }

  .bottom-sheet {
    left: auto;
    right: var(--space-md);
    width: 380px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
}

/* ---- Large Modal ---- */

.modal-lg {
  max-width: 640px;
}

/* ---- Visit Items ---- */

.visit-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}

.visit-date {
  color: var(--color-text-secondary);
  min-width: 80px;
}

.visit-duration {
  color: var(--color-text-tertiary);
  min-width: 40px;
}

.visit-notes {
  flex: 1;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Purchase Items ---- */

.purchase-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border);
}

.purchase-info {
  flex: 1;
  min-width: 0;
}

.purchase-summary {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-detail {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
}

/* ---- Trip List Items ---- */

.trip-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}

.trip-list-item:hover {
  background: var(--color-bg-hover);
}

.trip-list-info {
  flex: 1;
  min-width: 0;
}

.trip-list-title {
  font-weight: 500;
  font-size: var(--font-size-sm);
}

.trip-list-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

.trip-list-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.trip-shop-count {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
}

/* Trip status badges */
.tag-badge-planning { background: #e8e8e8; color: #666; }
.tag-badge-active { background: #d4edda; color: #155724; }
.tag-badge-completed { background: #d6e9f8; color: #0c5480; }
.tag-badge-archived { background: #f0f0f0; color: #999; }

/* ---- Trip Detail Shops ---- */

.trip-shop-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
}

.trip-shop-order {
  font-weight: 600;
  color: var(--color-brand);
  min-width: 28px;
}

.trip-shop-name {
  flex: 1;
  font-weight: 500;
}

.trip-shop-city {
  color: var(--color-text-tertiary);
  font-size: var(--font-size-xs);
}

/* ---- Dashboard ---- */

.dashboard-summary {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.dashboard-stat {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: var(--space-md);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
}

.dashboard-stat-value {
  display: block;
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-brand);
}

.dashboard-stat-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  margin-top: 4px;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.dashboard-table th,
.dashboard-table td {
  padding: var(--space-xs) var(--space-sm);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.dashboard-table th {
  font-weight: 500;
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-table td:last-child,
.dashboard-table th:last-child {
  text-align: right;
}

/* ---- Flea Market Items ---- */

.flea-item {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.15s;
}

.flea-item:hover {
  border-color: var(--color-accent);
}

.flea-info {
  flex: 1;
  min-width: 0;
}

.flea-name {
  font-weight: 600;
  font-size: var(--font-size-base);
  margin-bottom: 2px;
}

.flea-meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

.flea-detail {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.flea-notes {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-xs);
  white-space: pre-wrap;
}

.flea-actions {
  display: flex;
  gap: var(--space-xs);
  align-items: flex-start;
}

/* ---- Export Section ---- */

.export-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-md);
}

.export-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.export-option-info h4 {
  margin: 0 0 var(--space-xs);
  font-size: var(--font-size-base);
}

.export-option-info p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* ---- Country / City Grid (Flea Markets) ---- */

.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-sm);
}

.country-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s ease;
  text-align: center;
}

.country-card:hover {
  border-color: var(--color-accent);
  background: var(--color-bg);
}

.country-card:active {
  transform: scale(0.97);
}

.country-name {
  font-weight: 600;
  font-size: var(--font-size-base);
  margin-bottom: 2px;
}

.country-code {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  letter-spacing: 1px;
}

.city-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.city-btn {
  min-width: 100px;
}

/* ---- Mobile Responsive ---- */

@media (max-width: 480px) {
  .header-title {
    display: none;
  }
}

@media (max-width: 768px) {
  .header {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  .modal {
    max-width: 100%;
    margin: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 92vh;
  }

  .form-row {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .filter-select {
    max-width: 100px;
  }

  .dashboard-table {
    font-size: var(--font-size-xs);
  }

  .dashboard-table th,
  .dashboard-table td {
    padding: var(--space-xs);
  }

  .trip-shop-item {
    flex-direction: column;
  }

  .export-option {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
}

@media (min-width: 769px) {
  .sidebar-overlay {
    display: none !important;
  }
}
