/* =========================================================
   CT Pulse — Design System
   ========================================================= */

/* Self-hosted Inter — no external CDN dependency */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300; font-display: swap; src: url('../fonts/inter-300.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/inter-800.woff2') format('woff2'); }
@font-face { font-family: 'Russo One'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/russo-one-400.woff2') format('woff2'); }

/* ---------------------------------------------------------
   CSS Custom Properties — Original CT Pulse Design System
   --------------------------------------------------------- */
:root {
  --bg-primary:    #0c0e12;
  --bg-secondary:  #10131a;
  --bg-card:       rgba(255,255,255,0.035);
  --bg-card-hover: rgba(255,255,255,0.06);
  --border:        rgba(255,255,255,0.08);
  --border-hover:  rgba(255,255,255,0.14);
  --text-primary:  #b8c4d0;
  --text-secondary:#7a8a98;
  /* Was #4a5568 (~2.5:1 on the dark bg — failed WCAG AA, read as washed-out
     subtitle text the design DNA bans). Lifted to ~4.6:1 so muted/help text is
     legible app-wide; still a notch below --text-secondary to keep hierarchy.
     Only non-text uses are the neutral "unknown" status dots/borders, which a
     slightly lighter shade only improves. */
  --text-muted:    #76838f;
  --accent:        #10b981;
  --accent-light:  #34d399;
  --accent-glow:   rgba(16,185,129,0.2);
  --green:         #10b981;
  --green-glow:    rgba(16,185,129,0.15);
  --red:           #ef4444;
  --red-glow:      rgba(239,68,68,0.2);
  --amber:         #f59e0b;
  --amber-glow:    rgba(245,158,11,0.2);
  --blue:          #3b82f6;
  --blue-glow:     rgba(59,130,246,0.15);
  --teal:          #14b8a6;
  --teal-glow:     rgba(20,184,166,0.15);
  --purple:        #a855f7;
  --purple-glow:   rgba(168,85,247,0.15);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --radius-xl:     20px;
  --shadow:        0 1px 2px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2), 0 12px 28px rgba(0,0,0,0.15);
  --shadow-lg:     0 2px 4px rgba(0,0,0,0.4), 0 8px 20px rgba(0,0,0,0.3), 0 20px 50px rgba(0,0,0,0.25);
  --shadow-xl:     0 4px 8px rgba(0,0,0,0.5), 0 12px 32px rgba(0,0,0,0.35), 0 32px 64px rgba(0,0,0,0.25);
  --transition:    0.2s ease;
  --sidebar-width: 240px;
}

/* ---------------------------------------------------------
   Reset & Base — Cyber green atmosphere
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; color-scheme: dark; }

/* Force dark on ALL native form controls — no white anywhere */
input, select, textarea, button { color-scheme: dark; }
input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0;
}
input[type=number] { -moz-appearance: textfield; }
input[type=date]::-webkit-calendar-picker-indicator,
input[type=datetime-local]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(3) hue-rotate(100deg);
}
input[type=color] { -webkit-appearance: none; border: none; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type=color]::-webkit-color-swatch { border: 1px solid rgba(16,185,129,0.2); border-radius: 4px; }
input[type=range] { -webkit-appearance: none; background: transparent; }
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; background: rgba(16,185,129,0.15); border-radius: 2px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg-primary);
  margin-top: -6px; cursor: pointer;
  box-shadow: 0 0 6px rgba(16,185,129,0.3);
}
input[type=range]::-moz-range-track {
  height: 4px; background: rgba(16,185,129,0.15); border-radius: 2px; border: none;
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg-primary); cursor: pointer;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: #6ee7b7; text-decoration: underline; }
.nav-item:hover, .btn:hover, .sidebar a:hover { text-decoration: none; }

img, svg { display: block; }

button, input, select, textarea {
  font-family: inherit;
  font-size: 0.875rem;
}

/* ---------------------------------------------------------
   Scrollbar
   --------------------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ---------------------------------------------------------
   Keyframe Animations
   --------------------------------------------------------- */
@keyframes pulse-green {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0  rgba(16,185,129,0.7); }
  50%       { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(16,185,129,0); }
}

@keyframes pulse-red {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0  rgba(239,68,68,0.7); }
  50%       { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(239,68,68,0); }
}

@keyframes breathe-green {
  0%, 100% { opacity: 1;   box-shadow: 0 0 6px 2px  rgba(16,185,129,0.6); }
  50%       { opacity: 0.7; box-shadow: 0 0 12px 4px rgba(16,185,129,0.3); }
}

@keyframes breathe-red {
  0%, 100% { opacity: 1;   box-shadow: 0 0 6px 2px  rgba(239,68,68,0.6); }
  50%       { opacity: 0.7; box-shadow: 0 0 12px 4px rgba(239,68,68,0.3); }
}

@keyframes breathe-amber {
  0%, 100% { opacity: 1;   box-shadow: 0 0 6px 2px  rgba(245,158,11,0.6); }
  50%       { opacity: 0.7; box-shadow: 0 0 12px 4px rgba(245,158,11,0.3); }
}

