:root {
  --primary: #0f6cbd;
  --primary-dark: #0a4f8f;
  --bg: #f4f6f9;
  --card-bg: #ffffff;
  --input-bg: #ffffff;
  --surface-alt: #f3f4f6;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e2e5eb;
  --danger: #d92d20;
  --danger-bg: #fef2f1;
  --danger-border: #f3c6c2;
  --success: #157a3f;
  --success-bg: #eefaf1;
  --success-border: #bfe8cd;
  --online: #16a34a;
  --offline: #9ca3af;
  --toggle-track: #cbd2db;
  --badge-owner-bg: #e6f0fb;
  --badge-owner-text: #0f6cbd;
  --badge-manage-bg: #fff4e0;
  --badge-manage-text: #b26a00;
  --badge-view-bg: #eef0f2;
  --badge-view-text: #555555;
  --radius: 10px;
  --device-card-gradient: none;
  --device-card-shadow: none;
  --metric-gradient: none;
  --metric-shadow: none;
  --metric-icon-bg: var(--surface-alt);
  --metric-icon-shadow: none;
  --metric-icon-glow: none;
  --topbar-gradient: none;
  --topbar-glow-line: none;
  --body-gradient: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #4c9aeb;
    --primary-dark: #3d84cc;
    --bg: #12161c;
    --card-bg: #1b212b;
    --input-bg: #10141a;
    --surface-alt: #232a35;
    --text: #e8eaed;
    --muted: #9199a6;
    --border: #2b323d;
    --danger: #f87171;
    --danger-bg: #3a1f1d;
    --danger-border: #6b3330;
    --success: #4ade80;
    --success-bg: #16301f;
    --success-border: #2f6b45;
    --online: #22c55e;
    --offline: #6b7280;
    --toggle-track: #3a4250;
    --badge-owner-bg: rgba(76, 154, 235, 0.18);
    --badge-owner-text: #7bb6f2;
    --badge-manage-bg: #4a3216;
    --badge-manage-text: #e0a344;
    --badge-view-bg: #2a2f37;
    --badge-view-text: #b7bec9;
    --device-card-gradient: radial-gradient(ellipse at 40% 0%, rgba(42,66,93,.38), transparent 43%), linear-gradient(145deg, rgba(15,30,46,.98) 0%, rgba(5,15,25,.98) 55%, rgba(5,14,23,1) 100%);
    --device-card-shadow: inset 0 1px 0 rgba(255,255,255,.025), inset 0 -20px 40px rgba(0,0,0,.08), 0 12px 30px rgba(0,0,0,.16);
    --metric-gradient: linear-gradient(145deg, rgba(21,37,54,.96), rgba(8,18,29,.98));
    --metric-shadow: inset 0 1px 0 rgba(255,255,255,.02), 0 5px 12px rgba(0,0,0,.08);
    --metric-icon-bg: linear-gradient(145deg, #17293c, #091725);
    --metric-icon-shadow: inset 1px 1px 3px rgba(255,255,255,.025), inset -4px -4px 10px rgba(0,0,0,.18);
    --metric-icon-glow: drop-shadow(0 0 5px rgba(31,155,240,.18));
    --topbar-gradient: linear-gradient(90deg, rgba(2,9,16,0.96), rgba(10,23,38,0.72), rgba(3,11,19,0.96));
    --topbar-glow-line: linear-gradient(90deg, transparent, rgba(56,126,185,0.35), transparent);
    --body-gradient: radial-gradient(ellipse at 52% -15%, rgba(49,75,105,.65) 0%, rgba(14,30,46,.35) 25%, transparent 53%), linear-gradient(180deg, #020911 0%, #030b14 50%, #040d16 100%);
  }
}

:root[data-theme="dark"] {
  --primary: #4c9aeb;
  --primary-dark: #3d84cc;
  --bg: #12161c;
  --card-bg: #1b212b;
  --input-bg: #10141a;
  --surface-alt: #232a35;
  --text: #e8eaed;
  --muted: #9199a6;
  --border: #2b323d;
  --danger: #f87171;
  --danger-bg: #3a1f1d;
  --danger-border: #6b3330;
  --success: #4ade80;
  --success-bg: #16301f;
  --success-border: #2f6b45;
  --online: #22c55e;
  --offline: #6b7280;
  --toggle-track: #3a4250;
  --badge-owner-bg: rgba(76, 154, 235, 0.18);
  --badge-owner-text: #7bb6f2;
  --badge-manage-bg: #4a3216;
  --badge-manage-text: #e0a344;
  --badge-view-bg: #2a2f37;
  --badge-view-text: #b7bec9;
  --device-card-gradient: radial-gradient(ellipse at 40% 0%, rgba(42,66,93,.38), transparent 43%), linear-gradient(145deg, rgba(15,30,46,.98) 0%, rgba(5,15,25,.98) 55%, rgba(5,14,23,1) 100%);
  --device-card-shadow: inset 0 1px 0 rgba(255,255,255,.025), inset 0 -20px 40px rgba(0,0,0,.08), 0 12px 30px rgba(0,0,0,.16);
  --metric-gradient: linear-gradient(145deg, rgba(21,37,54,.96), rgba(8,18,29,.98));
  --metric-shadow: inset 0 1px 0 rgba(255,255,255,.02), 0 5px 12px rgba(0,0,0,.08);
  --metric-icon-bg: linear-gradient(145deg, #17293c, #091725);
  --metric-icon-shadow: inset 1px 1px 3px rgba(255,255,255,.025), inset -4px -4px 10px rgba(0,0,0,.18);
  --metric-icon-glow: drop-shadow(0 0 5px rgba(31,155,240,.18));
  --topbar-gradient: linear-gradient(90deg, rgba(2,9,16,0.96), rgba(10,23,38,0.72), rgba(3,11,19,0.96));
  --topbar-glow-line: linear-gradient(90deg, transparent, rgba(56,126,185,0.35), transparent);
  --body-gradient: radial-gradient(ellipse at 52% -15%, rgba(49,75,105,.65) 0%, rgba(14,30,46,.35) 25%, transparent 53%), linear-gradient(180deg, #020911 0%, #030b14 50%, #040d16 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: var(--bg);
  background-image: var(--body-gradient);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.topbar {
  position: relative;
  background: var(--card-bg);
  background-image: var(--topbar-gradient);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background-image: var(--topbar-glow-line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.brand span { color: var(--primary); }
.brand-icon { color: var(--primary); flex-shrink: 0; }

.topbar-right { display: flex; align-items: center; gap: 18px; }

.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.topbar nav a:hover { color: var(--primary); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
}
.theme-toggle:hover { border-color: var(--primary); }

.inline-form { display: inline; margin: 0; }
.link-button {
  background: none;
  border: none;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
}
.link-button:hover { color: var(--primary); }

.container {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px;
}
.container.container-wide {
  max-width: 1680px;
  padding: 32px 48px;
}
@media (max-width: 900px) {
  .container.container-wide { padding: 32px 20px; }
}

.footer {
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer .version {
  font-size: 0.75rem;
  margin-top: 2px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.card-narrow {
  max-width: 480px;
  margin: 0 auto;
}

h1 { font-size: 1.6rem; margin: 0 0 8px; }
h2 { font-size: 1.2rem; margin: 24px 0 12px; }
p.subtitle { color: var(--muted); margin: 0 0 24px; }

form .field { margin-bottom: 16px; }
form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
form .hint { font-weight: 400; color: var(--muted); font-size: 0.8rem; }

.help-box {
  background: var(--surface-alt, var(--input-bg));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}
.help-box strong { color: var(--text); }
.help-box ol { margin: 8px 0 0; padding-left: 20px; }
.help-box ol li { margin-bottom: 4px; }
.help-box a { color: var(--primary); font-weight: 600; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="time"], input[type="url"], input[type="search"],
select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field input { width: auto; }

button.btn, a.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
button.btn:hover, a.btn:hover { background: var(--primary-dark); }
button.btn.full { width: 100%; }
button.btn.secondary, a.btn.secondary { background: var(--card-bg); color: var(--primary); border: 1px solid var(--primary); }
button.btn:disabled { opacity: 0.4; cursor: default; }
button.btn:disabled:hover { background: var(--card-bg); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; }
.pagination .btn { padding: 8px 16px; font-size: 0.9rem; }
.pagination-info { font-size: 0.85rem; color: var(--muted); }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 0.92rem;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }

ul.error-list { margin: 0; padding-left: 18px; }

.form-footer { margin-top: 18px; font-size: 0.9rem; color: var(--muted); text-align: center; }
.form-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 18px;
  margin-top: 12px;
}

.device-card {
  background: var(--card-bg);
  background-image: var(--device-card-gradient);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--device-card-shadow);
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.device-card.dragging { opacity: 0.4; }
.device-card.drag-target { outline: 2px dashed var(--primary); outline-offset: 2px; }

.device-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px; }

.drag-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.4;
  user-select: none;
  flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }
.device-title { font-weight: 700; font-size: 1.05rem; }
.device-model { color: var(--muted); font-size: 0.82rem; }

.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600; }
.status-dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--offline); display: inline-block; }
.status-dot.online::before { background: var(--online); }
.status-dot.online { color: var(--online); }
.status-dot.offline { color: var(--offline); }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.metric {
  background: var(--bg);
  background-image: var(--metric-gradient);
  box-shadow: var(--metric-shadow);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.metric-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--metric-icon-bg);
  box-shadow: var(--metric-icon-shadow);
  color: var(--primary);
}
.metric-icon svg { width: 18px; height: 18px; filter: var(--metric-icon-glow); }
.metric-icon.green { color: var(--success); }
.metric-body { min-width: 0; flex: 1; }
.metric-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.3;
}
.metric-value {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-value.alert-state { color: var(--danger); }

table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge.owner { background: var(--badge-owner-bg); color: var(--badge-owner-text); }
.badge.manage { background: var(--badge-manage-bg); color: var(--badge-manage-text); }
.badge.view { background: var(--badge-view-bg); color: var(--badge-view-text); }
.badge.critical { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }

.owner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.remove-owner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}
.remove-owner-btn:hover { color: var(--danger); }
.remove-owner-btn svg { width: 15px; height: 15px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat-box { background: var(--surface-alt); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-box .stat-value { font-size: 1.7rem; font-weight: 700; color: var(--primary); word-break: break-all; }
.stat-box .stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

.bar-chart-box { background: var(--surface-alt); border-radius: var(--radius); padding: 16px; }
.bar-chart-box .stat-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 12px; }
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .bar-email {
  flex: 0 0 auto;
  max-width: 45%;
  font-size: 0.82rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-row .bar-track { flex: 1; background: var(--border); border-radius: 999px; height: 16px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--primary); border-radius: 999px; }
.bar-row .bar-count { flex: 0 0 22px; text-align: right; font-size: 0.82rem; font-weight: 600; color: var(--muted); }

.edit-alert-btn, .edit-automation-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}
.edit-alert-btn:hover, .edit-automation-btn:hover { color: var(--primary); }
.edit-alert-btn svg, .edit-automation-btn svg { width: 15px; height: 15px; }

