/* ══════════════════════════════════════════════
   Đà Lạt Trip Planner — Design System
   Dark mode default · Mobile-first · Glassmorphism
   ══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@600;700;800&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Design Tokens ── */
:root {
  /* Safe area insets (iPhone notch / Dynamic Island) */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Đà Lạt Night Theme */
  --bg-primary:   #080e1a;
  --bg-secondary: #0f1724;
  --bg-card:      #131d2e;
  --bg-glass:     rgba(13, 22, 40, 0.75);
  --bg-glass-border: rgba(255, 255, 255, 0.07);
  --bg-hover:     rgba(255, 255, 255, 0.04);

  --text-primary:   #eef2f8;
  --text-secondary: #8fa3bc;
  --text-muted:     #526070;

  --accent-coral:  #f97316;
  --accent-teal:   #14b8a6;
  --accent-gold:   #f59e0b;
  --accent-rose:   #f43f5e;
  --accent-purple: #a78bfa;

  --gradient-header: linear-gradient(135deg, #0a1628 0%, #1a2e4a 50%, #0c1a30 100%);
  --gradient-card-hover: linear-gradient(135deg, rgba(249,115,22,0.06), rgba(20,184,166,0.06));
  --gradient-timeline: linear-gradient(180deg, var(--accent-coral), var(--accent-teal));
  --gradient-hero: linear-gradient(180deg, #0d1f38 0%, #080e1a 100%);

  --font-display: 'Outfit', sans-serif;
  --font-body:    'Inter', sans-serif;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.35), 0 1px 4px rgba(0,0,0,0.2);
  --shadow-glow-coral: 0 0 20px rgba(249,115,22,0.25);
  --shadow-glow-teal:  0 0 20px rgba(20,184,166,0.2);

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast:   150ms var(--ease-out-expo);
  --transition-medium: 300ms var(--ease-out-expo);
  --transition-slow:   500ms var(--ease-out-expo);

  --nav-height: 68px;
  --header-height: 64px;
  --max-width: 640px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ══════════════════
   LAYOUT
   ══════════════════ */

#app-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

#app-content {
  flex: 1;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  overflow-y: auto;
}

/* ══════════════════
   HEADER
   ══════════════════ */

#app-header {
  background: var(--gradient-header);
  border-bottom: 1px solid var(--bg-glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: calc(12px + var(--safe-top)) 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(var(--header-height) + var(--safe-top));
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Header day pills (timeline mode) */
.header-day-pills {
  display: none;
  flex: 1;
  gap: 6px;
  padding: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.header-day-pills::-webkit-scrollbar { display: none; }

#app-header.timeline-mode #header-brand { display: none; }
#app-header.timeline-mode .header-day-pills { display: flex; align-items: center; }
#app-header.food-mode #header-brand { display: none; }
#app-header.food-mode .header-day-pills { display: flex; align-items: center; }
#app-header.map-mode #header-brand { display: none; }
#app-header.map-mode .header-day-pills { display: flex; align-items: center; }
#app-header.dashboard-mode {
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  position: absolute;
  width: 100%;
  justify-content: flex-end;
  pointer-events: none;
}
#app-header.dashboard-mode .sync-indicator { pointer-events: auto; }
#app-header.dashboard-mode #header-brand { display: none; }

.header-day-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition-fast);
  font-family: var(--font-body);
}
.header-day-pill:hover { border-color: rgba(249,115,22,0.35); }
.header-day-pill.active {
  background: rgba(249,115,22,0.15);
  border-color: rgba(249,115,22,0.55);
  color: var(--accent-coral);
}
.hpill-num  { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em; line-height: 1.2; }
.hpill-date { font-size: 0.6rem; color: var(--text-muted); line-height: 1.1; }
.header-day-pill.active .hpill-date { color: rgba(249,115,22,0.7); }

/* Food category pills in header */
.header-food-pill {
  display: flex;
  align-items: center;
  padding: 6px 18px;
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: var(--transition-fast);
}
.header-food-pill:hover { border-color: rgba(249,115,22,0.35); }
.header-food-pill.active {
  background: rgba(249,115,22,0.15);
  border-color: rgba(249,115,22,0.55);
  color: var(--accent-coral);
}

.header-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.header-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Sync indicator */
.sync-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  cursor: pointer;
  transition: var(--transition-fast);
}

.sync-indicator:hover { background: var(--bg-hover); }

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-teal);
  box-shadow: 0 0 6px var(--accent-teal);
  transition: var(--transition-medium);
}

