/* UnderHost Monitor -- UI v2 -- follows DESIGN.md */

/* -- Variables --------------------------------------------------------------- */
:root {
  --uh-primary:       #00D4FF;
  --uh-primary-dark:  #0091D6;
  --uh-secondary:     #0091D6;

  --uh-dark-base:     #0A1220;
  --uh-dark-mid:      #0D1B30;
  --uh-dark-panel:    #0F2040;
  --uh-dark-deep:     #071428;

  --uh-surface:       #FFFFFF;
  --uh-surface-soft:  #F8F9FA;
  --uh-border:        #E5E7EB;
  --uh-border-soft:   #F3F4F6;
  --uh-border-primary: rgba(0,212,255,0.20);
  --uh-border-secondary: rgba(0,145,214,0.18);

  --uh-text-main:     #111827;
  --uh-text-muted:    #6B7280;
  --uh-text-light:    rgba(255,255,255,0.86);
  --uh-text-dimmed:   rgba(255,255,255,0.55);

  --uh-gradient-primary: linear-gradient(135deg,#0A1220 0%,#0D1B30 40%,#0F2040 70%,#071428 100%);
  --uh-gradient-h:       linear-gradient(90deg,#00D4FF,#0091D6);
  --uh-gradient-card:    linear-gradient(135deg,#0A1220 0%,#0D1B30 60%,#0F2040 100%);
  --uh-gradient-accent:  linear-gradient(90deg,rgba(0,145,214,.18) 0%,transparent 60%);

  --uh-shadow-sm:  0 2px 8px rgba(0,0,0,.06);
  --uh-shadow-md:  0 4px 16px rgba(0,145,214,.25);
  --uh-shadow-lg:  0 6px 22px rgba(0,145,214,.40);
  --uh-shadow-xl:  0 20px 50px rgba(0,0,0,.14);
  --uh-glow:       0 0 24px rgba(0,212,255,.22);

  --uh-ok:         #22C55E;
  --uh-ok-bg:      rgba(34,197,94,.12);
  --uh-ok-text:    #86EFAC;
  --uh-warning:    #F59E0B;
  --uh-warning-bg: rgba(245,158,11,.12);
  --uh-warning-text: #FCD34D;
  --uh-critical:   #EF4444;
  --uh-critical-bg:rgba(239,68,68,.12);
  --uh-critical-text:#FECACA;
  --uh-offline:    #64748B;
  --uh-offline-bg: rgba(100,116,139,.12);
  --uh-offline-text:#CBD5E1;

  --uh-radius-sm:  8px;
  --uh-radius-md:  12px;
  --uh-radius-lg:  16px;
  --uh-radius-xl:  20px;

  --uh-container:  1200px;
}

/* -- Reset & Base ------------------------------------------------------------- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0 }
html { font-size: 16px; scroll-behavior: smooth }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--uh-surface-soft);
  color: var(--uh-text-main);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--uh-primary-dark); text-decoration: none }
a:hover { color: var(--uh-primary) }
img { max-width: 100%; display: block }
ul { list-style: none }
code, .mono {
  font-family: "JetBrains Mono","IBM Plex Mono",SFMono-Regular,Consolas,monospace;
  font-size: .875em;
}

/* -- Typography --------------------------------------------------------------- */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.25; color: var(--uh-text-main) }
h1 { font-size: clamp(1.5rem,3vw,2rem) }
h2 { font-size: clamp(1.25rem,2.5vw,1.5rem) }
h3 { font-size: 1.1rem }
p  { margin-bottom: .75rem }
p:last-child { margin-bottom: 0 }
small { font-size: .8125rem; color: var(--uh-text-muted) }

/* -- Layout ------------------------------------------------------------------- */
.uh-app { display: flex; flex-direction: column; min-height: 100vh }
.uh-container {
  width: min(100% - 32px, var(--uh-container));
  margin-inline: auto;
}
.uh-main { flex: 1; padding: 28px 0 48px }

/* -- Header / Topbar ---------------------------------------------------------- */
.uh-header {
  position: sticky; top: 0; z-index: 900;
  background: rgba(10,18,32,.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.uh-header-inner {
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px; height: 60px;
  max-width: var(--uh-container); margin-inline: auto;
}
.uh-logo { display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0 }
.uh-logo img { height: 34px; width: auto }

/* Nav */
.uh-nav { display: flex; align-items: center; gap: 4px; margin-left: auto }
.uh-nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--uh-radius-sm);
  font-size: .8125rem; font-weight: 600;
  color: rgba(255,255,255,.72);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.uh-nav a:hover, .uh-nav a.active {
  background: rgba(255,255,255,.09);
  color: #fff;
}
.uh-nav a.uh-nav-cta {
  background: var(--uh-gradient-h);
  color: #fff !important;
  padding: 7px 14px;
  box-shadow: var(--uh-shadow-md);
}
.uh-nav a.uh-nav-cta:hover { box-shadow: var(--uh-shadow-lg) }

/* User chip in header */
.uh-header-user {
  display: flex; align-items: center; gap: 8px;
  font-size: .8125rem; color: rgba(255,255,255,.6);
  margin-left: 6px; padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.uh-header-user .role-chip {
  background: rgba(0,212,255,.12); color: var(--uh-primary);
  border: 1px solid rgba(0,212,255,.22);
  padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700;
}

/* Mobile nav toggle */
.uh-nav-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: 6px;
}
.uh-nav-toggle svg { width: 22px; height: 22px; stroke: rgba(255,255,255,.7) }

/* -- Page heading ------------------------------------------------------------- */
.uh-page-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 24px;
}
.uh-page-head h1 { margin: 0 }
.uh-breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  overflow: hidden; max-width: 100%;
  font-size: .8rem; color: var(--uh-text-muted); margin-bottom: 16px;
}
.uh-breadcrumb a { color: var(--uh-primary-dark); text-decoration: none; white-space: nowrap }
.uh-breadcrumb span { color: var(--uh-text-muted) }
.uh-breadcrumb span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0 }

/* -- Stat cards --------------------------------------------------------------- */
.uh-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  gap: 14px; margin-bottom: 28px;
}
.uh-stat-card {
  background: var(--uh-surface); border: 1px solid var(--uh-border);
  border-radius: var(--uh-radius-lg); padding: 18px 20px;
  box-shadow: var(--uh-shadow-sm);
  display: flex; flex-direction: column; gap: 6px;
}
.uh-stat-card .stat-label {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--uh-text-muted);
}
.uh-stat-card .stat-value {
  font-size: 2rem; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.uh-stat-card.ok     .stat-value { color: var(--uh-ok) }
.uh-stat-card.warning .stat-value { color: var(--uh-warning) }
.uh-stat-card.critical .stat-value { color: var(--uh-critical) }
.uh-stat-card.offline .stat-value { color: var(--uh-offline) }
.uh-stat-card.total   .stat-value { color: var(--uh-primary-dark) }

/* -- Cards -------------------------------------------------------------------- */
.uh-card {
  background: var(--uh-surface); border: 1px solid var(--uh-border);
  border-radius: var(--uh-radius-xl); box-shadow: var(--uh-shadow-sm);
  overflow: hidden;
}
.uh-card-head {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 14px 20px;
  background: var(--uh-gradient-card); position: relative; overflow: hidden;
}
.uh-card-head::before {
  content: ""; position: absolute; inset: 0;
  background: var(--uh-gradient-accent); pointer-events: none;
}
.uh-card-head h2,.uh-card-head h3 {
  color: #fff; font-size: .9rem; font-weight: 700; margin: 0; position: relative; z-index: 1;
}
.uh-card-head-actions { position: relative; z-index: 1; display: flex; gap: 8px }
.uh-card-body { padding: 20px }

.uh-panel-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: rgba(0,212,255,.10); border: 1px solid rgba(0,212,255,.22);
  display: flex; align-items: center; justify-content: center;
  color: var(--uh-primary); font-size: .9rem; position: relative; z-index: 1;
}

