﻿@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #07090f;
  --card: rgba(20, 27, 42, 0.94);
  --line: rgba(212, 181, 128, 0.26);
  --text: #f5f3ee;
  --muted: #b8bfd1;
  --accent: #3d6fe0;
  --accent-strong: #6a92f0;
  --success: #16a34a;
  --danger: #dc2626;
  --chip: rgba(212, 181, 128, 0.1);
  --card-soft: rgba(11, 17, 30, 0.82);
  --card-strong: rgba(17, 24, 38, 0.96);
  --surface-glow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 10% 0%, #182138 0%, transparent 34%),
    radial-gradient(circle at 90% 8%, #121c30 0%, transparent 34%),
    linear-gradient(180deg, #06080f 0%, #0b111d 45%, #080c15 100%);
  color: var(--text);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(212, 181, 128, 0.26);
  background: linear-gradient(120deg, #0b1324 0%, #182744 48%, #10213d 100%);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.brand h1 {
  margin: 0;
  font-size: 21px;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar .muted {
  color: rgba(241, 245, 255, 0.9);
}

.auth {
  display: grid;
  gap: 14px;
}

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

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.status-line {
  margin-top: 6px;
  font-size: 12px;
  color: #a3bffa;
}

.status-line.error {
  color: #fca5a5;
}

.status-line.ok {
  color: #86efac;
}

.field {
  display: grid;
  gap: 6px;
  color: #d6def2;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

input,
select,
textarea,
button {
  font: inherit;
}

.auth input:not([type='checkbox']) {
  min-width: 200px;
}

input:not([type='checkbox']),
select,
textarea {
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(11, 18, 32, 0.88);
  color: #f8fafc;
  min-height: 44px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
}

input::placeholder,
textarea::placeholder {
  color: rgba(226, 232, 240, 0.7);
}

.auth .inline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(226, 232, 240, 0.88);
  font-size: 13px;
  background: transparent;
  border: none;
  padding: 0;
}

.auth input[type='checkbox'] {
  appearance: auto;
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  accent-color: #2563eb;
  min-height: 0;
  min-width: 0;
  padding: 0;
  box-shadow: none;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.text-link-btn {
  min-height: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(191, 219, 254, 0.92);
  font-size: 13px;
  font-weight: 600;
}

#simpleModeToggle {
  display: none !important;
}

.text-link-btn:hover {
  background: transparent;
  color: #dbeafe;
  text-decoration: underline;
}

.forgot-link {
  justify-self: end;
  margin-top: 2px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(212, 181, 128, 0.5);
  outline-offset: 2px;
}

textarea {
  min-height: 110px;
  width: 100%;
  resize: vertical;
}

button {
  padding: 11px 14px;
  border: none;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 44px;
  font-weight: 600;
  box-shadow: 0 10px 18px rgba(61, 111, 224, 0.16);
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

button.secondary {
  background: rgba(148, 163, 184, 0.14);
  color: #e8edf9;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: none;
}

button.secondary:hover {
  background: rgba(148, 163, 184, 0.2);
}

button.ghost {
  background: rgba(212, 181, 128, 0.07);
  color: #f0ddb8;
  border: 1px solid rgba(212, 181, 128, 0.24);
  box-shadow: none;
}

button.ghost:hover {
  background: rgba(212, 181, 128, 0.14);
}

button.mini {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.token-tools {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  background: rgba(12, 18, 32, 0.95);
  min-width: 240px;
}

.token-tools summary {
  cursor: pointer;
  font-size: 12px;
  color: #d7dceb;
  list-style: none;
}

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

.token-tools[open] {
  display: grid;
  gap: 8px;
}

.status-pill {
  justify-self: end;
  background: rgba(16, 22, 36, 0.92);
  color: #f5e8cf;
  border: 1px solid rgba(212, 181, 128, 0.35);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
}

.permission-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.permission-group {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(212, 181, 128, 0.18);
  background: rgba(10, 16, 28, 0.72);
}

.permission-group .label {
  color: #f4e4c1;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.permission-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: auto;
  padding: 0;
  color: #e5e7ef;
  font-size: 13px;
  line-height: 1.35;
  background: transparent;
  border: none;
}

.permission-item input[type='checkbox'] {
  margin-top: 2px;
}

.status-pill.small {
  padding: 4px 10px;
  font-size: 11px;
}

.status-pill.ok {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

#envBanner {
  margin: 10px 18px 0;
  justify-self: stretch;
  border-radius: 10px;
  font-size: 12px;
}


.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 24, 0.7);
}

.modal-content {
  position: relative;
  width: min(900px, 92vw);
  max-height: 88vh;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  padding: 16px;
  overflow: hidden;
  z-index: 1;
}

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

.modal-body {
  background: #0b1220;
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
  max-height: 70vh;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(860px, 96vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  display: grid;
  gap: 12px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.16);
}

.auth-card h1 {
  margin: 0;
  font-size: 24px;
}

.auth-card-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.2);
  background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
}

.auth-card-head h1 {
  color: #f8fbff;
}

.auth-card-head .muted {
  color: rgba(241, 245, 255, 0.92);
}

.auth-card .auth,
.auth-card .status-pill {
  margin: 0 20px;
}

.auth-card .auth {
  padding-top: 6px;
}

.auth-card .status-pill {
  margin-bottom: 20px;
  justify-self: start;
}

.auth-card-head .muted {
  color: rgba(241, 245, 255, 0.9);
}

.auth {
  justify-content: flex-start;
}

.app-shell {
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
}

.session-meta {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.layout {
  display: grid;
  grid-template-columns: 228px 1fr;
  gap: 18px;
  padding: 18px;
  align-items: start;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.sidebar {
  background: linear-gradient(180deg, rgba(20, 27, 42, 0.96), rgba(16, 23, 36, 0.96));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 3px;
  align-self: stretch;
  position: sticky;
  top: 0;
  height: 100%;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.sidebar::-webkit-scrollbar {
  width: 10px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.35);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(191, 219, 254, 0.42);
  background-clip: padding-box;
}

.nav-btn {
  background: rgba(9, 14, 24, 0.72);
  color: #f5f3ee;
  text-align: left;
  border: 1px solid rgba(212, 181, 128, 0.16);
  min-height: 34px;
  padding: 7px 11px;
  font-size: 13px;
  border-radius: 14px;
  box-shadow: none;
}

.nav-btn.active {
  background: linear-gradient(180deg, rgba(91, 126, 228, 0.95), rgba(99, 136, 240, 0.9));
  border-color: rgba(163, 191, 255, 0.44);
  color: #f8fbff;
  font-weight: 600;
  box-shadow: 0 12px 22px rgba(61, 111, 224, 0.2);
}

.workspace {
  display: grid;
  gap: 18px;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.workspace::-webkit-scrollbar {
  width: 10px;
}

.workspace::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.35);
  border-radius: 999px;
}

.workspace::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.workspace::-webkit-scrollbar-thumb:hover {
  background: rgba(191, 219, 254, 0.42);
  background-clip: padding-box;
}

.panel {
  display: none;
  gap: 16px;
}

.panel.active {
  display: grid;
  width: 100%;
  max-width: none;
  margin: 0;
  min-width: 0;
}

.panel-head {
  display: grid;
  gap: 6px;
}

.panel h2 {
  margin: 0;
  font-size: 22px;
}

.card {
  background: linear-gradient(180deg, rgba(17, 24, 38, 0.96), rgba(13, 20, 33, 0.96));
  border: 1px solid rgba(212, 181, 128, 0.16);
  border-radius: 20px;
  padding: 20px;
  display: grid;
  gap: 14px;
  box-shadow: var(--surface-glow);
}

.card h3,
.card h4 {
  margin: 0;
}

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

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.grid > *,
.two-col > *,
.payments-grid > *,
.summary-grid > * {
  min-height: 100%;
}

.checks {
  gap: 12px;
}

.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--chip);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: #f5f3ee;
}

