/* ==========================================================================
   Dreamstate — design system
   Dark and glassy, near-black with a whisper of green.
   Emerald is Luca. Coral is Philippe. The stars are why.
   ========================================================================== */

:root {
  /* Backgrounds — near-black with a whisper of green */
  --bg:          #080F0C;
  --bg-2:        #0C1510;
  --bg-3:        #101A14;

  /* Glass surfaces */
  --surface:         rgba(255, 255, 255, 0.04);
  --surface-2:       rgba(255, 255, 255, 0.07);
  --surface-hover:   rgba(255, 255, 255, 0.10);
  --border:          rgba(255, 255, 255, 0.07);
  --border-bright:   rgba(255, 255, 255, 0.14);

  /* Accent: emerald (Luca) + coral (Philippe) */
  --accent:          #059669;
  --accent-soft:     rgba(5, 150, 105, 0.18);
  --accent-glow:     rgba(5, 150, 105, 0.3);
  --coral:           #FF6B6B;
  --coral-soft:      rgba(255, 107, 107, 0.15);
  --coral-glow:      rgba(255, 107, 107, 0.3);

  /* Text — warm white with a hint of green */
  --text:            #F0F5F2;
  --text-muted:      #6B8A7A;
  --text-faint:      #354D42;

  /* Status */
  --success:         #059669;
  --success-glow:    rgba(5, 150, 105, 0.2);
  --warning:         #F59E0B;
  --danger:          #FF6B6B;
  --danger-glow:     rgba(255, 107, 107, 0.2);

  /* Motion */
  --ease-expo:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth:  cubic-bezier(0.4, 0, 0.2, 1);
  --fast:   150ms;
  --base:   300ms;
  --slow:   500ms;

  /* Shape */
  --radius:    20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
}

/* ------------------------------------------------------------------ Reset */

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ------------------------------------------------------------- Typography */

.display {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}
.display-quote {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--text);
  margin: 0;
}
.fraunces-italic { font-family: 'Fraunces', serif; font-style: italic; font-weight: 300; }
.heading-1  { font-size: 1.5rem;  font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.heading-2  { font-size: 1.125rem; font-weight: 600; margin: 0 0 4px; }
.body       { font-size: 0.9375rem; line-height: 1.6; }
.small      { font-size: 0.8125rem; color: var(--text-muted); }
.label      {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  display: block; margin-bottom: 6px;
}
.muted { color: var(--text-muted); }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

/* -------------------------------------------------------------- Utilities */

.hidden { display: none !important; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }
.flex { display: flex; align-items: center; }
.gap { gap: 12px; }
.gap-sm { gap: 8px; display: inline-flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inline-form { display: inline; }

/* ------------------------------------------------------ Ambient background */

.stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}
.orb-emerald {
  width: 600px; height: 600px;
  background: var(--accent);
  top: -200px; left: -150px;
}
.orb-coral {
  width: 500px; height: 500px;
  background: var(--coral);
  bottom: -200px; right: -100px;
}

@media (prefers-reduced-motion: no-preference) {
  .orb-emerald { animation: orb-drift 18s ease-in-out infinite; }
  .orb-coral   { animation: orb-drift 22s ease-in-out infinite reverse; }
  @keyframes orb-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(40px, -30px) scale(1.06); }
    66%      { transform: translate(-20px, 20px) scale(0.97); }
  }
}

/* ------------------------------------------------------------ Glass system */

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-elevated {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-emerald {
  background: linear-gradient(135deg,
    rgba(5, 150, 105, 0.12),
    rgba(255, 107, 107, 0.05));
  border: 1px solid rgba(5, 150, 105, 0.25);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 0 60px rgba(5, 150, 105, 0.10);
}

.card { padding: 22px; margin-bottom: 18px; position: relative; z-index: 1; }

/* ----------------------------------------------------------------- Layout */

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 28px 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.brand { text-decoration: none; display: block; padding: 0 14px 24px; }
.brand-name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.35rem;
  display: block;
}
.brand-tag {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem; font-weight: 500;
  transition: background var(--fast) var(--ease-smooth),
              color var(--fast) var(--ease-smooth);
  text-decoration: none;
}
.nav-item:hover  { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--text); }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.sidebar-user-meta { display: flex; flex-direction: column; }
.sidebar-user-name { font-weight: 600; font-size: 0.9rem; }
.sidebar-logout {
  font-size: 0.75rem; color: var(--text-muted); text-decoration: none;
  transition: color var(--fast) var(--ease-smooth);
}
.sidebar-logout:hover { color: var(--coral); }

.bottom-nav { display: none; }

.main {
  margin-left: 240px;
  padding: 36px clamp(20px, 4vw, 48px) 80px;
  position: relative;
  z-index: 1;
  max-width: 1240px;
}

