/* Crete Family Holiday 2026 — mobile-first stylesheet */
:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0e7490;     /* teal — Aegean */
  --brand-d: #155e75;
  --accent: #f59e0b;    /* sun */
  --good: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --info: #2563eb;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --tap: 44px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5; padding-bottom: 76px;
}
a { color: var(--brand-d); }
img { max-width: 100%; }
h1,h2,h3 { line-height: 1.2; }
h1 { font-size: 1.4rem; margin: .2rem 0 .6rem; }
h2 { font-size: 1.15rem; margin: 1.2rem 0 .5rem; }
h3 { font-size: 1rem; margin: .6rem 0 .3rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.center { text-align: center; }
.hidden { display: none !important; }

/* layout */
.app-header {
  position: sticky; top: 0; z-index: 50; background: linear-gradient(135deg, var(--brand), var(--brand-d));
  color: #fff; padding: .7rem 1rem; box-shadow: var(--shadow); display: flex; align-items: center; gap: .6rem;
}
.app-header .title { font-weight: 700; font-size: 1.05rem; }
.app-header .spacer { flex: 1; }
.app-header a, .app-header .badge { color: #fff; }
.container { max-width: 980px; margin: 0 auto; padding: 1rem; }
.grid { display: grid; gap: .8rem; }
.grid.cols-2 { grid-template-columns: 1fr; }
.grid.cols-3 { grid-template-columns: 1fr; }
.grid.cols-4 { grid-template-columns: 1fr 1fr; }

/* cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow); margin-bottom: .8rem;
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; box-shadow: var(--shadow); }
.stat .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.stat .value { font-size: 1.5rem; font-weight: 700; }
.stat .value.sm { font-size: 1.1rem; }

/* badges & pills */
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; background: #eef2f7; color: var(--muted); }
.badge.good { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.bad { background: #fee2e2; color: #991b1b; }
.badge.info { background: #dbeafe; color: #1e40af; }
.badge.brand { background: #cffafe; color: var(--brand-d); }
.tag-confirmed { background:#dcfce7; color:#166534; }
.tag-estimated { background:#fef3c7; color:#92400e; }
.tag-needs_checking, .tag-needs_review { background:#fee2e2; color:#991b1b; }
.tag-outdated { background:#e5e7eb; color:#374151; }
.tag-shortlist { background:#dbeafe; color:#1e40af; }
.tag-booked { background:#dcfce7; color:#166534; }
.tag-skip { background:#e5e7eb; color:#6b7280; }
.tag-researching { background:#ede9fe; color:#5b21b6; }
.tag-favourite { background:#fce7f3; color:#9d174d; }

/* buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: var(--tap);
  padding: .5rem .9rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: .95rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #f8fafc; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-d); }
.btn.accent { background: var(--accent); color: #1f2937; border-color: var(--accent); }
.btn.danger { background: #fff; color: var(--bad); border-color: #fecaca; }
.btn.sm { min-height: 34px; padding: .25rem .6rem; font-size: .85rem; }
.btn.block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: .5rem .6rem; border: 1px solid var(--line);
  border-radius: 10px; font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 80px; }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin: .5rem 0 .2rem; }
.field { margin-bottom: .4rem; }
.row { display: grid; gap: .5rem; grid-template-columns: 1fr; }
.checkline { display: flex; align-items: center; gap: .6rem; min-height: var(--tap); }
.checkline input[type=checkbox] { width: 22px; height: 22px; min-height: auto; }

/* progress */
.progress { height: 10px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--good); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.itinerary-item { border-left: 4px solid var(--brand); padding: .5rem .7rem; background: #fff; border-radius: 8px; margin: .4rem 0; box-shadow: var(--shadow); }
.itinerary-item .time { font-weight: 700; color: var(--brand-d); }
.itinerary-item.is-backup { border-left-color: var(--muted); opacity: .92; }
.itinerary-item.is-free { border-left-color: var(--accent); }
.handle { cursor: grab; color: var(--muted); padding: 0 .3rem; touch-action: none; }

/* tables that become cards */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: top; }
.table-wrap { overflow-x: auto; }

/* map */
#map { height: 60vh; min-height: 360px; border-radius: var(--radius); border: 1px solid var(--line); }
.map-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.map-filters .chip { padding: .3rem .6rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .8rem; cursor: pointer; }
.map-filters .chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.map-route-controls { display: flex; flex-wrap: wrap; gap: .4rem; margin: .35rem 0 .6rem; }
.map-route-controls .chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .6rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .78rem; cursor: pointer; }
.map-route-controls .chip.active { background: #111827; color: #fff; border-color: #111827; }
.route-dot, .route-swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: 999px; flex: 0 0 auto; }
.transport-head { display: flex; align-items: center; gap: .5rem; }
.transport-head h2 { margin: 0; }
.route-stops { margin: .4rem 0 .8rem; padding-left: 1.2rem; }
.route-stops li { margin: .18rem 0; font-size: .9rem; }

/* alerts */
.alert { padding: .6rem .8rem; border-radius: 10px; margin: .4rem 0; font-size: .9rem; border: 1px solid; }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert.bad  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.good { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

/* bottom nav (mobile) */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: .25rem env(safe-area-inset-right) calc(.25rem + env(safe-area-inset-bottom)) env(safe-area-inset-left);
}
.bottom-nav a {
  flex: 1; text-align: center; padding: .35rem .2rem; font-size: .68rem; color: var(--muted); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: var(--tap);
}
.bottom-nav a.active { color: var(--brand-d); font-weight: 700; }
.bottom-nav .ico { font-size: 1.15rem; line-height: 1; }

/* toast / save status */
.savebar { position: fixed; top: 56px; right: 12px; z-index: 70; }
.toast { background: #111827; color: #fff; padding: .5rem .8rem; border-radius: 10px; margin-top: .4rem; font-size: .85rem; opacity: .96; box-shadow: var(--shadow); }
.toast.good { background: #166534; } .toast.bad { background: #991b1b; }
.save-status { font-size: .8rem; color: var(--muted); }
.save-status.saving { color: var(--warn); } .save-status.saved { color: var(--good); } .save-status.error { color: var(--bad); }

/* offline banner */
#offline-banner { display:none; background: var(--warn); color:#fff; text-align:center; padding:.3rem; font-size:.8rem; }
body.is-offline #offline-banner { display:block; }

/* sub-nav (admin/desktop) */
.subnav { display: flex; gap: .3rem; overflow-x: auto; padding: .4rem 0; -webkit-overflow-scrolling: touch; }
.subnav a { white-space: nowrap; padding: .4rem .7rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .85rem; text-decoration: none; color: var(--ink); }
.subnav a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* useful-info: speak buttons, phrases, alphabet */
.speak { min-height: 32px; min-width: 36px; padding: .15rem .4rem; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: .95rem; line-height: 1; }
.speak:hover { background: #f1f5f9; }
.speak.speaking { background: var(--brand); border-color: var(--brand); }
table.phrases td { vertical-align: middle; }
.phrase .greek { font-size: .78rem; }
.alphabet > div { padding: .15rem 0; }
#phrase-search, #converter input { font-size: 1rem; }

.countdown { font-size: 2.2rem; font-weight: 800; color: var(--brand-d); }
.clocks { display: flex; gap: 1rem; flex-wrap: wrap; }
.clock .t { font-size: 1.2rem; font-weight: 700; }

/* responsive up */
@media (min-width: 640px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .row.two { grid-template-columns: 1fr 1fr; }
  .row.three { grid-template-columns: 1fr 1fr 1fr; }
  body { padding-bottom: 0; }
  .bottom-nav { position: static; border-top: 0; justify-content: flex-start; gap: .3rem; background: transparent; padding: 0; }
  .bottom-nav { display: none; }
  .desktop-nav { display: flex !important; }
}
.desktop-nav { display: none; gap: .4rem; }

/* print */
@media print {
  .app-header, .bottom-nav, .subnav, .btn, .map-filters, #map, .no-print { display: none !important; }
  body { background: #fff; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  a[href]:after { content: ""; }
}
