/* Copied unchanged from Sphere Nexus main 3ef64ea sphere_nexus/static/style.css so the portal matches Nexus (Tony, 2026-10-27). Re-copy, don't edit. */
/* -- Palette --------------------------------------------------------
 *
 * Two themes (2026-10-19, sphere_nexus/theme.py). base.html stamps
 * <html data-theme="light|dark"> from the person's own setting.
 *
 *   :root                    LIGHT -- the Expenses look Tony asked the
 *                            whole app to follow: light grey page, white
 *                            cards with a soft border and shadow, the
 *                            Expenses blue, dark bold titles.
 *   :root[data-theme=dark]   DARK -- the original palette, value for value.
 *                            Every token added for the light theme resolves
 *                            here to what the dark pages already drew, so
 *                            dark mode looks exactly as it did.
 *
 * The navy top bar is brand chrome and is the same in both (observer.css).
 * Generated reports, PDFs and emails are paper and are not themed.
 *
 * Contrast pairs are checked by tests/sphere_nexus/test_theme.py (WCAG AA).
 */
:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --panel-2: #f7f9fb;
  --border: #dde2e8;
  --text: #1d2733;
  --muted: #5f6b7a;
  --accent: #0a6ebd;
  --accent-2: #0a5fa3;
  --danger: #c0352b;
  --ok: #1d7a3a;
  --warn: #9a5b00;

  /* semantic tokens (light values) */
  --accent-hover: #085a9b;
  --on-accent: #ffffff;
  --link: #0a5fa3;
  --heading-2: var(--text);
  --h1-size: 26px;
  --card-radius: 10px;
  --card-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --input-bg: #ffffff;
  --input-border: #c3cbd5;
  --input-disabled-bg: #f4f6f8;
  --focus-ring: rgba(10, 110, 189, 0.35);
  --secondary-bg: #ffffff;
  --secondary-border: #c3cbd5;
  --secondary-hover: #f2f5f8;
  --table-head-bg: #f7f9fb;
  --table-head-weight: 700;
  --table-row-border: #edf0f3;
  --row-hover: #f5f9fe;
  --menu-bg: #ffffff;
  --menu-hover: #f2f5f8;
  --pop-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  --modal-backdrop: rgba(15, 23, 42, 0.45);
  --modal-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
  --code-bg: #f1f4f8;
  --code-text: #1d2733;
  --danger-bg: #fdf1f0;
  --danger-border: #e3b4b0;
  --ok-bg: #edf8f0;
  --ok-border: #b5dfc1;
  --warn-bg: #fff7e6;
  --warn-border: #f0cf8e;
  --warn-text: #6b4300;
  --info-bg: #eef6fd;
  --info-border: #b9d8f2;
  --info-text: #0b4a7d;
  --important-row-bg: #fffaf0;
  --tag-fb: #1d5fbf;  --tag-fb-border: #b9cff0;
  --tag-ig: #a3348f;  --tag-ig-border: #e8bfe0;
  --tag-tw: #0a5fa3;  --tag-tw-border: #b9d8f2;

  /* dashboards (bi.css, scorecard.css) */
  --hover-border: #b9c3cf;
  --card-grad-end: #f9fafc;
  --card-hover-shadow: 0 6px 18px rgba(15, 23, 42, 0.10);
  --pop-shadow-strong: 0 12px 32px rgba(15, 23, 42, 0.18);
  --btn-hover-text: var(--accent-2);
  --row-divider-soft: #edf0f3;
  --row-hover-soft: #f5f9fe;
  --focus-glow: 0 0 0 2px rgba(10, 110, 189, 0.28);
  --note-warn-bg: #fff7e6;
  --note-warn-text: #6b4300;
  --note-code-bg: rgba(15, 23, 42, 0.06);
  --pending-bg: #fafbfc;
  --error-soft-border: #e3b4b0;
  --error-soft-bg: #fdf1f0;
  --error-soft-text: #9b2c22;
  --status-serious: #b4521f;
  --ord-1: #0a4f8a;
  --ord-2: #0a6ebd;
  --ord-3: #3a8fd6;
  --ord-4: #6aaee3;
  --ord-n: #a9cdec;

  /* status text + tints used across templates */
  --ok-text: #1d7a3a;
  --bad-text: #b42318;
  --amber: #8a5300;
  --amber-tint: #fff3dc;
  --amber-tint-soft: #fff8e8;
  --hover-tint: #f5f7fa;
  --danger-tint: #fdecea;

  /* status badges, drop zones, viewer (Expenses first; shared) */
  --badge-neutral-bg: #eef1f5;
  --badge-neutral-fg: #4a5565;
  --badge-neutral-bd: #d6dce4;
  --badge-info-bg: #e6f1fb;
  --badge-info-fg: #0a5fa3;
  --badge-info-bd: #b9d8f2;
  --badge-warn-bg: #fff3dc;
  --badge-warn-fg: #8a5300;
  --badge-warn-bd: #f0cf8e;
  --badge-ok-bg: #e7f6ec;
  --badge-ok-fg: #1d7a3a;
  --badge-ok-bd: #b5dfc1;
  --badge-solid-ok-bg: #1d7a3a;
  --badge-solid-ok-fg: #ffffff;
  --badge-muted-bg: #f4f4f5;
  --badge-muted-fg: #66666f;
  --badge-muted-bd: #e4e4e7;
  --count-pill-bg: #e7eef7;
  --ok-text-strong: #155c2b;
  --btn-disabled-bg: #b9c3cf;
  --btn-disabled-fg: #ffffff;
  --dash-border: #c3cdd9;
  --drop-hover-bg: #f3f8fd;
  --missing-border: #e0a43c;
  --missing-bg: #fff8eb;
  --missing-fg: #965700;
  --empty-icon: #a9b4c2;
  --viewer-bg: #eef1f5;
}