.alert-bell-wrap { position: relative; display: inline-flex; }
.alert-bell-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.alert-bell-btn:hover { color: var(--primary); }
.alert-bell-popover {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  margin-top: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  padding: 10px;
  width: 260px;
  max-height: 280px;
  overflow-y: auto;
  text-align: left;
}
.alert-bell-popover .alert-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.alert-bell-popover .alert-item:last-child { border-bottom: none; }
.alert-bell-popover .alert-item-meta { color: var(--muted); font-size: 0.75rem; margin-top: 2px; }
.alert-bell-popover .see-all {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
}

.gear-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  font-size: 1.1rem;
}
.gear-link:hover { color: var(--primary); background: var(--bg); }

button.reboot-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
button.reboot-btn:hover { color: var(--danger); }
button.reboot-btn:disabled { opacity: 0.5; cursor: wait; }

button.logout-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.2rem;
}
button.logout-btn:hover { color: var(--danger); background: var(--bg); }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }

.device-card-x1 {
  grid-column: span 2;
}
@media (max-width: 720px) {
  .device-card-x1 { grid-column: span 1; }
}

.port-section { margin-top: 16px; }
.port-section-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}
.port-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
@media (max-width: 640px) {
  .port-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
/* Port hucreleri gorsel olarak .metric ile ayni aile (ikon kutusu + koyu gradyan kart) —
   .port-cell sinifi sadece dashboard.js'in relay-on/relay-off/toggle secicileri icin kalir. */
.port-cell.relay-on .metric-icon, .port-cell.relay-on .metric-value { color: var(--success); }
.port-toggle { margin-left: auto; margin-top: 0; flex-shrink: 0; }

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  margin-top: 6px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--toggle-track);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.toggle-switch input:checked + .toggle-slider { background: var(--online); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.5; cursor: wait; }
.toggle-switch input[data-can-control="0"]:disabled + .toggle-slider { cursor: not-allowed; }

