/* ==========================================================================
   Viscosity Canonical Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
  /* Colors */
  --bg-main: #020617;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-accent: rgba(30, 41, 59, 0.5);
  
  --border-color: rgba(148, 163, 184, 0.12);
  --border-hover: rgba(59, 130, 246, 0.3);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-primary: #3b82f6;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-info: #0ea5e9;
  
  /* Shadows & Glass */
  --glass-bg: rgba(15, 23, 42, 0.8);
  --glass-border: rgba(148, 163, 184, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

/* -- Base Reset -- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(30, 58, 138, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(30, 58, 138, 0.1) 0px, transparent 50%);
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .control-title, .protected-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

/* -- Shared UI Components -- */

.panel, .info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}

.section-kicker {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-success);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-success);
  margin-right: 8px;
  box-shadow: 0 0 10px var(--accent-success);
}

/* -- Forms & Buttons -- */

input, textarea, select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.primary-button:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ghost-button:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--text-dim);
  color: var(--text-main);
}

.message-banner {
  padding: 16px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-success);
  margin-bottom: 24px;
  font-weight: 600;
  font-size: 14px;
}

.message-banner--error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--accent-danger);
}

/* -- Layout Shell -- */

.control-shell {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px 24px;
}

.control-band {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  gap: 24px;
}

.control-title {
  font-size: 42px;
  line-height: 1.1;
  margin-bottom: 8px;
}

.control-copy {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 600px;
}

/* -- Navigation (ProtectedHeader) -- */

.protected-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.protected-title {
  font-size: 24px;
  margin-top: 4px;
}

.protected-copy {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 4px;
}

.protected-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.protected-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.tab-link {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s;
}

.tab-link:hover, .tab-link--active {
  color: var(--text-main);
  background: rgba(59, 130, 246, 0.1);
}

.user-pill {
  padding: 6px 14px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-info);
}

/* -- Tables & Lists -- */

.table-container {
  overflow-x: auto;
  margin-top: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
}

tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* -- Profile Sections -- */

.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.profile-summary-card h2 {
  font-size: 28px;
  margin-bottom: 24px;
}

.profile-meta-list {
  display: grid;
  gap: 12px;
}

.profile-meta-list div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.profile-meta-list span {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
}

.profile-meta-list strong {
  font-size: 14px;
  color: var(--text-main);
}

.profile-card--wide {
  grid-column: 1 / -1;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.profile-label {
  font-size: 14px;
  color: var(--text-muted);
}

.profile-value {
  font-weight: 600;
}

/* -- Chat Widget -- */

.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
}

.chat-fab {
  width: 64px;
  height: 64px;
  background: var(--accent-primary);
  color: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s, background 0.2s;
}

.chat-fab:hover {
  transform: scale(1.05);
  background: #2563eb;
}

.chat-popup {
  position: absolute;
  right: 0;
  bottom: 80px;
  width: 420px;
  height: 600px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.chat-widget--open .chat-popup {
  display: flex;
}

.chat-widget__header {
  padding: 24px;
  background: var(--bg-accent);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.chat-widget__content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
}

.chat-msg--theirs {
  align-self: flex-start;
  background: var(--bg-accent);
  border-bottom-left-radius: 4px;
}

.chat-msg--mine {
  align-self: flex-end;
  background: var(--accent-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-widget__composer {
  padding: 16px 24px 24px;
  background: var(--bg-accent);
  border-top: 1px solid var(--border-color);
}

.chat-widget__composer-row {
  display: flex;
  gap: 12px;
}

.chat-widget__input {
  flex: 1;
  background: var(--bg-main);
}

/* -- Responsive -- */

@media (max-width: 768px) {
  .control-band {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .protected-header {
    grid-template-columns: 1fr;
  }
  
  .protected-actions {
    justify-content: flex-start;
  }
  
  .chat-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

/* ==========================================================================
   Landing Page
   ========================================================================== */

.landing-body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 32rem),
    linear-gradient(180deg, #020617 0%, #030712 100%);
}

.landing-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 78%);
}

.landing-bg-orb {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.24;
}

.landing-bg-orb--one {
  top: -160px;
  left: -120px;
  background: var(--accent-primary);
}

.landing-bg-orb--two {
  right: -160px;
  bottom: 120px;
  background: var(--accent-info);
}

.landing-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.landing-nav {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 14px 16px;
  margin-bottom: 72px;
  background: rgba(2, 6, 23, 0.74);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text-main);
}

.landing-brand:hover {
  opacity: 1;
}

.landing-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  color: white;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(14, 165, 233, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}

.landing-brand strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.landing-brand small {
  display: block;
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.landing-nav__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.landing-nav-link {
  padding: 9px 14px;
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.landing-nav-link:hover,
.landing-nav-link--active {
  color: var(--text-main);
  background: rgba(59, 130, 246, 0.14);
  opacity: 1;
}

.landing-nav-link--muted {
  color: var(--text-dim);
}

.landing-nav__actions {
  display: flex;
  justify-content: flex-end;
}

.landing-user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.landing-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
}

.landing-nav-cta {
  min-height: 42px;
  padding: 10px 18px;
}

.landing-main {
  display: grid;
  gap: 28px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.96fr);
  align-items: center;
  gap: 32px;
}

.landing-hero__content {
  padding: 18px 0;
}

.landing-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 12px;
  color: var(--accent-info);
  background: rgba(14, 165, 233, 0.09);
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-title {
  max-width: 760px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.94;
  letter-spacing: -0.07em;
  color: var(--text-main);
}

.landing-copy {
  max-width: 660px;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.75;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.primary-button--large,
.secondary-button--large {
  min-height: 52px;
  padding: 14px 22px;
  border-radius: 16px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.secondary-button:hover {
  opacity: 1;
  transform: translateY(-1px);
  border-color: var(--border-hover);
  background: rgba(30, 41, 59, 0.72);
}

.landing-trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
  margin-top: 36px;
}

.landing-trust-row div {
  padding: 16px;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid var(--border-color);
  border-radius: 18px;
}

.landing-trust-row strong {
  display: block;
  color: var(--text-main);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  line-height: 1;
}

.landing-trust-row span {
  display: block;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.landing-hero__visual {
  position: relative;
}

.landing-console-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.86)),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 20rem);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 30px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.landing-console-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 28%),
    linear-gradient(315deg, rgba(59,130,246,0.12), transparent 30%);
}

