.tab-pills {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  padding:12px 14px;
  border-radius:14px;
  background: rgba(255,255,255,0.7);
  border:1px solid rgba(14,165,233,0.22);
  box-shadow: 0 14px 40px rgba(15,23,42,0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.tab-pill-btn {
  padding:9px 14px;
  border-radius:12px;
  border:1px solid rgba(14,165,233,0.25);
  background: rgba(255,255,255,0.65);
  color: var(--ink);
  font-weight:700;
  cursor:pointer;
  transition: all 150ms ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.tab-pill-btn.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color:#fff; border-color: transparent; box-shadow: 0 10px 30px rgba(14,165,233,0.2); }
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
  --brand: #0ea5e9;
  --brand-2: #7c3aed;
  --accent: #f59e0b;
  --ink: #0f172a;
  --muted: #667085;
  --panel: rgba(255,255,255,0.82);
  --border: rgba(14,165,233,0.22);
  --bg: #f3f7ff;
}

* { box-sizing: border-box; }
html {
  font-family: 'Vazirmatn', sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(40% 40% at 20% 20%, rgba(14,165,233,0.28), transparent 55%),
              radial-gradient(38% 38% at 80% 10%, rgba(124,58,237,0.18), transparent 60%),
              radial-gradient(50% 50% at 70% 80%, rgba(245,158,11,0.14), transparent 70%),
              linear-gradient(135deg, #f8fbff 0%, #f4f6ff 45%, #eef7ff 70%, #f7f2ff 100%);
  color: var(--ink);
  position: relative;
  overflow-x: hidden;
}

body, button, input, select, textarea, table, th, td {
  font-family: 'Vazirmatn', sans-serif;
}
a { color: inherit; text-decoration: none; }

.login-page { display:flex; align-items:center; justify-content:center; min-height:100vh; }

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.auth-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 46px 22px 52px;
  position: relative;
}

.glow {
  position: absolute;
  width: 360px;
  height: 360px;
  filter: blur(120px);
  opacity: 0.65;
  z-index: 0;
}
.glow.one { background: #0ea5e9; top: -120px; right: -80px; }
.glow.two { background: #7c3aed; bottom: -140px; left: -100px; }
.glow.three { background: #f59e0b; top: 40%; left: 35%; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15,23,42,0.10);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.05));
}

.glass {
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(14,165,233,0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 60px rgba(15,23,42,0.10);
  background-image: linear-gradient(145deg, rgba(255,255,255,0.35), rgba(255,255,255,0.08));
  border-radius: 16px;
}

.notice-success { background: rgba(16,185,129,0.12); border:1px solid rgba(16,185,129,0.35); color:#166534; }
.notice-error { background: rgba(248,113,113,0.14); border:1px solid rgba(248,113,113,0.35); color:#b91c1c; }


.login-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
  direction: ltr;
}

.login-card {
  padding: 28px 26px 24px;
  border-radius: 18px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(14,165,233,0.2);
  box-shadow: 0 24px 70px rgba(15,23,42,0.10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
  direction: rtl;
}
.login-head h1 { margin:0; font-size:26px; font-weight:800; color: var(--ink); }
.login-head p { margin:8px 0 16px; color: var(--muted); }

.form-group { display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
.form-group label { font-size:13px; color: var(--muted); }
.form-footer { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:6px; }
.link { color: var(--brand); font-weight:700; background:none; border:none; padding:0; cursor:pointer; }
.alert { padding:12px 14px; border-radius:12px; margin-bottom:12px; font-weight:600; }
.alert-error { background:#fef2f2; border:1px solid #fecdd3; color:#b91c1c; }
.switcher { display:flex; align-items:center; gap:8px; justify-content:center; margin-top:14px; font-size:13px; color: var(--muted); }

.login-hero {
  position: relative;
  border-radius: 18px;
  padding: 32px 28px;
  background: linear-gradient(170deg, rgba(11,21,52,0.8) 0%, rgba(12,29,70,0.78) 55%, rgba(15,38,85,0.75) 100%);
  color: #e5e7eb;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 22px 70px rgba(0,0,0,0.30);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  direction: rtl;
}
.login-hero::after {
  content:'';
  position:absolute;
  inset:0;
  background: radial-gradient(40% 40% at 80% 20%, rgba(14,165,233,0.16), transparent 60%);
  pointer-events:none;
}
.login-hero h1 { margin: 0; color: #fff; font-size: 30px; font-weight: 800; }
.login-hero p { color: #cbd5e1; margin: 10px 0 0; line-height: 1.7; }
.login-hero .slide-stack span { display:block; opacity:0; animation: slideDown 0.7s ease forwards; }
.login-hero .slide-stack span:nth-child(1){ animation-delay: 0.05s; }
.login-hero .slide-stack span:nth-child(2){ animation-delay: 0.25s; }
.login-hero .slide-stack span:nth-child(3){ animation-delay: 0.45s; }

.login-card {
  padding: 28px 26px 24px;
  border-radius: 20px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(14,165,233,0.16);
  box-shadow: 0 24px 70px rgba(15,23,42,0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  direction: rtl;
}

.login-hero {
  position: relative;
  border-radius: 20px;
  padding: 32px 28px;
  background: linear-gradient(170deg, #0b1534 0%, #0c1d46 55%, #0f2655 100%);
  color: #e5e7eb;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 22px 70px rgba(0,0,0,0.35);
  overflow: hidden;
}
.login-hero::after {
  content:'';
  position:absolute;
  inset:0;
  background: radial-gradient(40% 40% at 80% 20%, rgba(14,165,233,0.16), transparent 60%);
  pointer-events:none;
}
.login-hero h1 { margin: 0; color: #fff; font-size: 30px; font-weight: 800; }
.login-hero p { color: #cbd5e1; margin: 10px 0 0; line-height: 1.7; }
.login-hero .slide-stack span { display:block; opacity:0; animation: slideDown 0.7s ease forwards; }
.login-hero .slide-stack span:nth-child(1){ animation-delay: 0.05s; }
.login-hero .slide-stack span:nth-child(2){ animation-delay: 0.25s; }
.login-hero .slide-stack span:nth-child(3){ animation-delay: 0.45s; }

.accent-badge { display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border-radius:999px; background: rgba(14,165,233,0.12); color:#0ea5e9; font-weight:700; border:1px solid rgba(14,165,233,0.35); }
.pill { display:inline-flex; align-items:center; gap:6px; padding:10px 14px; border-radius:999px; background: rgba(14,165,233,0.12); color: var(--ink); border:1px solid rgba(14,165,233,0.25); font-weight:700; }
.pill.soft { background: rgba(124,58,237,0.1); color:#4338ca; border-color: rgba(124,58,237,0.25); }
.divider { height:1px; background: rgba(14,165,233,0.2); margin:14px 0; }

h1,h2,h3,h4 { margin: 0; color: var(--ink); font-weight: 700; }
.text-muted { color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 12px 32px rgba(14,165,233,0.22); }
.btn-ghost { background: rgba(255,255,255,0.65); border-color: rgba(14,165,233,0.25); color: var(--ink); backdrop-filter: blur(12px); }
.btn-outline { border-color: var(--brand); color: var(--brand); background: rgba(14,165,233,0.12); box-shadow: 0 8px 24px rgba(14,165,233,0.14); backdrop-filter: blur(10px); }
button:active { transform: translateY(0); box-shadow: none; }

.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.badge-ok { background: #ecfdf3; color: #166534; }
.badge-warn { background: #fff7ed; color: #b45309; }
.badge-danger { background: #fef2f2; color: #b91c1c; }
.badge-info { background: #eef2ff; color: #4338ca; }
.badge-muted { background: #f1f5f9; color: #475569; }

.input {
  width: 100%;
  border: 1px solid rgba(14,165,233,0.24);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 12px 36px rgba(14,165,233,0.18); background: rgba(255,255,255,0.9); }
.select { width: 100%; border: 1px solid rgba(14,165,233,0.24); border-radius: 12px; padding: 11px 12px; background: rgba(255,255,255,0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
  margin-bottom: 18px;
}
.tab-btn {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.8);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: all 150ms ease;
}
.tab-btn.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; box-shadow: 0 10px 30px rgba(14,165,233,0.2); }

.table { width: 100%; border-collapse: collapse; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.table th, .table td { padding: 12px 10px; text-align: right; border-bottom: 1px solid rgba(14,165,233,0.14); background: rgba(255,255,255,0.55); }
.table thead { background: rgba(255,255,255,0.75); font-weight: 700; }
.table tbody tr:hover { background: rgba(14,165,233,0.06); }

.icon { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; }

.fade-in { animation: fadeIn 0.5s ease forwards; opacity:0; }
.pop { animation: pop 0.35s ease; }

@keyframes fadeIn { from{opacity:0; transform: translateY(6px);} to{opacity:1; transform: translateY(0);} }
@keyframes pop { 0%{transform: scale(0.97);} 60%{transform: scale(1.02);} 100%{transform: scale(1);} }
@keyframes slideDown { from{opacity:0; transform: translateY(-10px);} to{opacity:1; transform: translateY(0);} }

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar form { width: 100%; }
  .select { width: 100%; }
  .shell { padding: 24px 16px 32px; }
  .auth-shell { padding: 26px 14px 36px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { order: 2; }
  .login-card { order: 1; }
}

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kpi { padding: 16px; border-radius: 16px; background: rgba(255,255,255,0.78); border: 1px solid rgba(14,165,233,0.22); color: var(--ink); box-shadow: 0 18px 60px rgba(15,23,42,0.10); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); background-image: linear-gradient(145deg, rgba(255,255,255,0.35), rgba(255,255,255,0.08)); }
.kpi-title { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.kpi-value { font-size: 26px; font-weight: 800; }

.device-status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.device-status.ok { background: #ecfdf3; color: #166534; }
.device-status.warn { background: #fff7ed; color: #b45309; }
.device-status.muted { background: #e2e8f0; color: #475569; }

.tag { border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700; }
.tag-green { background: #ecfdf3; color: #166534; }
.tag-yellow { background: #fff7ed; color: #b45309; }
.tag-slate { background: #eef2ff; color: #4338ca; }

.card-soft { background: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.4); backdrop-filter: blur(10px); }