.page-head { margin-bottom: 24px; }
.page-head .small { margin: 4px 0 0; }
.section { margin-top: 32px; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 24px 16px 110px; }
  .bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex; justify-content: space-around;
    padding: 12px 0 max(12px, env(safe-area-inset-bottom));
    background: rgba(9, 9, 15, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    z-index: 50;
  }
  .bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.05rem;
    padding: 2px 14px;
    border-radius: var(--radius-xs);
    transition: color var(--fast) var(--ease-smooth);
  }
  .bottom-nav-item.active { color: var(--accent); }
  .bottom-nav-item.active .bottom-nav-label { color: var(--text); }
  .bottom-nav-label { font-size: 0.65rem; font-weight: 500; }
}

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--fast) var(--ease-smooth),
              transform var(--fast) var(--ease-expo),
              box-shadow var(--base) var(--ease-expo);
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: wait; transform: none; }

.btn-primary {
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 8px 24px var(--accent-glow); }

.btn-coral {
  background: var(--coral);
  color: #080F0C;
  box-shadow: 0 0 0 0 var(--coral-glow);
}
.btn-coral:hover { box-shadow: 0 8px 24px var(--coral-glow); }

.btn-ghost {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-hover); }

.btn-danger {
  background: var(--danger-glow);
  border: 1px solid var(--danger);
  color: var(--danger);
}
.btn-danger:hover { background: var(--coral-soft); box-shadow: 0 8px 24px var(--danger-glow); }

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-block { width: 100%; }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  width: 28px; height: 28px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: background var(--fast) var(--ease-smooth), color var(--fast) var(--ease-smooth);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-glow); }

.row-actions { display: inline-flex; align-items: center; gap: 2px; }

/* ------------------------------------------------------------------ Forms */

.field { margin-bottom: 14px; }

input[type="text"], input[type="password"], input[type="email"], input[type="url"],
input[type="number"], input[type="date"], input[type="time"], input[type="file"],
select, textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color var(--fast) var(--ease-smooth),
              box-shadow var(--base) var(--ease-expo);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; }
select option { background: var(--bg-3); color: var(--text); }
input[type="date"], input[type="time"] { color-scheme: dark; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 600px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; gap: 0; }
}

.form-error {
  background: var(--danger-glow);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.form-success {
  background: var(--success-glow);
  border: 1px solid var(--success);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* Color picker */
.color-picker { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.color-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.color-swatch span {
  display: block;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--fast) var(--ease-expo), border-color var(--fast) var(--ease-smooth);
}
.color-swatch span:hover { transform: scale(1.12); }
.color-swatch input:checked + span {
  border-color: #fff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.3);
}
.color-custom { width: 40px; height: 32px; padding: 2px; cursor: pointer; }
.color-custom-wrap { display: inline-flex; align-items: center; gap: 8px; }

/* ----------------------------------------------------------------- Avatar */

.avatar {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--avatar-color, var(--warning));
  color: #08120D;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  box-shadow: 0 0 12px color-mix(in srgb, var(--avatar-color, var(--warning)) 40%, transparent);
}
.avatar-sm { width: 26px; height: 26px; font-size: 0.7rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.3rem; }

/* ----------------------------------------------------------------- Badges */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid;
}
.badge-planning  { color: var(--text-muted); border-color: var(--border-bright); background: var(--surface-2); }
.badge-upcoming  { color: var(--warning); border-color: var(--warning); background: rgba(245, 158, 11, 0.12); }
.badge-active    { color: #34D399; border-color: var(--success); background: var(--success-glow); }
.badge-past      { color: var(--text-muted); border-color: var(--border); background: var(--surface); }
.badge-cancelled { color: var(--danger); border-color: var(--danger); background: var(--danger-glow); }

/* ------------------------------------------------------------- Animations */

.animate-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--slow) var(--ease-expo),
              transform var(--slow) var(--ease-expo);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .animate-in { opacity: 1; transform: none; transition: none; }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes shimmer {
    from { background-position: -200% 0; }
    to   { background-position:  200% 0; }
  }
  .skeleton {
    background: linear-gradient(90deg,
      var(--surface)   25%,
      var(--surface-2) 50%,
      var(--surface)   75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: var(--radius-sm);
  }
}

/* ----------------------------------------------------------- Progress bar */

.progress-track {
  height: 3px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--coral));
  box-shadow: 0 0 10px var(--accent-glow);
  transition: width var(--slow) var(--ease-expo);
}

/* ------------------------------------------------------------------ Toast */

