:root {
  --navy: #0f172a;
  --navy-2: #111827;
  --blue: #2563eb;
  --green: #22c55e;
  --orange: #f97316;
  --red: #ef4444;
  --purple: #8b5cf6;
  --yellow: #eab308;
  --cyan: #0891b2;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #0f172a;
  --muted: #64748b;
  --soft: #f1f5f9;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  --radius: 12px;
  --sidebar: 264px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", "Pretendard", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: 0 0 auto;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 22px 16px;
  color: #dbeafe;
  background: var(--navy);
}

.sidebar-backdrop {
  display: none;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 78px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed .sidebar {
  padding: 18px 10px;
}

.app-shell.sidebar-collapsed .brand {
  justify-content: center;
  padding: 0 0 18px;
}

.app-shell.sidebar-collapsed .brand div:last-child,
.app-shell.sidebar-collapsed .nav-heading,
.app-shell.sidebar-collapsed .nav-link span.label,
.app-shell.sidebar-collapsed .nav-link.child {
  display: none;
}

.app-shell.sidebar-collapsed .nav-link {
  justify-content: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.16s ease, outline-color 0.16s ease;
}

.brand-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.brand-link:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.9);
  outline-offset: 3px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  color: white;
  border-radius: 10px;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--green));
  font-size: 13px;
  font-weight: 900;
}

.brand strong {
  display: block;
  color: white;
  font-size: 14px;
  white-space: nowrap;
}

.brand span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.nav-section { margin-top: 16px; }

.nav-heading {
  margin: 18px 10px 8px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
  color: #cbd5e1;
  border-radius: 8px;
}

.nav-link:hover { color: white; background: rgba(255, 255, 255, 0.08); }
.nav-link.active { color: white; background: var(--blue); box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28); }
.nav-link.child { min-height: 34px; padding-left: 38px; font-size: 13px; }