.landing-console-card > * {
  position: relative;
  z-index: 1;
}

.landing-console-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.landing-console-card__header h2 {
  font-size: 28px;
  line-height: 1;
}

.landing-device-list {
  display: grid;
  gap: 12px;
}

.landing-device-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: 18px;
}

.landing-device-row strong {
  display: block;
  color: var(--text-main);
  font-size: 14px;
}

.landing-device-row small {
  display: block;
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.landing-device-icon,
.landing-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.landing-device-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.landing-device-icon--blue {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
}

.landing-device-icon--amber {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.13);
}

.landing-device-icon--red {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.13);
}

.landing-rule {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.landing-rule--open {
  color: var(--accent-success);
  background: rgba(16, 185, 129, 0.11);
}

.landing-rule--light {
  color: var(--accent-warning);
  background: rgba(245, 158, 11, 0.12);
}

.landing-rule--hard {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.12);
}

.landing-console-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.landing-console-footer div {
  padding: 16px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid var(--border-color);
  border-radius: 18px;
}

.landing-console-footer span {
  display: block;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.landing-console-footer strong {
  display: block;
  margin-top: 6px;
  color: var(--text-main);
  font-size: 13px;
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.landing-feature-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.landing-feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  background: rgba(15, 23, 42, 0.72);
}

.landing-feature-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 16px;
}

.landing-feature-icon--cyan {
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.13);
}

.landing-feature-icon--green {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
}

.landing-feature-icon--orange {
  color: #fdba74;
  background: rgba(249, 115, 22, 0.12);
}

.landing-feature-card h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.landing-feature-card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.landing-ops-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 8px;
  background: var(--border-color);
  border: 1px solid var(--border-color);
  border-radius: 24px;
}

.landing-ops-strip div {
  padding: 22px;
  background: rgba(2, 6, 23, 0.68);
}

.landing-ops-strip span {
  display: block;
  margin-bottom: 18px;
  color: var(--accent-info);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.landing-ops-strip strong {
  display: block;
  color: var(--text-main);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px;
}

.landing-ops-strip p {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}

.landing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.landing-footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 980px) {
  .landing-nav {
    grid-template-columns: 1fr auto;
  }

  .landing-nav__links {
    display: none;
  }

  .landing-hero {
    grid-template-columns: 1fr;
  }

  .landing-hero__visual {
    order: -1;
  }

  .landing-title {
    max-width: 100%;
  }

  .landing-feature-grid,
  .landing-ops-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .landing-shell {
    width: min(100% - 28px, 1180px);
    padding-top: 14px;
  }

  .landing-nav {
    top: 10px;
    gap: 12px;
    padding: 12px;
    margin-bottom: 42px;
    border-radius: 20px;
  }

  .landing-brand small {
    display: none;
  }

  .landing-brand__mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .landing-nav-cta {
    padding: 10px 14px;
  }

  .landing-title {
    font-size: clamp(38px, 12vw, 54px);
  }

  .landing-actions,
  .landing-trust-row,
  .landing-console-footer {
    grid-template-columns: 1fr;
  }

  .landing-actions {
    display: grid;
  }

  .primary-button--large,
  .secondary-button--large {
    width: 100%;
  }

  .landing-device-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .landing-rule {
    grid-column: 2;
    justify-self: start;
  }

  .landing-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Auth / Sign In Page
   ========================================================================== */

.auth-body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 8%, rgba(59, 130, 246, 0.18), transparent 34rem),
    radial-gradient(circle at 88% 72%, rgba(14, 165, 233, 0.13), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #030712 100%);
}

.auth-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 78%);
}

.auth-bg-orb {
  position: fixed;
  width: 430px;
  height: 430px;
  border-radius: 999px;
  filter: blur(84px);
  pointer-events: none;
  opacity: 0.22;
}

.auth-bg-orb--one {
  top: -170px;
  left: -130px;
  background: var(--accent-primary);
}

