/* ============================================================
   DAVOMAT TIZIMI — toza, ixcham, professional dizayn (v3)
   ============================================================ */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --success: #059669;
  --success-50: #ecfdf5;
  --danger: #dc2626;
  --danger-50: #fef2f2;
  --warning: #d97706;
  --warning-50: #fffbeb;
  --info: #2563eb;
  --info-50: #eff6ff;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e6e8ee;
  --border-strong: #d8dbe3;
  --text: #101828;
  --text-2: #5b6472;
  --text-3: #98a1b0;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, .08);
  --shadow-lg: 0 14px 38px rgba(16, 24, 40, .16);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 216px;
  --sidebar-bg: #0f172a;
}

html[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #161b26;
  --surface-2: #10151f;
  --border: #232a38;
  --border-strong: #2e3648;
  --text: #e6e9f0;
  --text-2: #9aa3b5;
  --text-3: #6b7484;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .45);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-lg: 0 14px 38px rgba(0, 0, 0, .55);
  --primary-50: #1e1b4b;
  --primary-100: #312e81;
  --success-50: #022c22;
  --danger-50: #450a0a;
  --warning-50: #451a03;
  --info-50: #172554;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  transition: background .2s, color .2s;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 7px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }
.ic { flex-shrink: 0; vertical-align: middle; display: inline-block; }

/* ============ KIRISH SAHIFASI ============ */
.login-screen {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #0b1020 0%, #131a33 45%, #1e1b4b 100%);
}
.login-screen::before {
  content: ''; position: absolute; width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, .35), transparent 65%);
  top: -160px; right: -120px;
}
.login-screen::after {
  content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, .28), transparent 65%);
  bottom: -150px; left: -110px;
}
.login-card {
  position: relative; z-index: 1;
  background: var(--surface); border-radius: 16px; padding: 30px 28px;
  width: 100%; max-width: 360px; text-align: center;
  box-shadow: var(--shadow-lg); animation: modalUp .3s cubic-bezier(.22, 1, .36, 1);
}
.login-logo {
  width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 13px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 21px;
  box-shadow: 0 8px 20px rgba(79, 70, 229, .4);
}
.login-card h1 { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.login-sub { color: var(--text-2); font-size: 12px; margin: 4px 0 20px; }
.login-card input {
  width: 100%; padding: 10px 13px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 13px; margin-bottom: 11px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.login-error { color: var(--danger); font-size: 12px; margin-top: 10px; font-weight: 500; }

/* ============ ASOSIY LAYOUT ============ */
.app { display: flex; min-height: 100dvh; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; margin-left: var(--sidebar-w); }
.page {
  flex: 1; padding: 16px 20px 80px; overflow-y: auto;
  max-width: 1100px; width: 100%; margin: 0 auto;
}

/* ============ TUGMALAR ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface); color: var(--text); border-color: var(--border);
  transition: all .15s;
}
.btn .ic { width: 14px; height: 14px; }
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: transparent; }
.btn-primary:hover { background: var(--primary-hover); border-color: transparent; }
.btn-success { background: var(--success); color: #fff; border-color: transparent; }
.btn-success:hover { background: #047857; border-color: transparent; }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover { background: #b91c1c; border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-soft { background: var(--primary-50); color: var(--primary); border-color: transparent; }
.btn-soft:hover { background: var(--primary-100); border-color: transparent; }
.btn-soft-danger { background: var(--danger-50); color: var(--danger); border-color: transparent; }
.btn-soft-danger:hover { background: #fee2e2; border-color: transparent; }
.btn-soft-success { background: var(--success-50); color: var(--success); border-color: transparent; }
.btn-soft-success:hover { background: #d1fae5; border-color: transparent; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 9px; font-size: 11.5px; border-radius: 7px; gap: 5px; }
.btn-sm .ic { width: 12.5px; height: 12.5px; }

/* ============ KARTALAR ============ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-xs); padding: 14px; margin-bottom: 12px;
  transition: box-shadow .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-title {
  font-size: 12.5px; font-weight: 700; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px; letter-spacing: -.01em;
}
.card-title .ic { width: 15px; height: 15px; color: var(--primary); }

.grid { display: grid; gap: 12px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ============ STAT KARTALAR ============ */
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-xs); padding: 12px 14px;
  display: flex; align-items: center; gap: 11px;
  transition: box-shadow .18s, transform .18s;
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat-icon {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon .ic { width: 16px; height: 16px; }
.stat-body { min-width: 0; }
.stat-body .label {
  font-size: 10px; color: var(--text-2); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
}
.stat-body .value { font-size: 16px; font-weight: 800; margin-top: 1px; letter-spacing: -.02em; line-height: 1.25; }

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg); color: #94a3b8;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  transition: transform .25s ease;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.logo-box {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .4);
}
.sidebar-logo h1 { font-size: 12px; font-weight: 800; color: #fff; letter-spacing: .04em; }
.sidebar-logo p { font-size: 9px; color: #64748b; text-transform: uppercase; letter-spacing: .12em; margin-top: 1px; }
.nav { flex: 1; padding: 10px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: 8px; color: #8894ab; text-decoration: none;
  font-weight: 500; font-size: 12.5px; transition: all .15s; cursor: pointer;
}
.nav-item .ic { width: 16px; height: 16px; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #dbe2ef; }
.nav-item.active { background: rgba(99, 102, 241, .18); color: #c7d2fe; font-weight: 600; }
.nav-item.active .ic { color: #a5b4fc; }
.sidebar-footer { padding: 10px 8px; border-top: 1px solid rgba(255, 255, 255, .07); display: flex; flex-direction: column; gap: 5px; }
.install-btn, .logout-btn, .password-btn {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  padding: 7px 10px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 11.5px; font-weight: 600; font-family: inherit; transition: all .15s;
  background: transparent; color: #8894ab;
}
.install-btn .ic, .logout-btn .ic, .password-btn .ic { width: 15px; height: 15px; }
.install-btn:hover { background: rgba(16, 185, 129, .12); color: #34d399; }
.logout-btn:hover { background: rgba(239, 68, 68, .12); color: #fca5a5; }
.password-btn:hover { background: rgba(59, 130, 246, .12); color: #93c5fd; }

/* ============ HEADER ============ */
.header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
}
.header h2 { font-size: 14px; font-weight: 700; flex: 1; letter-spacing: -.01em; }
.header-right { display: flex; align-items: center; gap: 9px; }
.current-time { font-size: 11px; color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.menu-btn {
  display: none; background: none; border: none; color: var(--text);
  cursor: pointer; padding: 4px; border-radius: 7px;
}
.menu-btn .ic { width: 18px; height: 18px; }
.icon-btn {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  width: 30px; height: 30px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: all .15s;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.icon-btn .ic { width: 15px; height: 15px; }
.ws-status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-2); font-weight: 600; }
.ws-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.ws-dot.online { background: var(--success); box-shadow: 0 0 0 3px var(--success-50); }
.ws-dot.offline { background: var(--danger); }

/* ============ MOBIL PASTKI NAV ============ */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, 1fr);
  box-shadow: 0 -3px 14px rgba(16, 24, 40, .07);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 5px 2px; color: var(--text-3); text-decoration: none;
  font-size: 9px; font-weight: 600; border-radius: 8px; transition: color .15s;
}
.bottom-nav a .ic { width: 18px; height: 18px; }
.bottom-nav a.active { color: var(--primary); }

/* ============ JADVALLAR ============ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); padding: 8px 11px; border-bottom: 1px solid var(--border);
  font-weight: 600; background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 8px 11px; border-bottom: 1px solid var(--border); font-size: 12.5px; vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .actions { text-align: right; white-space: nowrap; }

/* ============ AVATARLAR ============ */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  background: var(--primary-50); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; flex-shrink: 0;
}
.avatar-lg { width: 56px; height: 56px; font-size: 17px; border-radius: 14px; }
.avatar-sm { width: 26px; height: 26px; font-size: 9.5px; }

/* ============ BADGELAR ============ */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 20px;
  font-size: 10px; font-weight: 700; white-space: nowrap;
}
.badge .ic { width: 10px; height: 10px; }
.badge-green { background: var(--success-50); color: var(--success); }
.badge-red { background: var(--danger-50); color: var(--danger); }
.badge-blue { background: var(--info-50); color: var(--info); }
.badge-amber { background: var(--warning-50); color: var(--warning); }
.badge-gray { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }

/* ============ TOOLBAR ============ */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select {
  padding: 6.5px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 12.5px; font-family: inherit;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.search-input { flex: 1; min-width: 150px; max-width: 260px; }
.spacer { flex: 1; }
.search-wrap { position: relative; }
.search-wrap > .ic {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-3); pointer-events: none;
}
.search-wrap input { padding-left: 29px; }

/* ============ JONLI OQIM ============ */
.feed { max-height: 480px; overflow-y: auto; }
.feed-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px;
  border-bottom: 1px solid var(--border); animation: slideIn .3s ease;
}
.feed-item:last-child { border-bottom: none; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.feed-photo { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.feed-info { flex: 1; min-width: 0; }
.feed-name { font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.feed-sub { font-size: 11px; color: var(--text-2); margin-top: 1px; display: flex; align-items: center; gap: 3px; }
.feed-sub .ic { width: 11px; height: 11px; }
.feed-time { font-size: 11px; color: var(--text-3); text-align: right; flex-shrink: 0; }

/* ============ GRAFIK ============ */
.chart { display: flex; align-items: flex-end; gap: 7px; height: 120px; padding-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart-bar {
  width: 100%; max-width: 26px; border-radius: 6px 6px 2px 2px; min-height: 3px;
  background: var(--primary); transition: height .5s cubic-bezier(.22, 1, .36, 1);
}
.chart-col .val { font-size: 10px; font-weight: 700; color: var(--text-2); }
.chart-col .lbl { font-size: 9.5px; color: var(--text-3); font-weight: 500; }

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(2, 6, 23, .5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: 14px; max-width: 500px; width: 100%;
  max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  padding: 20px; animation: modalUp .2s cubic-bezier(.22, 1, .36, 1);
  border: 1px solid var(--border);
}
@keyframes modalUp { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 14px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }
.modal h3 .ic { width: 16px; height: 16px; color: var(--primary); }
.form-group { margin-bottom: 11px; }
.form-group label { display: block; font-size: 11px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 11px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 12.5px; font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.photo-preview {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  background: var(--surface-2); display: block; margin: 0 auto 10px;
  border: 2px solid var(--primary-50);
}

/* ============ TOAST ============ */
.toast {
  position: fixed; bottom: 78px; left: 50%; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 9px 15px; border-radius: 10px;
  font-weight: 600; font-size: 12px; z-index: 200; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px; max-width: 90vw;
  animation: toastIn .25s ease;
}
html[data-theme="dark"] .toast { background: #1e293b; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast .ic { width: 14px; height: 14px; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============ BO'SH HOLAT ============ */
.empty {
  text-align: center; color: var(--text-3); padding: 26px 12px; font-size: 12.5px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty-ic {
  width: 44px; height: 44px; border-radius: 13px;
  background: var(--primary-50); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.empty-ic .ic { width: 20px; height: 20px; }
.loading { text-align: center; color: var(--text-3); padding: 30px; font-size: 12px; }
.loading::after {
  content: ''; display: inline-block; width: 12px; height: 12px; margin-left: 7px;
  border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ TABS ============ */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.tab {
  padding: 6px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 12px;
  cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 5px;
  transition: all .15s;
}
.tab .ic { width: 13px; height: 13px; }
.tab:hover { border-color: var(--primary); color: var(--primary); }
.tab.active { background: var(--primary); color: #fff; border-color: transparent; }
.tab.active .ic { color: #fff; }

/* ============ QURILMA KARTASI ============ */
.device-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.device-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--primary-50); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.device-icon .ic { width: 18px; height: 18px; }
.device-info { flex: 1; min-width: 0; }
.device-name { font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.device-sub { font-size: 11px; color: var(--text-2); margin-top: 2px; line-height: 1.55; display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.device-sub .ic { width: 12px; height: 12px; }
.device-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

/* ============ O'RNATISH BOSQICHLARI ============ */
.setup-steps { display: flex; flex-direction: column; gap: 9px; }
.setup-step { display: flex; gap: 10px; align-items: flex-start; }
.setup-num {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 11.5px;
  display: flex; align-items: center; justify-content: center;
}
.setup-step small { color: var(--text-3); font-size: 11px; line-height: 1.5; }
.setup-step code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 10.5px; }
.token-box {
  background: var(--surface-2); border: 1.5px dashed var(--border-strong); border-radius: 8px;
  padding: 9px 11px; font-family: ui-monospace, 'SF Mono', monospace; font-size: 11px;
  word-break: break-all; margin: 9px 0;
}
/* ============ DRIVER HOLAT PANELI ============ */
.status-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius); margin-bottom: 12px;
  border: 1px solid var(--border);
}
.status-banner-ic {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.status-banner-ic .ic { width: 18px; height: 18px; }
.status-banner b { display: block; font-size: 12.5px; margin-bottom: 1px; }
.status-banner span:not(.status-banner-ic) { font-size: 11.5px; color: var(--text-2); }
.status-banner .btn { margin-left: auto; flex-shrink: 0; }
.status-banner-green { background: var(--success-50); border-color: #a7f3d0; }
.status-banner-green .status-banner-ic { background: var(--success); color: #fff; }
.status-banner-green b { color: var(--success); }
.status-banner-amber { background: var(--warning-50); border-color: #fde68a; }
.status-banner-amber .status-banner-ic { background: var(--warning); color: #fff; }
.status-banner-amber b { color: var(--warning); }
.status-banner-red { background: var(--danger-50); border-color: #fecaca; }
.status-banner-red .status-banner-ic { background: var(--danger); color: #fff; }
.status-banner-red b { color: var(--danger); }
html[data-theme="dark"] .status-banner-green { border-color: #065f46; }
html[data-theme="dark"] .status-banner-amber { border-color: #78350f; }
html[data-theme="dark"] .status-banner-red { border-color: #7f1d1d; }

.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .main { margin-left: 0; }
  .sidebar { transform: translateX(-105%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: block; }
  .bottom-nav { display: grid; }
  .page { padding: 12px 12px 84px; }
  .current-time { display: none; }
}
@media (max-width: 560px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .header { padding: 9px 12px; }
  .page { padding: 10px 10px 84px; }
  .form-row { grid-template-columns: 1fr; }
  .device-card { flex-direction: column; align-items: flex-start; }
  .device-actions { justify-content: flex-start; }
  .toolbar .spacer { display: none; }
}
