:root {
  --bg: #f4f5f7; --panel: #fff; --ink: #1f2430; --muted: #7a8395;
  --line: #e4e7 ; --line: #e5e8ee; --brand: #2b6cb0; --brand-ink: #fff;
  --sidebar: #1c2230; --sidebar-ink: #cbd3e1; --sidebar-hi: #2a3345;
  --danger: #c0392b; --ok: #2f855a; --radius: 9px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
       color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); font-weight: 400; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 234px; flex: 0 0 234px; background: var(--sidebar);
           color: var(--sidebar-ink); display: flex; flex-direction: column; padding: 16px 12px; }
.brand a { color: #fff; font-weight: 700; font-size: 1.15rem; display: block; padding: 6px 8px 14px; }
.content { flex: 1; padding: 26px 34px; max-width: 1100px; }

.search input { width: 100%; padding: 8px 10px; border-radius: var(--radius);
                border: 1px solid #333c4f; background: #10151f; color: #eef; margin-bottom: 14px; }
.navgroup { margin-bottom: 14px; }
.navgroup-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
                  color: #6b7488; padding: 4px 8px; }
.navlink { display: flex; align-items: center; gap: 9px; color: var(--sidebar-ink);
           padding: 7px 9px; border-radius: 7px; }
.navlink:hover { background: var(--sidebar-hi); text-decoration: none; color: #fff; }
.navlink .icon { width: 18px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 2px; border-top: 1px solid #2b3346; font-size: .86rem; }
.sidebar-foot .who { color: #9aa4b7; margin-bottom: 3px; }
.sidebar-foot a { color: #8fb4e0; }

/* Header row */
.page-head { display: flex; align-items: center; justify-content: space-between;
             margin-bottom: 20px; gap: 12px; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.head-actions form { margin: 0; }

/* Buttons */
.btn { display: inline-block; background: var(--brand); color: var(--brand-ink);
       padding: 8px 15px; border: 0; border-radius: var(--radius); font-size: .92rem;
       cursor: pointer; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn.ghost { background: #e7ebf2; color: var(--ink); }
.btn.danger { background: var(--danger); }

/* Flash */
.flash { background: #fff6d9; border: 1px solid #efd98a; padding: 9px 13px;
         border-radius: var(--radius); margin-bottom: 18px; }

/* Tables */
.grid { width: 100%; border-collapse: collapse; background: var(--panel);
        border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid th, .grid td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.grid th { background: #fafbfc; font-size: .78rem; text-transform: uppercase;
           letter-spacing: .04em; color: var(--muted); }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover { background: #f0f6ff; }
.grid tr:last-child td { border-bottom: 0; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
         gap: 14px; margin-bottom: 26px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 16px; text-align: center; color: var(--ink); }
.card:hover { text-decoration: none; box-shadow: 0 2px 10px rgba(20,30,50,.07); }
.card-ico { font-size: 1.5rem; }
.card-n { font-size: 1.7rem; font-weight: 700; }
.card-l { color: var(--muted); font-size: .85rem; }

/* Panels */
.panel { background: var(--panel); border: 1px solid var(--line);
         border-radius: var(--radius); padding: 18px 20px; margin-top: 22px; }

/* Detail */
.detail { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.detail-row { display: flex; border-bottom: 1px solid var(--line); }
.detail-row:last-child { border-bottom: 0; }
.detail-row .k { flex: 0 0 190px; padding: 10px 16px; color: var(--muted); background: #fafbfc; }
.detail-row .v { padding: 10px 16px; white-space: pre-wrap; }

/* Contact log */
.log-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.log-form input[type=text] { flex: 1; min-width: 140px; padding: 7px 10px;
        border: 1px solid var(--line); border-radius: 7px; }
.log-form .followup { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.log-list { list-style: none; margin: 0; padding: 0; }
.log-list li { padding: 9px 0; border-top: 1px solid var(--line); }
.log-when { color: var(--muted); font-size: .8rem; }
.log-followup { color: var(--ok); font-size: .82rem; }

/* Forms */
.entity-form { background: var(--panel); border: 1px solid var(--line);
               border-radius: var(--radius); padding: 20px; max-width: 640px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.field .req { color: var(--danger); }
.entity-form input[type=text], .entity-form input[type=email], .entity-form input[type=date],
.entity-form input[type=number], .entity-form textarea, .entity-form select {
  width: 100%; padding: 8px 10px; border: 1px solid #cfd6e2; border-radius: 7px;
  font: inherit; background: #fff; }
.field-bool input { width: auto; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

/* Search */
.bigsearch { display: flex; gap: 10px; margin-bottom: 24px; }
.bigsearch input { flex: 1; padding: 12px 15px; font-size: 1.05rem;
                   border: 1px solid #cfd6e2; border-radius: var(--radius); }

.empty { color: var(--muted); }

/* Trip Studio */
.lede { color: var(--muted); margin: -8px 0 22px; max-width: 560px; }
.usage-pill { background: #eef4fb; border: 1px solid #d4e2f3; color: var(--brand);
              font-weight: 600; font-size: .85rem; padding: 6px 14px; border-radius: 999px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
         gap: 16px; margin-bottom: 26px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 22px; color: var(--ink); transition: box-shadow .12s, transform .12s; }
.tile:hover { text-decoration: none; transform: translateY(-2px);
              box-shadow: 0 8px 22px rgba(20,30,50,.10); }
.tile-emoji { font-size: 2rem; }
.tile-name { font-weight: 700; font-size: 1.05rem; margin: 8px 0 3px; }
.tile-blurb { color: var(--muted); font-size: .88rem; }
.limit-hit h2 { margin-bottom: 4px; }
.mdoc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 26px 30px; max-width: 780px; }
.mdoc h1 { font-size: 1.5rem; margin-top: 0; }
.mdoc h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .05em;
           color: var(--brand); margin-top: 22px; }
.mdoc li { margin: 3px 0; }
.mdedit { width: 100%; min-height: 480px; padding: 12px 14px; border: 1px solid #cfd6e2;
          border-radius: 8px; font: 13px/1.55 ui-monospace, Menlo, monospace; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
              padding: 30px 32px; width: 320px; box-shadow: 0 8px 30px rgba(20,30,50,.10); }
.login-brand { font-weight: 700; font-size: 1.3rem; text-align: center; margin-bottom: 20px; }
.login-card label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.login-card input { width: 100%; padding: 9px 11px; border: 1px solid #cfd6e2;
                    border-radius: 7px; font: inherit; margin-top: 4px; }
.login-card .btn { width: 100%; margin-top: 6px; padding: 10px; }

/* Command Center launcher */
.launcher { margin-bottom: 8px; }
.launch-group { margin-bottom: 18px; }
.launch-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
              color: var(--muted); font-weight: 700; margin: 0 2px 8px; }
.launch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.tool { display: flex; align-items: center; gap: 10px; background: var(--panel);
        border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
        color: var(--ink); transition: box-shadow .12s, border-color .12s; }
.tool:hover { text-decoration: none; box-shadow: 0 2px 10px rgba(20,30,50,.08); border-color: #cdd8ea; }
.tool-ico { font-size: 1.25rem; flex: 0 0 auto; line-height: 1; }
.tool-lbl { font-size: .88rem; font-weight: 600; line-height: 1.2; }
.tool.empty { border-style: dashed; background: #fafbfc; }
.tool.empty .tool-lbl { color: var(--muted); font-weight: 500; }
.tool-hint { margin-left: auto; font-size: .7rem; color: var(--brand); font-weight: 600; }

/* Demo one-click login banner (demo host only) */
.demo-note { background: #eef6ff; border: 1px solid #cfe1f7; border-radius: 9px;
             padding: 12px 14px; margin-bottom: 16px; font-size: .9rem; color: #234; }
.demo-note .demo-cred { font-family: ui-monospace, Menlo, monospace; margin-top: 6px;
                        color: var(--brand); font-weight: 600; }
.demo-note .demo-sub { color: var(--muted); font-size: .82rem; margin-top: 4px; }

/* Knowledge — wiki article view */
.kb-meta-top { display: flex; gap: 8px; margin-bottom: 12px; }
.kb-kind, .kb-topic { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 10px; border-radius: 999px; }
.kb-kind { background: #eef4fb; color: var(--brand); border: 1px solid #d4e2f3; }
.kb-topic { background: #f0f2f6; color: var(--muted); border: 1px solid var(--line); }
.kb-lead { font-size: 1.1rem; color: var(--ink); margin: 0 0 18px; max-width: 72ch; }
.kb-article { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 30px; max-width: 820px; line-height: 1.62; }
.kb-article h2 { font-size: 1.05rem; margin: 22px 0 8px; }
.kb-article h3 { font-size: .95rem; margin: 16px 0 6px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; }
.kb-article h4 { font-size: .92rem; margin: 14px 0 4px; }
.kb-article p { margin: 0 0 .8em; }
.kb-article ul, .kb-article ol { margin: 0 0 .95em; padding-left: 1.35em; }
.kb-article li { margin: 4px 0; }
.kb-article code { background: #f0f2f6; padding: 1px 5px; border-radius: 5px;
  font: .88em ui-monospace, Menlo, monospace; }
.kb-article strong { color: var(--ink); }
a.wikilink { color: var(--brand); border-bottom: 1px solid rgba(43,108,176,.35); }
a.wikilink:hover { text-decoration: none; border-bottom-color: var(--brand); }
a.wikilink.wanted { color: #b06a1f; border-bottom: 1px dashed #d8a45a; }
a.wikilink.wanted:hover { color: #8a5216; border-bottom-color: #b06a1f; }
.kb-links { margin-top: 20px; }
.kb-links h2, .backlinks h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-bottom: 6px; }
.kb-links ul, .backlinks ul { margin: 0; padding-left: 1.1em; }
.kb-links li { word-break: break-all; }
.kb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.kb-chip { font-size: .76rem; background: #f0f2f6; color: var(--muted);
  border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.kb-note { color: var(--muted); font-size: .9rem; margin-top: 18px; max-width: 72ch; }
.backlinks { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.backlinks li { margin: 3px 0; }

/* PDF importer */
.import-hint { background: #eef6ff; border: 1px solid #cfe1f7; }
.badge-stale { background: #fff3cd; border: 1px solid #ffe08a; color: #8a6d1b;
  font-size: .72rem; padding: 2px 8px; border-radius: 999px; }
.badge-merge { background: #fdecef; border: 1px solid #f6c9d2; color: #9b2c3f;
  font-size: .72rem; padding: 2px 8px; border-radius: 999px; }
.draft-list, .recent-list { list-style: none; margin: 0; padding: 0; }
.draft { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start;
  padding: 12px 0; border-top: 1px solid var(--line); }
.draft:first-child { border-top: 0; }
.draft-title { font-weight: 600; }
.draft-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.draft-sum { font-size: .9rem; }
.draft-src { font-size: .78rem; }
.draft-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.draft-actions form { margin: 0; }
.recent-list li { padding: 5px 0; border-top: 1px solid var(--line); }
.recent-list li:first-child { border-top: 0; }
.act-badge { font-family: ui-monospace, Menlo, monospace; font-size: .72rem; color: var(--muted);
  margin-right: 6px; }
.linkbtn { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit;
  padding: 0 0 0 4px; text-decoration: underline; }
.linkbtn:hover { filter: brightness(1.15); }

/* Party members — the per-person needs panel on a client's page.
   Needs read at a glance before quoting, which is the whole point of moving
   them off the trip and onto the person. */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin: 0; }
.party-list { list-style: none; padding: 0; margin: 12px 0 0; }
.party-list > li { padding: 12px 0; border-top: 1px solid var(--line); }
.party-list > li:first-child { border-top: 0; }
.party-name { font-weight: 600; }
.party-rel { color: var(--muted); font-size: .85rem; margin-left: 8px; }
.party-needs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.party-note { color: var(--muted); font-size: .88rem; margin-top: 6px; max-width: 72ch; }
.party-warn { color: #8a6d1b; background: #fff8e5; border: 1px solid #ffe08a;
  font-size: .82rem; margin-top: 6px; padding: 4px 10px; border-radius: 6px;
  display: inline-block; }

/* Secret fields — the encrypted passport number (migration 024).
   Deliberately quiet in the UI: presence is ordinary information, the value is
   an event. The monospace on a revealed number is functional, not decorative —
   it gets read aloud down a phone line and typed into a supplier's form, where
   an O and a 0 look identical in a proportional face. */
.secret-mask { font-weight: 600; }
.secret-mask.secret-shown { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em; background: #fff8e5; border: 1px solid #ffe08a;
  padding: 2px 8px; border-radius: 6px; }
.secret-reveal { margin-left: 8px; padding: 2px 10px; font-size: .82rem; }
.secret-clear { display: block; margin-top: 6px; font-size: .85rem; color: var(--muted); }
.secret-clear input { margin-right: 6px; }
.field-help { display: block; margin-top: 4px; color: var(--muted); font-size: .82rem;
  max-width: 72ch; }

/* Signup queue (app/signups.py). The row highlight is the point of the page:
   someone has paid and is still waiting, and that must be visible at a glance
   rather than inferred by reading a status column. */
tr.row-outstanding td { background: #fff8e5; }
tr.row-outstanding td:first-child { box-shadow: inset 3px 0 0 #e0a800; }
.kb-chip.status-new { background: #ffe08a; color: #6b5200; }
.kb-chip.status-in-progress { background: #cfe3ff; color: #14395f; }
.kb-chip.status-live { background: #d6f2dd; color: #1c5733; }
.kb-chip.status-parked,
.kb-chip.status-cancelled { background: #eee; color: #666; }
/* The count rides in the nav so a waiting customer is visible from every page,
   not only from the one screen someone remembers to open. */
.nav-badge { background: #e0a800; color: #3a2c00; border-radius: 10px; font-size: 11px;
  font-weight: 700; padding: 1px 7px; margin-left: 6px; }