/* -- Server list table -------------------------------------------------------- */
.uh-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch }
.uh-table {
  width: 100%; border-collapse: collapse;
  font-size: .875rem;
}
.uh-table th {
  background: var(--uh-surface-soft); padding: 10px 14px;
  text-align: left; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--uh-text-muted); border-bottom: 1px solid var(--uh-border);
  white-space: nowrap;
}
.uh-table td {
  padding: 11px 14px; border-bottom: 1px solid var(--uh-border-soft);
  vertical-align: middle;
}
.uh-table tr:last-child td { border-bottom: none }
.uh-table tr:hover td { background: var(--uh-surface-soft) }
.uh-table .col-actions { width: 1%; white-space: nowrap; text-align: right }
.uh-table .hostname { font-family: "JetBrains Mono","IBM Plex Mono",monospace; font-size: .8rem; color: var(--uh-text-muted) }
.uh-table .last-seen { font-size: .8rem; color: var(--uh-text-muted); white-space: nowrap }

/* -- Badges ------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50% }
.badge-ok       { background: var(--uh-ok-bg);       color: var(--uh-ok-text) }
.badge-ok::before { background: var(--uh-ok) }
.badge-warning  { background: var(--uh-warning-bg);  color: var(--uh-warning-text) }
.badge-warning::before { background: var(--uh-warning) }
.badge-critical { background: var(--uh-critical-bg); color: var(--uh-critical-text) }
.badge-critical::before { background: var(--uh-critical); box-shadow: 0 0 6px var(--uh-critical) }
.badge-offline  { background: var(--uh-offline-bg);  color: var(--uh-offline-text) }
.badge-offline::before { background: var(--uh-offline) }
.badge-role   { background: rgba(0,145,214,.12); color: var(--uh-primary-dark); border: 1px solid var(--uh-border-secondary) }
.badge-role::before { display: none }
.badge-suspended { background: rgba(239,68,68,.1); color: #fca5a5; border: 1px solid rgba(239,68,68,.25) }
.badge-suspended::before { display: none }
.badge-customer { background: rgba(168,85,247,.1); color: #c4b5fd; border: 1px solid rgba(168,85,247,.2) }
.badge-customer::before { display: none }

/* -- Buttons ------------------------------------------------------------------ */
.uh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 9px 18px; border-radius: var(--uh-radius-md);
  font-size: .8125rem; font-weight: 700; line-height: 1; cursor: pointer; border: none;
  text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.uh-btn:focus-visible { outline: 3px solid rgba(0,212,255,.4); outline-offset: 3px }
.uh-btn:hover { transform: translateY(-1px) }

.uh-btn-primary {
  background: var(--uh-gradient-h); color: #fff;
  box-shadow: var(--uh-shadow-md);
}
.uh-btn-primary:hover { box-shadow: var(--uh-shadow-lg); color: #fff }

.uh-btn-secondary {
  background: var(--uh-surface); color: var(--uh-text-main);
  border: 1.5px solid var(--uh-border);
  box-shadow: var(--uh-shadow-sm);
}
.uh-btn-secondary:hover { border-color: var(--uh-border-secondary); color: var(--uh-primary-dark) }

.uh-btn-ghost {
  background: transparent; color: var(--uh-primary-dark);
  padding: 6px 12px; min-height: 30px;
}
.uh-btn-ghost:hover { background: rgba(0,145,214,.08) }

.uh-btn-danger {
  background: rgba(239,68,68,.1); color: #dc2626;
  border: 1.5px solid rgba(239,68,68,.25);
}
.uh-btn-danger:hover { background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.5) }

.uh-btn-sm { min-height: 30px; padding: 5px 12px; font-size: .75rem; border-radius: var(--uh-radius-sm) }
.uh-btn-lg { min-height: 46px; padding: 12px 24px; font-size: .9rem }

/* On dark backgrounds */
.uh-btn-outline-light {
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.88);
  border: 1.5px solid rgba(255,255,255,.16);
}
.uh-btn-outline-light:hover { background: rgba(255,255,255,.14); color: #fff }

/* -- Forms -------------------------------------------------------------------- */
.uh-form-group { margin-bottom: 16px }
.uh-form-label {
  display: block; font-size: .8125rem; font-weight: 600;
  color: var(--uh-text-main); margin-bottom: 6px;
}
.uh-form-label .req { color: #ef4444; margin-left: 3px }
.uh-field, .uh-select, .uh-textarea {
  width: 100%; min-height: 42px; padding: 10px 13px;
  border: 1.5px solid var(--uh-border); border-radius: var(--uh-radius-md);
  background: var(--uh-surface); color: var(--uh-text-main);
  font-size: .875rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.uh-textarea { min-height: 90px; resize: vertical }
.uh-field:focus, .uh-select:focus, .uh-textarea:focus {
  outline: none;
  border-color: var(--uh-secondary);
  box-shadow: 0 0 0 3px rgba(0,145,214,.09);
}
.uh-field-hint { font-size: .775rem; color: var(--uh-text-muted); margin-top: 4px }
.uh-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }
.uh-form-grid .full { grid-column: 1/-1 }

/* Search bar */
.uh-search-bar {
  display: flex; gap: 8px; margin-bottom: 18px; align-items: center; flex-wrap: wrap;
}
.uh-search-bar .uh-field { max-width: 340px }

/* -- Alert / Notice boxes ----------------------------------------------------- */
.uh-alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; border-radius: var(--uh-radius-md); margin-bottom: 16px;
  font-size: .875rem; line-height: 1.5;
}
.uh-alert .uh-alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px }
.uh-alert-success { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.3);  color: #15803d }
.uh-alert-error   { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.3);  color: #b91c1c }
.uh-alert-warning { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: #92400e }
.uh-alert-info    { background: rgba(0,145,214,.1);  border: 1px solid rgba(0,145,214,.25); color: #0369a1 }

/* Token / code block */
.uh-token-box {
  background: rgba(7,20,40,.95); border: 1px solid rgba(0,212,255,.2);
  border-radius: var(--uh-radius-md); padding: 16px 18px; margin: 12px 0;
}
.uh-token-box pre {
  font-family: "JetBrains Mono","IBM Plex Mono",monospace;
  font-size: .8rem; color: #a5f3fc; white-space: pre-wrap; word-break: break-all;
  margin: 0;
}
.uh-token-note { font-size: .775rem; color: #86efac; margin-top: 8px }

/* -- Server detail ------------------------------------------------------------ */
.uh-server-header {
  background: var(--uh-gradient-primary); border-radius: var(--uh-radius-xl);
  padding: 28px 28px 24px; margin-bottom: 20px; position: relative; overflow: hidden;
}
.uh-server-header::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 50%, rgba(0,212,255,.12), transparent 50%);
  pointer-events: none;
}
.uh-server-header h1 { color: #fff; margin-bottom: 4px }
.uh-server-header .meta {
  font-size: .875rem; color: rgba(255,255,255,.6); display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
}
.uh-server-header .meta strong { color: rgba(255,255,255,.85) }

.uh-metrics-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
  gap: 14px; margin-bottom: 20px;
}
.uh-metric-card {
  background: var(--uh-surface); border: 1px solid var(--uh-border);
  border-radius: var(--uh-radius-lg); padding: 16px 18px;
  box-shadow: var(--uh-shadow-sm);
}
.uh-metric-card .m-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--uh-text-muted); margin-bottom: 4px;
}
.uh-metric-card .m-value {
  font-size: 1.6rem; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--uh-text-main);
}
.uh-metric-card .m-sub { font-size: .75rem; color: var(--uh-text-muted); margin-top: 3px }
.uh-metric-card.accent-ok     { border-left: 3px solid var(--uh-ok) }
.uh-metric-card.accent-warn   { border-left: 3px solid var(--uh-warning) }
.uh-metric-card.accent-crit   { border-left: 3px solid var(--uh-critical) }
.uh-metric-card.accent-blue   { border-left: 3px solid var(--uh-primary-dark) }