.auth-bg-orb--two {
  right: -170px;
  bottom: 80px;
  background: var(--accent-info);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 44px;
  display: flex;
  flex-direction: column;
}

.auth-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 64px;
  padding: 14px 16px;
  background: rgba(2, 6, 23, 0.74);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
}

.auth-brand:hover {
  opacity: 1;
}

.auth-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: white;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(14, 165, 233, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}

.auth-brand strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.auth-brand small {
  display: block;
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.auth-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 800;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.auth-nav-link:hover {
  opacity: 1;
  color: var(--text-main);
  background: rgba(30, 41, 59, 0.76);
  border-color: var(--border-hover);
}

.auth-nav-link .material-symbols-outlined {
  font-size: 18px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 440px);
  align-items: center;
  gap: 36px;
  flex: 1;
}

.auth-brief {
  max-width: 650px;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 8px 12px;
  color: var(--accent-info);
  background: rgba(14, 165, 233, 0.09);
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-brief h1 {
  max-width: 720px;
  font-size: clamp(40px, 6vw, 70px);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.auth-brief > p {
  max-width: 620px;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.75;
}

.auth-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.auth-signal-grid div {
  min-height: 148px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.54);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  backdrop-filter: blur(14px);
}

.auth-signal-grid .material-symbols-outlined {
  display: inline-flex;
  margin-bottom: 20px;
  color: var(--accent-info);
  font-size: 28px;
}

.auth-signal-grid strong {
  display: block;
  color: var(--text-main);
  font-size: 14px;
}

.auth-signal-grid small {
  display: block;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.auth-platform-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  max-width: 620px;
  margin-top: 14px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.68), rgba(2, 6, 23, 0.7)),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 18rem);
  border: 1px solid var(--border-color);
  border-radius: 24px;
}

.auth-platform-card .section-kicker {
  margin-bottom: 0;
}

.auth-platform-card strong {
  display: block;
  color: var(--text-main);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  text-align: right;
}

.auth-platform-card small {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.auth-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.88)),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 20rem);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 30px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 28%),
    linear-gradient(315deg, rgba(59,130,246,0.12), transparent 30%);
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-card__top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.auth-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 18px;
}

.auth-card__top h2 {
  font-size: 30px;
  line-height: 1;
}

.auth-card__top p {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.65;
}

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-error .material-symbols-outlined {
  font-size: 20px;
  flex: 0 0 auto;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field > span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-input-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 14px;
  background: rgba(2, 6, 23, 0.48);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input-wrap:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: rgba(2, 6, 23, 0.68);
}

.auth-input-wrap .material-symbols-outlined {
  color: var(--text-dim);
  font-size: 21px;
}

.auth-input-wrap input {
  width: 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.auth-input-wrap input:focus {
  box-shadow: none;
}

.auth-input-wrap input::placeholder {
  color: rgba(148, 163, 184, 0.42);
}

.auth-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 4px;
  border-radius: 16px;
  font-size: 15px;
}