@keyframes gradient-shift {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

@keyframes slide-in-right {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slide-out-right {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

@keyframes fade-in-scale {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes mesh-move {
  0%   { transform: translate(0,     0)   rotate(0deg); }
  33%  { transform: translate(30px, -20px) rotate(120deg); }
  66%  { transform: translate(-20px,30px) rotate(240deg); }
  100% { transform: translate(0,     0)   rotate(360deg); }
}

/* ---------------------------------------------------------
   Status Dot
   --------------------------------------------------------- */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.up      { background: var(--green); animation: breathe-green 2s ease infinite; }
.status-dot.down    { background: var(--red);   animation: breathe-red   2s ease infinite; }
.status-dot.amber   { background: var(--amber); animation: breathe-amber 2s ease infinite; }
.status-dot.unknown { background: var(--text-muted); }

/* Larger animated ring for banner */
.status-ring {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.status-ring.up   { background: var(--green-glow); animation: pulse-green 2.5s ease infinite; }
.status-ring.down { background: var(--red-glow);   animation: pulse-red   2.5s ease infinite; }
.status-ring-inner { width: 24px; height: 24px; border-radius: 50%; }
.status-ring.up   .status-ring-inner { background: var(--green); box-shadow: 0 0 12px rgba(16,185,129,0.8); }
.status-ring.down .status-ring-inner { background: var(--red);   box-shadow: 0 0 12px rgba(239,68,68,0.8); }

/* ---------------------------------------------------------
   Badges
   --------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.badge-green  { background: var(--green-glow);      color: var(--green);         border: 1px solid rgba(16,185,129,0.3);  box-shadow: 0 3px 10px rgba(0,0,0,0.4), 0 0 12px rgba(16,185,129,0.2); }
.badge-red    { background: var(--red-glow);         color: var(--red);           border: 1px solid rgba(239,68,68,0.3);   box-shadow: 0 3px 10px rgba(0,0,0,0.4), 0 0 12px rgba(239,68,68,0.2); }
.badge-amber  { background: var(--amber-glow);       color: var(--amber);         border: 1px solid rgba(245,158,11,0.3);  box-shadow: 0 3px 10px rgba(0,0,0,0.4), 0 0 12px rgba(245,158,11,0.18); }
.badge-purple, .badge-accent { background: var(--accent-glow); color: var(--accent-light);  border: 1px solid rgba(16,185,129,0.3);   box-shadow: 0 3px 10px rgba(0,0,0,0.4), 0 0 12px rgba(16,185,129,0.2); }
.badge-indigo { background: rgba(16,185,129,0.1);    color: var(--accent-light);  border: 1px solid rgba(16,185,129,0.25); box-shadow: 0 3px 10px rgba(0,0,0,0.4), 0 0 8px rgba(16,185,129,0.1); }
.badge-gray   { background: rgba(255,255,255,0.05);  color: var(--text-secondary);border: 1px solid var(--border);         box-shadow: 0 3px 10px rgba(0,0,0,0.35); }
.badge-blue   { background: rgba(16,185,129,0.12);    color: #6ee7b7;              border: 1px solid rgba(16,185,129,0.3);   box-shadow: 0 3px 10px rgba(0,0,0,0.4), 0 0 12px rgba(16,185,129,0.15); }
.badge-teal   { background: rgba(20,184,166,0.12);   color: #6ee7b7;              border: 1px solid rgba(20,184,166,0.3);  box-shadow: 0 3px 10px rgba(0,0,0,0.4), 0 0 12px rgba(20,184,166,0.18); }

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: rgba(16,185,129,0.06);
  color: var(--accent-light);
  border: 1px solid rgba(16,185,129,0.3);
  outline: 1px solid rgba(16,185,129,0.15);
  outline-offset: 2px;
  box-shadow: 0 4px 14px rgba(16,185,129,0.2), 0 2px 6px rgba(0,0,0,0.4);
  transition: all 0.4s ease, outline 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  background-size: 300% 100%;
  z-index: -1;
  opacity: 0.12;
  animation: btnSwipeIdle 3s ease-in-out infinite;
}
@keyframes btnSwipeIdle {
  0%   { background-position: 150% 0; }
  50%  { background-position: -50% 0; }
  100% { background-position: 150% 0; }
}
.btn-primary:hover {
  color: #0a0c10 !important;
  border-color: var(--accent);
  outline: 1px solid rgba(16,185,129,0.45);
  outline-offset: 2px;
  box-shadow: 0 2px 8px rgba(16,185,129,0.3), 0 0 16px rgba(16,185,129,0.1);
  transform: translateY(-1px);
}
.btn-primary:hover::before {
  opacity: 1;
  background: var(--accent);
  animation: none;
}
.btn-primary:hover svg { transform: translateX(3px); }
.btn-primary svg { transition: transform 0.4s ease; }
.btn-primary:active {
  box-shadow: 0 1px 3px rgba(16,185,129,0.2), 0 0 0 rgba(0,0,0,0);
  transform: translateY(2px);
  outline: 1px solid rgba(16,185,129,0.6);
}

.btn-secondary {
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.btn-glass-green {
  background: rgba(16,185,129,0.10);
  color: var(--accent-light);
  border: 1px solid rgba(16,185,129,0.22);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(8px);
}
.btn-glass-green:hover {
  background: rgba(16,185,129,0.22);
  border-color: rgba(16,185,129,0.5);
  color: #a7f3d0;
  box-shadow: 0 0 14px rgba(16,185,129,0.18), 0 2px 8px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

.btn-logout {
  font-family: 'Russo One', 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(239,68,68,0.06);
  color: rgba(248,113,113,0.7);
  border: 1px solid rgba(239,68,68,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
}
.btn-logout:hover {
  background: rgba(239,68,68,0.14);
  border-color: rgba(239,68,68,0.30);
  color: #f87171;
  box-shadow: 0 4px 16px rgba(239,68,68,0.12), inset 0 1px 0 rgba(255,255,255,0.04);
  transform: translateY(-1px);
}

/* Notify — green glass */
.um-btn-notify {
  background: rgba(16,185,129,0.06);
  color: rgba(16,185,129,0.8);
  border: 1px solid rgba(16,185,129,0.15);
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}
.um-btn-notify:hover {
  background: rgba(16,185,129,0.14);
  border-color: rgba(16,185,129,0.35);
  color: #10b981;
  box-shadow: 0 4px 12px rgba(16,185,129,0.12);
  transform: translateY(-1px);
}

/* Mute — blue glass (unmuted state) */
.um-btn-mute {
  background: rgba(59,130,246,0.06);
  color: rgba(96,165,250,0.8);
  border: 1px solid rgba(59,130,246,0.15);
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}
.um-btn-mute:hover {
  background: rgba(59,130,246,0.14);
  border-color: rgba(59,130,246,0.35);
  color: #60a5fa;
  box-shadow: 0 4px 12px rgba(59,130,246,0.12);
  transform: translateY(-1px);
}
/* Mute — red tinge when muted */
.um-btn-mute.muted {
  background: rgba(239,68,68,0.06);
  color: rgba(248,113,113,0.8);
  border-color: rgba(239,68,68,0.15);
}
.um-btn-mute.muted:hover {
  background: rgba(239,68,68,0.14);
  border-color: rgba(239,68,68,0.35);
  color: #f87171;
  box-shadow: 0 4px 12px rgba(239,68,68,0.12);
}

/* Danger — red glass */
.btn-danger {
  background: rgba(239,68,68,0.06);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.2);
  box-shadow: var(--shadow);
}
.btn-danger:hover {
  background: rgba(239,68,68,0.8);
  color: #0c0e12;
  border-color: rgba(239,68,68,0.6);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(239,68,68,0.2);
}
.btn-danger:active { transform: translateY(1px); }

/* Amber — warning actions (Reset) */
.btn-amber {
  background: rgba(245,158,11,0.08);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,0.2);
  box-shadow: var(--shadow);
}
.btn-amber:hover {
  background: rgba(245,158,11,0.75);
  color: #0c0e12;
  border-color: rgba(245,158,11,0.5);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245,158,11,0.2);
}
.btn-amber:active { transform: translateY(1px); }

/* Success — green glass (Check, Save) */
.btn-success {
  background: rgba(16,185,129,0.06);
  color: var(--accent-light);
  border: 1px solid rgba(16,185,129,0.2);
  box-shadow: var(--shadow);
}
.btn-success:hover {
  background: rgba(16,185,129,0.8);
  color: #0c0e12;
  border-color: rgba(16,185,129,0.6);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(16,185,129,0.2);
}
.btn-success:active { transform: translateY(1px); }
/* Warning — amber glass (Edit, Pause) */
.btn-warning {
  background: rgba(245,158,11,0.06);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,0.2);
  box-shadow: var(--shadow);
}
.btn-warning:hover {
  background: rgba(245,158,11,0.8);
  color: #0c0e12;
  border-color: rgba(245,158,11,0.6);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245,158,11,0.2);
}
.btn-warning:active { transform: translateY(1px); }

/* Toggle — teal glass (Pause/Enable) */
.btn-toggle {
  background: rgba(20,184,166,0.06);
  color: #5eead4;
  border: 1px solid rgba(20,184,166,0.2);
  box-shadow: var(--shadow);
}
.btn-toggle:hover {
  background: rgba(20,184,166,0.8);
  color: #0c0e12;
  border-color: rgba(20,184,166,0.6);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(20,184,166,0.2);
}
.btn-toggle:active { transform: translateY(1px); }