/* Range tabs */
.uh-range-tabs { display: flex; gap: 4px; margin-bottom: 16px }
.uh-range-tabs a {
  padding: 6px 14px; border-radius: var(--uh-radius-sm);
  font-size: .8rem; font-weight: 600; color: var(--uh-text-muted);
  border: 1.5px solid var(--uh-border); background: var(--uh-surface);
}
.uh-range-tabs a.active, .uh-range-tabs a:hover {
  border-color: var(--uh-primary-dark); color: var(--uh-primary-dark);
  background: rgba(0,145,214,.06);
}

/* Charts */
.uh-chart-card {
  background: var(--uh-surface); border: 1px solid var(--uh-border);
  border-radius: var(--uh-radius-xl); padding: 20px; margin-bottom: 16px;
  box-shadow: var(--uh-shadow-sm);
}
.uh-chart-card h3 { font-size: .875rem; color: var(--uh-text-muted); margin-bottom: 14px; font-weight: 600 }
.uh-chart-wrap { position: relative; height: 180px }

/* Incidents */
.uh-incident-list { display: flex; flex-direction: column; gap: 8px }
.uh-incident {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-radius: var(--uh-radius-md);
  background: var(--uh-surface-soft); border: 1px solid var(--uh-border);
  font-size: .8125rem;
}
.uh-incident .inc-time { color: var(--uh-text-muted); white-space: nowrap; font-size: .75rem }
.uh-incident.resolved { opacity: .75 }

/* Server info specs grid */
.uh-spec-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px;
  margin-bottom: 20px;
}
.uh-spec {
  background: var(--uh-surface-soft); border: 1px solid var(--uh-border);
  border-radius: var(--uh-radius-md); padding: 12px 14px;
}
.uh-spec .spec-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--uh-text-muted) }
.uh-spec .spec-value { font-size: .875rem; font-weight: 600; margin-top: 3px; word-break: break-all }
.uh-spec .spec-value code { font-size: .825rem }

/* -- User management ---------------------------------------------------------- */
.uh-user-card {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--uh-border-soft);
}
.uh-user-card:last-child { border-bottom: none }
.uh-user-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(0,145,214,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem; font-weight: 800; color: var(--uh-primary-dark); flex-shrink: 0;
}
.uh-user-info { flex: 1; min-width: 0 }
.uh-user-info .name { font-weight: 700; font-size: .9rem }
.uh-user-info .email { font-size: .8rem; color: var(--uh-text-muted) }
.uh-user-actions { display: flex; gap: 6px; align-items: center }

/* -- Settings ----------------------------------------------------------------- */
.uh-settings-grid { display: grid; gap: 20px }

/* -- Footer ------------------------------------------------------------------- */
.uh-footer {
  background: var(--uh-dark-mid);
  border-top: 1px solid rgba(0,212,255,.1);
  padding: 18px 0;
}
.uh-footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  max-width: var(--uh-container); margin-inline: auto; padding: 0 20px;
}
.uh-footer img { height: 26px; width: auto; opacity: .7 }
.uh-footer-links { display: flex; gap: 16px; flex-wrap: wrap }
.uh-footer-links a { font-size: .775rem; color: rgba(255,255,255,.45) }
.uh-footer-links a:hover { color: rgba(255,255,255,.75) }
.uh-footer-copy { font-size: .775rem; color: rgba(255,255,255,.3) }

/* -- Login page --------------------------------------------------------------- */
.uh-login-page {
  display: grid; place-content: center; min-height: 100vh;
  background: var(--uh-gradient-primary); padding: 20px;
  position: relative; overflow: hidden;
}
.uh-login-page::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(0,212,255,.14), transparent 50%);
  pointer-events: none;
}
.uh-login-card {
  width: min(420px,100%); background: rgba(13,27,48,.95);
  border: 1px solid rgba(0,212,255,.18); border-radius: var(--uh-radius-xl);
  padding: 36px 32px; box-shadow: var(--uh-shadow-xl), var(--uh-glow);
  position: relative; z-index: 1;
}
.uh-login-card .logo-wrap {
  display: flex; justify-content: center; margin-bottom: 24px;
}
.uh-login-card .logo-wrap img { height: 40px; width: auto }
.uh-login-card h1 {
  text-align: center; color: #fff; font-size: 1.2rem; margin-bottom: 6px;
}
.uh-login-card .subtitle {
  text-align: center; font-size: .8rem; color: rgba(255,255,255,.45); margin-bottom: 24px;
}
.uh-login-field {
  width: 100%; min-height: 44px; padding: 11px 14px;
  border: 1.5px solid rgba(255,255,255,.12); border-radius: var(--uh-radius-md);
  background: rgba(255,255,255,.05); color: #fff; font-size: .875rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.uh-login-field:focus {
  outline: none;
  border-color: rgba(0,212,255,.5);
  box-shadow: 0 0 0 3px rgba(0,212,255,.08);
}
.uh-login-field::placeholder { color: rgba(255,255,255,.28) }
.uh-login-label { display: block; font-size: .8rem; font-weight: 600; color: rgba(255,255,255,.6); margin-bottom: 6px }
.uh-login-group { margin-bottom: 14px }
.uh-login-btn {
  width: 100%; min-height: 46px; margin-top: 6px;
  background: var(--uh-gradient-h); color: #fff; border: none;
  border-radius: var(--uh-radius-md); font-size: .9rem; font-weight: 700;
  cursor: pointer; transition: box-shadow .15s, transform .15s;
  box-shadow: var(--uh-shadow-md);
}
.uh-login-btn:hover { box-shadow: var(--uh-shadow-lg); transform: translateY(-1px) }
.uh-login-error {
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5; border-radius: var(--uh-radius-md);
  padding: 10px 13px; font-size: .8125rem; margin-bottom: 16px;
}

