:root {
  --bg-root: #090e1a;
  --bg-surface: #111827;
  --bg-card: #182235;
  --bg-card-hover: #1e2b42;
  --bg-input: #0c1322;
  --border-color: #293548;
  --border-subtle: rgba(148, 163, 184, 0.14);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.14);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.15);
  --rose: #ef4444;
  --rose-bg: rgba(239, 68, 68, 0.15);
  --purple: #8b5cf6;
  --cyan: #06b6d4;
}

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

/* Custom Dark Slim Scrollbar (No ugly white Windows scrollbars) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

html,
body {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background-color: var(--bg-root);
  color: var(--text-main);
  font-size: 12px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}

/* =====================================================================
   SINGLE-ROW COMPACT TOP HEADER
   ===================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 10px;
  background: linear-gradient(90deg, #0c1322 0%, #171836 50%, #0c1322 100%);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  gap: 6px;
  white-space: nowrap;
}

.brand-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-badge {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  font-weight: 800;
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 5px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(12, 19, 34, 0.85);
  padding: 2px;
  border-radius: 7px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.nav-tab {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

.tab-count {
  background: rgba(9, 14, 26, 0.5);
  padding: 0 5px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.relay-combo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 4px 0 8px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
}

.header-select-clean {
  border: none !important;
  background: transparent !important;
  height: 24px;
  padding: 0 4px !important;
  font-size: 11px !important;
  font-weight: 600;
  max-width: 122px;
  outline: none;
}

.btn-port-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-port-badge:hover {
  background: rgba(59, 130, 246, 0.28);
  color: #fff;
}

.auth-port-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid rgba(51, 65, 85, 0.45);
}

.auth-port-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.auth-port-input {
  width: 72px !important;
  height: 22px !important;
  padding: 1px 6px !important;
  font-family: var(--font-mono);
  font-size: 11px !important;
  font-weight: 700;
  color: #60a5fa !important;
  text-align: center;
}

.header-select {
  height: 26px;
  padding: 1px 6px !important;
  font-size: 11px !important;
  max-width: 105px;
}

.relay-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}

.relay-combo.ok .relay-dot,
.relay-pill.ok .relay-dot {
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
}

.relay-combo.err .relay-dot,
.relay-pill.err .relay-dot {
  background: var(--rose);
}

/* Top Header User Pill */
.auth-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.32);
  padding: 0 6px;
  border-radius: 99px;
  font-size: 10.5px;
}

.auth-user-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  flex-shrink: 0;
}

.auth-user-email {
  color: #e2e8f0;
  font-weight: 700;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-plan-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.38);
  padding: 0 5px;
  border-radius: 99px;
  font-size: 9.8px;
  font-weight: 700;
  white-space: nowrap;
}

.btn-auth-logout {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 99px;
  padding: 0.5px 6px;
  font-size: 9.8px;
  font-weight: 700;
  cursor: pointer;
}

.btn-auth-logout:hover {
  background: #ef4444;
  color: #ffffff;
}

/* =====================================================================
   MAIN WORKSPACE (FITS VIEWPORT 100%)
   ===================================================================== */
.workspace {
  flex: 1;
  min-height: 0;
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

/* =====================================================================
   COMPACT CLUSTER STRIP
   ===================================================================== */
.cluster-overview-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.cluster-overview-section.collapsed-for-view {
  display: none !important;
}

.cluster-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cluster-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #e2e8f0;
}

.cluster-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.cluster-head-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.cluster-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 7px;
}

.cluster-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--cluster-color, #3b82f6);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  transition: all 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cluster-card:hover {
  background: var(--bg-card-hover);
}