.auth-help {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.auth-help strong {
  display: block;
  color: var(--text-main);
  font-size: 14px;
}

.auth-help span {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.auth-help a {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.auth-links {
  margin-top: 18px;
  text-align: center;
}

.auth-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-links a:hover {
  color: var(--text-main);
  opacity: 1;
}

.auth-links .material-symbols-outlined {
  font-size: 18px;
}

@media (max-width: 980px) {
  .auth-nav {
    margin-bottom: 42px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-brief {
    max-width: 100%;
  }

  .auth-signal-grid {
    grid-template-columns: 1fr;
  }

  .auth-platform-card {
    max-width: 100%;
  }

  .auth-card {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    width: min(100% - 28px, 1120px);
    padding-top: 14px;
  }

  .auth-nav {
    padding: 12px;
    border-radius: 20px;
  }

  .auth-brand small {
    display: none;
  }

  .auth-brand__mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .auth-nav-link {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
  }

  .auth-nav-link:not(.auth-nav-link--wide) {
    font-size: 0;
  }

  .auth-nav-link .material-symbols-outlined {
    font-size: 20px;
  }

  .auth-brief h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .auth-platform-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-platform-card strong,
  .auth-platform-card small {
    text-align: left;
  }

  .auth-card {
    padding: 22px;
    border-radius: 24px;
  }

  .auth-card__top {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Minimal Operator Pages: Profile + Full Chat
   ========================================================================== */

.app-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.10), transparent 32rem),
    linear-gradient(180deg, #020617 0%, #030712 100%);
}

.operator-page {
  max-width: 1600px;
}

.page-compact-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 20px;
}

.page-compact-header h1 {
  font-size: 30px;
  line-height: 1.1;
}

.profile-compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.compact-panel {
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 20px;
  backdrop-filter: blur(12px);
}

.compact-panel--wide {
  margin-bottom: 16px;
}

.compact-panel__head {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.compact-panel__head--row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.compact-panel__head span {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.compact-panel__head strong {
  color: var(--text-main);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  line-height: 1.2;
}

.kv-list {
  display: grid;
  gap: 1px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 14px;
  overflow: hidden;
}

.kv-list--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kv-list div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  background: rgba(2, 6, 23, 0.58);
}

.kv-list dt {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kv-list dd {
  min-width: 0;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.status-text {
  font-weight: 800;
}

.status-active {
  color: var(--accent-success) !important;
}

.status-locked {
  color: var(--accent-warning) !important;
}

.status-disabled {
  color: var(--accent-danger) !important;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.mini-badge--active {
  color: var(--accent-success);
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.18);
}

.mini-badge--disabled {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.18);
}

.compact-empty {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

.profile-security-block {
  margin-top: 16px;
}

.support-chat-shell {
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  min-height: calc(100vh - 190px);
  margin-top: 20px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  backdrop-filter: blur(12px);
}

.support-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
}

.support-chat-header h1 {
  font-size: 22px;
  line-height: 1;
}

.status-badge--error {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.20);
}

.support-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 20px;
}

.support-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-height: 360px;
  color: var(--text-dim);
  text-align: center;
}

.support-empty .material-symbols-outlined {
  font-size: 36px;
}

.support-empty p {
  font-size: 14px;
  font-weight: 700;
}

.support-chat-messages .chat-msg {
  max-width: min(72%, 620px);
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  box-shadow: none;
}

.support-chat-messages .chat-msg--theirs {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 5px;
}

.support-chat-messages .chat-msg--mine {
  align-self: flex-end;
  background: rgba(59, 130, 246, 0.92);
  color: white;
  border-bottom-right-radius: 5px;
}

.support-chat-messages .chat-msg__sender {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.72;
}

.support-chat-messages .chat-msg__text {
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.support-chat-messages .msg-meta {
  margin-top: 6px;
  font-size: 10px;
  opacity: 0.62;
}

.support-chat-composer {
  padding: 14px;
  background: rgba(2, 6, 23, 0.40);
  border-top: 1px solid var(--border-color);
}

.support-chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.support-chat-input {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
}

.support-chat-send {
  min-height: 46px;
  border-radius: 14px;
  padding-inline: 16px;
}

@media (max-width: 860px) {
  .profile-compact-grid,
  .kv-list--four {
    grid-template-columns: 1fr;
  }

  .support-chat-shell {
    min-height: calc(100vh - 170px);
  }

  .support-chat-messages .chat-msg {
    max-width: 86%;
  }
}

@media (max-width: 640px) {
  .page-compact-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .compact-panel {
    padding: 16px;
    border-radius: 16px;
  }

  .support-chat-header {
    padding: 16px;
  }

  .support-chat-messages {
    padding: 14px;
  }

  .support-chat-input-row {
    grid-template-columns: 1fr;
  }

  .support-chat-send {
    width: 100%;
  }
}

/* ==========================================================================
   Minimal Operator Shell Overrides
   ========================================================================== */

.op-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.54);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  backdrop-filter: blur(12px);
}

.op-header__brand,
.op-header__account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.op-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 12px;
}

.op-header h1 {
  font-size: 16px;
  line-height: 1.1;
}

.op-header p {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.op-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(2, 6, 23, 0.38);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.op-nav__link {
  padding: 8px 12px;
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.op-nav__link:hover,
.op-nav__link--active {
  opacity: 1;
  color: var(--text-main);
  background: rgba(59, 130, 246, 0.13);
}

.op-header__account {
  justify-content: flex-end;
}

.op-user {
  max-width: 150px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.op-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid var(--border-color);
  border-radius: 11px;
  cursor: pointer;
}

.op-logout:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.op-logout .material-symbols-outlined {
  font-size: 19px;
}

/* Password */

.password-panel {
  margin-top: 16px;
}

.password-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.password-form label {
  display: grid;
  gap: 7px;
}

.password-form label span {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.password-form input {
  min-height: 44px;
  border-radius: 12px;
}

.password-submit {
  min-height: 44px;
  padding-inline: 18px;
  border-radius: 12px;
}

/* Minimal floating chat */

.chat-widget__toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.widget-popup {
  width: 360px;
  height: 480px;
  background: rgba(2, 6, 23, 0.96);
  border-radius: 18px;
}

.widget-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
}

.widget-header strong {
  display: block;
  font-size: 14px;
}

.widget-status {
  display: inline-flex;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.widget-status--guest {
  color: var(--accent-info);
}

.widget-status--offline {
  color: var(--accent-danger);
}

.widget-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
}

.widget-close:hover {
  color: var(--text-main);
}

.widget-close .material-symbols-outlined {
  font-size: 18px;
}

.widget-content {
  min-height: 0;
}

.widget-chat {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
}

.widget-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 14px;
}

.widget-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
}

.widget-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border-color);
}

.widget-input {
  min-height: 42px;
  border-radius: 12px;
}

.widget-send {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
}

.widget-send .material-symbols-outlined {
  font-size: 18px;
}

.widget-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.widget-form label {
  display: grid;
  gap: 7px;
}