:root[data-theme="dark"] {
  --bg: #0f1115;
  --panel: #161a22;
  --panel-2: #1d2330;
  --border: #2a313d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #0088D9;
  --accent-2: #78CDFF;
  --danger: #f85149;
  --ok: #2ea043;
  --warn: #d29922;

  --accent-hover: #0072C0;
  --on-accent: #ffffff;
  --link: inherit;
  --heading-2: var(--accent-2);
  --h1-size: 24px;
  --card-radius: 8px;
  --card-shadow: none;
  --input-bg: var(--panel-2);
  --input-border: var(--border);
  --input-disabled-bg: var(--panel-2);
  --focus-ring: rgba(120, 205, 255, 0.35);
  --secondary-bg: var(--panel-2);
  --secondary-border: var(--border);
  --secondary-hover: var(--panel-2);
  --table-head-bg: transparent;
  --table-head-weight: 500;
  --table-row-border: var(--border);
  --row-hover: transparent;
  --menu-bg: var(--panel);
  --menu-hover: var(--panel-2);
  --pop-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  --modal-backdrop: rgba(0, 0, 0, 0.55);
  --modal-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --code-bg: #11151c;
  --code-text: #e6edf3;
  --danger-bg: rgba(248, 81, 73, 0.1);
  --danger-border: var(--danger);
  --ok-bg: rgba(46, 160, 67, 0.1);
  --ok-border: var(--ok);
  --warn-bg: rgba(210, 153, 34, 0.1);
  --warn-border: var(--warn);
  --warn-text: var(--warn);
  --info-bg: rgba(56, 139, 253, 0.10);
  --info-border: rgba(56, 139, 253, 0.40);
  --info-text: var(--accent-2);
  --important-row-bg: rgba(210, 153, 34, 0.06);
  --tag-fb: #4f9eff;  --tag-fb-border: #1d4f8e;
  --tag-ig: #e98ad8;  --tag-ig-border: #7d3e75;
  --tag-tw: #9ecbff;  --tag-tw-border: #1f6feb;

  /* dashboards (bi.css, scorecard.css) */
  --hover-border: #36506b;
  --card-grad-end: #12161e;
  --card-hover-shadow: 0 10px 26px rgba(0, 0, 0, .35);
  --pop-shadow-strong: 0 10px 28px rgba(0, 0, 0, .55);
  --btn-hover-text: #fff;
  --row-divider-soft: rgba(42, 49, 61, .5);
  --row-hover-soft: rgba(29, 35, 48, .6);
  --focus-glow: 0 0 0 2px rgba(64, 184, 255, .28);
  --note-warn-bg: rgba(210, 153, 34, .09);
  --note-warn-text: #e3c07b;
  --note-code-bg: rgba(0, 0, 0, .3);
  --pending-bg: rgba(255, 255, 255, .015);
  --error-soft-border: rgba(248, 81, 73, .45);
  --error-soft-bg: rgba(248, 81, 73, .08);
  --error-soft-text: #f0a9a4;
  --status-serious: #e0733c;
  --ord-1: #9bddff;
  --ord-2: #78cdff;
  --ord-3: #40b8ff;
  --ord-4: #0088d9;
  --ord-n: #005e96;

  /* status text + tints used across templates */
  --ok-text: #4caf50;
  --bad-text: #d9534f;
  --amber: #e3b341;
  --amber-tint: rgba(227,179,65,.16);
  --amber-tint-soft: rgba(227,179,65,.10);
  --hover-tint: rgba(255,255,255,.04);
  --danger-tint: rgba(248, 81, 73, 0.12);

  /* status badges, drop zones, viewer (Expenses first; shared) */
  --badge-neutral-bg: #1d2330;
  --badge-neutral-fg: #8b949e;
  --badge-neutral-bd: #2a313d;
  --badge-info-bg: #123a52;
  --badge-info-fg: #78CDFF;
  --badge-info-bd: #1d5877;
  --badge-warn-bg: #3a2f10;
  --badge-warn-fg: #e3b341;
  --badge-warn-bd: #574718;
  --badge-ok-bg: #143024;
  --badge-ok-fg: #56d364;
  --badge-ok-bd: #1f4a35;
  --badge-solid-ok-bg: #2ea043;
  --badge-solid-ok-fg: #ffffff;
  --badge-muted-bg: #1d2330;
  --badge-muted-fg: #6e7681;
  --badge-muted-bd: #2a313d;
  --count-pill-bg: #11344d;
  --ok-text-strong: #56d364;
  --btn-disabled-bg: #2a313d;
  --btn-disabled-fg: #8b949e;
  --dash-border: #3a4352;
  --drop-hover-bg: rgba(0, 136, 217, 0.08);
  --missing-border: #d29922;
  --missing-bg: rgba(210, 153, 34, 0.1);
  --missing-fg: #e3b341;
  --empty-icon: #4b5566;
  --viewer-bg: #0f1115;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

header.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.2px;
}