.btn-sm     { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn-icon   { padding: 0.45rem; border-radius: var(--radius-sm); }

/* Check Now button — fixed width so "Checking…" state doesn't shift layout */
.btn-check-now { min-width: 72px; justify-content: center; }

@keyframes spin { to { transform: rotate(360deg); } }
.btn-spinner {
  display: inline-block; width: 11px; height: 11px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   Form Elements
   --------------------------------------------------------- */
.form-group {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 1rem;
}

.form-label {
  font-size: 0.75rem; font-weight: 600;
  color: var(--text-secondary); letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: rgba(8,12,10,0.6);
  border: 1px solid rgba(16,185,129,0.1);
  border-radius: var(--radius-sm);
  color: var(--accent-light);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2), inset 0 1px 3px rgba(0,0,0,0.15);
  font-size: 0.875rem;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

.form-control::placeholder { color: rgba(16,185,129,0.3); }

.form-control:hover {
  border-color: rgba(16,185,129,0.25);
  background: rgba(16,185,129,0.04);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2), 0 0 6px rgba(16,185,129,0.06);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 12px rgba(16,185,129,0.15), inset 0 2px 4px rgba(0,0,0,0.12);
  background: rgba(16,185,129,0.05);
}

.form-control:disabled { opacity: 0.5; cursor: not-allowed; }

/* Dark-themed select — critical for cross-browser dark dropdowns */
select.form-control {
  color-scheme: dark;
  background-color: rgba(8,12,10,0.95);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2310b981' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.5rem;
  cursor: pointer;
  color: var(--accent-light);
  border: 1px solid rgba(16,185,129,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 2px rgba(0,0,0,0.2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select.form-control:hover {
  border-color: rgba(16,185,129,0.4);
  box-shadow: 0 3px 10px rgba(0,0,0,0.4), 0 0 8px rgba(16,185,129,0.1);
}
select.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15), 0 3px 10px rgba(0,0,0,0.4);
  outline: none;
}

select.form-control option {
  background: #0c0e12 !important;
  color: var(--accent-light) !important;
  padding: 10px 12px;
  border: none !important;
  outline: none !important;
}

select.form-control option:hover,
select.form-control option:checked,
select.form-control option:active {
  background: #0c0e12 linear-gradient(0deg, rgba(16,185,129,0.12) 0%, rgba(16,185,129,0.12) 100%) !important;
  background-color: rgba(16,185,129,0.12) !important;
  color: #6ee7b7 !important;
  -webkit-text-fill-color: #6ee7b7 !important;
}

/* Force dark dropdown + kill white border on popup */
select.form-control {
  color-scheme: dark !important;
}
select.form-control::-ms-expand { display: none; }
select.form-control:-moz-focusring { color: transparent; text-shadow: 0 0 0 var(--accent-light); }

/* Force dark dropdown appearance */
select.form-control::-ms-expand { display: none; }
@supports (-webkit-appearance: none) {
  select.form-control option:checked {
    background: var(--accent) linear-gradient(0deg, var(--accent) 0%, var(--accent) 100%);
    color: var(--text-primary);
  }
}

.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}

.form-check {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}

.form-check-input {
  width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer;
}

/* Hints were --text-muted (#4a5568 ≈ 2.5:1 on the dark bg — fails WCAG AA and
   reads as washed-out). Bumped to --text-secondary (~5:1) so help text is
   actually legible. Applies app-wide (every .form-hint). */
.form-hint { font-size: 0.73rem; color: var(--text-secondary); line-height: 1.5; margin-top: 2px; }

/* Consistent vertical rhythm for stacked checkboxes — matches the 1rem block
   spacing of .form-group + even 0.6rem between rows, so checkbox clusters line
   up with the rest of the form instead of using ad-hoc inline margins. */
.form-check-stack { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.form-check-stack .form-hint { margin: 2px 0 0 26px; }  /* indent under the checkbox label */

/* ---------------------------------------------------------
   Card
   --------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card:hover { background: var(--bg-card-hover); border-color: var(--border-hover); box-shadow: var(--shadow-lg); }
.card-body  { padding: 1.5rem; }
.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.card-title { font-size: 1rem; font-weight: 600; }

/* Status border accent */
.card-status-up      { border-left: 3px solid var(--green) !important; }
.card-status-down    { border-left: 3px solid var(--red)   !important; }
.card-status-unknown { border-left: 3px solid var(--text-muted) !important; }

/* ---------------------------------------------------------
   Admin Layout
   --------------------------------------------------------- */
.admin-layout { display: flex; min-height: 100vh; min-height: 100dvh; }

/* ─────────────────────────────────────────
   SIDEBAR — Glass panel, floating, depth
   ───────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width); min-width: var(--sidebar-width);
  background: rgba(10,14,22,0.85);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border-right: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    4px 0 16px rgba(0,0,0,0.5),
    8px 0 40px rgba(0,0,0,0.3),
    inset -1px 0 0 rgba(255,255,255,0.03);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0;
  height: 100vh; overflow-y: hidden; overflow-x: hidden;
  z-index: 100;
  scrollbar-width: none; -ms-overflow-style: none;
}
.sidebar:hover { overflow-y: auto; }
.sidebar::-webkit-scrollbar { width: 0; background: transparent; }
.sidebar::after {
  content: ''; position: absolute; top: 0; right: 0; width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, rgba(16,185,129,0.12) 30%, rgba(16,185,129,0.12) 70%, transparent);
  pointer-events: none;
}

.sidebar-logo {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; gap: 0.75rem;
}

/* Admin logo image (uploadable) — CIRCLE */
/* Spinning glow ring around logo */
.logo-spinner-ring {
  position: relative;
  width: 46px; height: 46px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.logo-spinner-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-image: linear-gradient(135deg, #10b981 35%, #06b6d4);
  animation: logoSpinRing 2.5s linear infinite;
  filter: blur(1.5px);
  box-shadow: 0px -3px 12px 0px rgba(16,185,129,0.4), 0px 3px 12px 0px rgba(6,182,212,0.3);
}
.logo-spinner-ring::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--bg-primary);
  filter: blur(0px);
}
.logo-spinner-ring > * {
  position: relative;
  z-index: 2;
}
@keyframes logoSpinRing {
  to { transform: rotate(360deg); }
}

.sidebar-logo-img-wrap {
  width: 38px; height: 38px; flex-shrink: 0; position: relative; cursor: pointer;
  border-radius: 50%; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5), 0 0 12px rgba(16,185,129,0.08);
  transition: box-shadow 0.25s ease;
}
.sidebar-logo-img-wrap:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.5), 0 0 20px rgba(16,185,129,0.15);
}
.sidebar-logo-img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.sidebar-logo-img-wrap .logo-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 2px;
  background: rgba(0,0,0,0.7); opacity: 0; transition: opacity 0.2s; border-radius: 50%;
}
.sidebar-logo-img-wrap:hover .logo-overlay { opacity: 1; }
.logo-overlay-btn {
  width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer; padding: 0; color: var(--text-primary); opacity: 0.8;
}
.logo-overlay-btn:hover { opacity: 1; }
.logo-overlay-btn svg { width: 14px; height: 14px; }

/* Fallback icon — CIRCLE */
.sidebar-logo-placeholder {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 50%; background: linear-gradient(135deg, var(--accent), #059669);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800; color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 12px rgba(16,185,129,0.15);
  cursor: pointer; position: relative; overflow: hidden;
  transition: box-shadow 0.25s ease;
}
.sidebar-logo-placeholder:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 20px rgba(16,185,129,0.25);
}
.sidebar-logo-placeholder:hover::after {
  content: '📷'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); font-size: 0.85rem; border-radius: 50%;
}

.sidebar-logo-wrap {
  min-width: 0; flex: 1;
  display: flex; flex-direction: column; gap: 4px;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 8px;
}

.sidebar-brand-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green-glow);
  animation: sidebarDotPulse 2.5s ease infinite;
  flex-shrink: 0;
}
@keyframes sidebarDotPulse {
  0%, 100% { box-shadow: 0 0 6px var(--green-glow); opacity: 1; }
  50% { box-shadow: 0 0 12px var(--green-glow); opacity: 0.6; }
}

.sidebar-brand-name {
  font-family: 'Russo One', 'Inter', sans-serif;
  font-size: 0.9rem; font-weight: 400; color: var(--text-primary);
  letter-spacing: 0.04em; line-height: 1;
}

.sidebar-admin-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: 6px;
  font-size: 0.65rem; font-weight: 700;
  font-family: 'Inter', monospace;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent-light);
  width: fit-content;
}
.sidebar-admin-badge::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green-glow);
  animation: sidebarDotPulse 2.5s ease infinite;
}

.sidebar-nav {
  flex: 1; padding: 1rem 0.75rem;
  display: flex; flex-direction: column; gap: 2px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 0.6rem 0.85rem; border-radius: var(--radius-sm);
  font-family: 'Russo One', sans-serif;
  font-size: 0.8rem; font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--text-muted); text-decoration: none;
  transition: all 0.15s ease; position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
}
.nav-item.active {
  background: rgba(16,185,129,0.1);
  color: var(--accent-light);
  box-shadow: inset 0 0 12px rgba(16,185,129,0.06);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 50%; background: var(--accent);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(16,185,129,0.4);
}

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.5; transition: opacity 0.15s; }
.nav-item:hover .nav-icon { opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 1; filter: drop-shadow(0 0 3px rgba(16,185,129,0.4)); }

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* ─────────────────────────────────────────
   MAIN CONTENT + TOPBAR — floating glass layer
   ───────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width); flex: 1;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
}

.topbar {
  padding: 0.85rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(10,12,18,0.75);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  position: sticky; top: 0; z-index: 50;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.03),
    0 4px 16px rgba(0,0,0,0.4),
    0 8px 32px rgba(0,0,0,0.2);
}

.topbar-title {
  display: inline-flex; align-items: center;
  padding: 5px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  font-family: 'Russo One', 'Inter', monospace;
  font-size: 0.82rem; font-weight: 400;
  color: var(--accent-light);
  letter-spacing: 0.06em;
}
.topbar-title::after {
  content: '';
  display: inline-block;
  width: 2px; height: 0.9em;
  margin-left: 5px;
  background: var(--accent);
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(16,185,129,0.5);
  animation: titleCursorBlink 1s step-end infinite;
}
@keyframes titleCursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

.page-content { padding: 2rem 2.5rem; flex: 1; max-width: 1200px; width: 100%; margin-left: auto; margin-right: auto; box-sizing: border-box; }

/* ─────────────────────────────────────────
   PANEL — universal glass container
   ───────────────────────────────────────── */