.inline-toggle {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.inline-toggle input {
  accent-color: #bfdbfe;
}

.slider-field {
  background: rgba(13, 24, 44, 0.6);
  border: 1px solid rgba(88, 120, 178, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.slider-field label {
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(226, 232, 255, 0.75);
}

.slider-field input[type='range'] {
  width: 100%;
}

.slider-field .muted {
  font-size: 12px;
}

.simple-mode .technical,
.simple-mode .output,
.simple-mode .advanced-json {
  display: none !important;
}
.output {
  margin: 0;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  border: 1px solid #1f2937;
  padding: 11px;
  max-height: 260px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
}

.advanced-json {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px;
}

.advanced-json summary {
  cursor: pointer;
  font-weight: 600;
  color: #e4ce9f;
}

.list {
  margin-top: 2px;
  display: grid;
  gap: 8px;
}

.compact-list {
  max-height: 220px;
  overflow: auto;
}

.list-item {
  border: 1px solid rgba(212, 181, 128, 0.1);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(10, 15, 27, 0.78);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.list-item .meta {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #d7dceb;
}

.list-item .actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.list-item .actions button {
  min-height: 38px;
  padding: 9px 12px;
  background: rgba(148, 163, 184, 0.14);
  color: #e8edf9;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: none;
}

.list-item .actions button.delete,
.list-item .actions .reject {
  background: var(--danger);
}

.list-item .actions .approve {
  background: var(--success);
}

.list-item .actions .expire {
  background: #64748b;
}

.list-item .actions .link {
  background: #2563eb;
}

.thumb-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.2);
  cursor: pointer;
}

.list-item.list-group-head {
  background: linear-gradient(120deg, rgba(20, 30, 48, 0.96), rgba(24, 36, 58, 0.96));
  border-color: rgba(212, 181, 128, 0.4);
}

.panel-quick-nav {
  display: none;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.step-card {
  text-align: left;
  background: linear-gradient(160deg, rgba(22, 30, 48, 0.92), rgba(16, 22, 36, 0.92));
  color: #f2e4c6;
  border: 1px solid rgba(212, 181, 128, 0.35);
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 120px;
}

.step-card:hover {
  background: linear-gradient(160deg, rgba(28, 38, 60, 0.96), rgba(20, 28, 44, 0.96));
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(212, 181, 128, 0.36);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
}

.step-title {
  font-weight: 700;
  color: #f4e7cb;
}

.step-desc {
  font-size: 12px;
  color: #b8bfd1;
}

.card-body.collapsed {
  display: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(212, 181, 128, 0.12);
  color: #f0dcb5;
}

.pill.approved {
  background: #16a34a;
  color: #fff;
}

.pill.rejected {
  background: #dc2626;
  color: #fff;
}

.pill.uploaded {
  background: #f59e0b;
  color: #1b1b1b;
}

.pill.expired {
  background: #6b7280;
  color: #fff;
}

.pill.critical {
  background: #b91c1c;
  color: #fff;
}

.pill.warning {
  background: #f59e0b;
  color: #1b1b1b;
}

.pill.healthy {
  background: #16a34a;
  color: #fff;
}

#chatThreadsList .list-item {
  background: linear-gradient(165deg, rgba(17, 26, 43, 0.95), rgba(12, 20, 34, 0.95));
  border-color: rgba(96, 165, 250, 0.28);
}

#chatThreadsList .list-item .meta strong {
  font-size: 13px;
  color: #e2ecff;
}

#chatThreadsList .actions button {
  min-width: 74px;
}

