:root {
  --bg: #070b14;
  --surface: rgba(15, 23, 42, 0.82);
  --surface-solid: #0f172a;
  --surface-hover: rgba(30, 41, 59, 0.72);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(56, 189, 248, 0.35);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0284c7;
  --emerald: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 16px;
}

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

body {
  font-family: "Tajawal", "Inter", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.mono {
  font-family: "JetBrains Mono", monospace;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

.hidden {
  display: none !important;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(600px circle at 15% 15%, rgba(56, 189, 248, 0.14), transparent 60%),
    radial-gradient(500px circle at 85% 80%, rgba(16, 185, 129, 0.11), transparent 60%);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 36px 30px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.login-title {
  font-size: 1.65rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin-bottom: 24px;
}

.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #cbd5e1;
}

.password-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.input-field,
.search-input,
.select-input {
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 0.96rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field {
  width: 100%;
  direction: ltr;
  text-align: left;
  font-family: "JetBrains Mono", monospace;
}

.input-field:focus,
.search-input:focus,
.select-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.btn-eye {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 12px;
  padding: 0 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  white-space: nowrap;
}

.btn-eye:hover {
  color: var(--text);
}

.btn-primary,
.btn-secondary,
.btn-danger {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.2s, background-color 0.2s;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
}

.btn-primary:hover {
  opacity: 0.94;
}

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

.btn-secondary {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 8px 14px;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.28);
  padding: 8px 14px;
}

.alert-box {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.security-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  justify-content: center;
}

.pill {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
}

.dashboard-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 20px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(16, 185, 129, 0.2));
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}

.brand-title {
  font-size: 1.28rem;
  font-weight: 800;
}

.brand-meta {
  font-size: 0.84rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.updated-pill {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 12px;
}

.auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #cbd5e1;
  cursor: pointer;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.kpi-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.kpi-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
}

.kpi-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.kpi-sub {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.progress-track {
  height: 8px;
  background: rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--emerald);
  transition: width 0.4s ease, background-color 0.3s ease;
}

.progress-fill.warn {
  background: var(--amber);
}

.progress-fill.crit {
  background: var(--red);
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.panel-header {
  margin-bottom: 14px;
}

.panel-title {
  font-size: 1.08rem;
  font-weight: 800;
}

.panel-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.services-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.service-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid var(--border);
  font-size: 0.86rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-dot.down {
  background: var(--red);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-input,
.select-input {
  padding: 8px 12px;
  font-size: 0.88rem;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.data-table th,
.data-table td {
  padding: 13px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.data-table th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.82rem;
  background: rgba(2, 6, 23, 0.38);
}

.data-table tbody tr:hover {
  background: var(--surface-hover);
}

.state-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.state-badge.on {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.state-badge.off {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.quota-cell {
  min-width: 150px;
}

.quota-mini-bar {
  height: 5px;
  margin-top: 6px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.quota-mini-fill {
  height: 100%;
  background: var(--accent);
}

@media (max-width: 640px) {
  .login-card {
    padding: 26px 20px;
  }
  .dashboard-shell {
    padding: 14px 12px 32px;
  }
}