/* -- Empty states ------------------------------------------------------------- */
.uh-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 20px; text-align: center; color: var(--uh-text-muted);
}
.uh-empty .empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .4 }
.uh-empty p { max-width: 360px; font-size: .875rem }

/* -- Divider ------------------------------------------------------------------ */
.uh-divider {
  width: 100%; margin: 24px 0;
  display: grid; grid-template-columns: 1fr 32px 1fr;
  align-items: center; gap: 16px; pointer-events: none;
}
.uh-divider-line {
  height: 1px;
  background: linear-gradient(90deg,transparent,rgba(0,212,255,.28),rgba(0,145,214,.2),transparent);
}
.uh-divider-icon {
  width: 32px; height: 32px; display: block; border-radius: 8px;
  filter: drop-shadow(0 0 10px rgba(0,212,255,.25));
}

/* -- Section divider (brand) -------------------------------------------------- */
.uh-section-divider {
  width: 100%; margin: 32px 0;
  display: grid; grid-template-columns: 1fr 32px 1fr;
  align-items: center; gap: 16px;
}
.uh-section-divider-line {
  height: 1px;
  background: linear-gradient(90deg,transparent,rgba(0,212,255,.35),rgba(0,145,214,.22),transparent);
}
.uh-section-divider-icon { width: 32px; height: 32px; border-radius: 8px; display: block }

/* -- Utilities ---------------------------------------------------------------- */
.flex { display: flex }
.flex-col { flex-direction: column }
.items-center { align-items: center }
.gap-2 { gap: 8px }
.gap-3 { gap: 12px }
.gap-4 { gap: 16px }
.mt-2 { margin-top: 8px }
.mt-4 { margin-top: 16px }
.mt-6 { margin-top: 24px }
.mb-4 { margin-bottom: 16px }
.mb-6 { margin-bottom: 24px }
.text-muted { color: var(--uh-text-muted) }
.text-sm { font-size: .8125rem }
.text-xs { font-size: .75rem }
.font-mono { font-family: "JetBrains Mono","IBM Plex Mono",monospace }
.w-full { width: 100% }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px }

/* -- Responsive --------------------------------------------------------------- */
@media (max-width: 960px) {
  .uh-nav { display: none }
  .uh-nav.open { display: flex; flex-direction: column; align-items: stretch; gap: 2px }
  .uh-nav-toggle { display: flex }
  .uh-header { position: relative }
  .uh-header-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px }
  .uh-nav {
    width: 100%; order: 3;
    background: rgba(7,20,40,.97); border-top: 1px solid rgba(255,255,255,.06);
    padding: 10px 16px;
  }
  .uh-nav a { padding: 10px 12px }
}
@media (max-width: 640px) {
  .uh-stat-grid { grid-template-columns: 1fr 1fr }
  .uh-form-grid { grid-template-columns: 1fr }
  .uh-form-grid .full { grid-column: 1 }
  .uh-page-head { flex-direction: column; align-items: flex-start }
  .uh-metrics-grid { grid-template-columns: 1fr 1fr }
  .uh-server-header { padding: 20px 16px }
  .uh-login-card { padding: 24px 20px }
}
@media (max-width: 480px) {
  .uh-stat-grid { grid-template-columns: 1fr }
  .uh-metrics-grid { grid-template-columns: 1fr }
}

/* -- Reduced motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}

/* Focus states */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(0,212,255,.4);
  outline-offset: 3px;
}

/* ===================================================================
   Shield v2.0.0 -- sidebar + topbar shell
   =================================================================== */

/* -- Animations ---------------------------------------------------- */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.5) }
  70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0) }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0) }
}
@keyframes pulse-amber {
  0%   { box-shadow: 0 0 0 0 rgba(245,158,11,.5) }
  70%  { box-shadow: 0 0 0 6px rgba(245,158,11,0) }
  100% { box-shadow: 0 0 0 0 rgba(245,158,11,0) }
}