/* ==========================================================================
   Cihaz hizli gecis paneli (deneysel, 2026-08-27) — sag kenarda sabit, aciklir/
   kapanir bir cihaz listesi; tiklaninca ilgili cihaz kartina kaydirir. Mevcut tema
   degiskenlerini (--card-bg, --border, vb.) kullanir, bu yuzden aydinlik/karanlik
   temada ayrica bir ayar gerekmez. GERI ALMA: dashboard.ejs'teki "device-switcher"
   blogunu ve buradan asagisini kaldirin, veya *.bak-switcher yedeklerini geri kopyalayip
   dev sunucusunu YENIDEN BASLATIN (EJS view cache nedeniyle sadece dosya degistirmek
   yetmeyebilir).
   ========================================================================== */
.device-switcher {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  align-items: flex-start;
}
.device-switcher-toggle {
  width: 26px;
  height: 46px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: var(--card-bg);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.08);
}
.device-switcher-toggle:hover { color: var(--primary); }
.device-switcher-arrow { display: inline-block; transition: transform 0.2s ease; }
.device-switcher.open .device-switcher-arrow { transform: rotate(180deg); }

.device-switcher-panel {
  width: 0;
  max-height: 60vh;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px 0 0 8px;
  transition: width 0.18s ease;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.08);
}
.device-switcher.open .device-switcher-panel { width: 230px; overflow-y: auto; }

