:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --accent: #3b82f6;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at top right, #172554 0%, #0b1120 42%, #020617 100%);
  color: #e2e8f0;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }

/* Login Dark Glass Premium */
.auth-page {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-page::before, .auth-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.35;
  pointer-events: none;
  animation: floatOrb 16s ease-in-out infinite alternate;
}
.auth-page::before { width: 420px; height: 420px; top: -120px; left: -90px; background: #2563eb; }
.auth-page::after { width: 380px; height: 380px; bottom: -120px; right: -80px; background: #0d9488; animation-delay: -7s; }

.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 430px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55);
  animation: cardEnter 0.55s var(--ease-out) both;
}
.auth-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.22);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

/* Command Center Shell */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.nav {
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(14px);
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav-brand {
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  font-weight: 800;
  font-size: 1.08rem;
  color: #f8fafc;
  letter-spacing: -0.02em;
  padding: 8px 12px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  margin-bottom: 10px;
}
.nav a {
  position: relative;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 0.89rem;
  font-weight: 500;
  color: #94a3b8;
  transition: background 0.2s var(--ease-out), color 0.2s, transform 0.2s var(--ease-out);
}
.nav a:hover { background: rgba(30, 41, 59, 0.75); color: #fff; transform: translateX(3px); }
.nav a.active { background: rgba(37, 99, 235, 0.18); color: #fff; font-weight: 600; }
.nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 99px;
  background: #3b82f6;
}

.main { padding: 28px 34px; animation: fadeIn 0.35s var(--ease-out); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi {
  background: rgba(30, 41, 59, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  padding: 18px 20px;
  transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
  animation: cardEnter 0.45s var(--ease-out) both;
}
.kpi:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
}
.kpi small { color: #94a3b8; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; font-weight: 700; }
.kpi strong { display: block; font-family: 'Manrope', 'Segoe UI', sans-serif; font-size: 1.75rem; margin-top: 6px; color: #fff; letter-spacing: -0.02em; }

.card {
  background: rgba(30, 41, 59, 0.62);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 22px;
  animation: cardEnter 0.5s var(--ease-out) both;
}
.card h2 { margin: 0 0 16px; font-family: 'Manrope', 'Segoe UI', sans-serif; font-size: 1.05rem; color: #f8fafc; font-weight: 800; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }

table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid rgba(148, 163, 184, 0.14); }
th { font-size: 0.74rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }
tbody tr { transition: background 0.16s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 0.82rem; font-weight: 600; color: #cbd5e1; }
.field input, .field select, .field textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 10px 13px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.24);
}

.btn {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 9px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
  transition: transform 0.18s var(--ease-out), box-shadow 0.2s, filter 0.18s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 10px 22px rgba(37, 99, 235, 0.32); }
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 6px 11px; font-size: 0.78rem; border-radius: 7px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.73rem; font-weight: 700; background: #334155; }
.badge-online { background: rgba(20, 83, 45, 0.75); color: #86efac; border: 1px solid rgba(74, 222, 128, 0.25); }
.badge-online::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: pulseDot 2s infinite;
}
.badge-offline { background: rgba(127, 29, 29, 0.75); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.25); }
.badge-offline::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #f87171; }

.flash { padding: 13px 16px; border-radius: 10px; margin-bottom: 18px; animation: cardEnter 0.35s var(--ease-out) both; }
.flash-success { background: rgba(20, 83, 45, 0.85); color: #dcfce7; border: 1px solid rgba(74, 222, 128, 0.28); }
.flash-error { background: rgba(127, 29, 29, 0.85); color: #fee2e2; border: 1px solid rgba(248, 113, 113, 0.28); }

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes floatOrb {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(34px, 26px) scale(1.1); }
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media (max-width: 900px) { .shell, .grid-2 { grid-template-columns: 1fr; } .main { padding: 18px; } }

.master-menu-btn { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid rgba(148,163,184,0.28); background: rgba(30,41,59,0.85); color: #f8fafc; font-size: 1.2rem; cursor: pointer; align-items: center; justify-content: center; }
.master-drawer-backdrop { display: none; position: fixed; inset: 0; background: rgba(2,6,23,0.65); backdrop-filter: blur(4px); z-index: 45; }
.master-drawer-backdrop.is-open { display: block; }
@media (max-width: 900px) {
  .master-menu-btn { display: inline-flex; }
  .nav { position: fixed; top: 0; left: 0; bottom: 0; width: 265px; z-index: 50; transform: translateX(-100%); transition: transform 0.3s var(--ease-out); }
  .nav.is-open { transform: translateX(0); }
}

.ms-icon { font-family: 'Material Symbols Rounded'; font-size: 19px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; font-variation-settings: 'FILL' 0, 'wght' 420, 'GRAD' 0, 'opsz' 20; flex-shrink: 0; }
.nav a { display: flex; align-items: center; gap: 10px; }
