/* ============================================================
   Breezedude Device Portal – Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Theme Variables ─────────────────────────────────────── */
:root {
  --accent:        #38BDF8;
  --accent-dim:    rgba(56, 189, 248, 0.15);
  --accent-border: rgba(56, 189, 248, 0.3);
  --indigo:        #818CF8;
  --success:       #34D399;
  --warning:       #FBBF24;
  --danger:        #F87171;

  /* Dark (default) */
  --bg:            #050A12;
  --bg-2:          #090F1C;
  --surface:       #0D1626;
  --surface-2:     #152035;
  --surface-hover: #1A2840;
  --border:        rgba(255, 255, 255, 0.06);
  --border-accent: rgba(56, 189, 248, 0.12);
  --text:          #E2E8F0;
  --text-2:        #94A3B8;
  --text-3:        #4A5A72;
  --text-invert:   #0A0F1A;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.6);

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --sidebar-w:  220px;
  --topbar-h:   60px;

  --transition: 0.2s ease;
}

/* Light override – explicit */
[data-theme="light"] {
  --bg:            #F0F4F8;
  --bg-2:          #E8EEF5;
  --surface:       #FFFFFF;
  --surface-2:     #F5F8FC;
  --surface-hover: #EBF2F9;
  --border:        rgba(0, 0, 0, 0.07);
  --border-accent: rgba(56, 189, 248, 0.25);
  --text:          #0F1929;
  --text-2:        #4B6080;
  --text-3:        #9AA8BE;
  --text-invert:   #FFFFFF;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
}

/* Auto – system preference */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:            #F0F4F8;
    --bg-2:          #E8EEF5;
    --surface:       #FFFFFF;
    --surface-2:     #F5F8FC;
    --surface-hover: #EBF2F9;
    --border:        rgba(0, 0, 0, 0.07);
    --border-accent: rgba(56, 189, 248, 0.25);
    --text:          #0F1929;
    --text-2:        #4B6080;
    --text-3:        #9AA8BE;
    --text-invert:   #FFFFFF;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
  }
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.85; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ── Typography ──────────────────────────────────────────── */
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.875em; }

h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); }

/* ── App Shell Layout ────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  grid-row: 1;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar-logo .logo-mark {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--indigo));
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.sidebar-logo .logo-sub {
  font-size: 0.72rem;
  color: var(--text-2);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  user-select: none;
}

.nav-item:hover, .nav-item:focus-visible {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}

/* ── Main Content ────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.page-content {
  flex: 1;
  padding: 28px 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--text-invert);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.2); }

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--surface-hover); color: var(--text); }
.btn-icon svg { width: 16px; height: 16px; }

.btn-sm { padding: 5px 11px; font-size: 0.8rem; }
.btn-lg { padding: 11px 22px; font-size: 0.95rem; }

/* ── Form Elements ───────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-input::placeholder { color: var(--text-3); }
.form-textarea { resize: vertical; min-height: 80px; }

.form-hint { font-size: 0.78rem; color: var(--text-3); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ── Device Cards ────────────────────────────────────────── */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.device-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}

.device-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--indigo));
  opacity: 0;
  transition: opacity var(--transition);
}

.device-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.device-card:hover::before { opacity: 1; }

.device-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 18px 12px;
}

.device-card-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.device-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
  line-height: 1.3;
}

