/* ---------- Colours: dark (default) and light ---------- */
:root {
  --navy: #081424;
  --navy-2: #15263b;
  --gold: #e8c78d;
  --gold-hover: #f1d7a8;
  --paper: #f8f5ee;
  --mist: #b7c5d5;

  --bg: #081424;
  --panel: #15263b;
  --field: #081424;
  --line: #2a3f57;
  --field-line: #3a5170;
  --text: #f8f5ee;
  --muted: #b7c5d5;
  --accent: #e8c78d;        /* gold text and numbers */
  --bar: #3a5170;
  --bar-today: #e8c78d;
  --ok: #9fe1cb;
  --bad: #f09595;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f8f5ee;
  --panel: #fffdf8;
  --field: #ffffff;
  --line: #ddd5c6;
  --field-line: #cfc6b4;
  --text: #152237;
  --muted: #536072;
  --accent: #725219;        /* darker gold so it reads on cream */
  --bar: #c9d3df;
  --bar-today: #c9a35c;
  --ok: #2f7a4f;
  --bad: #a3392f;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.error { color: var(--bad); }
.ok { color: var(--ok); }
.eyebrow { margin: 0 0 4px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; width: 100%; min-height: 46px; margin: 8px 0 16px; padding: 10px 18px;
  border: 1px solid var(--gold); border-radius: 6px; background: var(--gold); color: var(--navy);
  font: inherit; font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--gold-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--gold); }
.btn-ghost { background: transparent; color: var(--gold); }
.btn-ghost:hover { background: var(--gold); color: var(--navy); }
.btn-small { width: auto; min-height: 36px; margin: 0; padding: 6px 14px; font-size: 14px; }
.btn:focus-visible, .tab:focus-visible, a:focus-visible, .theme-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Centered card (sign-in, terms, errors) ---------- */
.card {
  width: min(calc(100% - 32px), 440px); margin: 10vh auto; padding: 36px 32px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-align: center;
}
.card .logo { width: 120px; height: auto; margin-bottom: 16px; }
.card h1 { margin: 0 0 12px; font-size: 26px; line-height: 1.2; }
.links { list-style: none; margin: 0 0 16px; padding: 0; }
.links li { margin: 4px 0; }
.agree {
  display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; padding: 14px;
  border: 1px solid var(--line); border-radius: 8px; text-align: left; cursor: pointer;
}
.agree input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--gold); flex-shrink: 0; }

/* ---------- Dashboard: top bar (navy in both themes, like the website header) ---------- */
.appbar { position: sticky; top: 0; z-index: 5; background: var(--navy-2); border-bottom: 1px solid #2a3f57; color: var(--paper); }
.appbar-inner {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  max-width: none; margin: 0 auto; padding: 12px clamp(16px, 2.5vw, 48px);
}
.app-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--paper); font-weight: 700; text-decoration: none; }
.app-brand img { width: 40px; height: auto; }
.biz-pill { padding: 3px 10px; border: 1px solid #2a3f57; border-radius: 999px; color: var(--gold); font-size: 13px; font-weight: 600; }
.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tab { padding: 8px 14px; border-radius: 6px; color: var(--mist); font-size: 15px; text-decoration: none; white-space: nowrap; }
.tab.is-active { background: var(--navy); color: var(--paper); box-shadow: inset 0 -2px 0 var(--gold); }
.tab.is-soon { opacity: .6; cursor: default; }
.tab em { margin-left: 4px; font-size: 11px; font-style: normal; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); }
.appbar-user { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.user-email { color: var(--mist); font-size: 14px; }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  border: 1px solid #2a3f57; border-radius: 6px; background: transparent; color: var(--paper);
  font: inherit; font-size: 14px; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--gold); }