.panel {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  position: relative;
  z-index: 1;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
/* Panels with hovered tooltips bubble above adjacent panels */
.panel:has(.um-has-tip:hover),
.panel:has([data-tooltip]:hover),
.panel:focus-within {
  z-index: 10000;
}
/* Top edge light catch */
.panel::after {
  content: '';
  position: absolute; top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  pointer-events: none;
}
.panel:hover {
  border-color: rgba(255,255,255,0.1);
  box-shadow: var(--shadow-xl);
}
.panel-title {
  font-family: 'Russo One', 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(16,185,129,0.6);
  margin-bottom: 1.25rem;
}

/* ─────────────────────────────────────────
   HERO STATS — 4 big cards
   ───────────────────────────────────────── */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.hero-stat {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  position: relative;
}
/* Top edge highlight */
.hero-stat::after {
  content: '';
  position: absolute; top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  pointer-events: none;
}
.hero-stat:hover {
  border-color: rgba(255,255,255,0.1);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.hero-stat-value {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-secondary);
  line-height: 1;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.hero-stat-value.green { color: var(--green); }
.hero-stat-value.red { color: var(--red); }
.hero-stat-value.amber { color: var(--amber); }
.hero-stat-label {
  font-family: 'Russo One', 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(16,185,129,0.6);
}

/* ─────────────────────────────────────────
   SPLIT PANEL — graph left + side stack right
   ───────────────────────────────────────── */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.split-main { display: flex; flex-direction: column; gap: 1.25rem; }
.split-side { display: flex; flex-direction: column; gap: 1.25rem; }

/* Chart container */
.chart-panel {
  min-height: 320px;
}
.chart-panel canvas {
  width: 100% !important;
  height: 280px !important;
}

/* System status panel */
.status-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.85rem;
}
.status-item:last-child { border-bottom: none; }
.status-item-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.status-item-dot.ok { background: var(--green); box-shadow: 0 0 6px var(--green-glow); }
.status-item-dot.warn { background: var(--amber); box-shadow: 0 0 6px var(--amber-glow); }
.status-item-dot.err { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }
.status-item-label { flex: 1; color: var(--text-muted); }
.status-item-value { font-weight: 600; color: var(--accent-light); font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────
   INCIDENT FEED (compact, right panel)
   ───────────────────────────────────────── */
.incident-feed-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.incident-feed-item:last-child { border-bottom: none; }
.incident-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0;
}
.incident-dot.open { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }
.incident-dot.resolved { background: var(--green); box-shadow: 0 0 4px var(--green-glow); }
.incident-info { flex: 1; min-width: 0; }
.incident-name { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.incident-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.incident-actions {
  opacity: 0; transition: opacity 0.15s;
  display: flex; gap: 4px;
}
.incident-feed-item:hover .incident-actions { opacity: 1; }

/* ─────────────────────────────────────────
   MONITOR MODULE — wide horizontal card
   ───────────────────────────────────────── */
.monitor-module {
  background: rgba(255,255,255,0.025);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.75rem;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  margin-bottom: 0.75rem;
}
.monitor-module:hover {
  border-color: rgba(255,255,255,0.1);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.monitor-module-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.monitor-module-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.monitor-module-dot.up { background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.monitor-module-dot.down { background: var(--red); box-shadow: 0 0 8px var(--red-glow); }
.monitor-module-dot.unknown { background: var(--text-muted); }
.monitor-module-name {
  font-family: 'Russo One', 'Inter', sans-serif;
  font-size: 0.95rem; font-weight: 400; color: var(--text-primary);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.monitor-module-badges {
  display: flex; gap: 0.5rem; align-items: center;
}
.monitor-module-stats {
  display: flex; gap: 2rem; align-items: center; margin-left: auto;
}
.monitor-module-stat-val {
  font-size: 0.95rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.monitor-module-stat-val.green { color: var(--green); }
.monitor-module-stat-val.amber { color: var(--amber); }
.monitor-module-stat-val.red { color: var(--red); }
.monitor-module-stat-label {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
}
.monitor-module-meta {
  display: flex; gap: 2rem; align-items: center;
  font-size: 0.78rem; color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.monitor-module-pills {
  margin-bottom: 0.5rem;
}
.monitor-module-actions {
  display: flex; gap: 0.5rem; justify-content: flex-end;
}

/* ── LIVE indicator ── */
.live-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--green);
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green-glow);
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; box-shadow: 0 0 10px var(--green-glow); }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .split-grid { grid-template-columns: 1fr; }
  .hero-stat-value { font-size: 2rem; }
}
@media (max-width: 480px) {
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .hero-stat { padding: 1.25rem; }
  .hero-stat-value { font-size: 1.8rem; }
  .page-content { padding: 1.25rem; }
  .monitor-module { padding: 1.25rem; }
  .monitor-module-header { flex-wrap: wrap; }
  .monitor-module-stats { margin-left: 0; margin-top: 0.5rem; width: 100%; }
}

/* Settings forms constrained width */
.settings-container { max-width: 100%; }

/* SES helper callout */
.ses-callout {
  padding: 1rem 1.1rem;
  background: rgba(245,158,11,0.04);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}
.ses-callout-links {
  display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.75rem;
}
/* Email test log */
.email-log-wrap { margin-top: 1.5rem; }
.email-log-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.6rem;
}
.email-log-title { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.email-log-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.email-log-table th {
  text-align: left; padding: 0.4rem 0.6rem;
  color: var(--text-muted); font-weight: 500; border-bottom: 1px solid var(--border);
}
.email-log-table td {
  padding: 0.45rem 0.6rem; border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary); vertical-align: middle;
}
.email-log-table tr:last-child td { border-bottom: none; }
.email-log-table tr:hover td { background: rgba(255,255,255,0.02); }
.email-log-del {
  opacity: 0; background: none; border: none; cursor: pointer;
  color: var(--red); font-size: 1rem; line-height: 1; padding: 2px 5px;
  border-radius: 4px; transition: opacity 0.2s;
}
.email-log-table tr:hover .email-log-del { opacity: 1; }
.email-log-del:hover { background: rgba(239,68,68,0.12); }

.ses-callout-note {
  font-size: 0.8rem; color: var(--text-muted); margin: 0; line-height: 1.5;
}

/* ---------------------------------------------------------
   Stats Grid
   --------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(145deg, rgba(16,185,129,0.03), rgba(16,185,129,0.01));
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(16,185,129,0.06);
  border-radius: var(--radius-lg); padding: 1.5rem 1.75rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4), inset 0 0 20px rgba(16,185,129,0.02), inset 0 1px 0 rgba(255,255,255,0.03);
  transition: all 0.25s ease;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16,185,129,0.15), transparent);
}
.stat-card:hover {
  border-color: rgba(16,185,129,0.12);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45), inset 0 0 30px rgba(16,185,129,0.04), 0 0 20px rgba(16,185,129,0.04);
}

.stat-label {
  font-size: 0.72rem; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.6rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.stat-value {
  font-size: 2.2rem; font-weight: 800; line-height: 1;
  color: var(--text-secondary);
}
.stat-value.green  { color: var(--green);  text-shadow: 0 2px 16px rgba(16,185,129,0.4), 0 4px 24px rgba(0,0,0,0.3); }
.stat-value.red    { color: var(--red);    text-shadow: 0 2px 16px rgba(239,68,68,0.4), 0 4px 24px rgba(0,0,0,0.3); }
.stat-value.amber  { color: var(--amber);  text-shadow: 0 2px 16px rgba(245,158,11,0.35), 0 4px 24px rgba(0,0,0,0.3); }
.stat-value.purple, .stat-value.accent { color: var(--accent-light); text-shadow: 0 2px 16px rgba(16,185,129,0.4), 0 4px 24px rgba(0,0,0,0.3); }
.stat-sub { font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); margin-top: 4px; text-shadow: 0 1px 3px rgba(0,0,0,0.3); }

/* ---------------------------------------------------------
   Monitor Cards Grid
   --------------------------------------------------------- */
.monitors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.25rem;
}

.monitor-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  /* NO overflow:hidden — allows pill tooltips to escape */
}

.monitor-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent 5%, rgba(16,185,129,0.3) 25%, rgba(16,185,129,0.5) 50%, rgba(16,185,129,0.3) 75%, transparent 95%);
  background-size: 200% 100%;
  animation: shimmer-line 4s linear infinite;
  pointer-events: none;
}

@keyframes shimmer-line {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.monitor-card:hover {
  background: linear-gradient(160deg, rgba(255,255,255,0.065), rgba(255,255,255,0.025));
  border-color: var(--border-hover);
  transform: translateY(-1px); box-shadow: var(--shadow-lg);
  z-index: 2;
}

.monitor-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 1.25rem;
}
.monitor-card-title-row {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
}
.monitor-card-name {
  font-size: 0.95rem; font-weight: 700;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.monitor-card-url {
  font-size: 0.75rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}

.monitor-card-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem;
}
.meta-item  { display: flex; flex-direction: column; gap: 2px; }
.meta-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.meta-value { font-size: 0.875rem; font-weight: 600; }
.meta-value.green { color: var(--green); }
.meta-value.red   { color: var(--red);   }
.meta-value.amber { color: var(--amber); }

/* Gradient text for uptime % */
.gradient-text {
  color: var(--green);
}
.gradient-text-red {
  color: var(--red);
}

.monitor-card-actions {
  display: flex; gap: 6px; margin-top: 1.25rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ---------------------------------------------------------
   Uptime Pills (90-day history)
   --------------------------------------------------------- */
.uptime-pills { margin: 0.85rem 0; position: relative; }

.uptime-pills-label {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--text-muted); margin-bottom: 6px;
}

.pills-track {
  display: flex; gap: 2px; align-items: center;
  /* overflow: visible is default — tooltips can escape card bounds */
}

.pill {
  flex: 1; height: 30px; border-radius: 4px;
  cursor: pointer;
  transition: transform var(--transition), filter var(--transition);
  position: relative;
  /* No overflow:hidden — tooltip must be visible */
}