.toast {
  position: fixed; bottom: 28px; right: 28px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: rgba(12, 21, 16, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-bright);
  font-size: 0.875rem; font-weight: 500;
  transform: translateY(80px) scale(0.95);
  opacity: 0;
  transition: all var(--base) var(--ease-expo);
  z-index: 999; pointer-events: none;
  max-width: min(360px, calc(100vw - 56px));
}
.toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }

@media (max-width: 768px) {
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); right: 16px; left: 16px; }
}

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

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--base) var(--ease-smooth);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
body.modal-locked { overflow: hidden; }

.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px;
  transform: scale(0.94) translateY(16px);
  opacity: 0;
  transition: transform var(--base) var(--ease-expo),
              opacity var(--base) var(--ease-expo);
}
.modal-backdrop.open .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.modal-sm { width: min(400px, 100%); }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 18px;
}

/* ------------------------------------------------------------------- Tabs */

.tab-bar {
  position: relative;
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 12px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--fast) var(--ease-smooth);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab-indicator {
  position: absolute; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--coral));
  border-radius: 99px;
  box-shadow: 0 0 8px var(--accent-glow);
  transition: left var(--base) var(--ease-expo),
              width var(--base) var(--ease-expo);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* -------------------------------------------------------------- Trip cards */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.bento-grid-lg { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.trip-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  min-height: 200px;
  cursor: pointer;
  display: block;
  text-decoration: none;
  transition: transform var(--base) var(--ease-expo),
              box-shadow var(--base) var(--ease-expo);
}
.trip-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.trip-card-tall { min-height: 240px; }
.trip-card-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform var(--slow) var(--ease-smooth);
}
.trip-card:hover .trip-card-bg { transform: scale(1.04); }
.trip-card-glass {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(9, 9, 15, 0.92) 0%, transparent 100%);
}
.trip-card-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.25rem;
}
.trip-card-meta {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.trip-card-stats { margin-top: 6px; }

/* ------------------------------------------------------------- Hero (dash) */

.hero-card {
  position: relative;
  display: block;
  overflow: hidden;
  text-decoration: none;
  margin-bottom: 24px;
  min-height: 260px;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0.35;
}
.hero-content {
  position: relative;
  padding: clamp(22px, 4vw, 40px);
  background: linear-gradient(to top, rgba(8, 15, 12, 0.85), transparent 70%);
}
.hero-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.hero-destination {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 6px 0 0;
}
.hero-meta {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-top: 22px; flex-wrap: wrap;
}
.hero-countdown { font-size: 0.95rem; }
.hero-countdown strong { font-size: 1.6rem; font-weight: 700; color: var(--accent); margin-right: 4px; }
.hero-progress { flex: 1; min-width: 180px; max-width: 320px; }
.hero-progress .progress-track { margin-top: 6px; }

.empty-hero { text-align: center; padding: 60px 24px; }

/* ------------------------------------------------------------------ Stats */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}
.stat-card {
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-value { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-sub { font-size: 1rem; color: var(--text-muted); font-weight: 500; }

/* ------------------------------------------------------------- Empty state */

.empty { text-align: center; padding: 48px 24px; }
.empty-text {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.25rem;
  color: var(--text-muted);
  margin: 0;
}

/* -------------------------------------------------------------- Auth pages */

.auth-body { display: flex; min-height: 100vh; }
.auth-wrap {
  margin: auto;
  width: min(400px, calc(100vw - 32px));
  padding: 24px 0;
  position: relative;
  z-index: 1;
}
.auth-card { padding: 36px 32px; }
.auth-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 2rem;
  margin: 0;
  text-align: center;
}
.auth-tagline {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  color: var(--text-muted);
  text-align: center;
  margin: 4px 0 26px;
}
.auth-form .btn { margin-top: 8px; }
.auth-back { text-align: center; margin-top: 18px; }
.auth-back a { color: var(--text-muted); text-decoration: none; }
.auth-back a:hover { color: var(--text); }

/* -------------------------------------------------------------- Trip hero */

.trip-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--border);
}
.trip-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0.45;
}
.trip-hero-content {
  position: relative;
  padding: clamp(20px, 4vw, 36px);
  background: linear-gradient(to top, rgba(8, 15, 12, 0.9), rgba(8, 15, 12, 0.2));
}
.trip-hero-sub { color: var(--text-muted); margin: 8px 0 0; }
.back-link { text-decoration: none; }
.back-link:hover { color: var(--text); }

/* --------------------------------------------------------------- Overview */

.overview-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) { .overview-grid { grid-template-columns: 1fr; } }
.overview-grid .card { margin-bottom: 0; }
.overview-media { grid-column: 1 / -1; }

.notes-text { white-space: normal; }
.glance-list { list-style: none; margin: 8px 0 0; padding: 0; }
.glance-list li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.glance-list li:last-child { border-bottom: none; }