.cluster-card.active {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.18) 0%, rgba(24, 34, 53, 0.96) 100%);
  border-color: var(--cluster-color, #3b82f6);
  box-shadow: 0 0 0 1px var(--cluster-color, #3b82f6);
}

.cluster-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.cluster-name {
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cluster-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cluster-color, #3b82f6);
  display: inline-block;
  flex-shrink: 0;
}

.cluster-acc-cnt {
  font-size: 10.5px;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(12, 19, 34, 0.7);
  padding: 1px 6px;
  border-radius: 99px;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.cluster-status-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.st-mini {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.st-mini.live {
  background: var(--emerald-bg);
  color: #34d399;
}

.st-mini.die {
  background: var(--rose-bg);
  color: #f87171;
}

.st-mini.debt {
  background: var(--amber-bg);
  color: #fbbf24;
}

.cluster-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 6px;
  padding-top: 4px;
  border-top: 1px dashed rgba(148, 163, 184, 0.15);
  font-size: 10.5px;
}

.cm-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cm-lbl {
  color: var(--text-muted);
  font-size: 9.8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-val {
  font-weight: 700;
  color: #f1f5f9;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-val.c-green { color: #34d399; }
.cm-val.c-blue { color: #60a5fa; }
.cm-val.c-amber { color: #fbbf24; }
.cm-val.c-cyan { color: #22d3ee; }
.cm-val.c-rose { color: #f87171; }
.cm-val.c-purple { color: #c084fc; }

/* =====================================================================
   VIEW PANELS & SPLIT LAYOUTS (FITTED TO REMAINING HEIGHT)
   ===================================================================== */
.view-panel {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.view-panel.active {
  display: flex;
}

.split-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.split-main-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--panel-accent, #3b82f6);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
}

.panel-header-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.mini-log-box {
  background: rgba(12, 19, 34, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 7px 9px;
  max-height: 120px;
  overflow-y: auto;
  font-family: Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}

/* =====================================================================
   TOOLBARS & CONTROLS
   ===================================================================== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.toolbar-section-label {
  font-weight: 700;
  font-size: 12.5px;
  color: #e2e8f0;
  margin-right: 2px;
}

.toolbar-divider-group {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 6px;
  border-left: 1px solid var(--border-color);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="month"],
select,
textarea {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
  outline: none;
  color-scheme: dark;
}

.date-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(12, 19, 34, 0.75);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 6px;
}

.date-filter-group input[type="date"],
.date-filter-group input[type="month"] {
  border: none;
  background: transparent;
  padding: 2px 4px;
  font-size: 11.5px;
  font-family: Consolas, monospace;
}

.date-filter-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22);
}

.btn {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: #334155;
  border-color: #475569;
}

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

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #3b82f6;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.btn-emerald {
  background: linear-gradient(135deg, #059669, #047857);
  border-color: #10b981;
  color: #fff;
}

.btn-emerald:hover:not(:disabled) {
  background: linear-gradient(135deg, #047857, #065f46);
}

.btn-amber {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.btn-amber:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.28);
}

.btn-purple {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.5);
  color: #ddd6fe;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.btn-xs {
  padding: 3.5px 8px;
  font-size: 11.5px;
  border-radius: 5px;
}

/* Status Banner */
.progress-banner {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* =====================================================================
   TABLES (FITTED, NO AWKWARD OVERFLOW)
   ===================================================================== */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.table-balance-compact {
  flex: 0 0 auto;
  max-height: 215px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.8px;
}

thead th {
  position: sticky;
  top: 0;
  background: #162032;
  color: #cbd5e1;
  font-weight: 700;
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  user-select: none;
  z-index: 10;
}

thead th[data-sort],
thead th[data-rsort] {
  cursor: pointer;
}

thead th[data-sort]:hover,
thead th[data-rsort]:hover {
  color: #fff;
  background: #1e293b;
}

tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s ease;
}

tbody tr:hover {
  background: rgba(59, 130, 246, 0.07);
}

tbody td {
  padding: 6px 8px;
  vertical-align: middle;
}

tfoot td {
  position: sticky;
  bottom: 0;
  background: #162032;
  font-weight: 700;
  padding: 7px 8px;
  border-top: 2px solid var(--border-color);
  z-index: 9;
}

.num {
  text-align: right;
  font-family: Consolas, "Courier New", monospace;
  white-space: nowrap;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.st-live {
  background: var(--emerald-bg);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-badge.st-die {
  background: var(--rose-bg);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.status-badge.st-debt {
  background: var(--amber-bg);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-badge.st-other {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.cluster-select-inline {
  background: rgba(12, 19, 34, 0.9);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--cl-color, #3b82f6);
  color: #f8fafc;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  max-width: 122px;
}

.sub-text {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.app-link {
  color: #60a5fa;
  text-decoration: none;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-link:hover {
  text-decoration: underline;
  color: #93c5fd;
}

.app-badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  font-family: Consolas, monospace;
}

/* Via User Pill on Permissions Table */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--border-color);
  padding: 1.5px 6px;
  border-radius: 5px;
  font-size: 11px;
  margin: 1px 3px 1px 0;
}

.user-pill.is-admin {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(37, 99, 235, 0.14);
}

.user-pill.is-hidden {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.user-pill-del {
  background: transparent;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-weight: 800;
  font-size: 10.5px;
  padding: 0 2px;
  border-radius: 3px;
}

.user-pill-del:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

/* Cluster Matrix Detail Grid (View 5) */
.cluster-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.cluster-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--cluster-color, #3b82f6);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cluster-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cluster-box-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: rgba(12, 19, 34, 0.7);
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.cluster-acc-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 220px;
  overflow-y: auto;
}

.cluster-acc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 11.5px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 13.5px;
}

.modal-body {
  padding: 12px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid var(--border-color);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.form-field label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Toast */
#toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: #1e293b;
  color: #fff;
  border: 1px solid #3b82f6;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  display: none;
  z-index: 3500;
}

/* =====================================================================
   GOOGLE LOGIN & JVS LICENSE AUTHENTICATION GATE (MINIMALIST)
   ===================================================================== */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #172554 0%, #090d16 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 3000;
  backdrop-filter: blur(8px);
}

.auth-gate-overlay.hidden {
  display: none !important;
}

.auth-card {
  width: 100%;
  max-width: 340px;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid #263248;
  border-top: 4px solid #3b82f6;
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.auth-alert {
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}

.auth-alert-info {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #bfdbfe;
}

.auth-alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.auth-alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.auth-alert-warn {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.btn-google-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #ffffff;
  color: #0f172a;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.15s ease;
}

.btn-google-signin:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.btn-google-signin:disabled {
  opacity: 0.7;
  cursor: wait;
}

.google-g-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