.widget-form label span {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.widget-form textarea {
  resize: vertical;
}

.widget-submit {
  min-height: 42px;
  border-radius: 12px;
}

.widget-fab {
  width: 54px;
  height: 54px;
  border-radius: 16px;
}

.widget-fab .material-symbols-outlined {
  font-size: 24px;
}

/* Make existing compact panels flatter */

.compact-panel {
  box-shadow: none;
}

.page-compact-header {
  margin-bottom: 16px;
}

.page-compact-header h1 {
  font-size: 24px;
}

@media (max-width: 860px) {
  .op-header {
    grid-template-columns: 1fr;
  }

  .op-nav {
    justify-content: space-between;
  }

  .op-nav__link {
    flex: 1;
    text-align: center;
  }

  .op-header__account {
    justify-content: space-between;
  }

  .password-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .widget-popup {
    position: fixed;
    inset: auto 12px 78px 12px;
    width: auto;
    height: min(520px, calc(100vh - 110px));
    border-radius: 18px;
  }
}

/* ==========================================================================
   Operator Dashboard & Device Grid
   ========================================================================== */

.refresh-btn {
  padding-inline: 16px;
  border-radius: 12px;
}

.refresh-btn .material-symbols-outlined {
  font-size: 19px;
}

.dashboard-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}

.dashboard-banner .material-symbols-outlined {
  font-size: 21px;
  flex: 0 0 auto;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.device-node {
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  backdrop-filter: blur(14px);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.device-node:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.device-node__header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.3);
  border-bottom: 1px solid var(--border-color);
}

.device-node__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 14px;
}

.device-node__title h3 {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-node__title code {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.device-node__meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border-color);
  padding-block: 0;
}

.device-node__meta .meta-item {
  padding: 14px 18px;
  background: rgba(2, 6, 23, 0.48);
}

.device-node__meta .meta-item span {
  display: block;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.device-node__meta .meta-item strong {
  display: block;
  margin-top: 5px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-node__actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.2);
}

.device-action-btn {
  width: 100%;
  min-height: 40px;
  padding-inline: 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.action-btn--unlock {
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
}

.action-btn--unlock:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--border-hover);
}

.action-btn--light {
  color: var(--accent-warning);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.action-btn--light:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}

.action-btn--hard {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.18);
}

.action-btn--hard:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.device-empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  min-height: 400px;
  padding: 40px;
  background: rgba(15, 23, 42, 0.4);
  border: 2px dashed var(--border-color);
  border-radius: 24px;
  text-align: center;
}

.empty-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  color: var(--text-dim);
  background: rgba(15, 23, 42, 0.6);
  border-radius: 20px;
}

.empty-icon-wrap .material-symbols-outlined {
  font-size: 36px;
}

.device-empty-state h3 {
  font-size: 22px;
}

.device-empty-state p {
  max-width: 360px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.dashboard-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  padding: 18px 20px;
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid var(--border-color);
  border-radius: 18px;
}

.footer-stat {
  display: grid;
  gap: 4px;
}

.footer-stat span {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-stat strong {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .device-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Admin Suite Layout & Components
   ========================================================================== */

.admin-body {
  min-height: 100vh;
  overflow-x: hidden;
  background: #020617;
}

.admin-bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.05), transparent 40%),
    linear-gradient(rgba(148, 163, 184, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
}

.admin-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  background: rgba(2, 6, 23, 0.8);
  border-right: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  color: var(--text-main);
}

.admin-brand:hover {
  opacity: 1;
}

.admin-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: white;
  background: linear-gradient(135deg, #f97316, #ea580c);
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(234, 88, 12, 0.2);
}

.admin-brand strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  line-height: 1.1;
}

.admin-brand small {
  display: block;
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-sidebar-nav {
  display: grid;
  gap: 6px;
}

.admin-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--text-muted);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s;
}

.admin-nav-item:hover {
  color: var(--text-main);
  background: rgba(148, 163, 184, 0.08);
  opacity: 1;
}

.admin-nav-item--active {
  color: white;
  background: rgba(148, 163, 184, 0.12);
  opacity: 1;
}

.admin-nav-item .material-symbols-outlined {
  font-size: 20px;
  opacity: 0.7;
}

.admin-nav-item--active .material-symbols-outlined {
  color: #fb923c;
  opacity: 1;
}

.admin-nav-item .active-indicator {
  position: absolute;
  left: 0;
  width: 3px;
  height: 18px;
  background: #fb923c;
  border-radius: 0 4px 4px 0;
}

.admin-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.admin-user-card__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #1e293b;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 900;
}

.admin-user-card__info {
  flex: 1;
  min-width: 0;
}

.admin-user-card__info strong {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-card__info span {
  display: block;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
}

.admin-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-logout-btn:hover {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.1);
}

.admin-logout-btn .material-symbols-outlined {
  font-size: 18px;
}

.admin-main {
  display: flex;
  flex-direction: column;
}