header.topbar nav {
  display: flex;
  gap: 18px;
  margin-left: 24px;
}

header.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
header.topbar nav a:hover { color: var(--text); }

header.topbar .spacer { flex: 1; }

header.topbar .user {
  font-size: 14px;
  color: var(--muted);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

h1, h2, h3 { margin: 0 0 12px 0; }
h1 { font-size: var(--h1-size); }
h2 { font-size: 18px; color: var(--heading-2); }

/* Light theme only: links take the Expenses blue (the dark theme has never
   set a page-wide link colour) and fields get the Expenses focus ring.
   :where() keeps these at zero specificity, so every component's own
   colours still win. */
:where(:root:not([data-theme="dark"])) a { color: var(--link); }
:where(:root:not([data-theme="dark"])) :is(input, select, textarea):focus {
  outline: 2px solid var(--focus-ring); outline-offset: 0; border-color: var(--accent);
}
:where(:root:not([data-theme="dark"])) h1 { letter-spacing: -0.01em; }
:where(:root:not([data-theme="dark"])) h2 { font-weight: 700; }
:where(:root:not([data-theme="dark"])) :is(button, .btn) { font-weight: 600; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .col { flex: 1 1 240px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}

button, .btn {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--secondary-bg); border: 1px solid var(--secondary-border); color: var(--text); }
.btn.secondary:hover { background: var(--secondary-hover); }
/* Selected tab in a button-style tab row (Active / Archived / Recently
   deleted on the cases list). Without this the current tab looked
   identical to the others. */
.btn.secondary.active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.btn.danger { background: var(--danger); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--table-row-border); text-align: left; font-size: 14px; }
th { color: var(--muted); font-weight: var(--table-head-weight); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
     background: var(--table-head-bg); border-bottom-color: var(--border); }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.tag.platform-facebook { color: var(--tag-fb); border-color: var(--tag-fb-border); }