.pill:hover { transform: scaleY(1.2); filter: brightness(1.2); z-index: 10; }
.pill.up      { background: var(--green); }
.pill.down    { background: var(--red);   }
.pill.partial { background: var(--amber); }
.pill.no-data { background: rgba(255,255,255,0.08); }
.pill.future  { background: rgba(255,255,255,0.04); }

/* Hourly pill row for today */
.uptime-pills-today {
  background: rgba(16,185,129,0.03);
  border: 1px solid rgba(16,185,129,0.1);
  border-radius: var(--radius-sm);
  padding: 6px 8px 6px;
  margin-top: 5px;
}
.pill-hour { height: 20px; border-radius: 3px; }

/* Tooltip — must escape card overflow */
.pill-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,14,12,0.97);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 9999;
  color: var(--accent-light);
  box-shadow: 0 4px 20px rgba(0,0,0,0.6), 0 0 8px rgba(16,185,129,0.06);
  font-weight: 600;
}
.pill:hover .pill-tooltip { opacity: 1; }

/* "Next pulse" countdown — always-on mini tooltip below the next-to-populate pill */
.pills-track-hourly { position: relative; }
.pill-next {
  box-shadow: 0 0 0 1px rgba(16,185,129,0.55), 0 0 8px rgba(16,185,129,0.35);
  animation: pillNextPulse 2.2s ease infinite;
}
@keyframes pillNextPulse {
  0%,100% { box-shadow: 0 0 0 1px rgba(16,185,129,0.4),  0 0 6px rgba(16,185,129,0.25); }
  50%     { box-shadow: 0 0 0 1px rgba(16,185,129,0.75), 0 0 12px rgba(16,185,129,0.55); }
}
.pill-countdown {
  position: absolute;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  background: rgba(10,14,12,0.92);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-light);
  text-shadow: 0 0 6px rgba(16,185,129,0.5);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 0 6px rgba(16,185,129,0.15);
  z-index: 6;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.pill-countdown.visible { opacity: 1; }
.pill-countdown::before {
  content: '';
  position: absolute;
  top: -4px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 6px; height: 6px;
  background: rgba(10,14,12,0.92);
  border-left: 1px solid rgba(16,185,129,0.3);
  border-top: 1px solid rgba(16,185,129,0.3);
}

/* ---------------------------------------------------------
   Sparkline Chart Wrapper
   --------------------------------------------------------- */
.sparkline-wrap { height: 60px; margin: 0.5rem 0; position: relative; }
.sparkline-wrap canvas { border-radius: 6px; }

/* ---------------------------------------------------------
   SSL Badge
   --------------------------------------------------------- */
.ssl-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; font-weight: 600; padding: 3px 8px; border-radius: 6px;
}
.ssl-badge.ssl-ok     { background: var(--green-glow);            color: var(--green);  }
.ssl-badge.ssl-warn   { background: var(--amber-glow);            color: var(--amber);  }
.ssl-badge.ssl-danger { background: var(--red-glow);              color: var(--red);    }
.ssl-badge.ssl-na     { background: rgba(255,255,255,0.04);       color: var(--text-muted); }

/* ---------------------------------------------------------
   Modal
   --------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 1rem; animation: fade-in 0.2s ease;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: #0e1018; border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 16px 64px rgba(0,0,0,0.7); animation: fade-in-scale 0.25s ease;
}

.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-shrink: 0;
}
.modal-title {
  font-family: 'Russo One','Inter',sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
  display: flex; align-items: center; gap: 10px;
  min-width: 0; flex: 1;
  margin: 0; line-height: 1.2;
}
.modal-title svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent); }
.modal-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 4px; letter-spacing: .02em; opacity: .85; }

.modal-close {
  width: 32px; height: 32px;
  background: transparent; border: none; color: var(--text-muted); cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 20px; line-height: 1;
  transition: color var(--transition), background var(--transition);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.modal-close:hover { color: #fca5a5; background: rgba(239,68,68,0.1); }

.modal-body   { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 0.75rem;
}

/* ---------------------------------------------------------
   Tables
   --------------------------------------------------------- */
.table-wrap {
  overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  box-shadow: var(--shadow);
}

/* Actions column — fixed width so button state changes never shift layout */
table th:last-child,
table td:last-child {
  width: 1px;
  white-space: nowrap;
}

table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
table th, table td { white-space: nowrap; padding: 0.65rem 0.6rem; }
table td:nth-child(4) { max-width: 180px; overflow: hidden; text-overflow: ellipsis; } /* Target column — truncate long URLs */

thead th {
  padding: 0.75rem 1rem; text-align: left;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  background: rgba(16,185,129,0.02); border-bottom: 1px solid rgba(16,185,129,0.06);
  letter-spacing: 0.07em; color: var(--text-secondary);
  text-shadow: 0 0 6px rgba(16,185,129,0.08);
  white-space: nowrap;
}

tbody tr {
  transition: background 0.2s ease;
  border-bottom: 1px solid rgba(16,185,129,0.03);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(16,185,129,0.03); }
tbody td { padding: 0.9rem 1rem; color: var(--text-primary); vertical-align: middle; text-shadow: 0 1px 3px rgba(0,0,0,0.25); }
tbody tr:nth-child(even) { background: rgba(255,255,255,0.015); }
tbody tr:nth-child(even):hover { background: rgba(255,255,255,0.04); }

/* ---------------------------------------------------------
   Tabs
   --------------------------------------------------------- */
.tabs { margin-bottom: 2rem; }
.tab-nav {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border); margin-bottom: 1.5rem;
}
.tab-btn {
  padding: 0.6rem 1.25rem; background: none; border: none;
  border-bottom: 2px solid transparent; color: var(--text-muted);
  font-family: 'Russo One', 'Inter', sans-serif;
  font-size: 0.72rem; font-weight: 400; cursor: pointer;
  transition: all 0.2s ease; margin-bottom: -1px;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-radius: 6px 6px 0 0;
}
.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(16,185,129,0.04);
}
.tab-btn.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
  background: rgba(16,185,129,0.08);
  box-shadow: 0 0 12px rgba(16,185,129,0.08), inset 0 -1px 0 rgba(16,185,129,0.3);
}
.tab-panel         { display: none; animation: fade-in 0.2s ease; }
.tab-panel.active  { display: block; }

/* ---------------------------------------------------------
   Toast Notifications
   --------------------------------------------------------- */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9000; display: flex; flex-direction: column;
  gap: 0.5rem; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 0.85rem 1.25rem;
  background: #121620; border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  min-width: 280px; max-width: 400px; font-size: 0.875rem;
  pointer-events: all; animation: slide-in-right 0.3s ease;
}
.toast.dismissing { animation: slide-out-right 0.3s ease forwards; }
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-msg  { flex: 1; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red);   }
.toast.warning { border-left: 3px solid var(--amber); }
.toast.info    { border-left: 3px solid var(--accent); }

/* Minimal check-result toast — just shows response time */
.toast-check {
  padding: 0.55rem 1.1rem;
  background: #13131a; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0.03em;
  color: var(--text-primary); text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,0.55);
  pointer-events: all; animation: slide-in-right 0.25s ease;
  white-space: nowrap;
}
.toast-check.dismissing { animation: slide-out-right 0.25s ease forwards; }
.toast-check.up   { border-left: 3px solid var(--green); }
.toast-check.down { border-left: 3px solid var(--red); }

/* ---------------------------------------------------------
   Alert Contacts Section
   --------------------------------------------------------- */