.theme-icon { width: 18px; height: 18px; background: center / contain no-repeat; }
/* Shows a sun in dark mode (switch to light) and a moon in light mode (switch to dark). */
:root .theme-icon { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8c78d' stroke-width='2' stroke-linecap='round'><circle cx='12' cy='12' r='4'/><path d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/></svg>"); }
:root[data-theme="light"] .theme-icon { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8c78d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/></svg>"); }

/* ---------- Dashboard: content ---------- */
.content { max-width: none; margin: 0 auto; padding: 28px clamp(16px, 2.5vw, 48px) 48px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 30px; line-height: 1.2; }
.page-head p { margin: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.kpi-label { display: block; color: var(--muted); font-size: 14px; }
.kpi strong { display: block; margin: 6px 0 2px; color: var(--accent); font-size: 30px; line-height: 1.15; }
.kpi-sub { color: var(--muted); font-size: 13px; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.panel { padding: 20px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel h2 { margin: 0; font-size: 17px; }
.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.dot-today { background: var(--bar-today); }

/* Chart */
.chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; align-items: end; height: 300px; padding: 8px 4px 0; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; min-width: 0; }
.bar-amt { color: var(--muted); font-size: 12px; white-space: nowrap; }
.bar-fill { width: 100%; max-width: 64px; min-height: 3px; border-radius: 4px 4px 0 0; background: var(--bar); }
.bar.is-today .bar-fill { background: var(--bar-today); }
.bar.is-today .bar-amt { color: var(--accent); font-weight: 700; }
.bar-label { color: var(--muted); font-size: 13px; text-align: center; line-height: 1.3; }
.bar-label b { display: block; color: var(--text); font-weight: 600; }

/* Form */
.sale-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sale-form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
.sale-form .wide { grid-column: 1 / -1; }
.sale-form label { min-width: 0; }
.sale-form input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
.sale-form input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.sale-form label select { -webkit-appearance: none; appearance: none; padding-right: 36px;
  background: var(--field) right 12px center / 14px no-repeat url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a35c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>"); }
.sale-form input, .sale-form select {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--field-line); border-radius: 6px;
  background: var(--field); color: var(--text); font: inherit;
}
.sale-form input:focus, .sale-form select:focus { outline: none; border-color: var(--bar-today); box-shadow: 0 0 0 2px #e8c78d55; }
.sale-form .btn { margin: 4px 0 0; }
#sale-msg { margin: 12px 0 0; }

/* Table */
.table-wrap { overflow-x: auto; }
.sales-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sales-table th { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap; }
.sales-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sales-table tr:last-child td { border-bottom: 0; }
.sales-table .num { text-align: right; white-space: nowrap; font-weight: 700; }
.tag { display: inline-block; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sales-table .empty { color: var(--muted); text-align: center; padding: 28px 12px; }
.sales-table td.c-meta { display: none; }


/* Report uploads */
.upload-panel { margin-bottom: 20px; }
.upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 150px; padding: 20px; border: 2px dashed var(--field-line); border-radius: 10px;
  background: var(--field); text-align: center; cursor: pointer;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--bar-today); }
.dropzone.is-busy { cursor: progress; opacity: .7; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.dropzone strong { color: var(--accent); }
.dz-icon { width: 30px; height: 30px; margin-bottom: 4px; background: center / contain no-repeat url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a35c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 16V4M7 9l5-5 5 5'/><path d='M4 16v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3'/></svg>"); }
#upload-msg { margin: 10px 0 0; }
.howto { margin-top: 12px; font-size: 14px; }
.howto summary { color: var(--accent); cursor: pointer; list-style-position: inside; }
.howto p { margin: 8px 0 0; }
.sub-head { margin: 0 0 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.upload-list { list-style: none; margin: 0; padding: 0; }
.upload-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.upload-list li:last-child { border-bottom: 0; }
.upload-list li.upload-empty { display: block; }
.u-status { grid-row: 1; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); align-self: center; }
.u-status.done { background: var(--ok); }
.u-status.failed { background: var(--bad); }
.u-status.waiting { background: var(--bar-today); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.u-title { font-weight: 600; min-width: 0; }
.u-amt { font-weight: 700; white-space: nowrap; }
.u-detail { grid-column: 2 / -1; grid-row: 2; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.u-detail.error { color: var(--bad); }
.sales-table .num.neg { color: var(--bad); }

/* Sale / Refund switch */
.kind-toggle { display: inline-flex; gap: 0; margin: 0; padding: 3px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--field); justify-self: start; }
.kind-toggle label { display: block; cursor: pointer; }
.kind-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kind-toggle span { display: block; padding: 6px 18px; border-radius: 6px; color: var(--muted); font-size: 14px; font-weight: 600; }
.kind-toggle input:checked + span { background: var(--bar-today); color: var(--navy); }
.kind-toggle input[value="refund"]:checked + span { background: var(--bad); color: #fff; }
.kind-toggle input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 1px; }
.sale-form.is-refund .btn { background: transparent; color: var(--bad); border-color: var(--bad); }
.sale-form.is-refund .btn:hover { background: var(--bad); color: #fff; }

/* Remove buttons (two clicks: ask, then do) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.link-btn {
  padding: 2px 6px; border: 0; border-radius: 4px; background: none; color: var(--muted);
  font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.link-btn:hover { color: var(--bad); text-decoration: underline; }
.link-btn.is-asking { background: var(--bad); color: #fff; text-decoration: none; }
.link-btn:disabled { opacity: .6; cursor: progress; }
.link-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sales-table td.c-act, .sales-table th.c-act { width: 1%; text-align: right; padding-left: 0; }
.upload-list .link-btn { grid-column: 3; grid-row: 2; justify-self: end; align-self: start; }
.upload-list li:has(.link-btn) .u-detail { grid-column: 2; }
.u-status.removed { background: transparent; border: 2px solid var(--muted); }
.upload-list li.is-removed .u-title { color: var(--muted); font-weight: 500; text-decoration: line-through; }

/* ---------- Tablets ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  .chart { height: 240px; }
  .upload-grid { grid-template-columns: 1fr; }
}

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  .appbar-inner { padding: 10px 16px; gap: 10px 12px; }
  .user-email { display: none; }
  .theme-text { display: none; }
  .theme-toggle { padding: 0 9px; }
  .tabs { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .content { padding: 20px 16px 40px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .page-head h1 { font-size: 26px; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi strong { font-size: 22px; }
  .panel { padding: 16px; }
  .chart { gap: 6px; height: 200px; }
  .bar-amt { font-size: 10px; }
  .sale-form { grid-template-columns: 1fr; }
  .sales-table thead { display: none; }
  .sales-table, .sales-table tbody, .sales-table tr, .sales-table td { display: block; width: 100%; }
  .sales-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .sales-table tr:last-child { border-bottom: 0; }
  .sales-table td { padding: 0; border: 0; }
  .sales-table td.c-item { grid-column: 1; grid-row: 1; font-weight: 600; }
  .sales-table td.num { grid-column: 2; grid-row: 1; }
  .sales-table td.c-date, .sales-table td.c-method, .sales-table td.c-source { display: none; }
  .sales-table td.c-meta { display: block; grid-column: 1; grid-row: 2; color: var(--muted); font-size: 13px; }
  .sales-table td.c-act { grid-column: 2; grid-row: 2; width: auto; padding: 0; }
  .sales-table .empty { text-align: left; }
  .panel-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .dropzone { min-height: 110px; padding: 16px; }
  .dz-drag { display: none; }
  .upload-grid { gap: 16px; }
  .upload-list li { grid-template-columns: 10px minmax(0, 1fr) auto; gap: 2px 10px; }
  .u-title { font-size: 15px; }
  .u-amt { font-size: 15px; }
}

/* ---------- Home page: one card per area ---------- */
.page { transform-origin: 50% 0; }
.todo { margin-bottom: 20px; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.todo-list li:last-child { border-bottom: 0; }
.todo-list .sev { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--bar-today); }
.todo-text { flex: 1; min-width: 0; }
.todo-list .btn { flex: none; text-decoration: none; }
.todo-done { color: var(--ok); }
.areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.area {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 190px; padding: 18px 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none;
  transition: transform .15s, border-color .15s;
}
a.area:hover { border-color: var(--bar-today); transform: translateY(-2px); }
a.area:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.area.is-soon { min-height: 0; background: transparent; border-style: dashed; }
.area.is-soon .area-head { color: var(--muted); }
.area-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; }
.area-big { color: var(--accent); font-size: 30px; line-height: 1.15; white-space: nowrap; }
.area-sub { color: var(--muted); font-size: 14px; }
.area-open { margin-top: 6px; color: var(--accent); font-size: 13px; font-weight: 700; }
.chip { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.ok { color: var(--ok); border-color: currentColor; }
.chip.warn { color: var(--accent); border-color: currentColor; }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 44px; margin-top: auto; }
.spark i { flex: 1; min-height: 3px; border-radius: 3px 3px 0 0; background: var(--bar); }
.spark i.is-today { background: var(--bar-today); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.pills span { padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) { .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .areas { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  a.area { min-height: 0; }
  .area-big { font-size: 26px; }
  .todo-list li { flex-wrap: wrap; }
  .todo-text { flex-basis: calc(100% - 22px); }
  .todo-list .btn { margin-left: 22px; }
}
@media (prefers-reduced-motion: reduce) { .area { transition: none; } }

/* ---------- Home: request a feature ---------- */
.head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.head-right .btn { text-decoration: none; }
@media (max-width: 700px) { .head-right { align-items: flex-start; } }

/* ---------- Nimbus Admin (Way of Nimbus staff only) ---------- */
.tab-admin { color: var(--gold); }
.adm-nav { display: inline-flex; padding: 3px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--field); }
.adm-navbtn { padding: 6px 16px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.adm-navbtn.is-active { background: var(--bar-today); color: var(--navy); }
.adm-navbtn:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.adm-table th { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap; }
.adm-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table .num { text-align: right; }
.adm-table .tag { margin-left: 6px; }
.adm-table .adm-row { cursor: pointer; }
.adm-table .adm-row:hover td { background: var(--field); }
.adm-table .adm-row:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.adm-center { text-align: center !important; }
.adm-table input[type="checkbox"], .adm-feature input[type="checkbox"], .adm-check input { width: 18px; height: 18px; accent-color: var(--gold); flex-shrink: 0; }
.adm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; margin-bottom: 16px; }
.adm-grid h2, .adm-section h2 { margin: 0 0 12px; font-size: 17px; }
.adm-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--muted); font-size: 14px; }
.adm-field small { font-size: 12px; }
.adm-form .adm-field:has(textarea), .adm-form .adm-check { grid-column: 1 / -1; }
.adm-field input, .adm-field select, .adm-field textarea, .adm-invite input {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--field-line); border-radius: 6px;
  background: var(--field); color: var(--text); font: inherit;
}
.adm-field textarea { resize: vertical; }
.adm-field input:focus, .adm-field select:focus, .adm-field textarea:focus, .adm-invite input:focus { outline: none; border-color: var(--bar-today); box-shadow: 0 0 0 2px #e8c78d55; }
.adm-check { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 14px; cursor: pointer; }
.adm-features { display: flex; flex-direction: column; }
.adm-feature { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.adm-feature:last-child { border-bottom: 0; }
.adm-feature-main { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.adm-feature-main input { margin-top: 3px; }
.adm-feature-main strong { display: block; font-size: 15px; }
.adm-feature-main small { display: block; font-size: 13px; }
.adm-feature:not(.is-on) strong { color: var(--muted); font-weight: 600; }
.adm-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; align-items: flex-start; }
.tag-gold { color: var(--accent); border-color: currentColor; }
.adm-settings { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 220px)); gap: 10px; padding-left: 28px; }
.adm-settings input { min-height: 36px; padding: 6px 10px; }
.adm-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; }
.adm-actions .btn { width: auto; margin: 0; }
.adm-actions .btn.is-asking, .adm-client-head .btn.is-asking { background: var(--bad); border-color: var(--bad); color: #fff; }
.adm-msg { margin: 0 0 12px; }
.adm-actions .adm-msg { margin: 0; }
.adm-client-head { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; margin-bottom: 16px; }
.adm-client-head .link-btn { grid-column: 1 / -1; justify-self: start; padding-left: 0; }
.adm-client-head h2 { margin: 0; font-size: 24px; display: flex; align-items: center; gap: 10px; }
.adm-client-head small { grid-column: 1; }
.adm-client-head .btn { grid-column: 2; grid-row: 2 / 4; }
.adm-section { margin-bottom: 20px; }
.adm-people, .adm-log { list-style: none; margin: 0 0 12px; padding: 0; }
.adm-people li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.adm-people li.is-off strong { color: var(--muted); text-decoration: line-through; }
.adm-row-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.adm-invite { display: flex; gap: 10px; max-width: 520px; }
.adm-invite .btn { flex: none; }
.adm-log li { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.adm-log li:last-child, .adm-people li:last-child { border-bottom: 0; }
@media (max-width: 1100px) { .adm-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .adm-form { grid-template-columns: 1fr; }
  .adm-feature { grid-template-columns: 1fr; }
  .adm-tags { justify-content: flex-start; padding-left: 28px; }
  .adm-log li { grid-template-columns: 1fr; gap: 2px; }
  .adm-people li { flex-direction: column; align-items: flex-start; }
  .adm-table th, .adm-table td { padding: 10px 6px; }
}

/* ---------- Nimbus Admin: Status heartbeat ---------- */
.beat-head { margin-bottom: 20px; }
.beat-row { display: flex; align-items: center; gap: 12px; }
.beat-row .btn { margin-left: auto; }
.beat-title { font-size: 20px; }
.beat-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.beat-dot.is-ok { background: var(--ok); }
.beat-dot.is-warn { background: var(--bar-today); }
.beat-dot.is-down { background: var(--bad); }
.beat-dot.is-soon { background: transparent; border: 2px dashed var(--muted); }
.beat-pulse { position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ok); }
.beat-pulse.is-warn { background: var(--bar-today); }
.beat-pulse.is-down { background: var(--bad); }
.beat-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: beat 1.6s ease-out infinite; }
@keyframes beat { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .beat-pulse::after { animation: none; } }
.beat-parts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; }
.beat-parts li { display: grid; grid-template-columns: 10px 1fr; gap: 0 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.beat-parts li span:last-child { grid-column: 2; }
.cap-kpis { margin-bottom: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.cap-kpis .kpi { background: var(--field); }
.cap-kpis .kpi strong { font-size: 26px; }
.cap-note { margin: 12px 0 4px; }
.cap-tables { margin-top: 8px; }

/* ---------- Phone app tip ---------- */
.install-tip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; border-color: var(--bar-today); }
.install-tip > div { flex: 1; min-width: 200px; }
.install-tip p { margin: 4px 0 0; }

/* ---------- Fee tracker ---------- */
.fees-panel { margin-bottom: 20px; }
.fees-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.fees-table th { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap; }
.fees-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.fees-table tr:last-child td { border-bottom: 0; }
.fees-table .num { text-align: right; }
.fees-table td.c-month { font-weight: 600; }
@media (max-width: 700px) { .fees-table th, .fees-table td { padding: 8px 6px; font-size: 14px; } }

/* Phone app (opened from the home screen): leave room for the iPhone notch */
@media (display-mode: standalone) {
  .appbar { padding-top: env(safe-area-inset-top); }
}

/* ---------- Monthly goal ---------- */
.goal-card #goal-show { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.goal-bar { position: relative; display: block; height: 12px; margin: 8px 0 2px; border-radius: 999px; background: var(--bar); overflow: visible; }
.goal-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--bar-today); transition: width .4s; }
.goal-bar b { position: absolute; top: -4px; width: 2px; height: 20px; margin-left: -1px; background: var(--text); opacity: .55; }
.goal-edit { align-self: flex-start; margin-top: auto; padding-left: 0; color: var(--accent); font-weight: 700; }
.goal-form { display: grid; gap: 10px; }
.goal-form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
.goal-form input, .goal-form select { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--field-line); border-radius: 6px; background: var(--field); color: var(--text); font: inherit; }
.goal-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.goal-form p { margin: 0; }
@media (prefers-reduced-motion: reduce) { .goal-bar i { transition: none; } }

/* ---------- Expenses and receipt snap ---------- */
.exp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.exp-actions .btn { width: auto; margin: 0; }
.exp-snap { position: relative; display: inline-flex; align-items: center; }
.exp-snap input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.exp-snap:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
#exp-msg { margin: -8px 0 16px; }
.exp-drafts { margin-bottom: 20px; border-color: var(--bar-today); }
.exp-draft { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.exp-draft:last-child { border-bottom: 0; }
.exp-thumb { display: block; width: 140px; height: 180px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); overflow: hidden; }
.exp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.exp-draft p { margin: 0 0 10px; }
.exp-reading { color: var(--accent); font-weight: 600; animation: pulse 1.2s ease-in-out infinite; }
.exp-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.exp-form label { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--muted); font-size: 14px; }
.exp-form .wide { grid-column: 1 / -1; }
.exp-form input, .exp-form select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--field-line); border-radius: 6px; background: var(--field); color: var(--text); font: inherit; }
.exp-form input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; }
.exp-form input:focus, .exp-form select:focus { outline: none; border-color: var(--bar-today); box-shadow: 0 0 0 2px #e8c78d55; }
.exp-form .btn { margin: 4px 0 0; }
.exp-form p { margin: 0; }
#exp-manual { margin-bottom: 20px; }
.exp-table td.c-act { white-space: nowrap; }
@media (max-width: 700px) {
  .exp-draft { grid-template-columns: 1fr; }
  .exp-thumb { width: 100%; height: 200px; }
  .exp-form { grid-template-columns: 1fr; }
  .exp-actions { width: 100%; }
  .exp-actions .btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .exp-reading { animation: none; } }

/* ---------- Profit tile: snap straight from Home ---------- */
.profit-drafts { color: var(--accent); font-weight: 700; text-decoration: none; }
.profit-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.profit-actions .btn { position: relative; width: auto; margin: 0; }
.profit-actions .btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.profit-actions .btn:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.profit-actions .area-open { margin-top: 0; text-decoration: none; }
.exp-table tr.is-other-month td { color: var(--muted); }

/* ---------- Tabs: icons only show in the phone bar ---------- */
.tab { display: inline-flex; align-items: center; gap: 6px; }
.tab-ico { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Phones: app-style bar at the bottom ---------- */
@media (max-width: 700px) {
  .appbar .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; order: 0; width: auto; margin: 0;
    display: flex; justify-content: space-around; gap: 0; overflow: visible;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--navy-2); border-top: 1px solid #2a3f57;
  }
  .appbar .tab { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11px; text-align: center; box-shadow: none; }
  .appbar .tab.is-active { background: transparent; color: var(--gold); box-shadow: none; }
  .appbar .tab.is-soon { display: none; }
  .appbar .tab-ico { display: block; }
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* ---------- Nimbus Admin: other software list ---------- */
.tool-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tool-chip { background: none; font: inherit; font-size: 12px; cursor: pointer; }
.tool-chip:hover { color: var(--accent); border-color: currentColor; }
.tool-form { display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr 1.6fr auto; gap: 10px; align-items: end; }
.tool-form .adm-field input, .tool-form .adm-field select { min-height: 38px; }
.tool-form-actions { display: flex; gap: 8px; align-items: center; padding-bottom: 2px; }
.tool-form-actions .btn { width: auto; margin: 0; }
@media (max-width: 900px) { .tool-form { grid-template-columns: 1fr 1fr; } }

/* ---------- Nimbus Admin: watch list ---------- */
.watch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.watch-block { min-width: 0; }
.watch-wide { grid-column: 1 / -1; }
.watch-block p { margin: 0 0 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.watch-big { color: var(--accent); font-size: 22px; }
.trend { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; align-items: end; height: 130px; }
.trend-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.trend-bar i { width: 100%; max-width: 36px; min-height: 3px; border-radius: 3px 3px 0 0; background: var(--bar); }
.trend-bar.is-now i { background: var(--bar-today); }
.trend-amt { color: var(--muted); font-size: 11px; white-space: nowrap; }
.trend-label { color: var(--muted); font-size: 11px; white-space: nowrap; }
@media (max-width: 1100px) { .watch-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .watch-grid { grid-template-columns: 1fr; } }

/* ---------- Nimbus Admin: plan templates ---------- */
.plans-table th.plan-col { min-width: 170px; vertical-align: bottom; }
.plans-table th.plan-col input[type="text"] { width: 100%; min-height: 34px; padding: 4px 8px; border: 1px solid var(--field-line); border-radius: 6px; background: var(--field); color: var(--text); font: inherit; font-weight: 700; }
.plans-table th.plan-col small { display: block; margin-top: 4px; font-weight: 400; }
.plans-table th.is-retired input[type="text"] { opacity: .6; text-decoration: line-through; }
.plan-retire { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.plans-table td input[type="text"], .plans-table td input[type="number"] { width: 100%; min-height: 34px; padding: 4px 8px; border: 1px solid var(--field-line); border-radius: 6px; background: var(--field); color: var(--text); font: inherit; font-size: 14px; }
.plans-table td input[type="number"] { max-width: 110px; text-align: right; }
.plans-table tr.plan-section td { padding-top: 22px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.plan-add { grid-template-columns: 1.4fr 1fr 1fr auto; }
.over-seats { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.over-seats .btn { width: auto; margin: 0; }

/* Sign-in card: stay signed in on this device */
.keep { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -6px 0 16px; color: var(--muted); font-size: 14px; cursor: pointer; }
.keep input { width: 16px; height: 16px; accent-color: var(--gold); }

/* Ask your numbers */
.ask-panel { margin-bottom: 20px; }
.ask-form { display: flex; gap: 10px; }
.ask-form input { flex: 1; min-width: 0; min-height: 44px; padding: 10px 14px; border: 1px solid var(--field-line);
  border-radius: 8px; background: var(--field); color: var(--text); font: inherit; font-size: 16px; }
.ask-form input:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.ask-form .btn { min-height: 44px; padding: 8px 22px; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip-btn { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.chip-btn:hover, .chip-btn:focus-visible { border-color: var(--gold); color: var(--accent); outline: none; }
.ask-answer { margin-top: 16px; padding: 14px 16px; border-left: 3px solid var(--gold); border-radius: 6px; background: var(--field); }
.ask-answer.is-error { border-left-color: var(--bad); }
.ask-answer.is-busy .ask-a { color: var(--muted); }
.ask-q { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.ask-a { margin: 0; white-space: pre-line; line-height: 1.5; }
.ask-history { margin-top: 12px; font-size: 14px; }
.ask-history summary { color: var(--accent); cursor: pointer; }
.ask-history ul { list-style: none; margin: 8px 0 0; padding: 0; }
.ask-history li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ask-history li:last-child { border-bottom: 0; }
.ask-history li p { margin: 4px 0 0; color: var(--muted); white-space: pre-line; }
.ask-note { margin: 12px 0 0; }
@media (max-width: 700px) {
  .ask-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .chip-btn { flex: none; }
}

/* Request a feature */
.request-panel { margin-bottom: 20px; border-color: var(--gold); }
.request-form { display: grid; gap: 12px; max-width: 900px; }
.request-form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
.request-form textarea { min-width: 0; padding: 10px 14px; border: 1px solid var(--field-line); border-radius: 8px;
  background: var(--field); color: var(--text); font: inherit; font-size: 16px; resize: vertical; }
.request-form textarea:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.request-actions { display: flex; align-items: center; gap: 14px; }
#request-msg { margin: 0; }

/* Contact support */
.tab { position: relative; }
.tab-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: var(--navy);
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.area-mid { font-size: 24px; }
.support-panel { display: flex; flex-direction: column; gap: 14px; }
.support-thread { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; min-height: 160px; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: min(720px, 85%); padding: 10px 14px; border-radius: 12px; }
.msg-me { align-self: flex-end; background: var(--field); border: 1px solid var(--line); border-bottom-right-radius: 4px; }
.msg-them { align-self: flex-start; background: var(--panel); border: 1px solid var(--gold); border-bottom-left-radius: 4px; }
.msg-who { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.msg-them .msg-who { color: var(--accent); }
.msg-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.support-form textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--field-line); border-radius: 8px;
  background: var(--field); color: var(--text); font: inherit; font-size: 16px; resize: vertical; }
.support-form textarea:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.support-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
#support-msg { margin: 8px 0 0; }

/* Expenses: phone camera tip */
.camera-tip { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; border-color: var(--gold); }
.camera-qr { flex: none; width: 96px; height: 96px; border-radius: 6px; overflow: hidden; }
.camera-qr svg { display: block; width: 100%; height: 100%; }
.camera-text { flex: 1; min-width: 0; }
.camera-text p { margin: 4px 0 0; }

/* Nimbus Admin: offboarding */
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: var(--bad); filter: brightness(1.1); }
.btn-danger:disabled:hover { background: var(--bad); filter: none; }
.adm-danger { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.adm-danger input { min-width: 240px; padding: 8px 12px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--field); color: var(--text); font: inherit; }

.head-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#export-msg { margin: 6px 0 0; max-width: 360px; text-align: right; }

/* Very wide screens: use the room */
@media (min-width: 1800px) { .areas { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
