:root {
  color-scheme: dark;
  --bg: #090d12;
  --panel: #111820;
  --panel-2: #151f29;
  --border: #24303c;
  --text: #f4f7f8;
  --muted: #91a1af;
  --accent: #61e7b5;
  --accent-ink: #062018;
  --warning: #f3c86a;
  --danger: #ff8585;
  --info: #82b7ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 75% 0%, #122a2a 0, var(--bg) 35%); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
code { color: var(--accent); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(440px, 100%); padding: 40px; border: 1px solid var(--border); border-radius: 22px; background: rgba(17, 24, 32, .94); box-shadow: 0 28px 90px rgba(0,0,0,.42); }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 900; letter-spacing: -.04em; }
.brand-mark.small { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.02em; }
.eyebrow { margin-bottom: 6px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.6; }
.stack { display: grid; gap: 18px; margin-top: 28px; }
label { display: grid; gap: 8px; color: #cdd6dc; font-size: 13px; font-weight: 650; }
input, select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; outline: none; background: #0c1218; color: var(--text); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(97,231,181,.12); }
button { min-height: 40px; padding: 9px 15px; border: 0; border-radius: 10px; font-weight: 750; }
button:disabled { cursor: not-allowed; opacity: .48; }
.primary { background: var(--accent); color: var(--accent-ink); }
.secondary { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); }
.danger-button { border: 1px solid rgba(255,133,133,.35); background: rgba(255,133,133,.1); color: var(--danger); }
.text-button { padding: 0; min-height: 28px; background: transparent; color: var(--muted); text-align: left; }
.error { min-height: 20px; color: var(--danger); }
.message { min-height: 24px; margin-bottom: 8px; color: var(--info); }
.message.error-message { color: var(--danger); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 22px 18px; border-right: 1px solid var(--border); background: rgba(10,14,19,.94); }
.brand-row { display: flex; align-items: center; gap: 11px; font-weight: 800; }
nav { display: grid; gap: 5px; }
.nav-item { width: 100%; background: transparent; color: var(--muted); text-align: left; }
.nav-item:hover, .nav-item.active { background: var(--panel-2); color: var(--text); }
.nav-item.active { box-shadow: inset 3px 0 var(--accent); }
.sidebar-foot { display: grid; gap: 6px; margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--border); font-size: 12px; overflow-wrap: anywhere; }
.role-pill, .status-pill { width: max-content; padding: 4px 8px; border-radius: 999px; background: rgba(97,231,181,.12); color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.content { min-width: 0; padding: 34px clamp(20px, 4vw, 58px) 70px; }
.page-header, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-header { margin-bottom: 20px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(150deg, var(--panel-2), var(--panel)); }
.metric strong { display: block; margin-top: 8px; font-size: 30px; letter-spacing: -.04em; }
.metric span { color: var(--muted); font-size: 12px; }
.panel { margin-top: 18px; padding: 20px; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: rgba(17,24,32,.9); }
.form-panel { border-color: #2d5148; }
.inline-form { display: grid; grid-template-columns: 1fr 1.5fr auto; align-items: end; gap: 12px; margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 14px; margin-top: 18px; }
.wide { grid-column: 1 / -1; }
.confirmation { grid-template-columns: auto 1fr; align-items: center; justify-content: start; }
.confirmation input { width: 18px; min-height: 18px; }
.table-wrap { width: 100%; margin-top: 16px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); font-size: 10px; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: nowrap; }
td.wrap { max-width: 280px; white-space: normal; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions button { min-height: 30px; padding: 5px 9px; font-size: 11px; }
.empty { margin: 20px 0 4px; color: var(--muted); }
.view + .view { margin-top: 0; }
@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; }
  nav { grid-template-columns: repeat(3, 1fr); }
  .sidebar-foot { grid-template-columns: 1fr auto; }
  .content { padding-top: 24px; }
  .form-grid, .inline-form { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
}
@media (max-width: 520px) {
  .login-panel { padding: 28px 22px; }
  nav { grid-template-columns: repeat(2, 1fr); }
  .page-header { align-items: end; }
}
