:root {
  color-scheme: dark;
  --bg: #1b1c1f;
  --sidebar: #161719;
  --panel: #202124;
  --line: #36373b;
  --text: #efeeeb;
  --muted: #a5a5a9;
  --accent: #c5b4ec;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
.hidden { display: none !important; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; font-weight: 650; letter-spacing: .01em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.login-shell { width: min(360px, 100%); }
.login-brand { margin-bottom: 48px; }
.login-card h2 { margin-bottom: 10px; font-size: 26px; font-weight: 600; letter-spacing: -.6px; }
.login-intro { margin-bottom: 32px; color: var(--muted); line-height: 1.6; }
label { display: block; margin-bottom: 9px; font-size: 13px; }
.password-field { position: relative; }
input { width: 100%; min-height: 44px; padding: 10px 70px 10px 12px; border: 1px solid #535359; border-radius: 5px; background: var(--sidebar); color: var(--text); }
input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
input::placeholder { color: #84848b; }
.password-toggle { position: absolute; right: 6px; top: 6px; min-height: 32px; border: 0; background: transparent; color: var(--muted); padding: 0 8px; font-size: 12px; }
.password-toggle:hover { color: var(--text); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 8px 13px; border: 1px solid #505158; border-radius: 5px; background: #2a2b30; color: var(--text); font-weight: 500; font-size: 13px; line-height: 1.35; }
.button:hover:not(:disabled) { background: #35363b; border-color: #77777f; }
.button.primary { color: #1c1726; background: #c5b4ec; border-color: #c5b4ec; }
.button.primary:hover { background: #d2c4f1; }
.button.danger { color: #f0a8a5; border-color: #80514f; background: transparent; }
.button.danger:hover:not(:disabled) { background: #3b292a; border-color: #c5807c; }
.sign-in-button { width: 100%; margin-top: 18px; min-height: 42px; }
.message { min-height: 20px; margin-top: 14px; color: #f0a8a5; line-height: 1.5; font-size: 13px; }
.message.info { color: var(--muted); }
.app { display: grid; grid-template-columns: 214px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 30px 16px 20px; background: var(--sidebar); border-right: 1px solid var(--line); }
.sidebar .brand { padding: 0 8px 42px; }
.nav-label { margin: 0 12px 13px; font-size: 11px; color: #85858e; }
nav { display: grid; gap: 4px; }
.nav-item { min-height: 39px; padding: 10px 12px; border: 0; border-radius: 5px; background: transparent; color: #b6b5bc; text-align: left; font-size: 13px; font-weight: 500; }
.nav-item:hover { background: #232427; color: var(--text); }
.nav-item.active { background: #2c2a32; color: #ddd1f6; }
.sidebar-status { display: grid; gap: 6px; margin: auto 12px 22px; padding-top: 22px; color: var(--muted); border-top: 1px solid var(--line); }
.sidebar-status strong { font-size: 12px; font-weight: 400; }
.sidebar-status small { font-family: ui-monospace, monospace; font-size: 11px; color: #81818b; }
.logout { width: 100%; }
.workspace { min-width: 0; width: 100%; max-width: 1360px; padding: 38px clamp(24px, 4vw, 64px) 64px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; }
.page-context { margin-bottom: 14px; font-size: 12px; color: #98989f; }
.topbar h1 { margin-bottom: 0; font-size: 28px; font-weight: 600; letter-spacing: -.7px; }
.topbar-meta { padding-bottom: 4px; color: var(--muted); font-size: 12px; }
.panel-view { display: none; }
.panel-view.active { display: block; }
.panel-intro { margin: 0 0 32px; color: var(--muted); line-height: 1.6; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin: 32px 0 44px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 0 20px; border-right: 1px solid var(--line); }
.stat:first-child { padding-left: 0; }
.stat:last-child { border: 0; }
.stat strong { display: block; font-size: 21px; font-weight: 500; margin-bottom: 8px; overflow-wrap: anywhere; }
.stat span { color: var(--muted); font-size: 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 15px; font-weight: 600; }
.section-heading .panel-intro { margin-bottom: 0; }
.text-button { padding: 5px 0; color: var(--accent); border: 0; background: transparent; font-size: 12px; }
.text-button:hover { text-decoration: underline; }
.product-grid { border-top: 1px solid var(--line); }
.product-card { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.product-copy { min-width: 0; }
.product-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 550; }
.product-card p { color: #b7b6bc; font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
.product-meta { display: flex; flex-wrap: wrap; gap: 7px 18px; color: #94939d; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.infrastructure-grid { border-top: 1px solid var(--line); }
.operation-card { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.operation-copy { max-width: 480px; }
.operation-label { margin-bottom: 10px; color: #a6a1b1; font-size: 11px; }
.operation-card h3 { margin: 0 0 9px; font-size: 17px; font-weight: 550; }
.operation-card .operation-copy > p:last-child { margin-bottom: 0; color: #b7b6bc; font-size: 13px; line-height: 1.65; }
.result-panel { margin-top: 38px; }
.result-status { font-size: 12px; color: var(--muted); }
.result-status.failed { color: #f0a8a5; }
.result-summary { color: #ceccd3; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.result-summary > p { margin-bottom: 18px; }
.muted { color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 12px; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-weight: 500; }
th:first-child, td:first-child { padding-left: 0; text-align: left; }
th:last-child, td:last-child { padding-right: 0; }
.output-details { margin-top: 20px; }
.output-details summary { width: fit-content; color: var(--muted); font-size: 12px; cursor: pointer; padding: 8px 0; }
.operation-output, .server-output { max-height: 440px; overflow: auto; margin-top: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 4px; background: var(--sidebar); color: #c5c4cb; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.audit-list { margin-top: 24px; border-top: 1px solid var(--line); }
.audit-entry { display: grid; grid-template-columns: minmax(160px,1fr) minmax(130px,1fr) minmax(100px,1fr) 75px; gap: 16px; padding: 17px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.audit-entry span { color: var(--muted); }
.audit-entry strong { font-weight: 500; overflow-wrap: anywhere; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: min(440px, calc(100vw - 48px)); padding: 13px 18px; border: 1px solid #55545d; border-radius: 6px; background: #303035; color: var(--text); font-size: 13px; line-height: 1.5; opacity: 0; pointer-events: none; transition: opacity .15s; }
.toast.show { opacity: 1; }
@media (max-width: 1050px) {
  .operation-card { align-items: flex-start; flex-direction: column; gap: 20px; }
  .product-card { align-items: flex-start; flex-direction: column; gap: 18px; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 18px 16px 12px; gap: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0 4px; }
  .sidebar nav { display: flex; gap: 4px; flex-wrap: wrap; }
  .nav-item { min-height: 36px; padding: 9px 10px; font-size: 12px; }
  .nav-label, .sidebar-status { display: none; }
  .logout { position: absolute; top: 20px; right: 18px; width: auto; }
  .workspace { padding: 28px 20px 44px; }
  .topbar-meta { display: none; }
  .topbar h1 { font-size: 26px; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 26px 20px; }
  .stat { padding: 0; border: 0; }
  .stat strong { font-size: 19px; }
  .product-card, .operation-card { padding: 24px 0; }
  .audit-entry { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.monitoring-section { margin-bottom: 38px; }
.monitoring-status, .monitoring-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.monitoring-status.failed { color: #f0a8a5; }
.server-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); border-top: 1px solid var(--line); }
.server-metric { min-width: 0; display: flex; flex-direction: column; gap: 11px; padding: 20px 16px 20px 0; border-bottom: 1px solid var(--line); }
.server-metric > span { color: var(--muted); font-size: 12px; }
.server-metric > strong { font-size: 20px; font-weight: 500; overflow-wrap: anywhere; }
.server-metric small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.server-metric progress { width: 100%; max-width: 200px; height: 5px; appearance: none; border: 0; border-radius: 0; background: #3b3b42; accent-color: var(--accent); }
.server-metric progress::-webkit-progress-bar { background: #3b3b42; }
.server-metric progress::-webkit-progress-value { background: var(--accent); }
.server-metric progress::-moz-progress-bar { background: var(--accent); }
.users-table { min-width: 680px; }
.users-table th:nth-child(2), .users-table td:nth-child(2) { text-align: left; }
.users-table td { vertical-align: top; }
.users-table td strong { font-size: 13px; font-weight: 550; }
.users-table td small { display: block; max-width: 240px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.service-status { font-size: 12px; text-transform: capitalize; }
.service-status.online { color: #a2c9ae; }
.service-status.unavailable { color: #f0b5a2; }
@media (max-width: 720px) { .server-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } }

.health-table, .backup-table { min-width: 620px; }
.health-table th, .health-table td, .backup-table th, .backup-table td { text-align: left; vertical-align: top; }
.health-table td small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.health-table strong { font-weight: 550; font-size: 13px; }
.backup-table a { color: var(--accent); text-underline-offset: 4px; font-family: ui-monospace, monospace; }

.users-search { display: grid; grid-template-columns: minmax(140px,1fr) minmax(200px,2fr) minmax(130px,1fr) auto; gap: 14px; align-items: end; margin-bottom: 22px; }
.users-search label { color: var(--muted); font-size: 12px; }
.users-search input, .users-search select, #userActionReason { width: 100%; min-height: 38px; padding: 9px 11px; border: 1px solid #535359; border-radius: 5px; background: var(--sidebar); color: var(--text); font: inherit; }
.users-search select:focus-visible, #userActionReason:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-table { min-width: 850px; }
.account-table th, .account-table td { text-align: left; vertical-align: top; }
.account-table td small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.account-table td strong { font-weight: 550; }
.users-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 20px; font-size: 12px; }
.user-detail { margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line); }
.account-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0 24px; margin-bottom: 24px; }
.account-fields > div { padding: 15px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.account-fields span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 9px; }
.account-fields strong { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
#userActionForm { max-width: 600px; margin-top: 20px; }
#userActionReason { min-height: 84px; resize: vertical; line-height: 1.6; margin-bottom: 14px; }
.audit-detail { grid-column: 1 / -1; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 1050px) { .users-search { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 720px) { .users-search, .account-fields { grid-template-columns: 1fr; } .users-pagination { justify-content: space-between; } }