.nav-group {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.nav-group-toggle {
  width: 100%;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.nav-group-toggle .label {
  flex: 1;
}

.nav-group-chevron {
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: .72;
  transform: rotate(45deg);
  transition: transform .16s ease;
}

.nav-group.open .nav-group-chevron {
  transform: rotate(225deg);
}

.nav-children {
  display: grid;
  gap: 2px;
  padding: 2px 0 6px;
}

.nav-children[hidden] {
  display: none;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  margin-left: auto;
  padding: 0 7px;
  color: white;
  border-radius: 999px;
  background: var(--orange);
  font-size: 12px;
  font-weight: 900;
}

.nav-badge.purple { background: var(--purple); }
.nav-badge.red { background: var(--red); }

.workspace {
  min-width: 0;
  padding: 0 24px 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 74px;
  margin: 0 -24px 22px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.93);
  backdrop-filter: blur(18px);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-grid;
  width: 38px;
  height: 38px;
  color: #334155;
  border: 1px solid var(--border);
  border-radius: 8px;
  place-items: center;
  background: white;
}

.icon-btn:hover { color: var(--blue); border-color: #bfdbfe; }

.icon-btn:disabled,
.action-btn:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.page-title h1 {
  margin: 0;
  font-size: clamp(21px, 2vw, 28px);
  font-weight: 900;
}

.page-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.top-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.bell,
.notification-wrap { position: relative; }

.alert-dot {
  position: absolute;
  top: -7px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  color: white;
  border: 2px solid white;
  border-radius: 999px;
  background: var(--red);
  font-size: 11px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
}

.notification-panel {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 70;
  width: min(360px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  box-shadow: 0 22px 48px rgba(15, 23, 42, .18);
}

.notification-panel[hidden] { display: none; }

.notification-head,
.notification-item strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-head {
  padding: 4px 4px 10px;
  font-size: 13px;
}

.notification-head span {
  color: var(--blue);
  font-weight: 950;
}

.notification-item,
.notification-empty {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.notification-item + .notification-item { margin-top: 8px; }
.notification-item.high { border-color: #fecaca; background: #fff1f2; }
.notification-item.mid { border-color: #fed7aa; background: #fff7ed; }
.notification-item.low { border-color: #bfdbfe; background: #eff6ff; }

.notification-item p,
.notification-empty span {
  margin: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.notification-empty strong {
  font-size: 13px;
}

.admin-chip {
  display: grid;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  place-items: center;
}

.admin-menu-wrap {
  position: relative;
}

.admin-chip {
  text-align: center;
}

.admin-chip:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.admin-menu-panel {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 80;
  width: 240px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  box-shadow: 0 22px 48px rgba(15, 23, 42, .18);
}

.admin-menu-panel[hidden] {
  display: none;
}

.admin-menu-head {
  display: grid;
  gap: 2px;
  padding: 8px 9px 10px;
  border-bottom: 1px solid var(--border);
}

.admin-menu-head strong {
  font-size: 13px;
}

.admin-menu-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-menu-link,
.admin-menu-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 8px 9px;
  color: #334155;
  border-radius: 8px;
  background: white;
  font-size: 13px;
  font-weight: 850;
  text-align: left;
}

.admin-menu-link:hover,
.admin-menu-action:hover {
  color: white;
  background: var(--blue);
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  color: white;
  border-radius: 50%;
  place-items: center;
  background: #1e293b;
  font-size: 12px;
  font-weight: 900;
}

.admin-chip div { display: none; }
.admin-chip strong { display: block; font-size: 13px; white-space: nowrap; }
.admin-chip div span { display: none; color: var(--muted); font-size: 11px; white-space: nowrap; }
.admin-chip .avatar { color: white; }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 342px;
  gap: 18px;
}

.stack { display: grid; gap: 18px; }
.span-all { grid-column: 1 / -1; }
.stack,
.card,
.content-grid > *,
.chart-grid > *,
.insight-grid > *,
.split > * {
  min-width: 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.section-block {
  display: grid;
  gap: 12px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-title h2 {
  margin: 0;
  color: #172033;
  font-size: 18px;
  font-weight: 950;
}

.card-pad { padding: 20px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.live-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #eff6ff, #ecfdf5);
}

.live-state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1e293b;
  font-size: 13px;
  font-weight: 800;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.endpoint {
  color: #1d4ed8;
  background: white;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(118px, 1fr));
  gap: 12px;
}

.kpi {
  position: relative;
  display: block;
  min-height: 118px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

a.kpi:hover,
a.kpi:focus-visible {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  outline: none;
}

.kpi::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -36px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.09;
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.kpi-actions {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.kpi-info-btn {
  display: inline-grid;
  width: 22px;
  height: 22px;
  color: #64748b;
  border: 1px solid #dbe4ef;
  border-radius: 999px;
  place-items: center;
  background: #fff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  cursor: help;
}

.kpi-info-btn:hover,
.kpi-info-btn:focus-visible {
  color: var(--blue);
  border-color: #93c5fd;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}

.kpi-icon {
  display: grid;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  place-items: center;
  background: #f1f5f9;
}

.kpi-value {
  margin-top: 16px;
  font-size: 25px;
  font-weight: 950;
}

.kpi-delta {
  display: inline-flex;
  gap: 4px;
  margin-top: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.kpi-tooltip {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  padding: 10px 11px;
  color: #fff;
  border-radius: 10px;
  background: rgba(15, 23, 42, .95);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .22);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease;
}

.kpi:has(.kpi-info-btn:hover) .kpi-tooltip,
.kpi:has(.kpi-info-btn:focus-visible) .kpi-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.kpi-help-sheet {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  align-items: end;
  padding: 16px;
}

.kpi-help-sheet[hidden] { display: none; }

.kpi-help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .44);
  backdrop-filter: blur(4px);
}

.kpi-help-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 20px;
  border: 1px solid #dbe4ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .24);
}

.kpi-help-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
}

.kpi-help-card h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 950;
}

.kpi-help-card p {
  margin: 8px 0 0;
  color: #334155;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.65;
}

.kpi-help-card button {
  justify-self: end;
  min-height: 38px;
  padding: 0 16px;
  color: #fff;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  font-weight: 900;
}

@media (min-width: 761px) {
  .kpi-help-sheet { align-items: center; }
}

@media (hover: none) {
  .kpi:has(.kpi-info-btn:hover) .kpi-tooltip,
  .kpi:has(.kpi-info-btn:focus-visible) .kpi-tooltip {
    opacity: 0;
    transform: translateY(6px);
  }
}

.blue { color: var(--blue); }
.green { color: var(--green); }
.orange { color: var(--orange); }
.red { color: var(--red); }
.purple { color: var(--purple); }
.yellow { color: var(--yellow); }
.cyan { color: var(--cyan); }

.chart-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(260px, 0.9fr);
  gap: 16px;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 16px;
}

.insight-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 236px;
}

.insight-card .card-head {
  align-items: start;
}

.insight-card .card-head span {
  max-width: 160px;
  text-align: right;
  line-height: 1.35;
}

.insight-list {
  display: grid;
  gap: 9px;
}

.insight-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  min-height: 54px;
  padding: 10px 11px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.insight-row > div,
.insight-row > b {
  position: relative;
  z-index: 1;
}

.insight-row strong,
.insight-row small {
  display: block;
}

.insight-row strong {
  overflow: hidden;
  color: #172033;
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-row small {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
}

.insight-row b {
  align-self: center;
  color: #1d4ed8;
  font-size: 15px;
  font-weight: 950;
  white-space: nowrap;
}

.insight-row i {
  position: absolute;
  inset: auto auto 0 0;
  width: var(--w);
  height: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.insight-row.muted b {
  color: #64748b;
}

.insight-row.muted i {
  background: #cbd5e1;
}

.bar-list { display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 118px minmax(100px, 1fr) 58px; align-items: center; gap: 10px; font-size: 12px; }
.bar-row strong { overflow: hidden; color: #334155; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.bar-fill { display: block; width: var(--w); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--green)); }
.bar-row span:last-child { color: #475569; font-weight: 900; text-align: right; }

.donut-wrap { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 18px; }
.donut {
  position: relative;
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#22c55e 0 22%, #eab308 22% 31%, #ef4444 31% 42%, #f97316 42% 53%, #8b5cf6 53% 66%, #facc15 66% 76%, #2563eb 76% 90%, #0891b2 90% 100%);
}
.donut::after { content: ""; position: absolute; inset: 23px; border-radius: 50%; background: white; box-shadow: inset 0 0 0 1px var(--border); }
.donut-center { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-center strong { display: block; font-size: 24px; line-height: 1; }
.donut-center span { color: var(--muted); font-size: 11px; font-weight: 900; }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 10px; }
.legend-item { display: flex; align-items: center; gap: 7px; color: #475569; font-size: 12px; font-weight: 800; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: 0 0 auto; }
.line-chart { width: 100%; height: 196px; }
.line-chart text { fill: #64748b; font-size: 10px; font-weight: 800; }

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 220px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
  font-size: 12px;
}

.audit-row strong {
  color: #0f172a;
}

.audit-row span {
  overflow: hidden;
  color: #475569;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.audit-row time {
  color: #64748b;
  text-align: right;
  font-weight: 850;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar-search-only {
  grid-template-columns: minmax(260px, 420px);
  justify-content: end;
}

.sales-toolbar {
  grid-template-columns: minmax(180px, 280px) auto auto auto;
  justify-content: start;
}

.sales-date-field {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.sales-date-field input {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.filters, .tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pill-btn, .tab {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  color: #475569;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  font-size: 12px;
  font-weight: 900;
}

.pill-btn.active, .tab.active { color: white; border-color: var(--blue); background: var(--blue); }

.search-box { position: relative; }
.search-box .icon { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; color: #94a3b8; transform: translateY(-50%); }
.input, .search-box input, textarea, select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: white;
}
.search-box input, .input, select { height: 38px; padding: 0 12px; }
.search-box input { padding-left: 36px; }
textarea { min-height: 110px; padding: 12px; resize: vertical; }
.input:focus, .search-box input:focus, textarea:focus, select:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }

.html-editor {
  min-height: 240px;
  font-family: Consolas, "SFMono-Regular", monospace;
  line-height: 1.55;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #172033;
  font-size: 13px;
  font-weight: 900;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
th, td { height: 48px; padding: 0 14px; border-top: 1px solid var(--border); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: #64748b; background: #f8fafc; font-size: 12px; font-weight: 900; }
td { color: #334155; font-size: 13px; }
tbody tr:hover, tbody tr.selected { background: #eff6ff; }
tbody tr[data-app-id], .room-card[data-room-id], .mobile-card[data-app-id] { cursor: pointer; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.online { color: #15803d; background: #dcfce7; }
.status.away { color: #a16207; background: #fef9c3; }
.status.waiting { color: #c2410c; background: #ffedd5; }
.status.chatting { color: #6d28d9; background: #f3e8ff; }
.status.left { color: #b91c1c; background: #fee2e2; }
.status.review { color: #a16207; background: #fef3c7; }
.status.done { color: #1d4ed8; background: #dbeafe; }

.risk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}
.risk.low { color: #15803d; background: #dcfce7; }
.risk.mid { color: #b45309; background: #fef3c7; }
.risk.high { color: #b91c1c; background: #fee2e2; }

.actions { display: flex; gap: 6px; }
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  color: #475569;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-size: 12px;
  font-weight: 900;
}
.action-btn.primary { color: white; border-color: var(--blue); background: var(--blue); }
.action-btn.warning { color: #92400e; border-color: #f59e0b; background: #fffbeb; }
.action-btn.danger { color: white; border-color: var(--red); background: var(--red); }
.action-btn:hover { color: white; border-color: var(--blue); background: var(--blue); }
.action-btn.warning:hover { color: white; border-color: #d97706; background: #d97706; }
.action-btn.danger:hover { border-color: var(--red); background: var(--red); }
.action-btn.is-loading { pointer-events: none; }
[data-app-action="delete"] { display: none; }

.split {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.data-control-panel {
  display: grid;
  gap: 14px;
}
.data-control-toolbar {
  flex-wrap: wrap;
}
.data-control-metrics {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}
.data-control-table {
  max-height: 440px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
}
.data-control-table table {
  min-width: 980px;
}
.data-control-table code {
  display: inline-block;
  max-width: 180px;
  padding: 3px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.data-control-actions {
  flex-wrap: wrap;
  min-width: 190px;
}

.support-clear-closed-btn {
  width: 100%;
  justify-content: center;
  margin: 0 0 12px;
}
.room-list, .item-list { display: grid; gap: 10px; }
.room-date-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
}
.room-date-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  color: #334155;
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
  list-style: none;
}
.room-date-group summary::-webkit-details-marker { display: none; }
.room-date-group summary::before {
  content: "+";
  display: grid;
  width: 20px;
  height: 20px;
  margin-right: 2px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #2563eb;
  background: white;
  place-items: center;
  font-weight: 950;
}
.room-date-group[open] summary::before { content: "-"; }
.room-date-group summary span {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
}
.room-date-group summary strong {
  padding: 4px 8px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 12px;
}
.room-date-items {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: white;
}
.room-card, .result-card, .queue-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
}
.room-card.active, .result-card.active { border-color: #93c5fd; background: #eff6ff; }
.room-card h3, .result-card h3, .queue-card h3 { margin: 0 0 6px; font-size: 14px; }
.room-card p, .result-card p, .queue-card p { margin: 6px 0 0; color: #475569; font-size: 13px; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 800; }
.meta-line > * { min-width: 0; }
.meta-line span { overflow-wrap: anywhere; }

.section-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.emergency-panel {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff 0%, #fff7ed 100%);
}

.emergency-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.emergency-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.emergency-summary span,
.emergency-summary a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 950;
}

.emergency-summary .high {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.emergency-summary .mid {
  color: #c2410c;
  border-color: #fed7aa;
  background: #fff7ed;
}

.emergency-summary .low {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.emergency-summary a {
  margin-left: auto;
  color: var(--blue);
  border-color: #bfdbfe;
  background: #fff;
}

.emergency-card {
  border-left: 5px solid #f97316;
}

a.emergency-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

a.emergency-card:hover,
a.emergency-card:focus-visible {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 18px 38px rgba(15, 23, 42, .13);
  outline: none;
}

.emergency-preview-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 12px;
  padding: 0 11px;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 950;
}

.emergency-card.high { border-left-color: #dc2626; background: #fff1f2; }
.emergency-card.mid { border-left-color: #f97316; background: #fff7ed; }
.emergency-card.low { border-left-color: #2563eb; background: #eff6ff; }

.emergency-actions,
.mobile-card-actions,
.detail-sticky-actions,
.detail-section-actions {
  margin-top: 12px;
  flex-wrap: wrap;
}

.emergency-support-card {
  display: grid;
  align-content: start;
}

.emergency-support-kpi-grid {
  grid-template-columns: minmax(220px, 360px);
}

.emergency-support-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #fee2e2;
  border-radius: 10px;
  background: rgba(255, 255, 255, .62);
}

.detail-section-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.emergency-overflow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px dashed #fdba74;
  border-radius: 14px;
  background: rgba(255, 247, 237, .78);
}

.emergency-overflow strong {
  color: #9a3412;
  font-size: 13px;
  font-weight: 950;
}

.emergency-overflow span {
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.emergency-overflow .action-btn {
  justify-self: end;
}

.decision-box {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-left: 5px solid var(--blue);
  border-radius: 12px;
  background: #eff6ff;
}

.decision-box h3 {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
}

.decision-box p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.decision-box ul {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  font-size: 13px;
  line-height: 1.65;
}

.decision-box.high {
  border-color: #fecaca;
  border-left-color: #dc2626;
  background: #fff1f2;
}

.decision-box.mid {
  border-color: #fed7aa;
  border-left-color: #f97316;
  background: #fff7ed;
}

.support-notice {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-left: 5px solid var(--blue);
  border-radius: 14px;
  background: #eff6ff;
  color: #1e3a8a;
}

.support-notice strong { font-size: 14px; }
.support-notice span { color: #334155; font-size: 13px; font-weight: 800; }

.support-summary {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.history-context {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
}

.history-row {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(130px, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  color: inherit;
  text-align: left;
  border-bottom: 1px solid #eef2f7;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

button.history-row:hover,
button.history-row:focus-visible {
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 10px;
  background: #eff6ff;
  outline: 2px solid #bfdbfe;
}

.history-row strong,
.history-row span {
  display: block;
}

.history-row div span {
  margin-top: 3px;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.detail-main-card { grid-column: 1 / -1; }
.detail-wide-card { grid-column: 1 / -1; }

.detail-timeline-card .timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.detail-timeline-card .timeline::before { display: none; }

.detail-timeline-card .timeline-item {
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  min-width: 150px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.detail-timeline-card .timeline-item > span:last-child {
  grid-column: 2;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.detail-identity-card .metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.detail-identity-card .metric strong {
  white-space: normal;
  word-break: break-word;
}

.detail-identity-card .item-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.detail-history-card .tabs {
  flex-wrap: wrap;
}

.detail-history-card .history-row {
  grid-template-columns: minmax(220px, 1.4fr) minmax(96px, auto) minmax(96px, auto) minmax(72px, auto);
}

.detail-history-card .metric-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.evidence-shell, .identity-live-shell, .evidence-viewer {
  display: grid;
  gap: 14px;
}

.evidence-loading, .evidence-error, .evidence-empty {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px dashed #bfdbfe;
  border-radius: 14px;
  color: #334155;
  background: #eff6ff;
}

.evidence-error {
  border-color: #fecaca;
  color: #991b1b;
  background: #fef2f2;
}

.evidence-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.evidence-toolbar > div:first-child {
  display: grid;
  gap: 4px;
}

.evidence-toolbar strong, .section-title h3 {
  color: #0f172a;
}

.evidence-toolbar span, .section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.evidence-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: white;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
}

.section-title h3 {
  margin: 0;
  font-size: 17px;
}

.evidence-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.evidence-info-grid.compact .info-row {
  grid-template-columns: 116px minmax(0, 1fr);
}

.evidence-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.evidence-crop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.evidence-crop-grid-primary {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.evidence-tile {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  color: #172033;
  text-decoration: none;
  background: #f8fafc;
}

.evidence-tile img, .evidence-tile video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 10px;
  background: #0f172a;
}

.evidence-tile.video-tile video {
  aspect-ratio: 9 / 12;
  max-height: 360px;
}

.evidence-tile strong {
  font-size: 13px;
}

.evidence-tile span, .evidence-tile a {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  word-break: break-all;
}

.evidence-tile.missing {
  align-content: center;
  min-height: 180px;
  border-style: dashed;
  background: #f1f5f9;
}

.evidence-subtitle {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.candidate-list {
  display: grid;
  gap: 8px;
}

.candidate-row {
  display: grid;
  grid-template-columns: 92px minmax(120px, 1fr) repeat(3, minmax(82px, auto));
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 12px;
}

.candidate-row strong {
  color: #0f172a;
  font-size: 14px;
}

.candidate-row span {
  color: #475569;
  font-weight: 800;
}

.evidence-details {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 12px;
  background: #fbfdff;
}

.evidence-details + .evidence-details {
  margin-top: 10px;
}

.evidence-details-open {
  display: grid;
  gap: 8px;
}

.evidence-details-title {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.evidence-details-note {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.evidence-details summary {
  position: relative;
  z-index: 1;
  cursor: pointer;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
  user-select: none;
}

.evidence-details summary::-webkit-details-marker {
  display: none;
}

.evidence-details-toggle summary::before {
  content: "▸ ";
}

.evidence-details-toggle[open] summary::before {
  content: "▾ ";
}

.evidence-actions {
  flex-wrap: wrap;
}

.info-list { display: grid; gap: 10px; }
.info-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; font-size: 13px; }
.info-row span:first-child { color: var(--muted); font-weight: 800; }
.info-row strong { min-width: 0; overflow: hidden; color: #1e293b; text-overflow: ellipsis; white-space: nowrap; }

.timeline { position: relative; display: grid; gap: 13px; }
.timeline::before { content: ""; position: absolute; top: 10px; bottom: 10px; left: 11px; width: 2px; background: #e2e8f0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 26px 1fr auto; align-items: start; gap: 8px; font-size: 12px; }
.node { z-index: 1; display: grid; width: 24px; height: 24px; border: 3px solid white; border-radius: 50%; place-items: center; background: #cbd5e1; box-shadow: 0 0 0 1px #e2e8f0; }
.node.done { background: var(--green); }
.node.active { background: var(--blue); }
.node.fail { background: var(--red); }
.node.review { background: var(--yellow); }
.timeline-item strong { display: block; color: #1e293b; font-size: 12px; }
.timeline-item span { color: var(--muted); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.metric span { display: block; color: var(--muted); font-size: 11px; font-weight: 900; }
.metric strong { display: block; margin-top: 4px; font-size: 17px; font-weight: 950; }

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.command-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow);
}

.command-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 14px;
}

.command-card p {
  margin: 0 0 12px;
  color: #475569;
  font-size: 13px;
}

.ops-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .5fr);
  gap: 14px;
  border-left: 5px solid var(--blue);
}

.ops-guide h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.ops-guide p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.guide-steps,
.role-list,
.integration-flow {
  display: grid;
  gap: 8px;
}

.guide-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-steps span,
.role-list div,
.integration-flow div,
.delivery-note {
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
}

.guide-steps span {
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 950;
}

.role-list strong,
.role-list span,
.integration-flow strong,
.integration-flow span,
.delivery-note strong,
.delivery-note span {
  display: block;
}

.role-list strong,
.integration-flow strong,
.delivery-note strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

.role-list span,
.integration-flow span,
.delivery-note span {
  margin-top: 3px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.delivery-note {
  margin-top: 12px;
  border-color: #fed7aa;
  background: #fff7ed;
}

.delivery-note.danger-note {
  border-color: #fecaca;
  background: #fff7f7;
}

.delivery-note.danger-note strong,
.delivery-note.danger-note span {
  color: #991b1b;
}

.notice-list {
  display: grid;
  gap: 10px;
}

.notice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.notice-row > div {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 5px 8px;
  min-width: 0;
}

.notice-row .icon {
  grid-row: 1 / span 2;
  color: #64748b;
}

.notice-row strong {
  overflow: hidden;
  color: #0f172a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-row span {
  grid-column: 2;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.notice-row b {
  color: var(--blue);
  font-size: 12px;
}

.notice-row small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.notice-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.action-btn.compact {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
}

.permission-table {
  display: grid;
  gap: 8px;
}

.permission-table > div {
  display: grid;
  grid-template-columns: 120px repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 850;
}

.permission-table span:first-child {
  color: var(--blue);
  font-weight: 950;
}

.code-sample {
  overflow: auto;
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 12px;
  color: #dbeafe;
  background: #0f172a;
  font-size: 12px;
  line-height: 1.6;
}

.settings-endpoint-card {
  grid-column: 1 / -1;
}

.endpoint-list .meta-line span {
  word-break: break-all;
}
.board-col { min-height: 260px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: #f8fafc; }
.board-col h3 { margin: 0; font-size: 14px; }

.board-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}

.board-more-link {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
}

.board-more-link:hover { text-decoration: underline; }

.manual-review-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .38fr);
  gap: 14px;
  border-left: 5px solid var(--blue);
}

.manual-review-guide h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.manual-review-guide p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
}

.manual-review-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.manual-review-steps span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #f8fafc;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 900;
}

.manual-review-guide-box {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
}

.manual-review-guide-box strong {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
}

.manual-review-guide-box span {
  color: #172033;
  font-size: 13px;
  font-weight: 850;
}

.manual-review-queue-panel {
  display: grid;
  gap: 16px;
  border-left: 5px solid var(--blue);
}

.manual-review-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .36fr);
  gap: 14px;
  align-items: start;
}

.manual-review-panel-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.manual-review-panel-head p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
}

.manual-review-empty {
  min-height: 126px;
}

.manual-review-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 14px;
}

.manual-review-table {
  margin-top: 2px;
  overflow-x: visible;
}

.manual-review-table table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.manual-review-table th,
.manual-review-table td {
  vertical-align: top;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.manual-review-table th:nth-child(1),
.manual-review-table td:nth-child(1) { width: 120px; }

.manual-review-table th:nth-child(2),
.manual-review-table td:nth-child(2) { width: 170px; }

.manual-review-table th:nth-child(3),
.manual-review-table td:nth-child(3) { width: 130px; }

.manual-review-table th:nth-child(5),
.manual-review-table td:nth-child(5) { width: 240px; }

.manual-review-table th:nth-child(6),
.manual-review-table td:nth-child(6) { width: 180px; }

.manual-review-checklist.compact {
  margin: 0;
  padding-left: 16px;
}

.manual-review-checklist.compact li {
  margin: 0 0 4px;
  line-height: 1.45;
}

.manual-review-scope {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.manual-review-more {
  justify-self: end;
}

.manual-review-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #dbe4f0;
  border-left: 5px solid var(--yellow);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.manual-review-card.transfer-card {
  border-left-color: var(--green);
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 48%);
}

.manual-review-kicker,
.manual-review-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.manual-review-kicker span:first-child {
  display: inline-flex;
  padding: 5px 9px;
  color: var(--blue);
  border-radius: 999px;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 950;
}

.manual-review-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  word-break: break-all;
}

.manual-review-stage,
.manual-review-reason,
.manual-review-next {
  margin: 0;
  color: #475569;
  font-size: 13px;
  font-weight: 750;
}

.manual-review-reason {
  color: #0f172a;
  font-weight: 900;
}

.manual-review-checklist {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 12px 10px 28px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 780;
}

.manual-review-checklist.compact {
  max-width: 320px;
  padding: 8px 10px 8px 24px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.45;
}

.manual-review-mobile-list .manual-review-checklist.compact {
  max-width: none;
}

.manual-review-table .manual-review-checklist.compact {
  max-width: none;
}

.manual-review-next {
  padding: 9px 10px;
  border-left: 3px solid var(--green);
  border-radius: 8px;
  background: #f0fdfa;
}

.transfer-confirm-btn {
  background: var(--green);
}

.receipt-tx-fallback .tx-fallback-card {
  display: grid;
  min-height: 150px;
  place-items: center;
  gap: 6px;
  border-radius: 10px;
  color: #dbeafe;
  background: #0f172a;
  text-align: center;
}

.receipt-tx-fallback .tx-fallback-card .icon {
  width: 26px;
  height: 26px;
}

.chat-shell { display: grid; grid-template-rows: auto minmax(340px, 1fr) auto auto; overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.chat-pane { display: grid; align-content: start; gap: 10px; padding: 16px; background: #f8fafc; }
.bubble { max-width: 72%; padding: 10px 12px; border-radius: 14px; font-size: 13px; }
.bubble small { display: block; margin-top: 5px; opacity: .72; font-size: 10px; font-weight: 900; }
.bubble.customer { color: #1e293b; border: 1px solid var(--border); border-bottom-left-radius: 5px; background: white; }
.bubble.admin { justify-self: end; color: white; border-bottom-right-radius: 5px; background: var(--blue); }
.reply-bar { display: grid; grid-template-columns: minmax(0, 1fr) 42px; align-items: end; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: white; }
.reply-bar textarea {
  min-height: 42px;
  max-height: 150px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  outline: none;
  resize: none;
  overflow-y: auto;
  line-height: 1.45;
}
.reply-bar button { display: grid; color: white; border-radius: 50%; place-items: center; background: var(--blue); }
.quick-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 12px 12px; background: white; }
.support-closed-note {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  color: #475569;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 800;
}

.phone-preview {
  position: sticky;
  top: 92px;
}
.phone {
  max-width: 318px;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 26px;
  background: var(--navy);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
}
.phone-screen { overflow: hidden; min-height: 570px; border-radius: 20px; background: #f8fafc; }
.phone-head { display: flex; align-items: center; justify-content: space-between; padding: 14px; color: white; background: var(--navy); }
.phone-body { padding: 14px; }
.phone-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 12px; }
.phone-kpi { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: white; }
.phone-kpi span { color: var(--muted); font-size: 11px; font-weight: 900; }
.phone-kpi strong { display: block; margin-top: 4px; font-size: 20px; font-weight: 950; }
.mobile-card { padding: 12px; margin-bottom: 9px; border: 1px solid var(--border); border-radius: var(--radius); background: white; }
.mobile-card h3 { margin: 0 0 5px; font-size: 13px; }
.mobile-card p { margin: 6px 0 0; color: #475569; font-size: 12px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-row { display: grid; gap: 7px; }
.form-row label { color: #475569; font-size: 12px; font-weight: 900; }
.muted { color: var(--muted); }
.mobile-table-list { display: none; }

.empty-state {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 128px;
  margin-top: 12px;
  padding: 18px;
  color: #475569;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 4px;
  color: #1e293b;
  font-size: 14px;
}

.empty-state span {
  font-size: 13px;
}

.mobile-only { display: none; }

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  color: #0f172a;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
  animation: toast-in 180ms ease;
}

.toast .icon { color: var(--blue); margin-top: 2px; }
.toast strong { display: block; font-size: 13px; }
.toast span { display: block; color: var(--muted); font-size: 12px; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1560px) {
  .kpi-grid { grid-template-columns: repeat(5, minmax(126px, 1fr)); }
  .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-main-card { grid-column: 1 / -1; }
}

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding: 18px 10px; }
  .brand { justify-content: center; padding: 0 0 18px; }
  .brand div:last-child, .nav-heading, .nav-link span.label, .nav-link.child { display: none; }
  .nav-link { justify-content: center; }
  .nav-children { display: none; }
  .nav-group-chevron { display: none; }
  .nav-badge { position: absolute; margin-left: 18px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; }
  .content-grid { grid-template-columns: 1fr; }
  .phone-preview { display: none; }
  .insight-grid, .chart-grid, .split { grid-template-columns: 1fr; }
  .data-control-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .manual-review-board { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .manual-review-guide { grid-template-columns: 1fr; }
  .command-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .emergency-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  body.sidebar-drawer-open .sidebar {
    display: block;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 90;
    width: min(82vw, 280px);
    height: 100dvh;
    padding: 18px 14px;
    box-shadow: 18px 0 44px rgba(15, 23, 42, .28);
  }
  body.sidebar-drawer-open .brand { justify-content: flex-start; }
  body.sidebar-drawer-open .brand div:last-child { display: block; }
  body.sidebar-drawer-open .nav-link { justify-content: flex-start; }
  body.sidebar-drawer-open .nav-link span.label { display: inline; }
  body.sidebar-drawer-open .nav-link.child { display: flex; }
  body.sidebar-drawer-open .nav-group.open .nav-children { display: grid; }
  body.sidebar-drawer-open .nav-group-chevron { display: inline-block; }
  body.sidebar-drawer-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 23, 42, .48);
  }
  .workspace { padding: 0 0 76px; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; min-height: 62px; margin: 0 0 14px; padding: 0 12px; color: white; background: var(--navy); border-bottom: 0; }
  .topbar-nav { gap: 5px; }
  .page-title p { display: none; }
  .page-title h1 { color: white; font-size: 17px; }
  .admin-chip {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    border-color: rgba(255,255,255,.16);
    background: rgba(255,255,255,.08);
  }
  .admin-chip div { display: none; }
  .admin-menu-panel { top: 44px; right: -2px; width: min(250px, calc(100vw - 24px)); color: var(--text); }
  .topbar .icon-btn { color: white; border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); }
  .topbar .icon-btn,
  .topbar .admin-chip .avatar { width: 34px; height: 34px; }
  .notification-panel { top: 44px; right: -4px; color: var(--text); }
  #page-root { padding: 0 14px; }
  .live-strip, .insight-grid, .chart-grid, .content-grid { display: block; }
  .insight-card { min-height: auto; margin-bottom: 12px; }
  .insight-card .card-head span { max-width: none; text-align: left; }
  .live-strip { margin-bottom: 14px; grid-template-columns: 1fr; }
  .endpoint { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { min-height: 92px; box-shadow: none; }
  .kpi-value { margin-top: 10px; font-size: 22px; }
  .card { box-shadow: none; }
  .card-pad { padding: 14px; }
  .toolbar { grid-template-columns: 1fr; }
  .audit-row {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .audit-row time {
    text-align: left;
  }
  .table-wrap table { min-width: 920px; }
  .table-wrap { display: none; }
  .mobile-table-list { display: grid; gap: 10px; }
  .detail-grid, .metric-grid, .form-grid, .board, .command-grid { grid-template-columns: 1fr; }
  .data-control-metrics { grid-template-columns: 1fr; }
  .data-control-table { max-height: none; }
  .data-control-table table { min-width: 760px; }
  .manual-review-board, .manual-review-guide, .manual-review-panel-head { grid-template-columns: 1fr; }
  .ops-guide, .guide-steps { grid-template-columns: 1fr; }
  .manual-review-steps { display: grid; grid-template-columns: 1fr; }
  .manual-review-card { padding: 14px; box-shadow: none; }
  .evidence-info-grid, .evidence-media-grid, .evidence-crop-grid { grid-template-columns: 1fr; }
  .evidence-toolbar, .section-title { align-items: stretch; flex-direction: column; }
  .candidate-row { grid-template-columns: 1fr; }
  .emergency-grid { grid-template-columns: 1fr; }
  .emergency-overflow { grid-template-columns: 1fr; }
  .emergency-summary a,
  .emergency-overflow .action-btn { width: 100%; justify-content: center; margin-left: 0; justify-self: stretch; }
  .history-row { grid-template-columns: 1fr; align-items: start; }
  .split { grid-template-columns: 1fr; }
  .room-list { grid-template-columns: 1fr; }
  .chat-shell { grid-template-rows: auto auto minmax(360px, 58vh) auto auto; }
  .chat-head { display: grid; gap: 10px; padding: 14px; }
  .chat-head .actions, .quick-row, .detail-sticky-actions, .detail-section-actions, .mobile-card-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .reply-bar { position: sticky; bottom: 74px; z-index: 20; border: 1px solid var(--border); border-radius: 14px; margin: 8px; box-shadow: 0 12px 28px rgba(15,23,42,.12); }
  .reply-bar:focus-within {
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 70;
  }
  body:has(.reply-bar:focus-within) .mobile-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(120%);
  }
  body:has(.reply-bar:focus-within) .workspace {
    padding-bottom: 12px;
  }
  .input, .search-box input, textarea, select {
    font-size: 16px;
  }
  .detail-sticky-actions {
    position: sticky;
    bottom: 78px;
    z-index: 18;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 14px 34px rgba(15,23,42,.14);
    backdrop-filter: blur(14px);
  }
  .ops-mobile-card {
    border-left: 5px solid #bfdbfe;
  }
  .ops-mobile-card:has(.risk.high) {
    border-left-color: #dc2626;
  }
  .decision-box {
    font-size: 14px;
  }
  .desktop-only { display: none; }
  .mobile-only { display: block; }
  .mobile-nav {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .16);
    backdrop-filter: blur(16px);
  }
  .mobile-nav a {
    display: grid;
    gap: 3px;
    color: #64748b;
    place-items: center;
    font-size: 11px;
    font-weight: 900;
  }
  .mobile-nav a.active { color: var(--blue); }
  .toast-root { right: 10px; bottom: 82px; left: 10px; width: auto; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .top-actions { gap: 6px; }
  .back-btn,
  .bell {
    width: 36px;
    height: 36px;
  }
  .page-title h1 {
    max-width: 52vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .board-col-head,
  .card-head,
  .meta-line {
    align-items: flex-start;
    flex-direction: column;
  }
  .notice-row,
  .permission-table > div {
    grid-template-columns: 1fr;
  }
  .notice-row > div,
  .notice-row span {
    grid-column: auto;
  }
  .notice-row strong {
    white-space: normal;
  }
  .notice-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .board-more-link { white-space: normal; }
  .notification-panel {
    right: -2px;
    width: calc(100vw - 24px);
  }
  .filters {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .pill-btn { flex: 0 0 auto; }
}

.admin-chip .alert-dot,
.admin-menu-wrap .alert-dot {
  display: none !important;
}

@media (max-width: 760px) {
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .workspace,
  #page-root,
  .section-block,
  .table-card,
  .manual-review-dashboard-panel,
  .manual-review-queue-panel,
  .applicant-board-panel,
  .evidence-section,
  .evidence-viewer,
  .identity-live-shell,
  .evidence-shell {
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  #page-root {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .topbar {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .evidence-tile img,
  .evidence-tile video {
    width: 100%;
    max-width: 100%;
    object-fit: contain;
  }

  .notification-panel {
    max-width: calc(100vw - 20px);
  }
}