.admin-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 72px;
  padding-inline: 32px;
  background: rgba(2, 6, 23, 0.4);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.admin-top-bar__status {
  display: flex;
  align-items: center;
  gap: 24px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.status-dot--active { background: var(--accent-success); box-shadow: 0 0 8px var(--accent-success); }
.status-dot--warning { background: var(--accent-warning); box-shadow: 0 0 8px var(--accent-warning); }

.admin-content {
  flex: 1;
  padding: 32px;
}

.admin-page-header {
  margin-bottom: 32px;
}

.admin-page-header h1 {
  margin-top: 4px;
  font-size: 32px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.stat-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
}

.stat-card__icon--blue { color: #3b82f6; background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2); }
.stat-card__icon--green { color: #10b981; background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); }
.stat-card__icon--amber { color: #f59e0b; background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); }

.stat-card__icon .material-symbols-outlined { font-size: 28px; }

.stat-label {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-value {
  display: block;
  margin-top: 4px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
}

.admin-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
}

.admin-panel {
  padding: 24px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 24px;
}

.admin-panel__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.admin-panel__header .material-symbols-outlined {
  color: var(--text-dim);
  font-size: 20px;
}

.admin-panel__header h2 {
  font-size: 18px;
}

.admin-action-list {
  display: grid;
  gap: 12px;
}

.admin-action-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  transition: all 0.2s;
}

.admin-action-item:hover {
  border-color: var(--border-hover);
  background: rgba(30, 41, 59, 0.7);
  opacity: 1;
}

.admin-action-item .material-symbols-outlined {
  color: #fb923c;
  font-size: 24px;
}

.admin-action-item strong {
  display: block;
  font-size: 15px;
}

.admin-action-item small {
  display: block;
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.admin-form {
  display: grid;
  gap: 20px;
}

.admin-field {
  display: grid;
  gap: 10px;
}

.admin-field label span {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.admin-field label small {
  display: block;
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.admin-field input {
  min-height: 48px;
  border-radius: 12px;
}

.admin-submit {
  min-height: 48px;
  border-radius: 12px;
}

@media (max-width: 1100px) {
  .admin-layout {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .admin-sidebar {
    padding: 16px;
  }

  .admin-brand div,
  .admin-nav-item span,
  .admin-user-card__info,
  .admin-logout-btn {
    display: none;
  }

  .admin-brand { margin-bottom: 30px; justify-content: center; }
  .admin-nav-item { justify-content: center; padding: 12px; }
  .admin-user-card { justify-content: center; padding: 8px; border-radius: 12px; }
}

@media (max-width: 900px) {
  .admin-stats-grid,
  .admin-content-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Admin User Management
   ========================================================================== */

.admin-select {
  width: 100%;
  min-height: 48px;
  padding-inline: 14px;
  background: rgba(2, 6, 23, 0.48);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
}

.clearance-list {
  display: grid;
  gap: 16px;
}

.clearance-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.clearance-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 24px;
  padding-inline: 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.clearance-badge--admin { color: #fb923c; background: rgba(251, 146, 60, 0.1); border: 1px solid rgba(251, 146, 60, 0.2); }
.clearance-badge--supervisor { color: #38bdf8; background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.2); }
.clearance-badge--operator { color: #94a3b8; background: rgba(148, 163, 184, 0.1); border: 1px solid rgba(148, 163, 184, 0.2); }

.clearance-item strong { display: block; font-size: 14px; }
.clearance-item p { margin-top: 4px; color: var(--text-dim); font-size: 12px; font-weight: 700; line-height: 1.4; }

.wide-panel {
  width: 100%;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-color);
}

.admin-table td {
  padding: 16px 20px;
  background: rgba(2, 6, 23, 0.4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #1e293b;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.role-tag {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.role-tag--admin { color: #f97316; background: rgba(249, 115, 22, 0.1); }
.role-tag--supervisor { color: #0ea5e9; background: rgba(14, 165, 233, 0.1); }
.role-tag--operator { color: #94a3b8; background: rgba(148, 163, 184, 0.1); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.status-pill--success { color: var(--accent-success); background: rgba(16, 185, 129, 0.1); }
.status-pill--error { color: var(--accent-danger); background: rgba(239, 68, 68, 0.1); }

.admin-table-actions {
  display: flex;
  gap: 8px;
}

.admin-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-dim);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-icon-btn:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
  background: rgba(30, 41, 59, 0.8);
}

.admin-icon-btn--danger:hover {
  color: var(--accent-danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}

.admin-icon-btn .material-symbols-outlined {
  font-size: 18px;
}

/* ==========================================================================
   Admin Subscriptions
   ========================================================================== */

.admin-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.plan-guide {
  display: grid;
  gap: 10px;
}

.plan-guide-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.plan-guide-item strong {
  color: #fb923c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.plan-guide-item span {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.admin-note-box {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding: 14px;
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 12px;
}

.admin-note-box .material-symbols-outlined {
  color: #3b82f6;
  font-size: 18px;
}

.admin-note-box p {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.quota-meter {
  min-width: 140px;
}

.quota-text {
  display: block;
  margin-bottom: 6px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
}

.quota-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
}

.quota-progress {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 999px;
}

.ttl-badge {
  display: inline-flex;
  padding: 4px 10px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.ttl-badge--expired {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.08);
}

.status-pill--inactive {
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.05);
}

/* ==========================================================================
   Admin Device Scanner & Extras
   ========================================================================== */

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-refresh-btn {
  padding-inline: 16px;
  border-radius: 12px;
  font-size: 13px;
}

.admin-count-badge {
  margin-left: auto;
  padding: 4px 10px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
}

.admin-table-empty {
  padding: 60px !important;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 700;
}

/* Ensure ActionButton within admin table doesn't break layout */
.admin-table .device-action-btn {
  min-width: 70px;
  min-height: 34px;
  padding-inline: 10px;
  font-size: 11px;
}

@media (max-width: 1024px) {
  .admin-top-bar__status {
    display: none;
  }
}

/* ==========================================================================
   Admin Sign-In
   ========================================================================== */

.admin-auth-panel {
  max-width: 440px;
  background: rgba(2, 6, 23, 0.9);
}

.admin-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px 12px;
  color: #fb923c;
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.admin-access-badge .material-symbols-outlined {
  font-size: 16px;
}

.admin-auth-submit {
  width: 100%;
  min-height: 52px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  border: none;
  box-shadow: 0 10px 20px rgba(234, 88, 12, 0.2);
}

.admin-auth-submit:hover {
  background: linear-gradient(135deg, #fb923c, #f97316);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(234, 88, 12, 0.3);
}

/* ==========================================================================
   Admin System Diagnostics
   ========================================================================== */

.admin-kv-list {
  display: grid;
  gap: 1px;
  background: var(--border-color);
  border-radius: 16px;
  overflow: hidden;
}

.admin-kv-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.6);
}

.admin-kv-item span {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
}

.admin-kv-item strong {
  font-size: 14px;
}

.admin-status-text {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-success);
  font-size: 12px;
  font-weight: 900;
}

.admin-warning-box {
  display: flex;
  gap: 16px;
  padding: 18px;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 16px;
}

.admin-warning-box .material-symbols-outlined {
  color: var(--accent-danger);
  font-size: 24px;
}

.admin-warning-box strong {
  display: block;
  color: var(--accent-danger);
  font-size: 14px;
}

.admin-warning-box p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.admin-reset-btn {
  width: 100%;
  min-height: 48px;
  color: var(--accent-danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.admin-reset-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--accent-danger);
}

.admin-console {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.admin-console__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.admin-console__bar .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.admin-console__bar .dot.red { background: #ef4444; }
.admin-console__bar .dot.yellow { background: #f59e0b; }
.admin-console__bar .dot.green { background: #10b981; }

.admin-console__bar span {
  margin-left: 8px;
  color: #94a3b8;
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
}

.admin-console__content {
  padding: 20px;
  margin: 0;
  color: #10b981;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 500px;
  overflow-y: auto;
}

/* ==========================================================================
   Support Chat Page (One-Screen Responsive)
   ========================================================================== */

/* Full-height layout for the chat page */
.operator-page:has(.support-chat-shell) {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px 20px 20px !important;
  max-width: 1400px;
  margin: 0 auto;
}

.support-chat-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}

.support-chat-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  background: rgba(2, 6, 23, 0.3);
  border-bottom: 1px solid var(--border-color);
}

.support-chat-header h1 {
  font-size: 24px;
  margin-top: 2px;
}

.support-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: 
    radial-gradient(circle at 50% 50%, rgba(30, 58, 138, 0.05), transparent 70%);
}

/* Scrollbar styling for messages */
.support-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.support-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.support-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.1);
  border-radius: 10px;
}

.support-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.2);
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  padding: 14px 18px;
  border-radius: 18px;
  animation: msgAppear 0.3s ease-out;
}

@keyframes msgAppear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-msg--mine {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent-primary), #2563eb);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.chat-msg--theirs {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}

.chat-msg__sender {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  opacity: 0.8;
}

.chat-msg__text {
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
}

.msg-meta {
  margin-top: 8px;
  text-align: right;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.6;
}

.support-chat-composer {
  flex: 0 0 auto;
  padding: 24px 28px;
  background: rgba(2, 6, 23, 0.4);
  border-top: 1px solid var(--border-color);
}

.support-chat-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
}

.support-chat-input {
  min-height: 52px;
  background: rgba(2, 6, 23, 0.6) !important;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  font-size: 15px;
}

.support-chat-input:focus {
  border-color: var(--accent-primary);
  background: rgba(2, 6, 23, 0.8) !important;
}

.support-chat-send {
  min-width: 120px;
  min-height: 52px;
  border-radius: 16px;
}

.support-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  text-align: center;
  gap: 16px;
}

.support-empty .material-symbols-outlined {
  font-size: 48px;
  opacity: 0.3;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .operator-page:has(.support-chat-shell) {
    padding: 8px !important;
  }
  
  .support-chat-shell {
    border-radius: 16px;
  }
  
  .support-chat-header {
    padding: 16px 20px;
  }
  
  .support-chat-messages {
    padding: 16px 20px;
  }
  
  .chat-msg {
    max-width: 90%;
  }
  
  .support-chat-composer {
    padding: 16px 20px;
  }
  
  .support-chat-input-row {
    gap: 10px;
  }
  
  .support-chat-send span:not(.material-symbols-outlined) {
    display: none;
  }
  
  .support-chat-send {
    min-width: 52px;
  }
}

/* Ensure body doesn't scroll when chat is active */
body:has(.support-chat-shell) {
  overflow: hidden;
}

/* ==========================================================================
   Admin Support Console
   ========================================================================== */

.admin-chat-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 200px);
  min-height: 500px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.admin-chat-sidebar {
  display: flex;
  flex-direction: column;
  background: rgba(2, 6, 23, 0.3);
  border-right: 1px solid var(--border-color);
}

.admin-chat-sidebar .sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.admin-chat-sidebar .sidebar-header h2 {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.admin-chat-sidebar .sidebar-header .material-symbols-outlined {
  color: var(--accent-info);
  font-size: 20px;
}

.admin-user-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.admin-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  color: var(--text-muted);
  transition: all 0.2s;
  margin-bottom: 4px;
}

.admin-user-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.admin-user-item--active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-main);
}

.user-avatar-mini--guest {
  background: #334155;
  color: #94a3b8;
}

.user-item-info {
  flex: 1;
  min-width: 0;
}

.user-item-info strong {
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-item-info span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.6;
}

.active-indicator {
  font-size: 18px;
  color: var(--accent-primary);
}

.admin-chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  background: rgba(2, 6, 23, 0.2);
  border-bottom: 1px solid var(--border-color);
}

.active-partner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-dim);
  gap: 16px;
}