.sync-dot.pending {
  background: var(--accent-gold);
  box-shadow: 0 0 6px var(--accent-gold);
  animation: pulse-dot 1.2s ease infinite;
}

.sync-dot.error {
  background: var(--accent-rose);
  box-shadow: 0 0 6px var(--accent-rose);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ══════════════════
   BOTTOM NAV
   ══════════════════ */

#app-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: calc(var(--nav-height) + var(--safe-bottom));
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--bg-glass-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: var(--safe-bottom);
  z-index: 200;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.3);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  flex: 1;
  max-width: 72px;
  background: none;
  border: none;
  color: var(--text-muted);
  position: relative;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-secondary); }

.nav-item.active {
  color: var(--accent-coral);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--accent-coral);
  border-radius: 0 0 2px 2px;
  box-shadow: var(--shadow-glow-coral);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.nav-item.active .nav-icon {
  transform: translateY(-1px);
}

.nav-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* ══════════════════
   CARDS & GLASS
   ══════════════════ */

.glass-card {
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: var(--transition-medium);
}

.glass-card:hover {
  border-color: rgba(255,255,255,0.12);
  background: var(--gradient-card-hover);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* ══════════════════
   DASHBOARD VIEW
   ══════════════════ */

.dashboard {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Countdown card */
.countdown-card {
  background: linear-gradient(135deg, rgba(249,115,22,0.15) 0%, rgba(20,184,166,0.1) 100%);
  border: 1px solid rgba(249,115,22,0.25);
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.countdown-card::before {
  content: '🏔️';
  position: absolute;
  font-size: 7rem;
  opacity: 0.05;
  top: -10px;
  right: -10px;
  line-height: 1;
}

.countdown-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-coral);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.countdown-digits {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-number {
  font-size: 2.5rem;
  line-height: 1;
  color: var(--accent-coral);
  text-shadow: 0 0 20px rgba(249,115,22,0.4);
}

.countdown-sep {
  font-size: 2rem;
  color: var(--text-muted);
  margin: 0 2px;
  line-height: 1;
  padding-bottom: 8px;
}

.countdown-unit-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.countdown-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Progress bar */
.progress-section {
  margin-top: 16px;
}

.progress-bar-wrap {
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-coral), var(--accent-teal));
  transition: width 0.8s var(--ease-out-expo);
  box-shadow: 0 0 8px rgba(249,115,22,0.4);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.progress-pct {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-coral);
}

/* Quick stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
}

.stat-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  color: var(--text-secondary);
}

.stat-icon svg {
  width: 100%;
  height: 100%;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.stat-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* Today highlights */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.today-highlight-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.highlight-item:hover {
  border-color: rgba(249,115,22,0.3);
  background: rgba(249,115,22,0.05);
}

.highlight-time {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 36px;
}

.highlight-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}
.highlight-icon svg { width: 100%; height: 100%; }

.highlight-text {
  font-size: 0.82rem;
  color: var(--text-primary);
  flex: 1;
}

/* Tips carousel */
.tip-card {
  background: linear-gradient(135deg, rgba(20,184,166,0.1), rgba(167,139,250,0.08));
  border: 1px solid rgba(20,184,166,0.2);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  position: relative;
  overflow: hidden;
}

.tip-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-teal);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.tip-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tip-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.tip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  transition: var(--transition-fast);
}

.tip-dot.active {
  background: var(--accent-teal);
  box-shadow: 0 0 6px var(--accent-teal);
}

/* ══════════════════
   TIMELINE VIEW
   ══════════════════ */

.timeline-view { padding: 0; }

/* Day selector pills */
.day-pills-wrap {
  position: sticky;
  top: calc(var(--header-height) + var(--safe-top));
  z-index: 50;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-glass-border);
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.day-pills-wrap::-webkit-scrollbar { display: none; }

.day-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-glass-border);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  min-width: 76px;
  flex-shrink: 0;
}

.day-pill:hover { border-color: rgba(249,115,22,0.35); }

.day-pill.active {
  background: linear-gradient(135deg, rgba(249,115,22,0.2), rgba(20,184,166,0.12));
  border-color: rgba(249,115,22,0.5);
  box-shadow: 0 0 16px rgba(249,115,22,0.15);
}

