/* =====================================================================
   QIG Decks — admin UI styling. Built to the QIG brand:
   palette White / Linen / Stone / Sand / Black, Gestura Display (serif,
   used sparingly for big editorial headings) + Euclid Circular A (sans,
   used for UI and body). Warm neutrals, generous whitespace, hairlines.
   ===================================================================== */

/* ---- fonts ---- */
@font-face { font-family: "Euclid"; src: url("fonts/EuclidCircularA-Light.woff2") format("woff2");   font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Euclid"; src: url("fonts/EuclidCircularA-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Euclid"; src: url("fonts/EuclidCircularA-Medium.woff2") format("woff2");  font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Gestura"; src: url("fonts/GesturaDisplay-Light.woff2") format("woff2");         font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Gestura"; src: url("fonts/GesturaDisplay-RegularItalic.woff2") format("woff2"); font-weight: 400; font-style: italic;  font-display: swap; }

:root {
  --white: #ffffff;
  --linen: #e8e4e1;
  --stone: #d0ccc7;
  --sand:  #c9beac;
  --black: #000000;

  --bg:        #f4f2ef;      /* warm near-white page ground */
  --card:      #ffffff;
  --ink:       #1a1814;      /* near-black, never pure for body */
  --ink-soft:  #4c4842;
  --muted:     #837d74;
  --hair:      #e2ddd6;      /* hairline border */
  --hair-2:    #efebe6;

  /* data accents from the QIG infographics palette (sanctioned for charts/metrics) */
  --olive: #bfab67;
  --dusk:  #a58c8e;
  --buff:  #d6b382;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 24px 50px -38px rgba(40, 32, 20, .45);
  --maxw: 1080px;
  --font: "Euclid", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Gestura", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-weight: 400; font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
.link { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--stone); padding-bottom: 1px; }
.link:hover { border-color: var(--ink); }
code, .code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
code { background: var(--hair-2); padding: 1px 6px; border-radius: 6px; }

/* ---- typography ---- */
.h1 { font-family: var(--serif); font-weight: 300; font-size: 34px; line-height: 1.1; letter-spacing: -.01em; margin: 0 0 4px; }
.h2 { font-weight: 500; font-size: 15px; letter-spacing: .02em; margin: 0; }
.h3 { font-weight: 500; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 10px; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.opt { color: var(--muted); font-weight: 400; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 28px;
  padding: 0 28px; height: 62px; background: var(--white); border-bottom: 1px solid var(--hair);
  position: sticky; top: 0; z-index: 10;
}
.topbar__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.topbar__brand img { display: block; }
.topbar__sep { width: 1px; height: 22px; background: var(--stone); }
.topbar__app { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink); }
.nav { display: flex; gap: 4px; margin-left: 4px; }
.nav__item { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-soft); font-size: 14px; font-weight: 500; }
.nav__item:hover { background: var(--linen); }
.nav__item.is-active { background: var(--ink); color: var(--white); }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar__email { color: var(--muted); font-size: 13px; }
.inline { display: inline; margin: 0; }

