/* Demir Konut v6 — Güvenlik: oturumlar ve cihazlar, olay günlüğü, güvenlik durumu */

/* ---------------- bu cihaz paneli (sayfanın tek vurgulu öğesi) */
.sg-here { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 4px 14px; padding: 16px 16px 14px 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--navy) 5%, var(--surface)), var(--surface)); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); overflow: hidden; }
.sg-here::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.sg-here .sg-dev { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--navy); color: #fff; grid-row: span 2; }
.sg-here .sg-dev .ic { width: 24px; height: 24px; }
.sg-here h3 { margin: 2px 0 0; font-size: 16px; font-weight: 700; letter-spacing: -.15px; line-height: 1.3; overflow-wrap: anywhere; }
.sg-here .sg-meta { color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.sg-here .sg-meta b { font-weight: 620; color: var(--ink); font-variant-numeric: tabular-nums; }
.sg-here .sg-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sg-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; vertical-align: 2px; margin-left: 6px; white-space: nowrap; }
[data-theme="dark"] .sg-here { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface)); }
[data-theme="dark"] .sg-here .sg-dev { background: var(--surface-3); color: var(--accent-2); }
[data-theme="dark"] .sg-tag { color: var(--accent-2); }

/* ---------------- oturum satırları */
.sg-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 14px; border-bottom: 1px solid var(--line-2); background: var(--surface); }
.sg-row:last-child { border-bottom: 0; }
.sg-row .li-sub { white-space: normal; }
.sg-row .sg-ago { font-variant-numeric: tabular-nums; }
.sg-row .sg-off { flex: none; min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: var(--surface); color: var(--red); border-radius: 12px; font-weight: 650; font-size: 13px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; }
.sg-row .sg-off:active { transform: scale(.97); }
.sg-row .sg-off:disabled { opacity: .5; }
.sg-row.is-idle .li-title { color: var(--ink-2); }
.sg-row.is-idle .li-ico { opacity: .65; }
.sg-bulk { margin-top: 10px; width: 100%; justify-content: center; color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.sg-group { margin-top: 14px; }
.sg-group-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); flex-wrap: wrap; }
.sg-group-h b { font-size: 14.5px; font-weight: 680; }
.sg-group-h .spacer { min-width: 4px; }

/* ---------------- olay satırları: soldaki çizgi önem derecesini gösterir */
.sg-ev { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--line-2); background: var(--surface); width: 100%; text-align: left;
  border-left: 0; border-right: 0; border-top: 0; position: relative; color: inherit; }
.sg-ev:last-child { border-bottom: 0; }
.sg-ev::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--line); }
.sg-ev.sev-2::before { background: var(--amber); }
.sg-ev.sev-3::before { background: var(--red); }
.sg-ev .li-title { white-space: normal; }
.sg-ev .sg-when { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; line-height: 1.35; }
@media (hover: hover) { .sg-ev:hover { background: var(--surface-2); } }
.sg-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 10px; }
.sg-filters .field { gap: 4px; }
.sg-filters .wide { grid-column: 1 / -1; }
.sg-sum { font-size: 13px; color: var(--ink-2); margin: 2px 2px 10px; line-height: 1.5; }
.sg-sum b { color: var(--ink); font-variant-numeric: tabular-nums; }
.sg-sum b.hot { color: var(--red); }

/* ---------------- zaman çizelgesi (kendi hareketleri) */
.sg-tl { list-style: none; margin: 0; padding: 0 0 0 4px; }
.sg-tl li { position: relative; padding: 0 0 12px 20px; font-size: 13.5px; }
.sg-tl li:last-child { padding-bottom: 0; }
.sg-tl li::before { content: ''; position: absolute; left: 3px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--slate); }
.sg-tl li::after { content: ''; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.sg-tl li:last-child::after { display: none; }
.sg-tl li.sev-2::before { border-color: var(--amber); }
.sg-tl li.sev-3::before { border-color: var(--red); background: var(--red); }
.sg-tl small { display: block; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------------- güvenlik durumu */
.sg-check { display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; padding: 13px 14px; border-bottom: 1px solid var(--line-2); }
.sg-check:last-child { border-bottom: 0; }
.sg-check .sg-st { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; grid-row: span 3; }
.sg-check .sg-st .ic { width: 16px; height: 16px; }
.sg-check.ok .sg-st { background: var(--green-soft); color: var(--green); }
.sg-check.warn .sg-st { background: var(--amber-soft); color: var(--amber); }
.sg-check.bad .sg-st { background: var(--red-soft); color: var(--red); }
.sg-check b { font-size: 14px; font-weight: 650; }
.sg-check p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.sg-check .sg-fix { margin-top: 6px; font-size: 12.5px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; overflow-wrap: anywhere; }
.sg-check .sg-fix code { font-size: 12px; word-break: break-all; }
.sg-check .row { margin-top: 8px; }

/* ---------------- ayarlar kartı ve portal süresi */
.sg-set .sg-line { display: flex; align-items: center; gap: 12px; }
.sg-set .sg-line .li-ico { background: var(--accent-soft); color: var(--accent); }
.sg-set p { margin: 0; font-size: 13px; color: var(--ink-2); }
.sg-set p b { color: var(--ink); }
.sg-days { margin: 10px 0 4px; }
.sg-portal .li { flex-wrap: wrap; }
.sg-portal .sg-url { font-size: 12px; overflow-wrap: anywhere; white-space: normal; }
.sg-portal .icon-btn { min-width: 40px; min-height: 40px; }

.sg-empty { padding: 18px 14px; text-align: center; color: var(--muted); font-size: 13.5px; }
.sg-row :focus-visible, .sg-ev:focus-visible, .sg-check :focus-visible, .sg-here :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (min-width: 720px) {
  .sg-filters { grid-template-columns: 1.2fr 1fr 1fr 1fr; }
  .sg-filters .wide { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { .sg-row .sg-off:active { transform: none; } }