#chatMessagesList .list-item {
  border-color: rgba(100, 116, 139, 0.35);
}

#chatMessagesList .list-item .meta {
  gap: 6px;
}

#chatThreadMeta {
  margin-top: 6px;
}

.table-wrap {
  overflow-x: auto;
}

.roles-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.roles-table th,
.roles-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

.roles-table td {
  color: #e3e7f1;
}


button.danger-soft {
  background: #ef4444;
}

button.danger-soft:hover {
  background: #dc2626;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.kpi-section {
  margin-bottom: 16px;
}

.kpi-section h4 {
  margin: 0;
  font-size: 14px;
  color: #e2e8f0;
}

.empty-card {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  color: #cbd5f5;
  background: rgba(12, 18, 30, 0.6);
  font-size: 12px;
}

.kpi-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(10, 15, 25, 0.92);
  display: grid;
  gap: 4px;
}

.kpi-card .label {
  font-size: 12px;
  color: #c4ccdc;
}

.kpi-card .value {
  font-weight: 700;
  font-size: 22px;
  color: #f5f3ee;
}

.kpi-card .sub {
  font-size: 12px;
  color: #a9b3c7;
}

.kpi-card.warning {
  background: rgba(28, 24, 17, 0.9);
  border-color: rgba(250, 204, 21, 0.45);
}