/* ---- layout ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 36px 28px 64px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.crumbs span { margin: 0 6px; color: var(--stone); }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 0 40px; }

/* ---- tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 28px; }
.tile { background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius); padding: 22px 22px 20px; }
.tile__value { font-family: var(--serif); font-weight: 300; font-size: 40px; line-height: 1; letter-spacing: -.01em; }
.tile__value--sm { font-size: 22px; font-family: var(--font); font-weight: 500; letter-spacing: 0; }
.tile__label { color: var(--muted); font-size: 12.5px; margin-top: 10px; letter-spacing: .02em; }

/* ---- panels ---- */
.panel { background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius); margin-bottom: 22px; overflow: hidden; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--hair-2); }
.panel--form { padding: 24px 22px; }
.panel--manage .manage { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; padding: 22px; }
.manage__block { border: 1px solid var(--hair-2); border-radius: var(--radius-sm); padding: 16px; margin: 0; }

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th {
  text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 12px 22px; border-bottom: 1px solid var(--hair);
}
.table tbody td { padding: 14px 22px; border-bottom: 1px solid var(--hair-2); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #faf8f5; }
.table .num { font-variant-numeric: tabular-nums; }
.row--unq { opacity: .5; }

/* ---- badges ---- */
.badge { display: inline-block; font-size: 11px; font-weight: 500; letter-spacing: .03em; padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.badge--ok { background: #eef0df; color: #5d5526; border-color: #e2e3c4; }
.badge--mute { background: var(--linen); color: var(--muted); border-color: var(--stone); }
.badge--brand { background: #f3eee6; color: #6b5f4c; border-color: #e6ddcd; }
.badge--accent { background: #efe4e4; color: #6e5557; border-color: #e0cccd; }
.badge--warn { background: #f3ead6; color: #6b5519; border-color: #e3d2a8; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 1px solid transparent; border-radius: 999px; font-family: var(--font); font-size: 14px; font-weight: 500; padding: 10px 20px; text-decoration: none; transition: filter .12s, background .12s, border-color .12s; }
.btn--primary { background: var(--ink); color: var(--white); }
.btn--primary:hover { filter: brightness(1.25); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--stone); }
.btn--ghost:hover { background: var(--linen); }
.btn--danger { background: transparent; color: #8a3b34; border-color: #e0c4c0; }
.btn--danger:hover { background: #f7eeec; }
.btn--danger[disabled] { opacity: .5; cursor: default; }
.btn--sm { padding: 7px 14px; font-size: 13px; }
.btn--block { width: 100%; margin-top: 8px; }

/* ---- forms ---- */
.form .field, .panel--form .field { margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); margin-bottom: 7px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--stone); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 15px; background: var(--white); color: var(--ink); outline: none;
}
input:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(26,24,20,.08); }
.field--radio legend { font-size: 13px; font-weight: 500; color: var(--ink-soft); margin-bottom: 8px; padding: 0; }
.radio { display: flex; align-items: center; gap: 9px; font-weight: 400; color: var(--ink); margin-bottom: 7px; }
.radio input { width: auto; }
.mt { margin-top: 10px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 7px 0 0; line-height: 1.45; }
.hint--pad { padding: 0 22px 18px; }
.formactions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.formerr { background: #f7eeec; border: 1px solid #e6cdc8; color: #8a3b34; padding: 11px 14px; border-radius: var(--radius-sm); margin: 0 0 18px; font-size: 14px; }
.flash { background: #eef0df; border: 1px solid #e2e3c4; color: #5d5526; padding: 11px 14px; border-radius: var(--radius-sm); margin: 0 0 18px; font-size: 14px; }
.kv { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---- copy row ---- */
.copyrow { display: flex; gap: 10px; }
.copyrow__input { flex: 1; background: var(--hair-2); border-color: var(--hair); }

/* ---- empty states ---- */
.empty { text-align: center; padding: 56px 24px; }
.empty__title { font-family: var(--serif); font-weight: 300; font-size: 22px; margin: 0 0 6px; }
.empty__sub { color: var(--muted); margin: 0 0 20px; }
.empty__note { color: var(--muted); padding: 26px 22px; margin: 0; font-size: 14px; }

/* ---- gate / login (standalone) ---- */
.gate { min-height: 100vh; margin: 0; display: grid; place-items: center; background: var(--linen); padding: 24px; }
.gate__card { width: min(94vw, 400px); background: var(--white); border: 1px solid var(--hair); border-radius: 20px; padding: 38px 34px; box-shadow: var(--shadow); }
.gate__card--msg { text-align: center; }
.gate__logo { display: block; margin: 0 auto 18px; }
.gate__eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 12px; }
.gate__title { font-family: var(--serif); font-weight: 300; font-size: 25px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -.01em; }
.gate__sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; line-height: 1.5; }
.gate__label { margin-top: 6px; }
.gate__input { margin-bottom: 6px; }
.gate__err { color: #8a3b34; font-size: 13.5px; margin: 14px 0 0; }
.gate__foot { color: var(--muted); font-size: 11px; text-align: center; margin: 20px 0 0; }

/* ---- dashboard follow-up queue ---- */
.follow { display: flex; flex-direction: column; }
.follow__row { display: grid; grid-template-columns: 1.2fr 1.4fr auto; gap: 14px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--hair-2); text-decoration: none; color: var(--ink); }
.follow__row:last-child { border-bottom: 0; }
.follow__row:hover { background: #faf8f5; }
.follow__client { font-weight: 500; }
.follow__deck { color: var(--muted); font-size: 14px; }
.follow__reason { text-align: right; font-size: 13px; white-space: nowrap; }

/* ---- send package ---- */
.sendpkg { width: 100%; padding: 12px 14px; border: 1px solid var(--stone); border-radius: var(--radius-sm); font-family: var(--font); font-size: 14px; line-height: 1.5; background: var(--white); color: var(--ink); resize: vertical; }
.sendpkg:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(26,24,20,.08); outline: none; }

/* ---- filter bar ---- */
.filterbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 22px; }
.filterbar__field { display: flex; flex-direction: column; gap: 5px; }
.filterbar__field label { margin: 0; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.filterbar__field select, .filterbar__field input { padding: 8px 10px; font-size: 14px; }
.filterbar__field--grow { flex: 1; min-width: 160px; }
.filterbar__actions { display: flex; gap: 8px; margin-left: auto; }

/* ---- decks: search, disclosure, sub-decks, status ---- */
.searchbar { display: flex; gap: 8px; margin-bottom: 18px; max-width: 520px; }
.searchbar input[type="search"] { flex: 1; }
.disclosure { background: none; border: 0; cursor: pointer; padding: 0 6px 0 0; color: var(--ink-soft); line-height: 1; }
.chev { display: inline-block; transition: transform .15s; font-size: 12px; }
.disclosure[aria-expanded="true"] .chev { transform: rotate(90deg); }
.row--sub td { background: #faf8f5; }
.row--sub td:first-child { padding-left: 46px; }
.subdeck-arrow { color: var(--stone); margin-right: 4px; }
.table tr[hidden] { display: none; }
.status-form { display: inline; margin: 0; }
.status-form select { padding: 5px 8px; font-size: 12.5px; border-radius: 8px; min-width: 100px; }

/* ---- analytics: day chart ---- */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 18px 22px 22px; }
.chart__col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.chart__bar { width: 100%; background: var(--olive); border-radius: 3px 3px 0 0; min-height: 2px; }
.chart__axis { display: flex; justify-content: space-between; padding: 0 22px 16px; color: var(--muted); font-size: 11px; }

/* ---- analytics: horizontal bar list ---- */
.barlist { padding: 8px 22px 18px; }
.barlist__row { display: grid; grid-template-columns: minmax(120px, 1.4fr) 2fr minmax(84px, auto); gap: 14px; align-items: center; padding: 8px 0; }
.barlist__label { font-size: 14px; }
.barlist__track { background: var(--hair-2); border-radius: 999px; height: 9px; overflow: hidden; }
.barlist__fill { display: block; height: 100%; background: var(--sand); border-radius: 999px; }
.barlist__val { font-size: 13px; color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }

/* ---- responsive ---- */
@media (max-width: 720px) {
  .topbar { gap: 14px; padding: 0 16px; height: 56px; }
  .topbar__email { display: none; }
  .nav__item { padding: 7px 11px; font-size: 13px; }
  .wrap { padding: 24px 16px 48px; }
  .h1 { font-size: 27px; }
  .pagehead { flex-direction: column; align-items: stretch; }
  .grid2 { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .filterbar { flex-direction: column; align-items: stretch; }
  .filterbar__actions { margin-left: 0; }
  .filterbar__field--grow { min-width: 0; }
}
