/* Kingsgate Estate — corporate trust: dark navy & charcoal on a light theme. */
:root {
  --navy: #0b1f3a; --navy-700: #12305a; --navy-500: #1e4a8a; --charcoal: #22262d; --charcoal-600: #3a4049;
  --ink: #16191f; --muted: #5b6472; --line: #dfe3ea; --bg: #f5f7fa; --surface: #ffffff; --surface-2: #eef2f7;
  --gold: #c9a24a; --ok: #1f7a4d; --ok-bg: #e6f4ec; --warn: #b26a00; --warn-bg: #fff3df; --bad: #b42323; --bad-bg: #fbe7e7; --info-bg: #e7eefb;
  --radius: 12px; --shadow: 0 1px 2px rgba(11,31,58,.06), 0 8px 24px rgba(11,31,58,.08);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--navy-500); }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.15; color: var(--navy); letter-spacing: -.01em; }
h1 { font-size: 2.25rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.125rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .tiny { font-size: .75rem; }
.money, .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money { font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Icon sprite (inline <symbol>s in each HTML entry); icons are decorative, text carries meaning. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.25em; height: 1.25em; display: inline-block; vertical-align: -.25em; flex: 0 0 auto; color: currentColor; }
.menu-btn .icon { width: 1.4rem; height: 1.4rem; vertical-align: middle; }
.gate-decision { display: flex; align-items: center; gap: .6rem; font-size: 1.2rem; font-weight: 700; }
.gate-decision .icon { width: 1.6rem; height: 1.6rem; }

/* Layout */
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1rem; }
.section { padding: 3rem 0; }
.section-head { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: end; justify-content: space-between; margin-bottom: 1.25rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.between { justify-content: space-between; }

/* Top nav */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--navy); color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.topbar .wrap { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.brand img { height: 34px; width: auto; }
.brand small { display: block; font-weight: 500; font-size: .7rem; opacity: .75; letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; gap: .25rem; margin-left: auto; align-items: center; }
.nav a { color: #e6ebf3; text-decoration: none; padding: .7rem .8rem; border-radius: 8px; font-size: .9rem; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a:focus-visible { background: rgba(255,255,255,.1); color: #fff; outline: none; }
.nav a.active { background: rgba(255,255,255,.16); color: #fff; }
.nav .cta { background: var(--gold); color: var(--navy); font-weight: 700; }
.nav .cta:hover { background: #d9b45f; }
.menu-btn { display: none; margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 8px; width: 44px; height: 44px; font-size: 1.25rem; cursor: pointer; }
.console-badge { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; background: var(--gold); color: var(--navy); padding: .2rem .5rem; border-radius: 4px; font-weight: 700; }

/* Hero */
.hero { position: relative; color: #fff; background: var(--navy) url('/assets/hero-generated.webp') center/cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(11,31,58,.94) 0%, rgba(11,31,58,.82) 45%, rgba(11,31,58,.45) 100%); }
.hero .wrap { position: relative; padding-top: 5rem; padding-bottom: 5rem; max-width: 1180px; }
.hero h1 { color: #fff; font-size: clamp(2.25rem, 4.5vw, 3.6rem); line-height: 1.05; max-width: 15ch; margin-bottom: 1rem; }
.hero p.lead { font-size: 1.15rem; max-width: 56ch; color: #dbe3ef; margin-bottom: 1.75rem; }
.hero .eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; font-weight: 700; margin-bottom: 1rem; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 1rem; margin-top: 2.5rem; }
.hero-stats div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); padding: .9rem 1rem; backdrop-filter: blur(4px); }
.hero-stats b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: .8rem; color: #c8d3e3; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; } .btn-primary:hover { background: var(--navy-700); }
.btn-gold { background: var(--gold); color: var(--navy); } .btn-gold:hover { background: #d9b45f; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--navy); } .btn-ghost:hover { background: var(--surface-2); }
.btn-light { background: #fff; color: var(--navy); } .btn-light:hover { background: #eef2f7; }
.btn-danger { background: var(--bad); color: #fff; } .btn-danger:hover { background: #8f1b1b; }
.btn-sm { min-height: 36px; padding: .35rem .75rem; font-size: .875rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(30,74,138,.35); outline-offset: 1px; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--charcoal); margin-bottom: .3rem; }
input, select, textarea { width: 100%; font: inherit; padding: .65rem .8rem; border: 1px solid #c8cfda; border-radius: 10px; background: #fff; color: var(--ink); min-height: 44px; }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: .9rem; }
.form-grid { display: grid; gap: .75rem 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.help { font-size: .8rem; color: var(--muted); margin-top: .3rem; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .5rem; height: 100%; }
.card h3 { margin-bottom: .25rem; }
.card .price-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; margin-top: auto; }
.card-dark { background: var(--navy); color: #fff; border-color: var(--navy); } .card-dark h3, .card-dark h2 { color: #fff; } .card-dark .muted { color: #b9c5d8; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.kpi .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.kpi .value { font-size: 2rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.1; margin: .25rem 0; }
.kpi .sub { font-size: .8rem; color: var(--muted); }
.kpi.bad .value { color: var(--bad); } .kpi.ok .value { color: var(--ok); } .kpi.warn .value { color: var(--warn); }
.feature { display: flex; gap: .9rem; align-items: flex-start; }
.feature .icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; background: var(--info-bg); color: var(--navy); display: grid; place-items: center; font-weight: 800; vertical-align: baseline; }

/* Tables & lists */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.list { display: flex; flex-direction: column; gap: .6rem; }
.item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; display: flex; gap: .75rem 1rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.item .main { flex: 1 1 240px; min-width: 0; }
.item .title { font-weight: 600; color: var(--navy); }
.item .meta { font-size: .8rem; color: var(--muted); }
.item.clickable { cursor: pointer; } .item.clickable:hover { border-color: var(--navy-500); }

/* Badges & alerts */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; background: var(--surface-2); color: var(--charcoal); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--navy-500); } .badge.navy { background: var(--navy); color: #fff; }
.alert { padding: .8rem 1rem; border-radius: 10px; border: 1px solid; font-size: .9rem; }
.alert.info { background: var(--info-bg); border-color: #c7d6f2; color: var(--navy); } .alert.ok { background: var(--ok-bg); border-color: #bfe3cf; color: var(--ok); } .alert.warn { background: var(--warn-bg); border-color: #f2d9a8; color: var(--warn); } .alert.bad { background: var(--bad-bg); border-color: #efbcbc; color: var(--bad); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toasts: rendered inside an aria-live region so screen readers announce them. */
.toast-region { position: fixed; left: 0; right: 0; bottom: 1.25rem; display: flex; justify-content: center; pointer-events: none; z-index: 100; padding: 0 1rem; }
.toast { pointer-events: auto; background: var(--charcoal); color: #fff; padding: .8rem 1.1rem; border-radius: 10px; box-shadow: var(--shadow); max-width: calc(100vw - 2rem); font-size: .9rem; animation: toast-in .18s ease-out; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Modal dialogs (confirmations & single-value prompts) — never native alert/confirm/prompt. */
dialog.dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(92vw, 460px); max-width: 92vw; background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgba(11,31,58,.35); }
dialog.dialog::backdrop { background: rgba(11,31,58,.55); backdrop-filter: blur(2px); }
.dialog-form { padding: 1.4rem 1.4rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; }
.dialog-title { font-size: 1.2rem; margin: 0; }
.dialog-message { color: var(--charcoal-600); margin: 0 0 .5rem; font-size: .95rem; }
.dialog-actions { justify-content: flex-end; margin-top: .5rem; }
.dialog-actions .btn { min-width: 120px; }

.pin { font-size: 2.2rem; letter-spacing: .3em; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: .7rem .9rem; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 44px; }
.tabs button.active { color: var(--navy); border-bottom-color: var(--gold); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.slots button { min-height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.slots button.taken { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.slots button.selected { background: var(--navy); color: #fff; border-color: var(--navy); }
.panic { background: var(--bad); color: #fff; border-radius: var(--radius); padding: 1.25rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.panic .btn { background: #fff; color: var(--bad); font-weight: 800; min-height: 56px; padding: 0 1.5rem; }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--navy-500); }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: .25rem 0 .75rem 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .55rem; width: 10px; height: 10px; border-radius: 50%; background: var(--navy-500); }

/* Admin console layout */
.console { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 64px); }
.sidebar { background: var(--charcoal); color: #cfd5de; padding: 1rem .75rem; }
.sidebar a { display: flex; align-items: center; gap: .6rem; color: #cfd5de; text-decoration: none; padding: .7rem .8rem; border-radius: 8px; font-size: .9rem; min-height: 44px; }
.sidebar a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.active { background: var(--navy-500); color: #fff; }
.sidebar .group { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #8a93a1; padding: 1rem .8rem .35rem; }
.console-main { padding: 1.5rem 1.25rem 3rem; min-width: 0; }
.console-main h1 { font-size: 1.6rem; }
.console .topbar-admin { background: var(--charcoal); }

/* Footer */
footer { background: var(--charcoal); color: #b8c0cc; padding: 2.5rem 0 1.5rem; margin-top: 3rem; font-size: .875rem; }
footer h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: .6rem; }
footer a { color: #dbe3ef; }
footer .trust { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12); }

/* Mobile */
@media (max-width: 860px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy-700); flex-direction: column; align-items: stretch; padding: .5rem; margin: 0; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
  .nav.open { display: flex; }
  .nav a { min-height: 48px; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .console { grid-template-columns: 1fr; }
  .sidebar { display: flex; overflow-x: auto; gap: .25rem; padding: .5rem; -webkit-overflow-scrolling: touch; }
  .sidebar .group { display: none; }
  .sidebar a { white-space: nowrap; }
  .section { padding: 2rem 0; }
  .hero .wrap { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  h1 { font-size: 1.8rem; }
  .kpi .value { font-size: 1.6rem; }
}