.kpi-card.danger {
  background: rgba(32, 16, 18, 0.9);
  border-color: rgba(252, 165, 165, 0.6);
}

.kpi-card.ok {
  background: rgba(10, 26, 28, 0.9);
  border-color: rgba(165, 243, 252, 0.5);
}

.kpi-card.kpi-wide {
  grid-column: span 2;
}

.mini-bar-chart {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.mini-bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 44px;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  position: relative;
}

.mini-bar-row strong {
  color: var(--text);
  text-align: right;
}

.mini-bar-row:hover {
  color: #e2e8f0;
}

.mini-bar-row:hover .mini-bar-track {
  background: rgba(148, 163, 184, 0.2);
}

.mini-tooltip {
  position: absolute;
  right: 0;
  top: -6px;
  transform: translateY(-100%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: #e2e8f0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

.mini-bar-row:hover .mini-tooltip {
  opacity: 1;
}

.mini-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(80, 164, 255, 0.9), rgba(64, 214, 152, 0.85));
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.segmented button {
  border: 0;
  background: transparent;
  color: #cbd5f5;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.segmented button.active {
  background: rgba(59, 130, 246, 0.35);
  color: #fff;
}

.line-chart {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(10, 15, 25, 0.75);
  min-height: 180px;
  position: relative;
}

.line-chart svg {
  width: 100%;
  height: 160px;
}

.line-chart .legend {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: #b4c0d9;
}

.line-chart .legend span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
  background: currentColor;
}

.line-tooltip {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  font-size: 12px;
  color: #e2e8f0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  min-width: 140px;
}

.line-chart svg {
  overflow: visible;
}

