/* TravelGenie admin site: a separate, plain console look so it's never mistaken for the traveller app. */
:root {
  --side: #14212b; --side-ink: #cfdbe3; --side-mute: #7f939f; --side-hi: #22394a;
  --bg: #f3f5f7; --paper: #fff; --ink: #18252e; --muted: #5d6d78; --line: #dfe5ea;
  --accent: #00808f; --accent-soft: #dff3f5; --ok: #1f9254; --warn: #c2410c; --warn-soft: #fff1e8;
  --radius: 12px; --sans: 'Source Sans 3', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.5; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: .86rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 700; font-size: 1.05rem; padding: 4px 10px 16px; color: #fff; }
.brand small { display: block; font-weight: 600; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #ffb627; }
.side a { color: var(--side-ink); text-decoration: none; padding: 9px 12px; border-radius: 8px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.side a:hover { background: var(--side-hi); }
.side a.on { background: var(--accent); color: #fff; }
.side .foot { margin-top: auto; border-top: 1px solid var(--side-hi); padding: 12px 10px 0; font-size: .85rem; color: var(--side-mute); }
.side .foot a { padding: 6px 0; font-weight: 600; }
main { padding: 26px 32px 60px; max-width: 1100px; }
.lead { color: var(--muted); margin: 0 0 20px; }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side .foot { margin: 0; border: 0; padding: 0 10px; width: 100%; }
  main { padding: 18px 16px 40px; }
}

/* pieces */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--warn); }
/* caution: allowed, but changes what travellers see (e.g. rolling back) — amber, between "go" (teal) and "stop" (red) */
.btn.caution { background: #fff7e0; border-color: #e0a100; color: #7a4f00; }
.btn.caution:hover { background: #ffecb3; border-color: #b98200; }
.btn.small { padding: 5px 10px; font-size: .86rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fbfcfd; color: var(--ink); width: 100%; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: auto; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; margin-bottom: 5px; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .two { grid-template-columns: 1fr; } }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: .74rem; font-weight: 600; color: var(--muted); vertical-align: 1px; }
.ok-txt { color: var(--ok); font-weight: 600; } .warn-txt { color: var(--warn); font-weight: 600; }
.banner { padding: 10px 14px; border-radius: 10px; background: var(--warn-soft); border: 1px solid #f7c9a8; margin-bottom: 14px; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(120px); visibility: hidden; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; transition: transform .25s, visibility .25s; z-index: 50; }
#toast.show { transform: translateX(-50%); visibility: visible; }

/* provider looks: --ai / --ai2 come from each provider's colour */
.ai-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #fff; background: linear-gradient(90deg, var(--ai), var(--ai2, var(--ai))); white-space: nowrap; }
.ai-chip .m { font-weight: 500; opacity: .9; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: linear-gradient(135deg, var(--ai), var(--ai2, var(--ai))); vertical-align: -1px; }

/* overview: routing map */
.routes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.route { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--paper); border-top: 5px solid var(--ai); }
.route b { display: block; margin-bottom: 8px; }
.route .st { margin-top: 8px; font-size: .84rem; }
.keys-list { display: flex; flex-direction: column; gap: 6px; }
.keys-list .row { padding: 6px 0; border-bottom: 1px dashed var(--line); }

/* AI research table */
.task-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.task-table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 0 8px; }
.task-table td { padding: 8px; background: var(--bg); vertical-align: middle; }
.task-table td:first-child { border-left: 5px solid var(--ai, var(--line)); border-radius: 8px 0 0 8px; font-weight: 600; white-space: nowrap; }
.task-table td:last-child { border-radius: 0 8px 8px 0; width: 130px; }
.pick { display: flex; gap: 8px; align-items: center; }
.pick .swatch { width: 16px; height: 16px; flex: none; }
@media (max-width: 760px) { .task-table thead { display: none; } .task-table tr { display: grid; } .task-table td, .task-table td:first-child, .task-table td:last-child { border-radius: 8px; width: auto; } }

/* providers */
.prov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.prov { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); overflow: hidden; }
.prov-head { padding: 12px 14px; color: #fff; background: linear-gradient(90deg, var(--ai), var(--ai2, var(--ai))); display: flex; align-items: center; gap: 8px; }
.prov-head b { flex: 1; }
.prov-head a { color: #fff; font-size: .85rem; }
.prov-body { padding: 12px 14px; }
.prov-body .row { flex-wrap: nowrap; }
.result { min-height: 1.3em; margin-top: 6px; font-size: .86rem; }

/* content */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.modes .toggle:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; }
.stat b { font-size: 1.6rem; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .85rem; }
.dest { border-top: 1px solid var(--line); padding: 10px 0; }
.dest.city, .dest.region { padding-left: 18px; }
.ver { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; padding: 6px 10px; background: var(--bg); border-radius: 8px; }
.tag.pub { background: #dcf3e5; color: var(--ok); border-color: #b9e3c9; }
.tag.draft { background: #fff4d6; color: #9a6400; border-color: #f3dc9b; }
.cmd, .errs { background: var(--side); color: #d7e6ee; padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: .82rem; white-space: pre-wrap; }
.errs { background: var(--warn-soft); color: var(--warn); margin: 0; }
.batches { width: 100%; border-collapse: collapse; font-size: .88rem; }
.batches th, .batches td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.pv { width: min(820px, 94vw); max-height: 86vh; border: 0; border-radius: 14px; padding: 18px 22px; }
.pv::backdrop { background: rgba(20, 33, 43, .5); }
.prose h2 { font-size: 1.15rem; margin: 1.2em 0 .4em; } .prose ul { padding-left: 1.2em; }

/* sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; background: var(--side); }
.auth .card { width: min(380px, 92vw); }
.err { color: var(--warn); font-weight: 600; min-height: 1.3em; }
.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; cursor: pointer; }
.toggle input { margin-top: 4px; }
/* Destinations grouped by country: folded when everything in it is published */
.dest-tools { margin: 4px 0 8px; gap: 6px; }
.dest-group { border-top: 1px solid var(--line); }
.dest-group > summary { display: flex; align-items: center; gap: 10px; padding: 10px 2px; cursor: pointer; list-style: none; }
.dest-group > summary::-webkit-details-marker { display: none; }
.dest-group > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.dest-group[open] > summary::before { transform: rotate(90deg); }
.dest-group > summary:hover { background: var(--bg); border-radius: 8px; }
.dest-group .dest:first-of-type { border-top: 0; }
/* US places grouped by state inside the country */
.dest-sub { margin-left: 18px; border-top: 1px solid var(--line); }
.dest-sub > summary { display: flex; align-items: center; gap: 10px; padding: 8px 2px; cursor: pointer; list-style: none; }
.dest-sub > summary::-webkit-details-marker { display: none; }
.dest-sub > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.dest-sub[open] > summary::before { transform: rotate(90deg); }
.dest-sub > summary:hover { background: var(--bg); border-radius: 8px; }
.dest-sub .dest:first-of-type { border-top: 0; }
.stat small { font-size: .75rem; margin-top: 3px; line-height: 1.3; }
/* Places (TravelGenie picks & Fans' choices) */
.place-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.place-row:first-of-type { border-top: 0; }
.place-dlg { width: min(680px, 94vw); max-height: 92vh; overflow: auto; }
.place-dlg .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.place-dlg .field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.place-dlg input, .place-dlg select, .place-dlg textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }
a.btn[aria-disabled=true] { opacity: .5; }

/* Places: standalone places (Belongs to, map) and demand signals */
.pf-map { height: 220px; border-radius: 8px; margin-top: 6px; background: var(--bg); }
.pf-pin { font-size: 22px; line-height: 26px; text-align: center; }
#plDemand .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { #plDemand .grid2 { grid-template-columns: 1fr; } }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
