:root {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: #111c2f;
  --panel-2: #16243a;
  --panel-3: #1b2b43;
  --line: rgba(170, 190, 220, .13);
  --text: #edf3fc;
  --muted: #8fa1ba;
  --accent: #63d6bd;
  --accent-strong: #36b99e;
  --blue: #8bb8ff;
  --danger: #ff858d;
  --warning: #f4c978;
  --success: #6fdbb7;
  --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 80% -10%, rgba(42, 92, 122, .18), transparent 34%), var(--bg); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .16em; direction: ltr; text-align: right; }
.brand { display: flex; align-items: center; gap: 11px; direction: ltr; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #071b1a; background: linear-gradient(145deg, #8ce7d1, #3eb69f); font-size: .9rem; font-weight: 900; letter-spacing: -.06em; box-shadow: 0 8px 24px rgba(68, 195, 166, .17); }
.brand-name { color: var(--text); font-size: 1.16rem; font-weight: 850; letter-spacing: -.04em; }
.login-screen { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card { width: min(100%, 430px); padding: 38px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(160deg, rgba(24, 40, 63, .98), rgba(14, 24, 40, .98)); box-shadow: 0 30px 90px rgba(0, 0, 0, .35); }
.brand-login { margin-bottom: 38px; }
.login-card h1 { margin: 0 0 10px; font-size: 1.65rem; }
.login-card > .muted { margin: 0 0 28px; line-height: 1.9; font-size: .92rem; }
.login-footnote { margin: 25px 0 0; color: #7487a2; text-align: center; font-size: .75rem; }
.form-stack { display: flex; flex-direction: column; gap: 10px; }
label { display: block; margin: 9px 0 7px; color: #c6d3e5; font-size: .85rem; font-weight: 650; }
input, select { width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid rgba(159, 181, 211, .19); border-radius: 10px; outline: none; color: var(--text); background: #0c1728; transition: border-color .18s, box-shadow .18s; }
textarea { width: 100%; min-height: 250px; padding: 13px; border: 1px solid rgba(159, 181, 211, .19); border-radius: 10px; outline: none; color: #a5f0df; background: #081321; font: .8rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-align: left; resize: vertical; }
textarea:focus { border-color: rgba(99, 214, 189, .7); box-shadow: 0 0 0 3px rgba(99, 214, 189, .11); }
input:focus, select:focus { border-color: rgba(99, 214, 189, .7); box-shadow: 0 0 0 3px rgba(99, 214, 189, .11); }
input::placeholder { color: #60738d; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; color: var(--text); font-size: .85rem; font-weight: 700; transition: transform .15s, background .15s, border-color .15s; white-space: nowrap; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { color: #06211d; background: linear-gradient(135deg, #83e2cc, #48c4a8); box-shadow: 0 8px 20px rgba(56, 183, 155, .13); }
.button-primary:hover:not(:disabled) { background: linear-gradient(135deg, #9aedd9, #55d1b4); }
.button-outline { border-color: var(--line); background: rgba(255,255,255,.025); }
.button-outline:hover:not(:disabled), .button-quiet:hover:not(:disabled) { border-color: rgba(99,214,189,.35); background: rgba(99,214,189,.07); }
.button-quiet { border-color: transparent; color: #b7c8dc; background: transparent; }
.button-wide { width: 100%; min-height: 48px; margin-top: 12px; }
.text-button { border: 0; color: var(--accent); background: transparent; font-size: .82rem; font-weight: 750; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; color: #bdcbe0; background: transparent; font-size: 1.4rem; line-height: 1; }
.form-error { margin: 7px 0 0; color: var(--danger); font-size: .82rem; line-height: 1.7; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 10; display: flex; flex-direction: column; width: 248px; padding: 27px 18px 18px; border-inline-end: 1px solid var(--line); background: rgba(13, 23, 39, .96); backdrop-filter: blur(18px); }
.sidebar .brand { padding: 0 9px 32px; }
.sidebar-caption { margin: 7px 10px 10px; color: #6f829c; font-size: .72rem; font-weight: 750; }
.main-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 45px; padding: 10px 13px; border: 1px solid transparent; border-radius: 11px; color: #a8b8ce; background: transparent; text-align: right; font-size: .88rem; font-weight: 650; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.035); }
.nav-item.active { border-color: rgba(99,214,189,.14); color: #a5f0df; background: linear-gradient(90deg, rgba(72,196,168,.11), rgba(72,196,168,.035)); }
.nav-icon { display: grid; place-items: center; width: 24px; color: #8ea3bd; font-size: 1.2rem; }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-divider { height: 1px; margin: 17px 9px 12px; background: var(--line); }
.sidebar-bottom { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 15px 10px 3px; border-top: 1px solid var(--line); color: #8ea2bc; font-size: .74rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(111,219,183,.1); }
.version-label { margin-inline-start: auto; color: #5e718c; direction: ltr; }
.main-area { width: calc(100% - 248px); min-height: 100vh; margin-inline-start: 248px; padding: 0 34px 50px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 106px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 1.5rem; letter-spacing: -.025em; }
.topbar .eyebrow { margin-bottom: 6px; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding-inline: 8px; }
.user-avatar { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(139,184,255,.22); border-radius: 50%; color: var(--blue); background: rgba(139,184,255,.08); font-size: .7rem; font-weight: 850; direction: ltr; }
.user-copy { display: flex; flex-direction: column; gap: 3px; }
.user-copy strong { font-size: .82rem; }
.user-copy small { color: var(--muted); font-size: .7rem; }
.page-section { animation: fade-in .22s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.welcome-row, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.welcome-row h2, .section-heading h2 { margin: 0 0 6px; font-size: 1.2rem; }
.welcome-row p, .section-heading p { margin: 0; font-size: .86rem; }
.last-updated { color: #72859e; font-size: .73rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 22px; }
.stat-card { display: flex; flex-direction: column; min-height: 145px; padding: 21px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(25, 42, 66, .9), rgba(17, 29, 47, .9)); }
.stat-label { color: #a7b8ce; font-size: .82rem; }
.stat-card strong { margin: 12px 0 5px; color: var(--text); font-size: 2rem; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-hint { color: #71849e; font-size: .73rem; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17, 28, 47, .86); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 21px 22px 16px; }
.panel-heading h3 { margin: 0 0 5px; font-size: .98rem; }
.panel-heading p { margin: 0; font-size: .78rem; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: right; white-space: nowrap; }
thead { background: rgba(255,255,255,.025); }
th { padding: 13px 17px; color: #8094ae; font-size: .72rem; font-weight: 750; }
td { padding: 14px 17px; border-top: 1px solid rgba(170,190,220,.075); color: #d1dceb; font-size: .79rem; }
tbody tr:hover { background: rgba(255,255,255,.018); }
.table-actions { display: flex; align-items: center; gap: 7px; }
.table-button { min-height: 31px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: #b9d7ee; background: rgba(255,255,255,.025); font-size: .72rem; font-weight: 700; }
.table-button:hover:not(:disabled) { border-color: rgba(99,214,189,.35); color: #a5f0df; }
.table-button.danger { color: #ff9ca3; }
.inline-select { width: auto; min-width: 112px; min-height: 32px; padding: 5px 8px; font-size: .74rem; }
.inline-check { width: 17px; min-height: 17px; accent-color: var(--accent); vertical-align: middle; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid transparent; border-radius: 999px; font-size: .7rem; font-weight: 750; }
.badge::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.badge-success { border-color: rgba(111,219,183,.16); color: #7ce0bf; background: rgba(111,219,183,.08); }
.badge-warning { border-color: rgba(244,201,120,.17); color: #f0c77c; background: rgba(244,201,120,.08); }
.badge-danger { border-color: rgba(255,133,141,.17); color: #ff959d; background: rgba(255,133,141,.08); }
.badge-neutral { border-color: rgba(143,161,186,.16); color: #9eafc6; background: rgba(143,161,186,.07); }
.empty-state { padding: 38px 18px; color: #71849e; text-align: center; font-size: .82rem; }
.notice { margin-bottom: 16px; padding: 13px 16px; border: 1px solid transparent; border-radius: 11px; font-size: .8rem; line-height: 1.8; }
.notice-info { border-color: rgba(139,184,255,.17); color: #a9c9f6; background: rgba(139,184,255,.065); }
.notice-warning { border-color: rgba(244,201,120,.18); color: #f2d49b; background: rgba(244,201,120,.07); }
.global-error { margin: -13px 0 20px; padding: 12px 15px; border: 1px solid rgba(255,133,141,.2); border-radius: 10px; color: #ff9ca3; background: rgba(255,133,141,.07); font-size: .82rem; }
.modal { width: min(94vw, 560px); max-height: 90vh; padding: 0; border: 1px solid rgba(170,190,220,.18); border-radius: 20px; color: var(--text); background: #132138; box-shadow: 0 30px 100px rgba(0,0,0,.6); }
.modal::backdrop { background: rgba(3, 8, 17, .76); backdrop-filter: blur(5px); }
.modal-card { display: flex; flex-direction: column; gap: 3px; max-height: 90vh; overflow-y: auto; padding: 25px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-heading h2 { margin: 0; font-size: 1.15rem; }
.modal-heading .eyebrow { margin-bottom: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 19px; padding-top: 16px; border-top: 1px solid var(--line); }
.secret-value { display: flex; align-items: center; gap: 9px; margin: 12px 0; padding: 12px; border: 1px solid rgba(99,214,189,.2); border-radius: 12px; background: rgba(3, 12, 22, .55); }
.secret-value code { flex: 1; overflow-wrap: anywhere; color: #a5f0df; direction: ltr; text-align: left; font-size: .85rem; user-select: all; }
.toast-region { position: fixed; inset-inline-end: 22px; inset-block-end: 22px; z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 44px)); }
.toast { padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: #1b2b43; box-shadow: 0 12px 35px rgba(0,0,0,.28); font-size: .82rem; line-height: 1.7; }
.toast.success { border-color: rgba(111,219,183,.22); }
.toast.error { border-color: rgba(255,133,141,.25); }
@media (max-width: 1100px) {
  .sidebar { width: 220px; }
  .main-area { width: calc(100% - 220px); margin-inline-start: 220px; padding-inline: 24px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; padding: 13px 14px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0 5px 13px; }
  .main-nav { flex-direction: row; overflow-x: auto; gap: 5px; padding-bottom: 2px; }
  .nav-item { flex: 0 0 auto; width: auto; min-height: 38px; padding: 8px 10px; font-size: .76rem; }
  .nav-icon { display: none; }
  .sidebar-caption, .nav-divider, .sidebar-bottom { display: none; }
  .main-area { width: 100%; margin: 0; padding: 0 15px 35px; }
  .topbar { min-height: 84px; margin-bottom: 22px; }
  .topbar h1 { font-size: 1.2rem; }
  .topbar-actions { gap: 5px; }
  .topbar-actions .button-quiet span { display: none; }
  .user-chip { gap: 6px; padding-inline: 3px; }
  .user-copy small { display: none; }
  .user-copy strong { max-width: 75px; overflow: hidden; text-overflow: ellipsis; }
  .topbar-actions .button-outline { min-height: 34px; padding: 6px 9px; font-size: .73rem; }
  .welcome-row, .section-heading { align-items: flex-start; }
  .section-heading { flex-direction: column; }
  .stats-grid { gap: 10px; }
  .stat-card { min-height: 120px; padding: 15px; }
  .stat-card strong { font-size: 1.65rem; }
  .panel-heading { padding: 17px 15px 12px; }
  th, td { padding: 12px 13px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; gap: 0; }
  .login-card { padding: 27px 22px; }
}
@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 110px; }
  .stat-label { font-size: .73rem; }
  .stat-hint { font-size: .66rem; }
  .last-updated { display: none; }
}


/* Keep panel spacing compatible with the strict production Content-Security-Policy. */
.panel-spaced {
  margin-bottom: 16px;
}