.device-switcher-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  padding: 10px 12px 4px;
  white-space: nowrap;
}
.device-switcher-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.88rem;
  font-family: inherit;
}
.device-switcher-item:hover { background: var(--bg); }
.device-switcher-item.active { background: var(--badge-owner-bg); color: var(--badge-owner-text); font-weight: 600; }
.device-switcher-item.device-switcher-all {
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding-top: 10px;
  padding-bottom: 10px;
  margin-bottom: 4px;
}
.device-switcher-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--offline); flex-shrink: 0; }
.device-switcher-dot.online { background: var(--online); }

.device-card.device-switcher-highlight {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
@media (max-width: 640px) {
  .device-switcher.open .device-switcher-panel { width: 180px; }
}

/* ==========================================================================
   Cihaz "odak modu" (tam ekran karti, deneysel, 2026-08-27) — ana grid AYNEN
   kalir, sadece bir cihaz secildiginde digerleri gizlenip secilen kart tam
   genislige yayilir. GERI ALMA: bu blogu ve dashboard.ejs/dashboard.js'teki
   "odak modu"/"focus" ile ilgili parcalari kaldirin.
   ========================================================================== */
.device-grid.focus-mode .device-card { display: none; }
.device-grid.focus-mode .device-card.focused {
  display: block;
  grid-column: 1 / -1;
}
.device-grid.focus-mode .device-card.focused .metrics {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.device-grid.focus-mode .device-card.focused .metric { padding: 16px; }
.device-grid.focus-mode .device-card.focused .metric-icon { width: 44px; height: 44px; border-radius: 12px; }
.device-grid.focus-mode .device-card.focused .metric-icon svg { width: 22px; height: 22px; }
.device-grid.focus-mode .device-card.focused .metric-label { font-size: 0.8rem; }
.device-grid.focus-mode .device-card.focused .metric-value { font-size: 1.7rem; }
.device-grid.focus-mode .device-card.focused .device-title { font-size: 1.3rem; }
.device-grid.focus-mode .drag-handle { visibility: hidden; }
