.admin { background: #101a19; }
.admin h1 { font-size: clamp(2.15rem, 4vw, 3rem); }
.admin h2 { font-size: 1.25rem; margin-bottom: .65rem; }
.admin-layout { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; min-width: 0; display: flex; flex-direction: column; padding: 1.2rem .85rem; background: #13211e; border-right: 1px solid var(--border); }
.sidebar > .brand { padding-inline: .55rem; margin-bottom: 1.5rem; }
.side-nav { display: grid; gap: .2rem; overflow: auto; }
.side-nav a { display: flex; align-items: center; gap: .65rem; min-height: 2.55rem; padding: .5rem .7rem; color: var(--muted); font-size: .925rem; border-radius: .45rem; white-space: nowrap; }
.side-nav a > span { width: 1.15rem; text-align: center; color: var(--accent); }
.side-nav a[aria-current=page] { background: #284638; color: #ecf9f1; font-weight: 650; }
.side-nav a:hover { background: #254234; }
.nav-group { font-size: .75rem; font-weight: 740; letter-spacing: .08em; color: var(--muted); padding: .9rem .72rem .25rem; }
.side-footer { display: flex; gap: .65rem; align-items: center; border-top: 1px solid var(--border); margin-top: auto; padding: 1rem .4rem 0; font-size: .875rem; }
.avatar { display: grid; place-items: center; background: #284638; color: var(--accent); font-weight: 800; border-radius: 50%; width: 2.15rem; height: 2.15rem; flex: none; }
.workspace-bar { min-height: 4.35rem; display: flex; justify-content: space-between; align-items: center; gap: .65rem; padding: .65rem clamp(1rem, 3vw, 2rem); border-bottom: 1px solid var(--border); }
.workspace-label { font-size: .91rem; color: var(--muted); }
.workspace-label span { padding: 0 .3rem; }
.workspace-label strong { color: var(--text); }
.workspace { padding: clamp(1rem, 3vw, 2.5rem); max-width: 95rem; margin-inline: auto; }
.mobile-switch { display: none; }
.environment { font-size: .875rem; color: var(--muted); margin-inline-end: .2rem; }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.workspace-heading .eyebrow { margin-bottom: .35rem; }
.workspace-heading h1 + p { margin-top: .55rem; }
.workspace > .form-status { margin-block: .35rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.metric { border: 1px solid var(--border); background: linear-gradient(135deg, #20322b, var(--surface)); display: grid; border-radius: .75rem; gap: .25rem; padding: 1rem; }
.metric:hover { border-color: var(--primary); }
.metric strong { font-size: 2.1rem; line-height: 1.2; }
.metric p { font-size: .9rem; }
.overview-grid { display: grid; grid-template-columns: 1.07fr .93fr; gap: 1rem; margin-top: 1rem; }
.admin .panel { padding: 1.15rem; border-radius: .7rem; }
.overview-grid .panel > a { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.overview-grid .panel > a:last-child { border-bottom: 0; padding-bottom: 0; }
.toolrow { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; margin-bottom: .85rem; }
.toolrow label:first-child { flex: 1 1 14rem; }
.toolrow label:last-child { flex: 0 1 12rem; }
.admin .table-scroll td:first-child { color: var(--text); font-weight: 620; }
.admin .table-scroll td { font-size: .94rem; }
.badge { display: inline-block; padding: .18rem .5rem; border-radius: .35rem; background: #30403d; color: #deede5; white-space: nowrap; font-size: .875rem; }
.badge.good { background: #1f3a31; color: var(--success); }
.badge.wait { background: #433526; color: var(--warning); }
.empty { padding: clamp(1.5rem, 5vw, 3rem); text-align: center; border: 1px dashed #425750; background: var(--surface); border-radius: .65rem; }
.empty h2 { margin-bottom: .3rem; }
.login { width: min(28rem, calc(100% - 2rem)); margin: clamp(3rem, 12vh, 9rem) auto; }
.login > .brand { margin-bottom: 1.25rem; }
.login .form-status, #record-status { min-height: 1.5em; }
dialog { width: min(34rem, calc(100% - 1.5rem)); background: var(--surface); color: var(--text); padding: 1.15rem; border: 1px solid var(--border); border-radius: .75rem; }
dialog::backdrop { background: #080914be; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .9rem; }
.dialog-header h2 { margin-bottom: 0; }
.ticket-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.row-caption { font-size: .875rem; color: var(--muted); font-weight: 400; }
.settings-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1rem; align-items: start; }
.settings-form { margin-top: 1rem; }
.settings-form button { justify-self: start; }
@media (max-width: 980px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; border: 0; border-bottom: 1px solid var(--border); padding: .7rem .85rem; }
  .sidebar > .brand { margin-bottom: .45rem; }
  .side-nav, .side-footer, .environment { display: none; }
  .mobile-switch { display: grid; max-width: 25rem; }
  .overview-grid, .settings-grid { grid-template-columns: 1fr; }
}