.day-pill-num {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.day-pill.active .day-pill-num { color: var(--accent-coral); }

.day-pill-date {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.day-pill-emoji { font-size: 0.85rem; margin-top: 1px; }

/* Timeline */
.timeline-container {
  padding: 20px 16px;
  position: relative;
}

.timeline-line {
  position: absolute;
  left: 64px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gradient-timeline);
  opacity: 0.35;
}

.timeline-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.tl-left {
  width: 48px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-top: 14px;
  position: relative;
  z-index: 2;
}

.timeline-dot {
  position: absolute;
  right: -6px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
  z-index: 3;
}

.tl-time {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: left;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.tl-end-time {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-align: left;
}

.tl-icon {
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-top: 2px;
}

.tl-icon svg {
  width: 100%;
  height: 100%;
}

/* Activity card */
.activity-card {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-medium);
  cursor: pointer;
}

.activity-card:hover {
  border-color: rgba(255,255,255,0.12);
  box-shadow: var(--shadow-card);
}

.activity-card.done {
  opacity: 0.55;
}

.activity-card.done .activity-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.activity-card.skipped {
  opacity: 0.4;
}

.activity-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 10px;
}

.activity-time-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 42px;
}

.activity-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.activity-end-time {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.activity-type-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 2px;
  flex-shrink: 0;
}

.activity-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.activity-icon svg {
  width: 100%;
  height: 100%;
}

.activity-body { flex: 1; min-width: 0; }

.activity-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.activity-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.fixed-badge {
  font-size: 0.58rem;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(249,115,22,0.15);
  border: 1px solid rgba(249,115,22,0.35);
  color: var(--accent-coral);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.alt-active-badge {
  font-size: 0.58rem;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(20,184,166,0.15);
  border: 1px solid rgba(20,184,166,0.4);
  color: var(--accent-teal);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.activity-location {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.activity-location::before { content: '📍'; font-size: 0.65rem; }

.activity-type-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-top: 5px;
  letter-spacing: 0.03em;
}

/* Activity note (collapsible) */
.activity-note {
  padding: 0 14px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s var(--ease-out-expo), padding 0.3s;
}

.activity-note.open {
  max-height: 200px;
  padding-bottom: 12px;
}

.activity-note-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.6;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  border-left: 2px solid rgba(255,255,255,0.1);
}

/* Activity actions */
.activity-actions {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
  flex-wrap: nowrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
  background: none;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn svg { width: 13px; height: 13px; flex-shrink: 0; }

.btn-status {
  border-color: var(--bg-glass-border);
  background: var(--bg-glass);
}

.btn-status:hover { border-color: rgba(20,184,166,0.5); color: var(--accent-teal); }
.btn-status.done { border-color: rgba(20,184,166,0.4); color: var(--accent-teal); background: rgba(20,184,166,0.1); }
.btn-status.skipped { border-color: rgba(100,116,139,0.4); color: var(--text-muted); }

.btn-maps {
  border-color: var(--bg-glass-border);
  background: var(--bg-glass);
}

.btn-maps:hover { border-color: rgba(249,115,22,0.5); color: var(--accent-coral); }

.btn-note-toggle {
  margin-left: auto;
}

.btn-note-toggle:hover { color: var(--accent-purple); }

/* Alternatives panel */
.alternatives-panel {
  margin: 0 14px 12px;
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s var(--ease-out-expo);
}

.alternatives-panel.open { max-height: 300px; }

.alternatives-inner { padding: 10px 12px; }

.alt-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.alt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.alt-item:last-child { border-bottom: none; }

.alt-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.alt-note {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Alt dropdown button (top-right of activity header) ── */
.alt-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-glass-border);
  background: var(--bg-glass);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  transition: var(--transition-fast);
}

.alt-dropdown-btn svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.alt-dropdown-btn:hover {
  border-color: rgba(245,158,11,0.5);
  color: var(--accent-gold);
}

.alt-dropdown-btn.open svg {
  transform: rotate(180deg);
}

/* ── Alt select panel ── */
.alt-select-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s var(--ease-out-expo);
}

.alt-select-panel.open {
  max-height: 480px;
}

.alt-select-inner {
  padding: 0 14px 12px;
}

.alt-panel-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 8px;
  padding-top: 4px;
}

.alt-select-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: 4px;
}

.alt-select-item:hover {
  background: rgba(245,158,11,0.06);
  border-color: rgba(245,158,11,0.2);
}

.alt-select-item.selected {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.4);
}

.alt-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.alt-item-addr {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.alt-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.alt-item-dist {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.alt-hours-badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}

.alt-hours-badge.open {
  background: rgba(20,184,166,0.12);
  color: var(--accent-teal);
}

.alt-hours-badge.closed {
  background: rgba(100,116,139,0.12);
  color: var(--text-muted);
}

.alt-item-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

/* ── Selected alt badge on card body ── */
.selected-alt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.35);
  color: var(--accent-gold);
  margin-top: 4px;
  letter-spacing: 0.03em;
}