.alert-contact-row {
  display: flex; align-items: center; gap: 8px;
  padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.alert-contact-row:last-child { border-bottom: none; }
.contact-type-badge {
  font-size: 0.68rem; font-weight: 600; padding: 2px 7px;
  border-radius: 4px; text-transform: uppercase; flex-shrink: 0;
}
.contact-type-email   { background: rgba(16,185,129,0.15); color: var(--green); }
.contact-type-discord { background: rgba(88,101,242,0.2);  color: #7289da; }
.contact-type-webhook { background: rgba(245,158,11,0.15); color: var(--amber); }

/* ---------------------------------------------------------
   Particle Canvas (Public Page Header)
   --------------------------------------------------------- */
.particles-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

/* ---------------------------------------------------------
   Public Status Page — Header
   --------------------------------------------------------- */
.status-header {
  position: relative; overflow: hidden;
  padding: 5rem 2rem 4.5rem; text-align: center;
  background: var(--bg-secondary);
  box-shadow: 0 16px 40px rgba(0,0,0,0.7), 0 6px 16px rgba(0,0,0,0.5);
  z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.mesh-bg {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
}
.mesh-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.3;
}
.mesh-orb-1 {
  width: 600px; height: 600px; top: -250px; left: -120px;
  background: radial-gradient(circle, rgba(16,185,129,0.7) 0%, transparent 70%);
  animation: mesh-move 22s ease-in-out infinite;
}
.mesh-orb-2 {
  width: 450px; height: 450px; top: -120px; right: -120px;
  background: radial-gradient(circle, rgba(37,99,235,0.35) 0%, transparent 70%);
  animation: mesh-move 28s ease-in-out infinite reverse;
}
.mesh-orb-3 {
  width: 350px; height: 350px; bottom: -120px; left: 40%;
  background: radial-gradient(circle, rgba(16,185,129,0.35) 0%, transparent 70%);
  animation: mesh-move 18s ease-in-out infinite 5s;
}

.status-header-content {
  position: relative; z-index: 2; max-width: 720px; margin: 0 auto;
}

.site-name {
  font-size: 0.85rem; font-weight: 700; color: rgba(255,255,255,0.35);
  text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 1.75rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Public page logo orb — CT Sentry press-in style */
.ctp-public-logo-wrap {
  position: relative;
  display: block;
  text-decoration: none;
  width: 106px;
  height: 106px;
  margin: 0 auto 1.75rem;
}
.ctp-public-logo-orb {
  width: 106px;
  height: 106px;
  border-radius: 50%;
  background-color: #0c0e12;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 10px 18px rgba(0,0,0,0.95), 0 0 18px rgba(16,185,129,0.12);
  filter: brightness(0.9);
  transition: box-shadow 0.25s ease, filter 0.25s ease, transform 0.18s ease;
  cursor: pointer;
}
.ctp-public-logo-wrap:hover .ctp-public-logo-orb {
  filter: brightness(1.05);
  transform: scale(0.98);
  box-shadow:
    0 2px 5px rgba(0,0,0,0.9),
    inset 0 18px 12px rgba(0,0,0,0.90),
    inset 0 4px 6px rgba(0,0,0,0.55),
    0 0 22px rgba(16,185,129,0.35),
    0 0 6px rgba(16,185,129,0.6);
}
.ctp-public-logo-wrap:active .ctp-public-logo-orb {
  transform: scale(0.96);
  transition: transform 0.08s ease;
}
.ctp-public-logo-wrap::after {
  content: 'Crafted by Craig Todd';
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(18,24,32,0.95);
  border: 1px solid rgba(52,211,153,0.25);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #7ac494;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.7), inset 0 0 10px rgba(0,0,0,0.5);
  transition: all 0.2s ease;
  z-index: 10;
}
.ctp-public-logo-wrap:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.status-banner {
  display: flex; align-items: center; justify-content: center; gap: 1.25rem;
  padding: 1.5rem 2.5rem; border-radius: var(--radius-lg);
  margin: 0 auto 1.75rem; max-width: 520px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.status-banner.all-up {
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.2);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.5),
    0 8px 32px rgba(0,0,0,0.4),
    0 0 40px rgba(16,185,129,0.08),
    inset 0 1px 0 rgba(255,255,255,0.05);
}
.status-banner.has-down {
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.2);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.5),
    0 8px 32px rgba(0,0,0,0.4),
    0 0 40px rgba(239,68,68,0.08),
    inset 0 1px 0 rgba(255,255,255,0.05);
}
.status-banner-text h1 {
  font-size: 1.7rem; font-weight: 800; text-align: left;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  letter-spacing: -0.01em;
}
.all-up .status-banner-text h1 {
  -webkit-text-stroke: 0.3px rgba(16,185,129,0.3);
  text-shadow: 0 2px 20px rgba(0,0,0,0.5), 0 0 30px rgba(16,185,129,0.1);
}
.has-down .status-banner-text h1 {
  -webkit-text-stroke: 0.3px rgba(239,68,68,0.3);
  text-shadow: 0 2px 20px rgba(0,0,0,0.5), 0 0 30px rgba(239,68,68,0.15);
}
.status-banner-text p {
  font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); text-align: left; margin-top: 4px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

/* ---------------------------------------------------------
   Public Status Page — Monitor Cards
   --------------------------------------------------------- */
.public-main { max-width: 960px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }

.public-monitor-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.3),
    0 8px 24px rgba(0,0,0,0.25),
    0 16px 40px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.04);
  margin-bottom: 1.25rem;
  transition: all 0.25s ease;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  position: relative;
  /* NO overflow:hidden — pill tooltips must escape */
}

.public-monitor-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
  pointer-events: none;
}

/* Glow accent on left side */
.public-monitor-card.pub-card-up::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--green);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: 0 0 12px rgba(16,185,129,0.5);
}
.public-monitor-card.pub-card-down::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--red);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: 0 0 12px rgba(239,68,68,0.5);
}

.public-monitor-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 3px 10px rgba(0,0,0,0.35), 0 0 20px rgba(255,255,255,0.03);
  transform: translateY(1px);
  z-index: 2;
}
.public-monitor-card.pub-card-up:hover {
  border-color: rgba(16,185,129,0.3);
  box-shadow: 0 3px 10px rgba(0,0,0,0.35), 0 0 24px rgba(16,185,129,0.12);
}
.public-monitor-card.pub-card-down:hover {
  border-color: rgba(239,68,68,0.3);
  box-shadow: 0 3px 10px rgba(0,0,0,0.35), 0 0 24px rgba(239,68,68,0.12);
}

.public-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.public-card-title {
  display: flex; align-items: center; gap: 12px;
}
.public-card-name {
  font-size: 1.05rem; font-weight: 700;
  color: var(--text-secondary);
}
.public-card-url { font-size: 0.8rem; color: var(--accent); margin-top: 2px; transition: color 0.15s ease; display: block; text-decoration: none; }
a.public-card-url:hover { color: #6ee7b7; text-decoration: underline; text-underline-offset: 3px; }
.public-card-right { display: flex; align-items: center; gap: 0.85rem; }
.public-card-stats { display: flex; align-items: center; gap: 1.75rem; }
.public-stat { text-align: right; }
.public-stat-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.public-stat-value {
  font-size: 1.1rem; font-weight: 800;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* ---------------------------------------------------------
   Section title
   --------------------------------------------------------- */
.section-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: rgba(16,185,129,0.6); margin-bottom: 1rem;
}

/* Terminal-style label (public status page monitor count) */
.terminal-label {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 14px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4), inset 0 1px 2px rgba(0,0,0,0.3);
  -webkit-text-stroke: 0.2px rgba(16,185,129,0.25);
  text-shadow: 0 0 8px rgba(16,185,129,0.15), 0 1px 4px rgba(0,0,0,0.4);
}
.terminal-dot {
  width: 7px; height: 7px; flex-shrink: 0;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,0.5);
  animation: terminalPulse 2s ease-in-out infinite;
}
@keyframes terminalPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ---------------------------------------------------------
   Login Page
   --------------------------------------------------------- */
.login-page {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: var(--bg-primary); position: relative; overflow: hidden;
}
.login-card {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg); padding: 2.5rem; width: 100%; max-width: 400px;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 16px 64px rgba(0,0,0,0.7); position: relative; z-index: 1;
  animation: fade-in-scale 0.4s ease;
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #10b981);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 24px rgba(16,185,129,0.5), 0 0 0 1px rgba(16,185,129,0.3);
  font-size: 1.6rem;
}
.login-title {
  font-size: 1.75rem; font-weight: 800; margin-bottom: 4px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.login-subtitle { font-size: 0.875rem; color: var(--text-secondary); }
.login-error {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm); padding: 0.75rem 1rem;
  font-size: 0.875rem; color: var(--red); margin-bottom: 1rem;
}
.login-error-locked {
  background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: var(--amber);
}

/* ---------------------------------------------------------
   Settings
   --------------------------------------------------------- */
.settings-section {
  background: rgba(255,255,255,0.025);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: visible;
  overflow: hidden;
  animation: um-scale-in 0.4s cubic-bezier(0.16,1,0.3,1) backwards;
}
/* Top edge light */
.settings-section::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}
/* Staggered entrance */
.settings-section:nth-child(1) { animation-delay: 0.03s; }
.settings-section:nth-child(2) { animation-delay: 0.08s; }
.settings-section:nth-child(3) { animation-delay: 0.13s; }
.settings-section:nth-child(4) { animation-delay: 0.18s; }
.settings-section:nth-child(5) { animation-delay: 0.23s; }

.settings-section h3 {
  font-family: 'Russo One', 'Inter', sans-serif;
  font-size: 0.75rem; font-weight: 400; margin-bottom: 1.25rem;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.1em;
}
.settings-section.collapsible h3 {
  cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px;
}
.settings-section.collapsible h3::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg); transition: transform 0.2s ease; flex-shrink: 0;
}
.settings-section.collapsed h3 { margin-bottom: 0; }
.settings-section.collapsed h3::before { transform: rotate(-45deg); }
.settings-section.collapsed > *:not(h3) { display: none !important; }