.media-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.media-strip img {
  width: 120px; height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.danger-zone {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ----------------------------------------------------------------- Places */

.places-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) { .places-layout { grid-template-columns: 1fr; } }

.place-map {
  height: 420px;
  position: sticky;
  top: 20px;
  z-index: 1;
  overflow: hidden;
}
@media (max-width: 900px) { .place-map { position: static; height: 300px; } }
.leaflet-container { background: var(--bg-2); font: inherit; border-radius: var(--radius); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--bg-3); color: var(--text);
}

.place-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.place-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
}
.place-item.visited .place-name { color: var(--text-muted); }
.place-body { flex: 1; min-width: 0; }
.place-name { font-weight: 600; }

.cat-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 7px;
}
.cat-restaurant    { background: #F59E0B; }
.cat-activity      { background: #059669; }
.cat-accommodation { background: #6366F1; }
.cat-transport     { background: #0EA5E9; }
.cat-sport         { background: #FF6B6B; }
.cat-other         { background: #6B8A7A; }

/* -------------------------------------------------------------- Checklist */

.checklist-summary { margin-bottom: 18px; }
.checklist-group { margin-top: 22px; }
.checklist-group-title { margin-bottom: 8px; }
.checklist-card { padding: 8px 16px; }

.checklist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.checklist-item:last-child { border-bottom: none; }

.check-box {
  width: 22px; height: 22px;
  flex-shrink: 0;
  border: 2px solid var(--border-bright);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 0.75rem;
  padding: 0;
  display: grid; place-items: center;
  transition: background var(--fast) var(--ease-expo),
              border-color var(--fast) var(--ease-expo),
              box-shadow var(--base) var(--ease-expo);
  cursor: pointer;
}
.checklist-item.done .check-box,
.place-item.visited .check-box {
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 0 14px var(--success-glow);
}
.checklist-item.done .item-text {
  text-decoration: line-through;
  color: var(--text-muted);
  transition: color var(--base) var(--ease-expo);
}

.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.assign-select {
  width: auto;
  padding: 4px 8px;
  font-size: 0.75rem;
  background: transparent;
  border-color: transparent;
}
.assign-select:hover { border-color: var(--border-bright); }

/* -------------------------------------------------------------- Itinerary */

.day-card { margin-bottom: 16px; }
.day-head { align-items: flex-start; }
.slot-list { margin-top: 14px; display: flex; flex-direction: column; }
.slot {
  display: flex; align-items: baseline; gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.slot:last-child { border-bottom: none; }
.slot-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 86px;
  font-variant-numeric: tabular-nums;
}
.slot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slot-label { font-weight: 500; }

.slot-form {
  display: grid;
  grid-template-columns: 92px 92px 1fr 130px auto;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
@media (max-width: 700px) { .slot-form { grid-template-columns: 1fr 1fr; } }

/* --------------------------------------------------------------- Expenses */

.expense-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) { .expense-layout { grid-template-columns: 1fr; } }

.split-row { display: flex; gap: 14px; flex-wrap: wrap; }
.split-check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.875rem;
  cursor: pointer;
}
.split-check input { width: auto; accent-color: var(--accent); }
.split-check span::before {
  content: '';
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--avatar-color, var(--text-faint));
  margin-right: 6px;
}

.expense-list { padding: 8px 16px; }
.expense-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.expense-row:last-child { border-bottom: none; }
.expense-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.expense-desc { font-weight: 500; }
.expense-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.balance-line { padding: 6px 0; }
.balance-line strong { float: right; }

/* ------------------------------------------------------------------ Media */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.media-item {
  margin: 0;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.media-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.media-item figcaption {
  padding: 10px 14px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.media-actions { display: flex; gap: 2px; margin-top: 6px; }

/* ------------------------------------------------------------------ Links */

.link-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.link-row:last-child { border-bottom: none; }
.link-label {
  font-weight: 500;
  text-decoration: none;
  transition: color var(--fast) var(--ease-smooth);
}
.link-label:hover { color: var(--accent); }
.link-meta { flex: 1; text-align: right; }

/* ------------------------------------------------------------------ Admin */

.admin-grid { display: grid; grid-template-columns: 1fr; gap: 0; }

.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-bright);
}
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.row-muted { opacity: 0.45; }

@media (max-width: 700px) {
  .table thead { display: none; }
  .table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .table td { display: inline-block; border: none; padding: 4px 8px 4px 0; }
}

.invite-link-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.invite-link {
  flex: 1;
  min-width: 200px;
  font-size: 0.78rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  word-break: break-all;
  user-select: all;
}

/* ---------------------------------------------------------------- Profile */

.profile-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 800px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-grid .card { margin-bottom: 0; }
.profile-identity {
  display: flex; align-items: center; gap: 16px;
  margin: 14px 0 18px;
}