.line-chart.theme-slate svg polyline {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart.theme-emerald svg polyline {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart.theme-ember svg polyline {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart.theme-slate .legend span {
  color: #cbd5f5;
}

.line-chart.theme-emerald .legend span {
  color: #d1fae5;
}

.line-chart.theme-ember .legend span {
  color: #fed7aa;
}

.chart-theme-toggle {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.chart-theme-toggle button {
  border: 0;
  background: transparent;
  color: #cbd5f5;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.chart-theme-toggle button.active {
  background: rgba(59, 130, 246, 0.35);
  color: #fff;
}

.card-sub {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
  background: rgba(8, 13, 24, 0.64);
  padding: 14px;
}

p.card-sub {
  margin: 2px 0 0;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  color: rgba(184, 191, 209, 0.84);
  font-size: 13px;
  line-height: 1.5;
}

.staff-card {
  display: grid;
  gap: 10px;
}

.staff-card .meta {
  display: grid;
  gap: 6px;
}

.staff-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.staff-title-row strong {
  font-size: 15px;
}

.staff-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.staff-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(61, 111, 224, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: #dbeafe;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.staff-badge.muted-badge {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.2);
  color: #d7dceb;
}

.sidebar-group {
  display: grid;
  gap: 3px;
  padding: 3px 0 5px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.sidebar-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-group-title {
  margin: 0 4px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(184, 191, 209, 0.72);
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nav-meta {
  display: none;
}

.page-hero {
  padding: 18px 20px;
  border: 1px solid rgba(212, 181, 128, 0.14);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(61, 111, 224, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(16, 24, 38, 0.96), rgba(11, 17, 29, 0.96));
  box-shadow: var(--surface-glow);
}

.page-hero h2 {
  font-size: 28px;
}

.page-hero .muted {
  font-size: 14px;
  max-width: 720px;
  line-height: 1.5;
}

.workspace-shell {
  display: grid;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.workspace-shell .card {
  padding: 20px;
}

.workspace-shell > * {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.auto-load-hint {
  display: none;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.status-badge.neutral {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.18);
  color: #d7dceb;
}

.status-badge.success {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.24);
  color: #bbf7d0;
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.26);
  color: #fcd34d;
}

.status-badge.danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.24);
  color: #fecaca;
}

.status-badge.info {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(96, 165, 250, 0.28);
  color: #dbeafe;
}

.control-bar {
  display: grid;
  gap: 10px;
}

.soft-card {
  background: rgba(8, 13, 24, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  align-content: start;
  height: 100%;
}

.payments-board {
  display: grid;
  gap: 16px;
}

.payments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.slideover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 110;
}

.slideover-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.slideover {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(760px, 92vw);
  background:
    radial-gradient(circle at top left, rgba(61, 111, 224, 0.12), transparent 28%),
    linear-gradient(180deg, #09111f 0%, #0c1525 100%);
  border-left: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.34);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  z-index: 120;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.slideover.open {
  transform: translateX(0);
}

.slideover-head {
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  display: grid;
  gap: 10px;
}

.slideover-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.slideover-title {
  display: grid;
  gap: 6px;
}

.slideover-title h3 {
  margin: 0;
  font-size: 20px;
}

.slideover-close {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.18);
  min-width: 44px;
}

.slideover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slideover-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.slideover-tab {
  padding: 8px 12px;
  min-height: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: #d7dceb;
}

.slideover-tab.active {
  background: rgba(61, 111, 224, 0.18);
  border-color: rgba(96, 165, 250, 0.28);
  color: #eff6ff;
}

.slideover-body {
  overflow: auto;
  padding: 18px 20px 24px;
  display: grid;
  gap: 14px;
}

.modal-note {
  margin: 6px 0 0;
  max-width: 540px;
}

.drawer-panel {
  display: none;
  gap: 14px;
}

.drawer-panel.active {
  display: grid;
}

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

.audit-change {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 10px;
}

.audit-change summary {
  cursor: pointer;
  color: #cfe0ff;
  font-size: 12px;
}

.audit-diff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.audit-diff-grid pre {
  margin: 6px 0 0;
  border-radius: 12px;
  padding: 10px;
  background: rgba(4, 10, 19, 0.88);
  color: #d8e2f5;
  font-size: 11px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.summary-item {
  border: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(8, 13, 24, 0.72);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 8px;
  align-content: start;
  height: 100%;
}

.summary-item .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(184, 191, 209, 0.68);
}

.summary-item .value {
  font-size: 16px;
  font-weight: 700;
}

.smart-alerts-feed {
  display: grid;
  gap: 8px;
}

.smart-alert {
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-left: 4px solid rgba(96, 165, 250, 0.6);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(8, 13, 24, 0.72);
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 70px;
}

.smart-alert.warning {
  border-left-color: rgba(245, 158, 11, 0.7);
}

.smart-alert.danger {
  border-left-color: rgba(239, 68, 68, 0.7);
}

.ops-map-placeholder {
  min-height: 260px;
  height: 100%;
  border-radius: 18px;
  border: 1px dashed rgba(96, 165, 250, 0.26);
  background:
    radial-gradient(circle at 20% 20%, rgba(61, 111, 224, 0.22) 0, transparent 30%),
    radial-gradient(circle at 75% 25%, rgba(16, 185, 129, 0.18) 0, transparent 28%),
    linear-gradient(135deg, rgba(8, 14, 26, 0.98), rgba(17, 25, 42, 0.96));
  display: grid;
  place-items: center;
  text-align: center;
  color: rgba(226, 232, 240, 0.82);
}

.dense-actions,
.legacy-inline-controls {
  display: none !important;
}

.queue-card {
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 18px;
  padding: 16px;
  background: rgba(8, 13, 24, 0.72);
  display: grid;
  gap: 12px;
}

.queue-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.queue-card h4 {
  margin: 0;
}

.queue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #d7dceb;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mission-card {
  border-color: rgba(96, 165, 250, 0.22);
  background: linear-gradient(180deg, rgba(12, 20, 36, 0.94), rgba(10, 16, 28, 0.82));
}

.training-callout,
.training-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  background: rgba(20, 32, 56, 0.56);
  color: #dbeafe;
  font-size: 12px;
}

.training-callout strong,
.training-inline strong {
  color: #f8fafc;
}

.training-callout em,
.training-inline em {
  color: #fde68a;
  font-style: normal;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .slideover {
    width: 100vw;
  }

  .audit-diff-grid {
    grid-template-columns: 1fr;
  }
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.feature-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 23, 37, 0.9);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.feature-card h4 {
  margin: 0;
  color: #f4e7cb;
  font-size: 14px;
}

.feature-card p {
  margin: 0;
  color: #cfd7e8;
  font-size: 12px;
  line-height: 1.45;
}

.roles-table th {
  background: rgba(15, 23, 42, 0.8);
  font-weight: 600;
}

@media (max-width: 1180px) {
  .topbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.28);
  background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 48%, #3b82f6 100%);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.22);
}

  .status-pill {
    justify-self: start;
  }

  .session-meta {
    justify-items: start;
  }

  .layout {
    grid-template-columns: 220px 1fr;
    gap: 16px;
    padding: 16px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    grid-template-columns: 1fr;
  }
}