/* Toggle switch */
.toggle-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.toggle-wrap:last-child { border-bottom: none; }
.toggle-label { font-size: 0.875rem; }
.toggle-desc  { font-size: 0.75rem; color: var(--text-muted); }
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,255,255,0.1); border: 1px solid var(--border);
  border-radius: 24px; transition: all var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; top: 3px;
  background: var(--text-secondary); border-radius: 50%; transition: all var(--transition);
}
.toggle input:checked + .toggle-slider {
  background: rgba(16,185,129,0.2);
  border-color: rgba(16,185,129,0.35);
  box-shadow: 0 0 8px rgba(16,185,129,0.15);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: var(--green);
  box-shadow: 0 0 6px var(--green-glow), 0 1px 3px rgba(0,0,0,0.3);
}

/* Section Header */
.section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem;
}
.section-header h2 {
  font-family: 'Russo One', 'Inter', sans-serif;
  font-size: 0.95rem; font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------
   Misc Utilities
   --------------------------------------------------------- */
.d-flex          { display: flex; }
.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1  { gap: 0.25rem; } .gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; } .gap-4  { gap: 1rem; }
.mt-1   { margin-top: 0.25rem; }  .mt-2   { margin-top: 0.5rem; }
.mt-3   { margin-top: 0.75rem; }  .mt-4   { margin-top: 1rem; }
.mb-1   { margin-bottom: 0.25rem; } .mb-2   { margin-bottom: 0.5rem; }
.mb-3   { margin-bottom: 0.75rem; } .mb-4   { margin-bottom: 1rem; }
.mb-6   { margin-bottom: 1.5rem; }
.text-sm        { font-size: 0.875rem; }  .text-xs       { font-size: 0.75rem; }
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); text-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.text-green     { color: var(--green); text-shadow: 0 1px 6px rgba(16,185,129,0.25); }
.text-red       { color: var(--red);   text-shadow: 0 1px 6px rgba(239,68,68,0.25); }
.text-amber     { color: var(--amber); text-shadow: 0 1px 6px rgba(245,158,11,0.25); }
.font-semibold  { font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,0.3); }   .font-bold { font-weight: 700; }
.w-full         { width: 100%; }
.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 320px; text-align: center; padding: 3rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.empty-state::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent 10%, rgba(16,185,129,0.4) 50%, transparent 90%);
}
.empty-state-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; margin-bottom: 1.25rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), 0 0 20px rgba(16,185,129,0.06);
}
.empty-state-title {
  font-size: 1rem; font-weight: 700; color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.empty-state-text {
  font-size: 0.85rem; font-weight: 500; max-width: 380px; line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  text-shadow:
    0 0.12em 12px rgba(0,0,0,0.45),
    0 -1px 0 rgba(255,255,255,0.08);
}

/* Footer */
.public-footer {
  text-align: center; padding: 2.5rem 2rem;
  border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.8rem;
}
.public-footer p { margin: 0.35rem 0; line-height: 1.6; }

/* Maintenance banners */
.maintenance-banner {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 1.25rem 1.5rem; border-radius: var(--radius);
  margin-bottom: 1.5rem; font-size: 0.85rem; line-height: 1.5;
  box-shadow: var(--shadow);
}
.maintenance-banner.active {
  background: rgba(16,185,129,0.06); border: 1px solid rgba(16,185,129,0.15);
  color: var(--text-primary);
}
.maintenance-banner.upcoming {
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25);
  color: #fcd34d;
}
.maintenance-banner-icon { font-size: 1.25rem; margin-bottom: 0.35rem; }
.maintenance-banner strong { display: block; margin-bottom: 0.25rem; font-size: 0.9rem; }
.maintenance-banner p { margin: 0.15rem 0; opacity: 0.85; }

/* Copy button state */
.copy-btn {
  min-width: 60px;
  text-align: center;
}
.copy-btn.copied, .btn.copied {
  background: rgba(16,185,129,0.2) !important;
  color: var(--accent) !important;
  border-color: rgba(16,185,129,0.3) !important;
  transition: all 0.2s ease;
}

/* Settings form */
.settings-form { max-width: 100%; }

/* Settings two-column grid — fills the space */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}
/* Alerts tab now uses .settings-masonry — no order hack needed. */
.settings-grid > .settings-section,
.settings-grid > div > .settings-section:last-child { margin-bottom: 0; }

/* Stacked sections inside grid column wrappers */
.settings-grid > div > .settings-section + .settings-section,
.settings-grid > div > .settings-form + .settings-form,
.settings-grid > div > .settings-section + .settings-form,
.settings-grid > div > .settings-form + .settings-section { margin-top: 1.25rem; }

@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
  .um-email-grid { grid-template-columns: 1fr; }
}

/* Masonry layout — columns flow independently (no row-height coupling) */
.settings-masonry {
  columns: 2;
  column-gap: 1.25rem;
}
.settings-masonry-item {
  break-inside: avoid;
  margin-bottom: 1.25rem;
}
@media (max-width: 900px) {
  .settings-masonry { columns: 1; }
}

/* Scrollbar preview mouse animation */
.um-sb-mouse {
  width: 25px;
  height: 40px;
  border: 1px solid var(--accent);
  background-color: transparent;
  border-radius: 13px;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto 8px;
}
.um-sb-mouse-scroll {
  width: 3px;
  height: 10px;
  background-color: var(--accent);
  border-radius: 2px;
  position: absolute;
  bottom: 9px;
  animation: um-sb-scroll 1.5s linear infinite;
}
@keyframes um-sb-scroll {
  0%   { bottom: 9px; }
  50%  { bottom: 5px; }
  100% { bottom: 9px; }
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
/* Entrance animation for cards */
@keyframes um-scale-in {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.monitor-card, .public-monitor-card, .card, .stat-card {
  animation: um-scale-in 0.4s cubic-bezier(0.16,1,0.3,1) backwards;
}
.monitor-card:nth-child(1), .public-monitor-card:nth-child(1) { animation-delay: 0.03s; }
.monitor-card:nth-child(2), .public-monitor-card:nth-child(2) { animation-delay: 0.08s; }
.monitor-card:nth-child(3), .public-monitor-card:nth-child(3) { animation-delay: 0.13s; }
.monitor-card:nth-child(4), .public-monitor-card:nth-child(4) { animation-delay: 0.18s; }
.monitor-card:nth-child(5), .public-monitor-card:nth-child(5) { animation-delay: 0.23s; }
.monitor-card:nth-child(6), .public-monitor-card:nth-child(6) { animation-delay: 0.28s; }

/* Admin backdrop — subtle gradient orbs */
.main-content::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 600px 400px at 25% 35%, rgba(16,185,129,0.03), transparent),
    radial-gradient(ellipse 500px 350px at 75% 65%, rgba(16,185,129,0.02), transparent),
    radial-gradient(ellipse 300px 200px at 50% 50%, rgba(0,200,100,0.015), transparent);
  animation: gradient-shift 20s ease infinite;
  background-size: 200% 200%;
}

/* Admin sidebar — glow on active nav */
.nav-item.active {
  box-shadow: inset 0 0 12px rgba(16,185,129,0.08), 0 0 8px rgba(16,185,129,0.04);
}

/* Input focus glow */
.form-control:focus {
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12), 0 0 12px rgba(16,185,129,0.2), inset 0 2px 4px rgba(0,0,0,.15) !important;
}

/* Stat card glass treatment */
.stat-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Mobile hamburger + overlay — hidden on desktop */
.um-hamburger { display: none; }
.um-sidebar-overlay { display: none; }

/* Tablet portrait — between 768 and 900px the sidebar is still position:fixed
   but main-content kept the desktop margin-left of 240px, stranding the
   sidebar visually. Reset margin at 900px so the sidebar collapses cleanly
   instead of leaving a 240px gap. */
@media (max-width: 900px) {
  .main-content { margin-left: 0; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .main-content { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .monitors-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .public-card-stats { display: none; }
  .public-monitor-card { padding: 1.5rem 1.25rem; }
  .status-header { padding: 3.5rem 1.5rem 2.5rem; }
  .status-banner { padding: 1.25rem 1.25rem; width: 100%; box-sizing: border-box; }
  .site-logo { width: 60px; height: 60px; }
  .public-logo-spinner { width: 68px; height: 68px; }
  .status-banner-text h1 { font-size: 1.2rem; }
  .um-hamburger {
    display: flex;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 10001;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: rgba(10,16,24,0.95);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 10px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  }
  .um-hamburger svg { color: #10b981; }
  .sidebar.open { transform: translateX(0) !important; z-index: 10000; }
  .um-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    backdrop-filter: blur(4px);
  }
  .um-sidebar-overlay.open { display: block; }
}

@media (max-width: 375px) {
  .public-monitor-card { padding: 1.25rem 1rem; }
  .status-header { padding: 2.5rem 1rem 1.75rem; }
  .site-logo { width: 48px; height: 48px; }
  .public-logo-spinner { width: 56px; height: 56px; }
  .status-banner-text h1 { font-size: 1rem; }
  .pill { min-height: 20px; }
}

/* ─────────────────────────────────────────
   GREEN TOOLTIPS (matches CT Theme pattern)
   ───────────────────────────────────────── */
#um-tooltip {
  position: fixed;
  z-index: 99999999;
  pointer-events: none;
  background: rgba(10,14,12,0.97);
  border: 1px solid rgba(16,185,129,0.35);
  color: var(--accent-light);
  font-size: 11px;
  font-family: 'Inter', monospace;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 6px;
  max-width: 280px;
  white-space: normal;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0,0,0,0.7), 0 0 8px rgba(16,185,129,0.08);
  opacity: 0;
  transition: opacity 0.18s ease;
}
#um-tooltip.visible { opacity: 1; }
#um-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(16,185,129,0.35);
}

