:root {
  --navy:   #0D1B2E;
  --navy2:  #162840;
  --gold:   #C9A96E;
  --cream:  #FAF8F4;
  --sand:   #F0EBE4;
  --muted:  #6B7280;
  --border: #E2D9CF;
  --ok:     #22c55e;
  --warn:   #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --nav-h:  64px;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--navy);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 16px);
}

/* ── TYPOGRAPHY ── */
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 0.95rem; font-weight: 600; }
p  { line-height: 1.6; }

/* ── TOP BAR ── */
.topbar {
  background: var(--navy);
  color: var(--cream);
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--cream);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}

.topbar-gold { color: var(--gold); }

.topbar-sub {
  font-size: 0.75rem;
  color: rgba(250,248,244,0.5);
  margin-top: 2px;
}

.topbar-action {
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.topbar-action svg { width: 16px; height: 16px; stroke: var(--navy); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ── MAIN CONTENT ── */
.main { padding: 16px 16px 0; }

/* ── CARDS ── */
.card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card + .card { margin-top: 12px; }

.card-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body { padding: 16px; }

.card-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ── STAT GRID ── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.stat-value.gold { color: var(--gold); }
.stat-value.green { color: var(--ok); }

.stat-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ── LIST ITEMS ── */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  gap: 12px;
  cursor: pointer;
}

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

.list-item:active { background: var(--sand); }

.list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--sand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.list-item-icon svg { width: 20px; height: 20px; stroke: var(--navy); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.list-item-icon.gold-bg { background: rgba(201,169,110,0.15); }
.list-item-icon.gold-bg svg { stroke: var(--gold); }

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

.list-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-right {
  text-align: right;
  flex-shrink: 0;
}

.list-item-amount {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
}

.list-item-date {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.badge-grey  { background: #f3f4f6; color: #6b7280; }
.badge-blue  { background: #dbeafe; color: #1d4ed8; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-navy  { background: var(--navy); color: var(--gold); }
.badge-red   { background: #fee2e2; color: #991b1b; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--navy);
  background: white;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
}

textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s;
  width: 100%;
}

.btn:active { opacity: 0.8; }

.btn-primary { background: var(--navy); color: var(--cream); }
.btn-gold    { background: var(--gold); color: var(--navy); }
.btn-outline { background: white; color: var(--navy); border: 1.5px solid var(--border); }
.btn-danger  { background: var(--danger); color: white; }

.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.btn-row { display: flex; gap: 10px; margin-top: 20px; }
.btn-row .btn { flex: 1; }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.alert-success { background: #dcfce7; color: #15803d; }
.alert-error   { background: #fee2e2; color: #991b1b; }

/* ── LOGIN PAGE ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--navy);
}

.login-logo { margin-bottom: 32px; text-align: center; }

.login-logo-title {
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--cream);
  margin-top: 12px;
}

.login-logo-sub {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 4px;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
}

.login-card h2 {
  margin-bottom: 6px;
}

.login-card p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 24px;
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--navy);
  display: flex;
  align-items: stretch;
  z-index: 200;
  border-top: 1px solid rgba(201,169,110,0.2);
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar { display: none; }

.nav-item {
  flex: 0 0 auto;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: rgba(250,248,244,0.45);
  text-decoration: none;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 8px 6px;
  transition: color 0.15s;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

/* ── MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-box {
  background: white;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  font-weight: 700;
  font-size: 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: white;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.modal-body { padding: 20px; }

/* ── CALENDAR ── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  max-width: 500px;
}
.cal-header {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 0;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  text-decoration: none;
  color: var(--navy);
  position: relative;
  transition: background 0.12s;
  background: white;
  border: 1px solid var(--border);
  gap: 2px;
}
.cal-day:active { opacity: 0.8; }
.cal-num { font-size: 0.88rem; font-weight: 600; line-height: 1; }
.cal-dot {
  background: var(--navy);
  color: var(--gold);
  border-radius: 20px;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  line-height: 1.4;
}
.cal-today { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.cal-today .cal-dot { background: var(--gold); color: var(--navy); }
.cal-blocked { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.cal-selected { border-color: var(--gold); border-width: 2px; }

/* ── STATUS PICKER ── */
.status-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}
.status-opt {
  padding: 13px 8px;
  text-align: center;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  color: var(--muted);
  background: white;
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.status-opt[data-s="enquiry"].active   { background: #64748b; color: white; border-color: #64748b; }
.status-opt[data-s="confirmed"].active { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.status-opt[data-s="completed"].active { background: #15803d; color: white; border-color: #15803d; }
.status-opt[data-s="cancelled"].active { background: #dc2626; color: white; border-color: #dc2626; }

/* ── PACKAGE PICKER ── */
.pkg-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}
.pkg-opt {
  padding: 12px 10px;
  text-align: center;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  color: var(--muted);
  background: white;
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.3;
}
.pkg-opt.active { background: var(--navy); color: var(--gold); border-color: var(--navy); }

/* ── SECTION HEADER ── */
.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 20px 0 8px;
}

/* ── TABS ── */
.tabs {
  display: flex;
  background: var(--sand);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 9px;
  border-radius: 7px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.tab.active { background: white; color: var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

/* ── SEARCH ── */
.search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search-wrap input {
  padding-left: 40px;
}

/* ── EMPTY STATE ── */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}

.empty svg {
  width: 48px;
  height: 48px;
  stroke: var(--border);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin: 0 auto 12px;
  display: block;
}

.empty p { font-size: 0.9rem; }

/* ── DETAIL VIEW ── */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.detail-row:last-child { border-bottom: none; }

.detail-key {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.detail-val {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

/* ── QR CODE ── */
.qr-wrap {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

.secret-code {
  background: var(--sand);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: monospace;
  font-size: 1rem;
  letter-spacing: 0.15em;
  word-break: break-all;
  text-align: center;
  color: var(--navy);
  margin: 12px 0;
}

/* ── DASHBOARD HERO ── */
.dash-hero {
  background: var(--navy);
  margin: -16px -16px 0;
  padding: 20px 20px 28px;
  color: var(--cream);
}

.dash-date {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(250,248,244,0.5);
  margin-bottom: 6px;
}

.dash-greeting {
  font-size: 1.4rem;
  font-weight: 700;
}

.dash-greeting span { color: var(--gold); }

/* ── FINANCE SUMMARY ── */
.finance-summary {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--cream);
  margin-bottom: 16px;
}

.finance-summary-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(250,248,244,0.5);
  margin-bottom: 4px;
}

.finance-summary-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}

.finance-summary-row {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(250,248,244,0.1);
}

.finance-summary-item { flex: 1; }

/* ── MISC ── */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.text-muted { color: var(--muted); font-size: 0.85rem; }
.text-gold  { color: var(--gold); }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.danger-zone { border: 1.5px solid var(--danger); border-radius: var(--radius); padding: 16px; margin-top: 8px; }

/* ── ALERT BANNERS ── */
.alert-banner {
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  color: inherit;
}
.alert-banner.warn   { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-banner.danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-banner.ok     { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-banner-icon   { font-size: 1.1rem; flex-shrink: 0; }

/* ── WEATHER CARD ── */
.weather-card {
  background: linear-gradient(135deg, #162840, #0D1B2E);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--cream);
}
.weather-loc  { font-size: 0.7rem; color: rgba(250,248,244,0.4); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }
.weather-now  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.weather-icon { font-size: 2.2rem; }
.weather-temp { font-size: 2rem; font-weight: 700; line-height: 1; }
.weather-wind-text, .weather-wind { font-size: 0.85rem; color: var(--gold); margin-top: 3px; }
.weather-forecast { display: flex; border-top: 1px solid rgba(250,248,244,0.1); padding-top: 12px; }
.weather-day { flex: 1; text-align: center; font-size: 0.75rem; }
.weather-day-name { color: rgba(250,248,244,0.5); margin-bottom: 4px; }
.weather-day-icon { font-size: 1.1rem; margin-bottom: 2px; }
.weather-day-temp { font-weight: 600; }
.weather-day-wind { font-size: 0.68rem; color: var(--gold); }

/* ── FUEL GAUGE ── */
.fuel-gauge-wrap {
  background: linear-gradient(160deg, #0b1c31, #060f1c);
  border: 1px solid rgba(201,169,110,0.15);
  border-radius: var(--radius);
  padding: 16px;
}
.fuel-stat-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.fuel-stat { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.fuel-stat-val { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
.fuel-stat-lbl { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