.device-card-body {
  padding: 0 18px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.device-meta-item { display: flex; flex-direction: column; gap: 2px; }
.device-meta-label { font-size: 0.7rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.device-meta-value { font-size: 0.875rem; color: var(--text); font-weight: 500; }

.device-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ── Status Indicators ───────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--success); box-shadow: 0 0 0 2px rgba(52,211,153,0.25); }
.status-dot.recent  { background: var(--warning); box-shadow: 0 0 0 2px rgba(251,191,36,0.25); }
.status-dot.offline { background: var(--text-3); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.status-pill.online  { background: rgba(52,211,153,0.12); color: var(--success); }
.status-pill.recent  { background: rgba(251,191,36,0.12);  color: var(--warning); }
.status-pill.offline { background: rgba(100,116,139,0.12); color: var(--text-2); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-blue    { background: rgba(56,189,248,0.12); color: var(--accent); }
.badge-indigo  { background: rgba(129,140,248,0.12); color: var(--indigo); }
.badge-green   { background: rgba(52,211,153,0.12); color: var(--success); }
.badge-yellow  { background: rgba(251,191,36,0.12);  color: var(--warning); }
.badge-red     { background: rgba(248,113,113,0.12); color: var(--danger); }
.badge-muted   { background: var(--surface-2); color: var(--text-2); }

/* ── Battery Bar ─────────────────────────────────────────── */
.battery-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}
.battery-bar {
  flex: 1;
  height: 5px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.battery-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.battery-fill.good    { background: var(--success); }
.battery-fill.medium  { background: var(--warning); }
.battery-fill.low     { background: var(--danger); }
.battery-pct { font-size: 0.75rem; color: var(--text-2); font-weight: 500; min-width: 32px; text-align: right; }

/* ── Pending Indicators ──────────────────────────────────── */
.pending-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--warning);
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96) translateY(8px);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--surface-hover); color: var(--text); }
.modal-close svg { width: 15px; height: 15px; }

.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ── Toast Notifications ─────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: 360px;
  width: calc(100% - 48px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.25s ease;
  font-size: 0.875rem;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.toast-text { flex: 1; color: var(--text); }
.toast-msg-bold { font-weight: 600; }
.toast-msg-sub  { color: var(--text-2); font-size: 0.8rem; margin-top: 1px; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(100%); }
}

/* ── Theme Toggle ────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 2px;
  border: 1px solid var(--border);
}
.theme-toggle-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition);
}
.theme-toggle-btn.active {
  background: var(--surface-hover);
  color: var(--text);
}
.theme-toggle-btn svg { width: 14px; height: 14px; display: block; }

/* ── Avatar ──────────────────────────────────────────────── */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--indigo));
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
}

/* ── Dropdown ────────────────────────────────────────────── */
.dropdown-wrap { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 300;
  overflow: hidden;
  display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 0.875rem;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover { background: var(--surface-hover); color: var(--text); }
.dropdown-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  gap: 12px;
}
.empty-state-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}
.empty-state-icon svg { width: 28px; height: 28px; color: var(--text-3); }
.empty-state h3 { color: var(--text); }
.empty-state p { color: var(--text-2); font-size: 0.875rem; max-width: 320px; }

/* ── Table ───────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--surface-hover); }

/* ── Skeleton Loader ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Section header row ──────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ── Divider ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Utility ─────────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--text-2); }
.text-sm { font-size: 0.8rem; }
.fw-600 { font-weight: 600; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-accent  { color: var(--accent); }

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-2);
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text-3); }
.breadcrumb span { color: var(--text); font-weight: 500; }

/* ── Info Grid (device detail) ───────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.info-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.info-tile-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 5px; }
.info-tile-value { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.info-tile-sub   { font-size: 0.75rem; color: var(--text-2); margin-top: 3px; }

/* ── Mobile Sidebar Toggle ───────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    transform: translateX(-100%);
    width: 240px;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-backdrop.open { display: block; }

  .main { margin-left: 0; }

  .topbar { padding: 0 16px; }
  .page-content { padding: 20px 16px; }

  .device-grid { grid-template-columns: 1fr; }
  .info-grid   { grid-template-columns: 1fr 1fr; }

  .device-card-body { grid-template-columns: 1fr; gap: 8px; }

  .toast-stack { right: 16px; bottom: 16px; width: calc(100% - 32px); }
}

@media (max-width: 480px) {
  .info-grid { grid-template-columns: 1fr; }
  .modal { max-width: 100%; border-radius: var(--radius-lg); }
}