/* -- Shell layout -------------------------------------------------- */
body.sh-page { background: #EEF1F5 }
.sh-layout { display: flex; min-height: 100vh }

/* -- Sidebar ------------------------------------------------------- */
.sh-sidebar {
  width: 236px; flex-shrink: 0;
  background: linear-gradient(180deg,#0A1220 0%,#0B1730 100%);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
  overflow-y: auto; overflow-x: hidden;
}
.sh-sidebar.sh-admin { background: linear-gradient(180deg,#071428 0%,#0A1220 100%) }

.sh-sidebar-brand {
  padding: 20px 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0;
}
.sh-sidebar-brand img { height: 28px; width: auto; align-self: flex-start; object-fit: contain }

.sh-pro-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(0,212,255,.1); border: 1px solid rgba(0,212,255,.2);
  border-radius: 7px; padding: 4px 9px;
  font-size: .67rem; font-weight: 800; letter-spacing: .05em; color: #00D4FF;
  width: fit-content;
}
.sh-staff-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.25);
  border-radius: 7px; padding: 4px 9px;
  font-size: .67rem; font-weight: 800; letter-spacing: .05em; color: #EF4444;
  width: fit-content;
}

.sh-sidebar-nav {
  flex: 1; padding: 14px 10px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.sh-nav-label {
  padding: 0 8px 5px;
  font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.28);
}
.sh-nav-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 9px;
  font-size: .8rem; font-weight: 600;
  color: rgba(255,255,255,.6); text-decoration: none;
  transition: background .15s, color .15s; white-space: nowrap;
}
.sh-nav-link:hover { background: rgba(255,255,255,.06); color: #fff }
.sh-nav-link.active { background: rgba(0,212,255,.1); color: #fff }
.sh-nav-link.active i, .sh-nav-link.active .sh-nav-icon { color: #00D4FF }
.sh-nav-icon { width: 15px; text-align: center; flex-shrink: 0; font-size: .82rem; opacity: .75 }
.sh-nav-link:hover .sh-nav-icon { opacity: 1 }
.sh-nav-link.active .sh-nav-icon { opacity: 1 }
.sh-nav-badge {
  margin-left: auto; background: #EF4444; color: #fff;
  font-size: .58rem; font-weight: 800; padding: 1px 5px; border-radius: 999px;
  min-width: 16px; text-align: center;
}

.sh-sidebar-bottom {
  padding: 12px 10px 18px; flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sh-support-card {
  background: rgba(0,212,255,.05); border: 1px solid rgba(0,212,255,.12);
  border-radius: 11px; padding: 11px 12px;
}
.sh-support-card strong { display: block; font-size: .77rem; color: rgba(255,255,255,.75); font-weight: 700; margin-bottom: 3px }
.sh-support-card p { font-size: .73rem; color: rgba(255,255,255,.45); margin-bottom: 9px; line-height: 1.4 }
.sh-btn-support {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  width: 100%; padding: 7px 10px; border-radius: 8px;
  background: linear-gradient(90deg,#00D4FF,#0091D6);
  color: #04121f !important; font-size: .75rem; font-weight: 700; text-decoration: none;
  transition: box-shadow .15s;
}
.sh-btn-support:hover { box-shadow: 0 4px 14px rgba(0,145,214,.35) }

/* -- Content area -------------------------------------------------- */
.sh-content { margin-left: 236px; flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh }

/* -- Topbar -------------------------------------------------------- */
.sh-topbar {
  height: 60px; background: #fff;
  border-bottom: 1px solid #E7EBF0;
  display: flex; align-items: center;
  padding: 0 24px; gap: 10px; flex-shrink: 0;
  position: sticky; top: 0; z-index: 100;
}
.sh-topbar-search {
  flex: 1; max-width: 280px; min-width: 0;
  display: flex; align-items: center; gap: 7px;
  background: #F8FAFC; border: 1px solid #E7EBF0; border-radius: 9px; padding: 7px 11px;
}
.sh-topbar-search input {
  border: none; background: transparent;
  font-size: .8125rem; color: #0A1220; width: 100%; outline: none; font-family: inherit;
}
.sh-topbar-search input::placeholder { color: #94A3B8 }
.sh-topbar-search-icon { color: #94A3B8; font-size: .82rem; flex-shrink: 0 }
.sh-topbar-status {
  display: flex; align-items: center; gap: 5px;
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.25);
  border-radius: 999px; padding: 4px 11px;
  font-size: .73rem; font-weight: 700; color: #16A34A; white-space: nowrap; flex-shrink: 0;
}
.sh-topbar-status.has-issues {
  background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); color: #B45309;
}
.sh-topbar-dot { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; animation: pulse-ring 2.4s infinite }
.sh-topbar-status.has-issues .sh-topbar-dot { background: #F59E0B; animation: pulse-amber 1.8s infinite }
.sh-topbar-gap { flex: 1 }
.sh-topbar-icon-btn {
  width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: #64748B; cursor: pointer; background: transparent; border: none; font-size: .85rem;
  transition: background .15s; text-decoration: none; flex-shrink: 0;
}
.sh-topbar-icon-btn:hover { background: #F1F5F9; color: #0A1220 }
.sh-topbar-menu-btn {
  display: none; width: 34px; height: 34px; border-radius: 8px;
  align-items: center; justify-content: center;
  color: #64748B; cursor: pointer; background: transparent; border: none; font-size: 1rem;
  transition: background .15s; flex-shrink: 0;
}
.sh-topbar-menu-btn:hover { background: #F1F5F9; color: #0A1220 }
.sh-topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding-left: 10px; border-left: 1px solid #E7EBF0; flex-shrink: 0;
}
.sh-topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg,#00D4FF,#0091D6);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; color: #04121f; flex-shrink: 0;
}
.sh-topbar-user-info .u-name { font-size: .8rem; font-weight: 600; color: #0A1220; line-height: 1.2 }
.sh-topbar-user-info .u-role { font-size: .68rem; color: #64748B }

/* -- Page body ----------------------------------------------------- */
.sh-body { flex: 1; padding: 26px; background: #EEF1F5 }

/* -- Page head ----------------------------------------------------- */
.sh-page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 22px;
}
.sh-eyebrow {
  font-size: .62rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: #0091D6; margin-bottom: 4px;
}
.sh-page-h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; color: #0A1220; margin: 0; line-height: 1.2 }
.sh-page-sub { font-size: .8rem; color: #64748B; margin-top: 4px }
.sh-page-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0 }
.sh-btn-refresh {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 9px;
  font-size: .8rem; font-weight: 600; cursor: pointer;
  background: #fff; color: #334155; border: 1.5px solid #E7EBF0; text-decoration: none;
  transition: border-color .15s, color .15s;
}
.sh-btn-refresh:hover { border-color: #0091D6; color: #0091D6 }
.sh-btn-add {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 9px;
  font-size: .8rem; font-weight: 700; cursor: pointer;
  background: linear-gradient(90deg,#00D4FF,#0091D6);
  color: #04121f !important; border: none; text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,145,214,.3); transition: box-shadow .15s;
}
.sh-btn-add:hover { box-shadow: 0 6px 20px rgba(0,145,214,.45) }
.sh-btn-warn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 9px;
  font-size: .8rem; font-weight: 700; cursor: pointer;
  background: #F59E0B; color: #000; border: none; text-decoration: none;
}

/* -- Hero row (donut + gauges) ------------------------------------- */
.sh-hero-row { display: grid; grid-template-columns: 290px 1fr; gap: 16px; margin-bottom: 24px }
.sh-fleet-card {
  background: #fff; border: 1px solid #E7EBF0; border-radius: 16px;
  box-shadow: 0 2px 10px rgba(10,18,32,.04);
  padding: 20px; display: flex; flex-direction: column;
}
.sh-agg-card {
  background: radial-gradient(120% 120% at 50% 0%, #0f2036 0%, #0A1220 60%, #070e1a 100%);
  border: 1px solid #1c2c44; border-radius: 16px;
  box-shadow: 0 8px 30px rgba(10,18,32,.18);
  padding: 20px 22px; display: flex; flex-direction: column;
}
.sh-card-sec-title {
  font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: #64748B; margin-bottom: 14px;
}
.sh-donut-wrap { display: flex; justify-content: center; margin-bottom: 14px }
.sh-donut-legend { display: flex; flex-direction: column; gap: 6px; margin-top: auto }
.sh-donut-row {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; color: #334155;
}
.sh-donut-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0 }
.sh-donut-count { margin-left: auto; font-weight: 800; color: #0A1220; font-size: .8rem }

.sh-gauges-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px }
.sh-gauge-block { text-align: center; flex: 1 }
.sh-gauge-lbl { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748B; margin-top: 4px }
.sh-gauges { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; align-items: start; margin-bottom: 14px }

.sh-stat-strip {
  display: grid; grid-template-columns: repeat(4,1fr);
  background: #E7EBF0; border-radius: 10px; overflow: hidden;
  gap: 1px; border: 1px solid #E7EBF0; margin-top: auto;
}
.sh-strip-cell { background: #FAFBFC; padding: 8px 6px; text-align: center }
.sh-strip-val { font-size: .78rem; font-weight: 800; color: #0A1220; font-family: "JetBrains Mono","IBM Plex Mono",monospace; display: block }
.sh-strip-lbl { font-size: .6rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #94A3B8; display: block; margin-top: 2px }

/* -- Server cards grid --------------------------------------------- */
.sh-section-title { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #64748B; margin-bottom: 12px }
.sh-server-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px }

.sh-server-card {
  background: #fff; border: 1px solid #E7EBF0; border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(10,18,32,.04);
  transition: transform .2s, box-shadow .2s;
}
.sh-server-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(10,18,32,.10) }
.sh-server-card-link { display: block; text-decoration: none; color: inherit }

.sh-sc-head { padding: 14px 14px 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px }
.sh-sc-name-row { display: flex; align-items: center; gap: 7px; min-width: 0 }
.sh-status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0 }
.sh-status-dot.s-ok       { background: #22C55E; animation: pulse-ring  2.4s infinite }
.sh-status-dot.s-warning  { background: #F59E0B; animation: pulse-amber 1.8s infinite }
.sh-status-dot.s-critical { background: #EF4444 }
.sh-status-dot.s-offline  { background: #94A3B8 }

.sh-sc-name { font-weight: 700; font-size: .875rem; color: #0A1220; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px }
.sh-sc-pill { font-size: .58rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; white-space: nowrap; flex-shrink: 0 }
.sh-pill-ok       { background: rgba(34,197,94,.12);  color: #16A34A }
.sh-pill-warning  { background: rgba(245,158,11,.16); color: #B45309 }
.sh-pill-critical { background: rgba(239,68,68,.1);   color: #DC2626 }
.sh-pill-offline  { background: rgba(100,116,139,.12);color: #475569 }

.sh-sc-ip { padding: 0 14px 8px; font-family: "JetBrains Mono","IBM Plex Mono",monospace; font-size: .71rem; color: #94A3B8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.sh-sparkline-wrap { padding: 0 14px 0; height: 56px; display: flex; align-items: center }
.sh-sparkline-wrap svg { width: 100%; height: 56px; display: block }
.sh-sc-foot { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid #F1F4F8; margin-top: 8px }
.sh-foot-cell { padding: 9px 8px; text-align: center; border-right: 1px solid #F1F4F8 }
.sh-foot-cell:last-child { border-right: none }
.sh-foot-val { font-size: .85rem; font-weight: 800; color: #0A1220; font-family: "JetBrains Mono","IBM Plex Mono",monospace; display: block }
.sh-foot-val.fv-warn { color: #F59E0B }
.sh-foot-val.fv-crit { color: #EF4444 }
.sh-foot-lbl { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #94A3B8; display: block; margin-top: 1px }

/* Empty server grid state */
.sh-server-empty {
  grid-column: 1/-1;
  background: #fff; border: 1px solid #E7EBF0; border-radius: 16px;
  padding: 48px 24px; text-align: center; color: #64748B;
}
.sh-server-empty .ico { font-size: 2.2rem; margin-bottom: 10px; opacity: .3 }
.sh-server-empty p { font-size: .875rem; max-width: 340px; margin: 0 auto }

/* -- KPI row (server detail) --------------------------------------- */
.sh-kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px }
.sh-kpi-card {
  background: #fff; border: 1px solid #E7EBF0; border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 2px 10px rgba(10,18,32,.04); display: flex; align-items: flex-start; gap: 12px;
}
.sh-kpi-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.sh-kpi-icon.ok   { background: rgba(34,197,94,.1);  color: #16A34A }
.sh-kpi-icon.warn { background: rgba(245,158,11,.1); color: #B45309 }
.sh-kpi-icon.crit { background: rgba(239,68,68,.1);  color: #DC2626 }
.sh-kpi-icon.blue { background: rgba(0,145,214,.1);  color: #0091D6 }
.sh-kpi-val { font-size: 1.35rem; font-weight: 800; color: #0A1220; line-height: 1; margin-bottom: 3px }
.sh-kpi-lbl { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #64748B }
.sh-kpi-sub { font-size: .7rem; color: #94A3B8; margin-top: 3px }

/* -- Server detail layout ------------------------------------------ */
.sh-detail-grid { display: grid; grid-template-columns: 1fr 260px; gap: 16px; margin-bottom: 20px; align-items: start }
.sh-degraded-notice {
  background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.3);
  border-left: 4px solid #F59E0B; border-radius: 10px; padding: 13px 16px; margin-bottom: 18px;
  font-size: .8rem; color: #92400e; display: flex; gap: 10px; align-items: flex-start; line-height: 1.5;
}
.sh-degraded-notice.critical { background: rgba(239,68,68,.06); border-color: rgba(239,68,68,.3); border-left-color: #EF4444; color: #991b1b }

/* Live gauges (right-now card) */
.sh-live-gauge { margin-bottom: 14px }
.sh-lg-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px }
.sh-lg-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #64748B }
.sh-lg-value { font-size: .8rem; font-weight: 800; color: #0A1220 }
.sh-lg-bar { height: 7px; background: #F1F4F8; border-radius: 999px; overflow: hidden }
.sh-lg-fill { height: 100%; border-radius: 999px; background: #22C55E; transition: width .4s }
.sh-lg-fill.warn { background: #F59E0B }
.sh-lg-fill.crit { background: #EF4444 }

/* -- Login v2 split screen ----------------------------------------- */
.sh-login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr }
.sh-login-brand {
  background: linear-gradient(135deg,#0A1220 0%,#0D1B30 45%,#0F2040 72%,#071428 100%);
  padding: 48px 52px; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.sh-login-brand::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 18% 20%, rgba(0,212,255,.16), transparent 38%);
  pointer-events: none;
}
.sh-login-brand > * { position: relative; z-index: 1 }
.sh-login-brand-img { height: 28px; max-width: 160px; width: auto; align-self: flex-start; object-fit: contain; margin-bottom: 20px }
.sh-login-brand-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,212,255,.1); border: 1px solid rgba(0,212,255,.2);
  border-radius: 999px; padding: 4px 13px; margin-bottom: 28px;
  font-size: .68rem; font-weight: 800; letter-spacing: .08em; color: #00D4FF; width: fit-content;
}
.sh-login-brand h1 {
  font-size: clamp(1.25rem,2.2vw,1.75rem); font-weight: 700; color: rgba(255,255,255,.82);
  letter-spacing: -.01em; line-height: 1.25; margin-bottom: 32px;
}
.sh-login-features { display: flex; flex-direction: column; gap: 14px; flex: 1 }
.sh-login-feature { display: flex; align-items: flex-start; gap: 12px }
.sh-login-feature-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: rgba(0,212,255,.1); border: 1px solid rgba(0,212,255,.18);
  display: flex; align-items: center; justify-content: center; font-size: .82rem; color: #00D4FF;
}
.sh-login-feature-txt strong { display: block; font-size: .855rem; font-weight: 700; color: #fff; margin-bottom: 1px }
.sh-login-feature-txt span { font-size: .77rem; color: rgba(255,255,255,.46) }
.sh-login-brand-copy { font-size: .7rem; color: rgba(255,255,255,.22); margin-top: 28px }
.sh-login-form-panel {
  background: #fff; display: flex; align-items: center; justify-content: center; padding: 40px 32px;
}
.sh-login-form-inner { width: min(400px,100%); display: flex; flex-direction: column }
.sh-login-logo-row { display: flex; align-items: center; margin-bottom: 28px }
.sh-login-logo-txt { font-size: 1.75rem; font-weight: 900; color: #0A1220; letter-spacing: -.03em; line-height: 1 }
.sh-login-logo-txt span { color: #0091D6 }
.sh-login-h2 { font-size: 1.35rem; font-weight: 800; color: #0A1220; letter-spacing: -.01em; margin-bottom: 5px }
.sh-login-sub { font-size: .82rem; color: #64748B; margin-bottom: 24px }
.sh-login-err {
  background: #FEF2F2; border: 1px solid #FECACA; border-radius: 9px;
  padding: 10px 13px; margin-bottom: 16px; font-size: .8125rem; color: #DC2626;
  display: flex; gap: 8px; align-items: center;
}
.sh-lf-group { margin-bottom: 15px }
.sh-lf-label { display: block; font-size: .8rem; font-weight: 600; color: #334155; margin-bottom: 5px }
.sh-lf-wrap { position: relative }
.sh-lf-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94A3B8; font-size: .82rem; pointer-events: none }
.sh-lf-input {
  width: 100%; height: 44px; padding: 10px 13px 10px 36px;
  border: 1.5px solid #E7EBF0; border-radius: 10px;
  background: #FAFBFC; color: #0A1220; font-size: .875rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.sh-lf-input:focus { outline: none; border-color: #0091D6; box-shadow: 0 0 0 3px rgba(0,145,214,.08); background: #fff }
.sh-lf-input::placeholder { color: #C0CADA }
.sh-lf-eye { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 4px; color: #94A3B8; font-size: .82rem }
.sh-lf-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 8px }
.sh-lf-check { display: flex; align-items: center; gap: 7px; font-size: .8rem; color: #475569; cursor: pointer }
.sh-lf-check input { width: 15px; height: 15px; accent-color: #0091D6; cursor: pointer; margin: 0 }
.sh-btn-signin {
  width: 100%; height: 46px; background: linear-gradient(90deg,#00D4FF,#0091D6);
  color: #04121f; font-size: .9rem; font-weight: 700; border: none; border-radius: 10px;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,145,214,.32);
  transition: box-shadow .15s, transform .15s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.sh-btn-signin:hover { box-shadow: 0 6px 20px rgba(0,145,214,.45); transform: translateY(-1px) }
.sh-login-tls { text-align: center; font-size: .7rem; color: #94A3B8; margin-top: 11px }
.sh-login-foot {
  text-align: center; margin-top: 22px; padding-top: 18px; border-top: 1px solid #F1F4F8;
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; font-size: .77rem;
}
.sh-login-foot a { color: #64748B }
.sh-login-foot a:hover { color: #0091D6 }

/* -- Sidebar overlay (mobile) -------------------------------------- */
.sh-sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 199;
}
.sh-sidebar-overlay.sh-open { display: block }

/* -- Responsive ---------------------------------------------------- */
@media (max-width: 1200px) {
  .sh-server-grid { grid-template-columns: repeat(2,1fr) }
}
@media (max-width: 1023px) {
  .sh-sidebar { width: 210px }
  .sh-content { margin-left: 210px }
  .sh-hero-row { grid-template-columns: 260px 1fr }
  .sh-kpi-grid { grid-template-columns: repeat(2,1fr) }
  .sh-detail-grid { grid-template-columns: 1fr }
}
@media (max-width: 768px) {
  .sh-sidebar { transform: translateX(-100%); transition: transform .25s; width: 236px }
  .sh-sidebar.sh-open { transform: translateX(0) }
  .sh-content { margin-left: 0 }
  .sh-topbar-menu-btn { display: flex }
  .sh-hero-row { grid-template-columns: 1fr }
  .sh-server-grid { grid-template-columns: 1fr }
  .sh-body { padding: 16px }
  .sh-topbar { padding: 0 16px }
}
@media (max-width: 640px) {
  .sh-kpi-grid { grid-template-columns: repeat(2,1fr) }
  .sh-login-page { grid-template-columns: 1fr }
  .sh-login-brand { display: none }
  .sh-stat-strip { grid-template-columns: repeat(2,1fr) }
}
@media (max-width: 480px) {
  .sh-kpi-grid { grid-template-columns: 1fr }
  .sh-gauges-row, .sh-gauges { gap: 6px }
}

/* ===================================================================
   Shield v2.0.1 -- Mobile responsive pass
   =================================================================== */

/* -- Global overflow prevention ------------------------------------ */
html { overflow-x: hidden }
body.sh-page { overflow-x: hidden }

/* -- Server detail action buttons ---------------------------------- */
/* Replaces inline style="display:flex;gap:8px;flex-shrink:0;..." */
.sd-server-acts {
  display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; align-items: center;
}
@media (max-width: 640px) {
  .sd-server-acts { width: 100%; flex-shrink: 1 }
  .sd-server-acts .uh-btn { flex: 1; min-width: 0; justify-content: center; text-align: center }
  .sd-server-acts form { flex: 1; min-width: 0; margin: 0 }
  .sd-server-acts form .uh-btn { width: 100%; justify-content: center }
}

/* -- Topbar: compact on mobile ------------------------------------- */
@media (max-width: 640px) {
  /* Hide user name/role text, keep the avatar circle */
  .sh-topbar-user-info { display: none }
  .sh-topbar-user { padding-left: 6px; border-left-color: transparent }
  /* Reduce topbar gap */
  .sh-topbar { gap: 6px }
  /* Status pill: show only the dot indicator, hide text */
  .sh-topbar-status { font-size: 0; line-height: 0; padding: 7px 8px; border-radius: 50% }
  .sh-topbar-status .sh-topbar-dot { margin: 0 }
  /* Hide non-essential icon buttons (refresh, bell) */
  .sh-topbar-icon-btn { display: none }
  /* Allow search to grow into available space */
  .sh-topbar-search { max-width: none; flex: 1 }
}
@media (max-width: 430px) {
  /* On very small screens hide search, only keep hamburger + status dot + avatar */
  .sh-topbar-search { display: none }
}

/* -- Sidebar: prevent content overflow ----------------------------- */
@media (max-width: 768px) {
  /* Ensure content never bleeds past viewport when sidebar is hidden */
  .sh-content { max-width: 100vw }
}

/* -- Tables: ensure process cmd column does not blow width on mobile */
@media (max-width: 640px) {
  .uh-table td:last-child { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
  /* Incident list: hide exact UTC timestamp on mobile to save space */
  .uh-incident .inc-time { display: none }
}

/* -- Spec grid: single column on very small screens ---------------- */
@media (max-width: 400px) {
  .uh-spec-grid { grid-template-columns: 1fr }
}

/* -- Metric cards: equal in 2 cols even at small sizes ------------- */
@media (max-width: 400px) {
  .uh-metrics-grid { grid-template-columns: 1fr }
}

/* -- KPI cards: 2-col at narrow phones, 1-col only at <=400px ------ */
@media (max-width: 640px) {
  .sh-kpi-grid { grid-template-columns: repeat(2,1fr) }
}
@media (max-width: 400px) {
  .sh-kpi-grid { grid-template-columns: 1fr }
  .sh-kpi-card { padding: 12px 14px }
  .sh-kpi-val { font-size: 1.1rem }
}

/* -- Chart cards: proper containment ------------------------------- */
.uh-chart-card { overflow: hidden }
.uh-chart-wrap canvas { max-width: 100% }

/* -- Range tabs: wrap on mobile ------------------------------------ */
@media (max-width: 480px) {
  .uh-range-tabs { flex-wrap: wrap }
  .uh-range-tabs a { flex: 1; text-align: center; min-width: 80px }
}

/* -- Degraded notices: prevent content overflow -------------------- */
.sh-degraded-notice { word-break: break-word }

/* -- Token box: ensure install command wraps ----------------------- */
.uh-token-box pre { white-space: pre-wrap; word-break: break-all }

/* -- User management cards: stack on mobile ------------------------ */
@media (max-width: 480px) {
  .uh-user-card { flex-direction: column; align-items: flex-start }
  .uh-user-actions { width: 100% }
  .uh-user-actions .uh-btn { flex: 1; justify-content: center }
}

/* -- Dashboard hero row: fix gauge row overflow on mobile ---------- */
@media (max-width: 480px) {
  .sh-gauges-row { flex-wrap: wrap; justify-content: center }
  .sh-gauge-block { min-width: 80px }
  .sh-gauges { grid-template-columns: repeat(3,minmax(0,1fr)) }
}

/* -- Login branding: refine UnderShield trademark appearance ------- */
.sh-login-logo-txt span { color: #00D4FF }

/* -- Prevent chart containers from overflowing on narrow screens --- */
.sh-fleet-card, .sh-agg-card { overflow: hidden }
.sh-agg-card svg { max-width: 100%; height: auto }

/* -- v2.0.4 dashboard improvements -------------------------------- */
/* Sidebar nav logout section */
.sh-nav-logout { margin-top: auto; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.06) }
.sh-nav-link-logout { color: rgba(255,255,255,.38) }
.sh-nav-link-logout:hover { color: rgba(255,255,255,.7) }
.sh-nav-link-danger { color: rgba(239,68,68,.7) !important }
.sh-nav-link-danger:hover { color: #EF4444 !important }

/* Aggregate card header row */
.sh-agg-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0 }
.sh-agg-fleet-lbl { font-size: .64rem; font-weight: 600; letter-spacing: .04em; color: #94A3B8; font-family: "JetBrains Mono","IBM Plex Mono",monospace }
.sh-agg-card .sh-card-sec-title { color: rgba(255,255,255,.85) }
.sh-agg-card .sh-agg-fleet-lbl  { color: rgba(255,255,255,.35) }

/* Dark stat strip variant (aggregate card) */
.sh-stat-strip-dark { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08) }
.sh-stat-strip-dark .sh-strip-cell { background: transparent }
.sh-stat-strip-dark .sh-strip-val  { color: rgba(255,255,255,.9) }
.sh-stat-strip-dark .sh-strip-lbl  { color: rgba(255,255,255,.35) }

/* Stat strip alert value */
.sh-strip-val-warn { color: #EF4444 }

/* Server card IP separator */
.sh-sc-ip-sep { color: #CBD5E1; margin: 0 3px }

/* -- v2.1.4 admin panel tables ------------------------------------- */
.adm-table { width: 100%; border-collapse: collapse; font-size: .82rem }
.adm-table th { text-align: left; padding: 8px 12px; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748B; border-bottom: 1px solid #E7EBF0; white-space: nowrap }
.adm-table td { padding: 10px 12px; border-bottom: 1px solid #F1F4F8; vertical-align: middle }
.adm-table tbody tr:last-child td { border-bottom: none }
.adm-table tbody tr:hover { background: #F8FAFC }

/* Admin table metric cells */
.adm-metric { font-family: "JetBrains Mono","IBM Plex Mono",monospace; font-size: .78rem; font-weight: 600 }
.fv-warn { color: #D97706 }
.fv-crit { color: #DC2626; font-weight: 700 }

/* -- v2.1.22 server card instrument panel -------------------------- */
.sh-card-panel   { background: radial-gradient(120% 130% at 50% 0%, #0f2036 0%, #0A1220 62%, #070e1a 100%); padding: 15px 15px 14px }
.sh-card-dials   { display: grid; grid-template-columns: 108px 1fr; gap: 12px; align-items: center }
.sh-card-minis   { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px }
.sh-card-load    { margin-top: 13px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08) }
.sh-card-load-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px;
                     font-size: 9.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: rgba(255,255,255,.5) }
.sh-card-load-head .mono { font-weight: 800; color: #34D399 }
.sh-card-uptime  { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px;
                   border-top: 1px solid #F1F4F8; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
                   letter-spacing: .05em; color: #94A3B8 }
.sh-card-uptime .mono { font-size: 12.5px; color: #0A1220 }
.sh-card-move    { display: flex; gap: 8px; align-items: center; padding: 11px 14px; border-top: 1px solid #F1F4F8; background: #FAFBFC }
.sh-card-move i        { color: #94A3B8; font-size: 12px; flex-shrink: 0 }
.sh-card-move select   { flex: 1; min-width: 0; height: 34px; border: 1px solid #E2E6EC; border-radius: 9px; padding: 0 10px; font-size: 12.5px; color: #334155; background: #fff; cursor: pointer }
.sh-card-move button   { height: 34px; padding: 0 16px; border: none; border-radius: 9px; background: linear-gradient(90deg,#00D4FF,#0091D6); color: #04121f; font-weight: 700; font-size: 12.5px; cursor: pointer; flex-shrink: 0 }
@media (max-width: 480px) { .sh-card-dials { grid-template-columns: 1fr } .sh-card-minis { margin-top: 4px } }

/* ── v2.1.23: Smart Recommendations ──────────────────────────────────────── */
.sd-recs-card .uh-card-body  { padding: 0 }
.sd-rec-item  { display: flex; align-items: flex-start; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--uh-border); font-size: .84rem; line-height: 1.5 }
.sd-rec-item:last-child { border-bottom: none }

/* ── v2.1.23: Connections by IP ──────────────────────────────────────────── */
.sd-conn-alert { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: .84rem; font-weight: 600 }
.sd-conn-alert.critical { background: rgba(239,68,68,.08); border-bottom: 1px solid rgba(239,68,68,.2); color: #EF4444 }
.sd-conn-alert.warn     { background: rgba(245,158,11,.08); border-bottom: 1px solid rgba(245,158,11,.2); color: #F59E0B }
.sd-conn-filters { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--uh-border); flex-wrap: wrap }
.sd-conn-filters button { padding: 3px 10px; border: 1px solid var(--uh-border); border-radius: 6px; background: var(--uh-bg); color: var(--uh-text-muted); font-size: .75rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s }
.sd-conn-filters button.active, .sd-conn-filters button:hover { background: var(--uh-primary); color: #fff; border-color: var(--uh-primary) }
.sd-conn-table td { vertical-align: middle }
.sd-risk-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em }
.risk-normal     { background: rgba(34,197,94,.12);  color: #22C55E }
.risk-watch      { background: rgba(245,158,11,.12); color: #F59E0B }
.risk-suspicious { background: rgba(249,115,22,.12); color: #F97316 }
.risk-critical   { background: rgba(239,68,68,.14);  color: #EF4444 }
.risk-info       { background: rgba(246,130,31,.10); color: #F6821F }

/* ── v2.1.23: Admin Notes ────────────────────────────────────────────────── */
.sd-notes-list { display: flex; flex-direction: column; gap: 10px }
.sd-note { border: 1px solid var(--uh-border); border-radius: 8px; padding: 12px 14px; position: relative }
.sd-note-pinned { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.04) }
.sd-note-meta { display: flex; align-items: center; gap: 8px; font-size: .78rem; margin-bottom: 6px; flex-wrap: wrap }
.sd-note-text { font-size: .84rem; line-height: 1.55; color: var(--uh-text); white-space: pre-wrap; word-break: break-word }
.sd-note-del  { position: absolute; top: 10px; right: 10px; padding: 2px 8px; font-size: .7rem }