.tag.platform-instagram { color: var(--tag-ig); border-color: var(--tag-ig-border); }
.tag.platform-twitter { color: var(--tag-tw); border-color: var(--tag-tw-border); }

.feed-card { display: flex; gap: 12px; padding: 12px; border-bottom: 1px solid var(--border); }
.feed-card .meta { flex: 0 0 160px; color: var(--muted); font-size: 12px; }
.feed-card .body { flex: 1; }
.feed-card.important { background: var(--important-row-bg); border-left: 3px solid var(--warn); }

.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.flash.error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.flash.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); }
/* Routes redirect with flash_kind=success (settings, users); it rendered as an
   unstyled box until 2026-10-09. Same look as .ok. */
.flash.success { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); }
.flash.info { background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info-border); }

/* ── Admin-gated delete: button + confirm modal ──────────────────── */

.btn.danger {
  background: var(--danger);
  color: var(--on-accent);
}
.btn.danger:hover {
  filter: brightness(1.08);
}

.modal {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal[hidden] { display: none; }

.modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 20px 22px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--modal-shadow);
}
.modal-card h2 {
  margin-top: 0;
  color: var(--danger);
}
.modal-card .row {
  margin-top: 16px;
  justify-content: flex-end;
  gap: 8px;
}
.modal-card input[type=password] {
  margin-bottom: 4px;
}

/* Per-slot "Clear" on the CLEAR/TLO/VS uploads in the report generators.
   Drops that source from the report being generated; the file itself stays
   on the TrackOps case. */
.upload-slot { display: flex; align-items: center; gap: 6px; }
.upload-slot input[type=file] { flex: 1; min-width: 0; }
.clear-slot {
  flex: none;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}
.clear-slot:hover { color: var(--danger); border-color: var(--danger); }
.slot-undo {
  padding: 0 4px;
  font-size: 11px;
  color: var(--accent-2);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
}

/* Report-type and status pills (report_types.py, cases_display.py). Each
   pill carries both themes' colours inline (--tp-bg/--tp-fg dark,
   --tp-lbg/--tp-lfg light); this picks the pair for the theme showing. */
.tpill { background: var(--tp-lbg); color: var(--tp-lfg); --tp-bd-now: var(--tp-lbd, transparent); }
:root[data-theme="dark"] .tpill { background: var(--tp-bg); color: var(--tp-fg); --tp-bd-now: var(--tp-bd, transparent); }

/* Light theme only: the text-like inputs style.css never listed (search,
   number, ...) get the same field look. Dark keeps what it had. */
:where(:root:not([data-theme="dark"])) :is(input[type=search], input[type=number], input[type=tel], input[type=url], input[type=time], input[type=datetime-local], input[type=month], input:not([type])) {
  padding: 8px 10px; background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 6px; color: var(--text); font-size: 14px;
}