/* ─────────────────────────────────────────
   INCIDENT TIMELINE (public page)
   ───────────────────────────────────────── */
.incident-timeline { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; }
.incident-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.incident-card.active { border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.03); }
.incident-card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; font-size: 0.88rem; }
.incident-card-header strong { color: var(--text-primary); }
.incident-card-header .text-muted { font-size: 0.78rem; }
.incident-updates-feed { padding-left: 1.25rem; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 0.75rem; }
.timeline-entry { position: relative; padding-left: 1rem; }
.timeline-entry::before { content: ''; position: absolute; left: -1.35rem; top: 0.4rem; width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.timeline-entry.status-investigating::before { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.timeline-entry.status-identified::before { background: #3b82f6; box-shadow: 0 0 6px rgba(59,130,246,0.4); }
.timeline-entry.status-monitoring::before { background: #8b5cf6; box-shadow: 0 0 6px rgba(139,92,246,0.4); }
.timeline-entry.status-resolved::before { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.4); }
.timeline-status { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.timeline-status.investigating { color: #f59e0b; }
.timeline-status.identified { color: #3b82f6; }
.timeline-status.monitoring { color: #8b5cf6; }
.timeline-status.resolved { color: #10b981; }
.timeline-msg { font-size: 0.82rem; color: var(--text-primary); line-height: 1.5; }
.timeline-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 3px; }

/* ─────────────────────────────────────────
   LOGO ANIMATION (matches dl.php error/download pages — green version)
   ───────────────────────────────────────── */
/* Logo override — remove, handled by main .site-logo above */
.site-logo-animated {
  /* no breathing animation — clean static logo */
}

/* ─────────────────────────────────────────
   CUSTOM SCROLLBAR (green-tinted, matches brand)
   ───────────────────────────────────────── */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.14);
}

/* ---------------------------------------------------------
   Custom Select Dropdown — replaces native <select>
   --------------------------------------------------------- */
/* Hide tooltips when disabled */
.um-no-tooltips #um-tooltip { display: none !important; }

select.form-control.custom-select-hidden {
  display: none !important;
}

.custom-select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.custom-select-display {
  width: 100%;
  padding: 0.65rem 2.5rem 0.65rem 0.9rem;
  background: rgba(8,12,10,0.95);
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: var(--radius-sm);
  color: var(--accent-light);
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 2px rgba(0,0,0,0.2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-select-display::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2310b981' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.custom-select-wrapper.open .custom-select-display::after,
.custom-select-display.open::after {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select-display:hover {
  border-color: rgba(16,185,129,0.4);
  box-shadow: 0 3px 10px rgba(0,0,0,0.4), 0 0 8px rgba(16,185,129,0.1);
}

.custom-select-wrapper.open .custom-select-display,
.custom-select-display.open {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15), 0 3px 10px rgba(0,0,0,0.4);
}

.custom-select-display.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.custom-select-dropdown {
  position: fixed !important;
  z-index: 2147483000 !important;
  isolation: isolate;
  transform: translateZ(0);
  background: #0c0e12;
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 12px rgba(16,185,129,0.06);
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
}

.custom-select-dropdown.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.custom-select-option {
  padding: 8px 12px;
  color: var(--accent-light);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-select-option:hover {
  background: rgba(16,185,129,0.08);
}

.custom-select-option.selected {
  color: #6ee7b7;
  font-weight: 600;
  background: rgba(16,185,129,0.06);
}

.custom-select-option.selected:hover {
  background: rgba(16,185,129,0.12);
}

/* Custom scrollbar for dropdown */
.custom-select-dropdown::-webkit-scrollbar { width: 6px; }
.custom-select-dropdown::-webkit-scrollbar-track { background: transparent; }
.custom-select-dropdown::-webkit-scrollbar-thumb {
  background: rgba(16,185,129,0.2);
  border-radius: 3px;
}
.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(16,185,129,0.35);
}
.custom-select-dropdown {
  scrollbar-width: thin;
  scrollbar-color: rgba(16,185,129,0.2) transparent;
}

/* =====================================================================
   Orange glass button — third-party credential CTAs (Turnstile/reCAPTCHA)
   ===================================================================== */
.um-captcha-creds-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px 7px 11px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  color: #ffb787;
  background: linear-gradient(180deg, rgba(251,146,60,0.13), rgba(234,88,12,0.06));
  border: 1px solid rgba(251,146,60,0.30);
  border-radius: 7px;
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  box-shadow:
    0 2px 8px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,220,180,.08),
    0 0 0 1px rgba(251,146,60,.04);
  transition: all .2s ease;
  cursor: pointer;
}
.um-captcha-creds-btn:hover {
  color: #ffd4a8;
  background: linear-gradient(180deg, rgba(251,146,60,0.24), rgba(234,88,12,0.12));
  border-color: rgba(251,146,60,0.58);
  box-shadow:
    0 4px 14px rgba(0,0,0,.45),
    0 0 18px rgba(251,146,60,.25),
    inset 0 1px 0 rgba(255,220,180,.14);
  transform: translateY(-1px);
}
.um-captcha-creds-btn:active { transform: translateY(0); }
.um-captcha-creds-btn:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(251,146,60,.25),
    0 4px 14px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,220,180,.14);
}
.um-captcha-creds-btn svg { opacity: .8; transition: opacity .2s ease; }
.um-captcha-creds-btn:hover svg { opacity: 1; }

/* Provider credentials block visibility (JS-toggled) */
.um-captcha-block { display: none; }
.um-captcha-block.is-visible { display: block; }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE — zero horizontal-scroll policy (added in responsive audit)
═══════════════════════════════════════════════════════════════════════ */
html, body { max-width: 100vw; overflow-x: hidden; }
img, video, canvas, svg, iframe { max-width: 100%; height: auto; }
.main-content, .page-wrap, .panel, .card { max-width: 100%; box-sizing: border-box; }

/* Tables → card reflow on mobile (no h-scroll) */
@media (max-width: 768px) {
    table.data-table, table.um-table,
    table.data-table thead, table.um-table thead,
    table.data-table tbody, table.um-table tbody,
    table.data-table tr, table.um-table tr,
    table.data-table th, table.um-table th,
    table.data-table td, table.um-table td { display: block; width: 100%; box-sizing: border-box; }
    table.data-table thead, table.um-table thead { position: absolute; left: -9999px; top: -9999px; }
    table.data-table tr, table.um-table tr {
        margin-bottom: 10px; padding: 12px 14px;
        background: rgba(255,255,255,0.03);
        border: 1px solid var(--border, rgba(255,255,255,0.08));
        border-radius: 10px;
    }
    table.data-table td, table.um-table td {
        padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.03);
        display: flex; justify-content: space-between; align-items: center;
        gap: 12px; font-size: 12.5px; word-break: break-word; text-align: right;
    }
    table.data-table td:last-child, table.um-table td:last-child { border-bottom: none; padding-bottom: 0; }
    table.data-table td:first-child, table.um-table td:first-child { padding-top: 0; }
    table.data-table td::before, table.um-table td::before {
        content: attr(data-label);
        font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
        text-transform: uppercase; color: var(--text-muted, #7a8a98);
        flex-shrink: 0; min-width: 80px; text-align: left;
    }
    table.data-table td:not([data-label])::before,
    table.um-table td:not([data-label])::before { display: none; }
    table.data-table td:not([data-label]),
    table.um-table td:not([data-label]) { justify-content: flex-start; text-align: left; }
}

/* iOS Safari zoom-on-focus: any text input <16px on a touch viewport triggers
   the zoom. Previously this rule lived at 480px which left iPad portrait
   (768px) and landscape phones (481-767px) zooming on every form focus.
   CLAUDE.md §6 spec is 768px. */
@media (max-width: 768px) {
    input, select, textarea { font-size: 16px; }
}
@media (max-width: 480px) {
    h1 { font-size: 1.25rem; }
    h2 { font-size: 1.1rem; }
    .kpi-grid { grid-template-columns: 1fr; }
}
