:root {
  --bg: #0f171d;
  --panel: #18232c;
  --panel-2: #202d37;
  --line: #31414e;
  --text: #e9eff3;
  --muted: #97a6b2;
  --brand: #f2a93b;
  --brand-dark: #1a222a;
  --green: #2fb36d;
  --blue: #4d9de0;
  --red: #e05260;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Segoe UI, Arial, sans-serif; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { min-height: 40px; border: 0; border-radius: 6px; cursor: pointer; background: var(--panel-2); color: var(--text); padding: 0 14px; }
button.primary { background: var(--brand); color: #111820; font-weight: 700; }
button.danger { background: rgba(224, 82, 96, .18); color: #ff9aa4; }
button:disabled { opacity: .5; cursor: wait; }
button.is-loading { animation: refreshPulse .45s ease-in-out infinite alternate; }
button.is-clicked {
  animation: buttonPressPulse .32s ease-in-out infinite alternate;
  box-shadow: inset 0 0 0 999px rgba(0,0,0,.12);
  filter: saturate(.85);
  transform: translateY(1px);
}
button.is-clicked:disabled { cursor: wait; opacity: .72; }
.button-link { display: inline-flex; align-items: center; min-height: 40px; border-radius: 6px; padding: 0 14px; background: var(--panel-2); color: var(--text); text-decoration: none; }
.button-link:hover { color: var(--brand); }
.photo-link { display: block; color: var(--text); text-decoration: none; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.photo-link:hover { color: var(--brand); }
input, select, textarea { width: 100%; background: #111a21; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; }
textarea { min-height: 96px; resize: vertical; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.brand-lockup { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.brand-logo { display: block; width: 142px; max-width: 100%; height: auto; object-fit: contain; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { background: #152028; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; }
.side-title { color: var(--muted); font-size: 12px; margin: 0 0 6px 0; text-transform: uppercase; }
.nav { display: grid; gap: 7px; }
.nav button { justify-content: flex-start; display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; color: var(--muted); text-align: left; }
.nav button.active, .nav button:hover { background: var(--panel-2); color: var(--text); }
.nav button.nav-cta,
.sidebar > button.nav-cta { background: var(--brand); color: #111820; font-weight: 800; justify-content: center; margin-bottom: 8px; }
.nav button.nav-cta:hover,
.sidebar > button.nav-cta:hover { background: #ffbc55; color: #111820; }
.profile { margin-top: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #253541; color: var(--brand); font-weight: 800; }
.main { min-width: 0; }
.topbar { height: 66px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.content { padding: 24px; display: grid; gap: 18px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 12px; }
.card, .table-wrap, .form-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.metric strong { display: block; font-size: 30px; }
.metric span, .label, .muted { color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; font-size: 12px; color: var(--muted); background: #273641; white-space: nowrap; }
.badge.open, .badge.pending_client_approval { background: rgba(242,169,59,.14); color: var(--brand); }
.badge.assigned, .badge.accepted, .badge.in_progress { background: rgba(77,157,224,.14); color: #65b6ff; }
.badge.completed, .badge.approved, .badge.resolved { background: rgba(47,179,109,.14); color: #50d98c; }
.badge.high, .badge.critical, .badge.declined, .badge.cancelled, .badge.expired { background: rgba(224,82,96,.16); color: #ff8490; }
.detail { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; }
.stack { display: grid; gap: 16px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card hr { border: 0; border-top: 1px solid rgba(255,255,255,.08); margin: 18px 0; }
.alert { border-left: 3px solid var(--brand); background: var(--panel); padding: 12px 14px; color: var(--muted); border-radius: 6px; }
.hidden { display: none !important; }
@keyframes refreshPulse {
  from { background: var(--panel-2); color: var(--text); }
  to { background: var(--brand); color: #111820; }
}
@keyframes buttonPressPulse {
  from { filter: brightness(.82) saturate(.9); }
  to { filter: brightness(1.08) saturate(1.05); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .grid, .detail, .fields { grid-template-columns: 1fr; }
}