.pricing-rule-item .meta {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  width: 100%;
}

.pricing-rule-item .meta strong {
  grid-column: 1 / -1;
  font-size: 14px;
}

.pricing-rule-item .rule-id-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}


.service-area-item {
  display: grid;
  gap: 10px;
}

.service-city-list {
  display: grid;
  gap: 8px;
  width: 100%;
}

.service-city-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(19, 25, 39, 0.9);
  display: grid;
  gap: 8px;
}

.service-city-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.map-canvas {
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(19, 25, 39, 0.9);
  margin: 10px 0 14px;
}


.tab-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 8px;
}

.tab-btn {
  border-radius: 999px;
  border: 1px solid rgba(90, 112, 160, 0.4);
  background: rgba(15, 26, 48, 0.9);
  color: #eaf0ff;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(64, 119, 255, 0.95), rgba(88, 160, 255, 0.85));
  border-color: rgba(88, 160, 255, 0.85);
  color: #0b1020;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel-divider {
  height: 1px;
  margin: 16px 0;
  background: rgba(148, 163, 184, 0.2);
}

.catalog-editor {
  display: grid;
  gap: 10px;
}

.catalog-editor textarea {
  min-height: 140px;
}

/* Login Page Refresh */
#authGate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 10% 0%, #182138 0%, transparent 34%),
    radial-gradient(circle at 90% 8%, #121c30 0%, transparent 34%),
    linear-gradient(180deg, #06080f 0%, #0b111d 45%, #080c15 100%);
}

#authGate .auth-card {
  width: min(680px, 96vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.16);
  gap: 14px;
}