/* Day summary */
.day-summary {
  padding: 16px;
  margin-bottom: 4px;
}

.day-summary-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.day-summary-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ══════════════════
   FOOD VIEW
   ══════════════════ */

.food-view { padding: 16px; }

/* Category tabs (Quán ăn / Cafe) */
.food-cat-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  padding: 3px;
  overflow: hidden;
}

.food-cat-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.food-cat-tab:hover { color: var(--text-secondary); }

.food-cat-tab.active {
  background: rgba(249,115,22,0.15);
  color: var(--accent-coral);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Hours badge (open/closed on restaurant card) */
.hours-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.03em;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}

.hours-badge.open {
  background: rgba(20,184,166,0.12);
  color: var(--accent-teal);
}

.hours-badge.closed {
  background: rgba(100,116,139,0.1);
  color: var(--text-muted);
}

/* Restaurant hours text row */
.restaurant-hours {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 2px;
}

/* Filter chips */
.filter-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--bg-glass-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.chip:hover { border-color: rgba(249,115,22,0.4); }
.chip.active {
  background: rgba(249,115,22,0.15);
  border-color: rgba(249,115,22,0.5);
  color: var(--accent-coral);
}

/* Restaurant card */
.restaurant-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.restaurant-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: var(--transition-fast);
}

.restaurant-card.fixed-venue {
  border-left: 3px solid var(--accent-coral);
}

.restaurant-card.alternative-venue {
  border-style: dashed;
  opacity: 0.8;
}

.restaurant-card:hover { border-color: rgba(249,115,22,0.35); }

.restaurant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.restaurant-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.restaurant-cuisine {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.restaurant-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.meal-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
}

.meal-badge.breakfast { background: rgba(245,158,11,0.15); color: var(--accent-gold); }
.meal-badge.lunch     { background: rgba(249,115,22,0.15); color: var(--accent-coral); }
.meal-badge.dinner    { background: rgba(167,139,250,0.15); color: var(--accent-purple); }
.meal-badge.snack     { background: rgba(20,184,166,0.15);  color: var(--accent-teal); }

.day-badge {
  font-size: 0.62rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.restaurant-note {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

.restaurant-actions {
  margin-top: 10px;
}

/* ══════════════════
   MAP VIEW
   ══════════════════ */

.map-view { padding: 0 0 16px; }

.map-day-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-glass-border);
  position: sticky;
  top: calc(var(--header-height) + var(--safe-top));
  z-index: 40;
}
.map-day-tabs::-webkit-scrollbar { display: none; }

.map-day-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-glass-border);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 70px;
}
.map-day-tab:hover { border-color: rgba(249,115,22,0.35); }
.map-day-tab.active {
  background: linear-gradient(135deg, rgba(249,115,22,0.18), rgba(20,184,166,0.1));
  border-color: rgba(249,115,22,0.5);
}
.mdt-num  { font-size: 0.62rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.map-day-tab.active .mdt-num { color: var(--accent-coral); }
.mdt-date { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.map-day-tab.active .mdt-date { color: var(--accent-coral); }

.map-iframe-wrap {
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--bg-card);
}
.map-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.map-open-btn-wrap {
  padding: 12px 16px 4px;
}
.map-open-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(20,184,166,0.4);
  background: rgba(20,184,166,0.1);
  color: var(--accent-teal);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}
.map-open-btn:hover { background: rgba(20,184,166,0.18); }

.map-list-header {
  padding: 16px 16px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.waypoints-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 16px;
}

.waypoint-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
}

.waypoint-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.waypoint-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.waypoint-icon svg { width: 18px; height: 18px; }

.waypoint-info { flex: 1; min-width: 0; }
.waypoint-time  { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; }
.waypoint-title { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.waypoint-addr  { font-size: 0.7rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.waypoint-map-btn { padding: 5px 8px !important; font-size: 0.8rem !important; flex-shrink: 0; }

/* ══════════════════
   CHECKLIST VIEW
   ══════════════════ */

.checklist-view { padding: 16px; }

.checklist-section { margin-bottom: 24px; }

.checklist-section-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checklist-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.check-item:hover { border-color: rgba(20,184,166,0.3); }
.check-item.checked { opacity: 0.55; }

.check-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--bg-glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-fast);
  background: transparent;
}

.check-item.checked .check-box {
  background: var(--accent-teal);
  border-color: var(--accent-teal);
  box-shadow: 0 0 8px rgba(20,184,166,0.3);
}