.admin-chat-composer {
  padding: 24px 28px;
  background: rgba(2, 6, 23, 0.3);
  border-top: 1px solid var(--border-color);
}

.admin-chat-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
}

.admin-chat-input {
  min-height: 52px;
  background: rgba(2, 6, 23, 0.6) !important;
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.admin-chat-send {
  min-width: 140px;
}

.admin-chat-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 12px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1024px) {
  .admin-chat-shell {
    grid-template-columns: 80px 1fr;
  }
  
  .admin-chat-sidebar .sidebar-header h2,
  .user-item-info {
    display: none;
  }
  
  .admin-chat-sidebar .sidebar-header {
    justify-content: center;
  }
  
  .admin-user-item {
    justify-content: center;
    padding: 12px;
  }
}

/* ==========================================================================
   Global Responsiveness & Dashboard Refinements
   ========================================================================== */

/* Dashboard Footer Stacking */
@media (max-width: 640px) {
  .dashboard-footer {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }
  
  .footer-stat {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
  }
  
  .footer-stat:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
}

/* Device Node Mobile Adjustments */
@media (max-width: 480px) {
  .device-node__header {
    padding: 14px;
  }
  
  .device-node__icon {
    width: 40px;
    height: 40px;
  }
  
  .device-node__title h3 {
    font-size: 15px;
  }
  
  .device-node__actions {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  
  .device-action-btn {
    min-height: 44px;
  }
}

/* Admin Top Bar Stacking */
@media (max-width: 768px) {
  .admin-top-bar {
    height: auto;
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .admin-top-bar__status {
    width: 100%;
    justify-content: space-between;
  }
}

/* Page Header Adjustments */
@media (max-width: 860px) {
  .admin-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .admin-header-actions {
    width: 100%;
  }
  
  .admin-refresh-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Universal Table Containment */
.admin-table-wrap, .table-container {
  -webkit-overflow-scrolling: touch;
}

/* Mobile-First Body Fixes */
@media (max-width: 1024px) {
  .admin-content {
    padding: 20px;
  }
}

/* ==========================================================================
   Admin Authorization Page (Premium SOC Aesthetic)
   ========================================================================== */

.admin-auth-body {
  position: relative;
  min-height: 100vh;
  background: #020617;
  color: var(--text-main);
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(rgba(148, 163, 184, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
}

.auth-orb {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
}

.auth-orb--primary {
  top: -100px;
  left: -100px;
  background: var(--accent-primary);
}

.auth-orb--secondary {
  bottom: -100px;
  right: -100px;
  background: #f97316;
}

.admin-auth-shell {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  padding: 20px;
}

.admin-auth-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 32px;
  padding: 40px;
  backdrop-filter: blur(24px);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.admin-auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.admin-security-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.2);
  color: #f97316;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 24px;
}

.admin-auth-header h1 {
  font-size: 32px;
  margin-bottom: 12px;
}

.admin-auth-header p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

.admin-error-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 16px;
  color: var(--accent-danger);
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 700;
}

.admin-auth-form {
  display: grid;
  gap: 20px;
}

.admin-auth-field label {
  display: grid;
  gap: 8px;
}

.field-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.field-label-row .material-symbols-outlined {
  font-size: 16px;
}

.admin-auth-field input {
  width: 100%;
  min-height: 52px;
  background: rgba(2, 6, 23, 0.5);
  border-radius: 16px;
  padding-inline: 20px;
  font-size: 15px;
}

.admin-auth-field input:focus {
  background: rgba(2, 6, 23, 0.8);
}

.admin-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  background: linear-gradient(135deg, var(--accent-primary), #2563eb);
  color: white;
  border: none;
  border-radius: 16px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.05em;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.admin-auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.admin-auth-footer {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.tunnel-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-success);
  font-size: 11px;
  font-weight: 900;
}

.status-pulse {
  width: 8px;
  height: 8px;
  background: var(--accent-success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.return-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  transition: color 0.2s;
}

.return-link:hover {
  color: var(--text-main);
}

.return-link .material-symbols-outlined {
  font-size: 18px;
}