#authGate .auth-card-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.2);
  background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
}

#authGate .auth-card-head h1 {
  color: #f8fbff;
  font-size: 24px;
}

#authGate .auth-card-head .muted {
  color: rgba(241, 245, 255, 0.92);
  font-size: 14px;
}

#authGate .auth-card .auth {
  margin: 0 22px;
  padding: 2px 0 20px;
  width: calc(100% - 44px);
}

#authGate .auth {
  width: 100%;
  justify-content: stretch;
}

#authGate .auth-grid {
  display: block;
  width: 100%;
}

#authGate .field {
  display: block;
  gap: 8px;
  color: #d6def2;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  margin-bottom: 14px;
}

#authGate .field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#authGate .auth input:not([type='checkbox']) {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.35);
  margin-top: 8px;
}

#authGate .auth-input-wide {
  display: block;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
}

#authGate .auth input:not([type='checkbox'])::placeholder {
  color: rgba(226, 232, 240, 0.7);
}

#authGate .text-link-btn {
  min-height: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(191, 219, 254, 0.92);
  font-size: 12px;
  font-weight: 600;
}

#authGate .text-link-btn:hover {
  background: transparent;
  color: #dbeafe;
  text-decoration: underline;
}

#authGate .forgot-link {
  margin: 0;
  line-height: 1;
}

#authGate .auth .inline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(226, 232, 240, 0.88);
  font-size: 12px;
  padding: 0;
  border: none;
  background: transparent;
}

#authGate .auth input[type='checkbox'] {
  width: 14px;
  height: 14px;
  accent-color: #2563eb;
  margin: 0;
}

#authGate .auth-actions {
  display: grid;
  gap: 14px;
  width: 100%;
}

#authGate #loginBtn {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 18px;
}

#authGate #loginBtn:hover {
  background: var(--accent-strong);
}

.live-search-status {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #93c5fd;
  min-height: 14px;
}

@media (max-width: 900px) {
  .app-shell {
    height: auto;
    overflow: visible;
    grid-template-rows: auto auto auto;
  }

  body {
    padding-bottom: 76px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 14px;
  }

  .topbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .session-meta {
    justify-items: start;
  }

  .layout {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 12px;
    gap: 12px;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .workspace {
    height: auto;
    overflow: visible;
    padding-right: 0;
  }

  .nav-btn {
    min-height: 42px;
    font-size: 13px;
    padding: 8px 10px;
  }

  .card {
    padding: 12px;
    gap: 10px;
  }

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

  .row {
    gap: 8px;
  }

  .row > * {
    flex: 1 1 100%;
    min-width: 0;
  }

  .grid,
  .grid.compact,
  .two-col {
    grid-template-columns: 1fr;
  }

  .list-item {
    padding: 10px;
  }

  .list-item .actions {
    width: 100%;
    justify-content: flex-start;
  }

  .list-item .actions button {
    flex: 1 1 140px;
  }

  .output {
    max-height: 220px;
  }

  .mobile-action-bar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 120;
    display: flex;
    gap: 8px;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(10, 16, 30, 0.94);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.45);
  }

  .mobile-action-bar.hidden {
    display: none;
  }

  .mobile-action-btn {
    flex: 1 1 0;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(37, 99, 235, 0.95);
    color: #f8fafc;
  }
}

@media (max-width: 640px) {
  .auth-gate {
    padding: 12px;
  }

  .auth-card {
    width: 100%;
  }

  .auth-card .auth {
    margin: 0 12px;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .auth-actions {
    gap: 8px;
  }

  .auth-actions > * {
    flex: 1 1 100%;
  }

  .forgot-link {
    justify-self: start;
  }

  .panel h2 {
    font-size: 18px;
  }
}
