:root {
  color-scheme: dark;
  --bg: #0d0e10;
  --panel: #17191c;
  --panel-soft: #121416;
  --sidebar: #101113;
  --text: #f4f4ef;
  --muted: #a9aeb5;
  --brand: #f3cc4b;
  --brand-hover: #ffe078;
  --brand-soft: #292516;
  --line: #2c2f34;
  --ok: #78d7a7;
  --warn: #f2cf75;
  --bad: #ffabb0;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: 30px; line-height: 1.2; letter-spacing: -.025em; }
h2 { margin: 0; font-size: 17px; line-height: 1.35; }
h3 { font-size: 15px; }
p { margin-bottom: 16px; }
small, .muted { color: var(--muted); }
code { font: 12px/1.5 Consolas, monospace; overflow-wrap: anywhere; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.skip-link {
  position: absolute; left: -100vw; top: 10px; z-index: 100;
  padding: 12px 18px; color: #171409; background: var(--brand); border-radius: 8px;
}
.skip-link:focus { left: 12px; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  min-width: 0; padding: 24px 16px 16px;
  background: var(--sidebar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.02em; }
.brand small { font-size: 11px; letter-spacing: .04em; }
.sidebar > .brand { margin: 0 10px 28px; flex: 0 0 auto; }
.desktop-navigation { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.sidebar-nav {
  display: flex; flex-direction: column; justify-content: flex-start;
  gap: 20px; min-height: 0; overflow-y: auto; scrollbar-width: thin;
  scrollbar-color: #47483f transparent;
}
.desktop-navigation > .sidebar-nav { flex: 1 1 auto; padding-right: 2px; }
.nav-group { display: flex; flex-direction: column; flex: 0 0 auto; gap: 4px; min-width: 0; }
.nav-group h2 {
  margin: 0 12px 5px; color: #999eaa;
  font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .12em;
}
.nav-link {
  display: flex; align-items: center; gap: 11px; flex: 0 0 auto;
  height: 42px; padding: 9px 12px; border: 1px solid transparent;
  border-radius: 9px; color: #c7cacf; text-decoration: none; font-size: 13px; line-height: 1.35;
}
.nav-link .icon { width: 17px; height: 17px; flex: 0 0 auto; color: #8f949c; }
.nav-link:hover { background: #1d1f22; color: var(--text); }
.nav-link.active { background: var(--brand-soft); color: #f7d66e; border-color: #5d5125; font-weight: 650; }
.nav-link.active .icon { color: var(--brand); }
.sidefoot {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
  border-top: 1px solid var(--line); margin-top: 18px; padding: 18px 4px 0;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 10px; background: #292618;
  color: var(--brand); font-weight: 700; display: grid; place-items: center; flex: 0 0 auto;
}
.user-label { min-width: 0; flex: 1; }
.user-label strong, .user-label small { display: block; overflow-wrap: anywhere; }
.user-label strong { font-size: 12px; }
.user-label small { font-size: 10px; }
.sidefoot .inline { flex: 0 0 auto; margin: 0; }
.sidefoot button { min-height: 34px; padding: 7px 9px; font-size: 11px; }
.mobile-menu { display: none; }
main { min-width: 0; width: 100%; max-width: 1740px; padding: 34px 36px 48px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 9px; color: var(--brand); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .13em; }
.page-description { margin: 0; max-width: 700px; color: var(--muted); font-size: 14px; }
.role-pill { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: #cdd0d4; font-size: 11px; }
.role-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 20px; overflow: hidden; }
.card-header { padding: 20px 22px 0; }
.card-body { padding: 16px 22px 22px; }
.card-body > :last-child { margin-bottom: 0; }
.card-primary { border-top: 2px solid var(--brand); }
.card-danger { border-color: #593236; }
.card-danger .card-header h2 { color: var(--bad); }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.stat { min-width: 0; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.stat small, .stat span { display: block; font-size: 12px; }
.stat strong { display: block; margin: 8px 0 2px; font-size: 28px; line-height: 1.3; letter-spacing: -.04em; overflow-wrap: anywhere; }
.stat span { color: var(--muted); font-size: 11px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.workspace-grid > * { min-width: 0; }
.workspace-grid { margin-top: 20px; }
.workspace-grid > .card { margin-top: 0; }
.quick-links { display: grid; gap: 12px; }
.quick-links a {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) 16px; align-items: center; gap: 12px;
  padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); text-decoration: none;
}
.quick-links a:hover { border-color: #6e5d29; background: #1c1c16; }
.quick-links .quick-icon { display: grid; place-items: center; width: 36px; height: 36px; background: var(--brand-soft); border-radius: 9px; }
.icon { display: inline-block; width: 19px; height: 19px; vertical-align: middle; }
.quick-links strong, .quick-links .quick-description { display: block; }
.quick-links strong { color: var(--text); font-size: 13px; }
.quick-links .quick-description { color: var(--muted); font-size: 12px; margin-top: 3px; }
.task-preview { list-style: none; padding: 0; margin: 0; }
.task-preview li + li { border-top: 1px solid var(--line); }
.task-preview a { display: flex; gap: 14px; justify-content: space-between; align-items: center; padding: 14px 0; text-decoration: none; }
.task-preview strong, .task-preview small { display: block; }
.task-preview strong { color: var(--text); font-size: 13px; }
.task-preview small { color: var(--muted); font-size: 12px; margin-top: 4px; }
.task-preview .badge { flex: 0 0 auto; }
.section-title { margin: 28px 0 4px; font-size: 14px; color: var(--muted); }
.meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 20px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.meta-grid > div { min-width: 0; }
.meta-grid dt { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.meta-grid dd { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.section-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.section-links a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: #c5c9cf; text-decoration: none; font-size: 12px; }
.section-links a:hover { color: var(--brand); border-color: #6e5d29; }
.badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 7px; font-size: 11px; font-weight: 650; line-height: 1.5; white-space: nowrap; }
.badge.ok { background: #1b3027; color: var(--ok); }
.badge.warn { background: #302919; color: var(--warn); }
.badge.bad { background: #382126; color: var(--bad); }
.badge.neutral { background: #25292e; color: #c9cdd3; }
.tablewrap { overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #1c1e21; }
td small { display: block; margin-top: 4px; }
td a:not(.button) { font-weight: 600; }
.empty { color: var(--muted); text-align: center; padding: 28px 20px; }
.empty-state { padding: 24px; border: 1px dashed #41433b; border-radius: 10px; background: var(--panel-soft); color: var(--muted); }
.empty-state strong { display: block; color: var(--text); margin-bottom: 6px; }
.empty-state p { margin: 0; font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; padding: 14px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 10px; }
.filters input[type=search] { flex: 2 1 200px; min-width: 0; }
.filters select { flex: 1 1 145px; min-width: 0; }
.filters input, .filters select { width: auto; margin: 0; }
.filters button, .filters .button { flex: 0 0 auto; }
.pagination { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.pagination div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pagination a, .pagination strong { display: grid; place-items: center; min-width: 34px; min-height: 34px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; text-decoration: none; color: var(--text); }
.pagination strong { color: #191608; background: var(--brand); border-color: var(--brand); }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 10px 14px; border: 1px solid transparent; border-radius: 9px;
  font: 650 12px/1.4 "Segoe UI", Arial, sans-serif; text-decoration: none; cursor: pointer;
  background: var(--brand); color: #171409; max-width: 100%; text-align: center;
}
button:hover, .button:hover { background: var(--brand-hover); color: #171409; }
button.secondary, .button.secondary { color: #e0e2e5; background: #25282d; border-color: #383c43; }
button.secondary:hover, .button.secondary:hover { background: #30343a; color: #fff; }
button.danger, .button.danger { background: #382126; color: var(--bad); border-color: #743e46; }
button.danger:hover, .button.danger:hover { background: #4b2930; color: #fff; }
button.ok, .button.ok { background: var(--brand); color: #171409; }
button:disabled { opacity: .5; cursor: not-allowed; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.inline { display: inline; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; }
.actions .inline { display: inline-flex; }
.actions form { max-width: 100%; }
.action-stack { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.action-stack form { max-width: 100%; margin: 0 !important; }
.action-stack .inline { display: block; }
.card form:not(.inline):not(.filters) { max-width: 620px; margin-top: 16px; }
label { display: block; margin: 14px 0 5px; color: #d4d7dc; font-size: 12px; font-weight: 600; }
input, textarea, select { display: block; width: 100%; min-width: 0; background: #101214; border: 1px solid #3c4046; border-radius: 8px; color: var(--text); font: 14px/1.5 "Segoe UI", Arial, sans-serif; padding: 10px 12px; margin: 0 0 12px; }
input::placeholder, textarea::placeholder { color: #9298a2; opacity: 1; }
textarea { min-height: 110px; resize: vertical; }
form > button { margin-top: 5px; }
.field-help { margin: -3px 0 14px; color: var(--muted); font-size: 12px; }
details.card { padding: 0; }
details.card > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; color: #d9dce1; font-size: 13px; font-weight: 650; cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; font-size: 20px; font-weight: 400; color: var(--brand); }
details.card[open] > summary::after { content: "−"; }
details.card[open] > summary { border-bottom: 1px solid var(--line); }
.detail-body { padding: 20px 22px; }
.detail-body > .card { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.detail-body > .card > .card-header { display: none; }
.detail-body > .card > .card-body { padding: 0; }
.notice, .flash { padding: 14px 16px; border: 1px solid #625329; border-left: 3px solid var(--brand); background: #252218; border-radius: 9px; color: #ebdcae; font-size: 13px; }
.notice { margin: 16px 0; }
.flash { margin: 0 0 22px; }
.flash.bad { color: #ffc4c8; border-color: #6b3941; background: #2b1c20; }
.flash.ok { color: #bde7d0; border-color: #365b48; background: #19261f; }
.flash.warn { color: #ebdcae; }
.transcript-message { border: 1px solid var(--line); background: var(--panel-soft); border-radius: 10px; padding: 18px; margin: 16px 0; }
.message-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.message-heading small { font-size: 11px; }
.transcript-message p { margin: 12px 0; }
.transcript-message blockquote { margin: 14px 0; padding: 12px 16px; border-left: 3px solid #746432; background: #201e17; border-radius: 5px; }
.attachment { padding-top: 12px; border-top: 1px solid var(--line); }
.attachment a { overflow-wrap: anywhere; }
.attachment-meta { margin-top: 8px; font-size: 11px; color: var(--muted); }
.attachment-meta summary { cursor: pointer; color: #bcc1c8; list-style: none; }
.attachment-meta summary::before { content: "+ "; color: var(--brand); }
.attachment-meta[open] summary::before { content: "− "; }
.attachment-meta small { display: block; margin-top: 8px; overflow-wrap: anywhere; }
.credential { display: block; padding: 14px; margin: 10px 0; background: #101214; border: 1px solid #5f5126; border-radius: 9px; color: var(--brand); font-size: 17px; overflow-wrap: anywhere; user-select: all; }
body.auth-page { display: grid; grid-template-columns: 1fr; place-items: center; background: radial-gradient(ellipse at 50% 0, #262217 0, var(--bg) 55%); }
.auth-shell { width: 100%; max-width: 470px; padding: 24px; }
.auth-shell .brand { justify-content: center; margin-bottom: 30px; }
.auth-shell .card { margin-top: 0; border-top: 2px solid var(--brand); }
.auth-shell .card-body { padding-top: 26px; }
.auth-shell h1 { font-size: 25px; }
.auth-shell button { width: 100%; margin-top: 12px; }
@media (max-width: 1250px) {
  main { padding: 28px 24px 40px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 850px) {
  body { display: block; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 20px 14px; }
  .sidebar > .brand { margin: 0 0 14px; }
  .desktop-navigation { display: none; }
  .mobile-menu { display: block; }
  .mobile-menu > summary { display: flex; align-items: center; gap: 10px; padding: 11px 13px; min-height: 44px; background: #1b1d20; border: 1px solid var(--line); border-radius: 9px; color: var(--text); font-size: 13px; font-weight: 650; cursor: pointer; list-style: none; }
  .mobile-menu > summary small { margin-left: auto; color: var(--brand); font-size: 11px; font-weight: 400; }
  .mobile-menu > summary::after { content: "+"; color: var(--brand); font-size: 19px; font-weight: 400; }
  .mobile-menu[open] > summary::after { content: "−"; }
  .mobile-menu .sidebar-nav { margin-top: 24px; max-height: 60vh; max-height: 60dvh; overflow: auto; }
  .mobile-menu .sidefoot { margin-top: 20px; }
  main { padding: 24px 20px 36px; }
  .page-header { margin-bottom: 22px; }
  .page-header > .role-pill { display: none; }
  h1 { font-size: 27px; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .sidebar { padding: 16px; }
  main { padding: 22px 16px 32px; }
  h1 { font-size: 25px; }
  .page-description { font-size: 13px; }
  .grid { gap: 10px; margin: 18px 0; }
  .stat { padding: 14px; }
  .stat strong { font-size: 23px; }
  .stat small { font-size: 11px; }
  .card-header { padding: 18px 16px 0; }
  .card-body { padding: 14px 16px 18px; }
  details.card > summary { padding: 16px; }
  .detail-body { padding: 16px; }
  .filters { padding: 12px; }
  .filters input, .filters select { flex-basis: 100%; width: 100%; }
  .filters button, .filters .button { flex: 1; }
  .actions { gap: 8px; }
  .actions > .button, .actions > .inline { flex: 1 1 auto; }
  .actions .inline > button { width: 100%; }
  button, .button { min-height: 44px; }
  .meta-grid { gap: 14px; }
  .meta-grid dd { font-size: 13px; }
  .message-heading { flex-direction: column; align-items: flex-start; }
  .transcript-message { padding: 14px; }
  .pagination { flex-direction: column; align-items: flex-start; }
  .auth-shell { padding: 18px; }
}
@media (prefers-reduced-motion: no-preference) {
  a, button, summary { transition: background-color .15s, border-color .15s; }
}

/* Live activity stays outside the refreshed page content. */
.dashboard-tools { display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 0 22px;position:relative; }
.live-state { display:flex;align-items:center;flex-wrap:wrap;gap:10px;min-width:0;font-size:12px;color:var(--muted); }
#live-status::before { content:'';display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:8px;background:#78d7a7; }
#live-status[data-tone="warn"]::before { background:var(--brand); }
#live-status[data-tone="bad"]::before { background:#ed4245; }
.dashboard-tools button { font-size:12px;padding:7px 11px; }
.notification-menu { position:relative;flex-shrink:0; }
.notification-menu > summary { display:flex;align-items:center;gap:8px;cursor:pointer;padding:7px 10px;border:1px solid var(--line);border-radius:8px;font-size:12px;list-style:none; }
.notification-menu > summary::-webkit-details-marker { display:none; }
.notification-menu[open] > summary { border-color:var(--brand);color:var(--brand); }
.notification-count { min-width:19px;padding:1px 5px;border-radius:12px;background:var(--brand);color:#15130a;text-align:center;font-weight:700; }
.notification-count[hidden],#live-refresh[hidden] { display:none; }
.notification-panel { position:absolute;right:0;top:calc(100% + 8px);z-index:20;width:min(420px,calc(100vw - 32px));max-height:65vh;overflow:auto;padding:16px;background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:0 18px 45px #0007; }
.notification-heading { display:flex;align-items:center;justify-content:space-between;gap:12px; }
.notification-heading strong { font-size:14px; }
#push-status { font-size:12px;color:var(--muted);line-height:1.5; }
#notification-list { list-style:none;padding:0;margin:16px 0 0; }
#notification-list li { border-top:1px solid var(--line); }
#notification-list a { display:flex;flex-direction:column;gap:5px;padding:12px 8px;color:var(--text);border-radius:6px; }
#notification-list a:hover { background:#f3cc4b0c; }
#notification-list small { font-size:11px;color:var(--muted); }
#notification-list .unread a { border-left:3px solid var(--brand); }
@media (max-width:600px) {
 .dashboard-tools { flex-wrap:wrap; }
 .notification-menu { margin-left:auto; }
 .live-state { flex-basis:100%; }
}