.check-mark {
  font-size: 0.75rem;
  color: white;
  opacity: 0;
  transition: var(--transition-fast);
}

.check-item.checked .check-mark { opacity: 1; }

.check-text {
  font-size: 0.82rem;
  color: var(--text-primary);
  flex: 1;
  line-height: 1.4;
}

.check-item.checked .check-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.priority-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.priority-dot.high   { background: var(--accent-rose); box-shadow: 0 0 4px var(--accent-rose); }
.priority-dot.medium { background: var(--accent-gold); }
.priority-dot.low    { background: var(--text-muted); }

/* Add custom item */
.add-item-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.add-item-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font-body);
  transition: var(--transition-fast);
}

.add-item-input:focus {
  outline: none;
  border-color: rgba(249,115,22,0.5);
}

.add-item-input::placeholder { color: var(--text-muted); }

.btn-add {
  padding: 8px 16px;
  background: rgba(249,115,22,0.15);
  border: 1px solid rgba(249,115,22,0.4);
  color: var(--accent-coral);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-add:hover { background: rgba(249,115,22,0.25); }

/* Progress ring */
.checklist-progress {
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.ring-wrap { position: relative; flex-shrink: 0; }

.ring-svg { transform: rotate(-90deg); }

.ring-track { fill: none; stroke: rgba(255,255,255,0.07); }
.ring-fill {
  fill: none;
  stroke: url(#ring-gradient);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s var(--ease-out-expo);
}

.ring-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.ring-pct {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-coral);
  line-height: 1;
}

.ring-sub { font-size: 0.55rem; color: var(--text-muted); }

.checklist-progress-text { flex: 1; }
.checklist-progress-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.checklist-progress-sub { font-size: 0.74rem; color: var(--text-muted); }

/* ══════════════════
   NOTES VIEW
   ══════════════════ */

.notes-view { padding: 16px; }

.notes-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.notes-tabs::-webkit-scrollbar { display: none; }

.notes-tab {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--bg-glass-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.notes-tab.active {
  background: rgba(167,139,250,0.15);
  border-color: rgba(167,139,250,0.4);
  color: var(--accent-purple);
}

.notes-textarea {
  width: 100%;
  min-height: 280px;
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-body);
  line-height: 1.7;
  resize: vertical;
  transition: var(--transition-fast);
}

.notes-textarea:focus {
  outline: none;
  border-color: rgba(167,139,250,0.4);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.1);
}

.notes-textarea::placeholder { color: var(--text-muted); }

.notes-save-indicator {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: right;
  min-height: 1em;
  transition: var(--transition-fast);
}

.notes-save-indicator.saving { color: var(--accent-gold); }
.notes-save-indicator.saved  { color: var(--accent-teal); }

/* ══════════════════
   ANIMATIONS & UTILS
   ══════════════════ */

.fade-in {
  animation: fadeIn 0.4s var(--ease-out-expo) both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.slide-up {
  animation: slideUp 0.35s var(--ease-out-expo) both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stagger children */
.stagger-children > * { opacity: 0; transform: translateY(12px); }
.stagger-children.animate > *:nth-child(1)  { animation: slideUp 0.4s 0.05s var(--ease-out-expo) forwards; }
.stagger-children.animate > *:nth-child(2)  { animation: slideUp 0.4s 0.10s var(--ease-out-expo) forwards; }
.stagger-children.animate > *:nth-child(3)  { animation: slideUp 0.4s 0.15s var(--ease-out-expo) forwards; }
.stagger-children.animate > *:nth-child(4)  { animation: slideUp 0.4s 0.20s var(--ease-out-expo) forwards; }
.stagger-children.animate > *:nth-child(5)  { animation: slideUp 0.4s 0.25s var(--ease-out-expo) forwards; }
.stagger-children.animate > *:nth-child(n+6){ animation: slideUp 0.4s 0.30s var(--ease-out-expo) forwards; }

/* Today indicator pulse */
@keyframes today-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0.4); }
  70% { box-shadow: 0 0 0 6px rgba(249,115,22,0); }
}

.today-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-coral);
  animation: today-pulse 2s ease infinite;
  box-shadow: 0 0 6px var(--accent-coral);
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state-text { font-size: 0.85rem; line-height: 1.6; }

/* ══════════════════
   RESPONSIVE
   ══════════════════ */

@media (min-width: 768px) {
  :root { --max-width: 720px; }

  .stats-grid { grid-template-columns: repeat(4, 1fr); }

  .restaurant-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline-container { padding: 20px 20px; }
  .timeline-line { left: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
