:root {
  --bg: #f5f6fa; --surface: #ffffff; --surface-2: #eef0f6; --border: #e0e3ee;
  --text: #161a2b; --muted: #555b72; --faint: #8a90a6;
  --brand: #4338ca; --brand-soft: #e0e7ff;
  --ok: #16a34a; --ok-soft: #dcfce7; --bad: #dc2626; --bad-soft: #fee2e2; --warn: #b45309; --warn-soft: #fef3c7;
  --bar: #6366f1;
  --radius: 14px; --shadow: 0 1px 2px rgba(21, 20, 43, .06), 0 4px 16px rgba(21, 20, 43, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117; --surface: #171a23; --surface-2: #1f2330; --border: #2a2f3f;
    --text: #e7e9f2; --muted: #a3a9be; --faint: #6f768d;
    --brand: #a5b4fc; --brand-soft: #23264a;
    --ok: #4ade80; --ok-soft: #13301f; --bad: #f87171; --bad-soft: #3d1a1d; --warn: #fbbf24; --warn-soft: #382a0c;
    --bar: #818cf8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; }
.okc { color: var(--ok); } .badc { color: var(--bad); } .warnc { color: var(--warn); }

/* ---------- Yerleşim ---------- */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.top .in { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .3px; font-size: 17px; color: var(--text); }
.logo img { width: 30px; height: 30px; border-radius: 8px; }
.top .sp { flex: 1; }
.clock { color: var(--muted); font-size: 13px; text-align: right; line-height: 1.25; }
main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; }
.sec-title { font-size: 12px; font-weight: 750; letter-spacing: .6px; text-transform: uppercase; color: var(--faint); margin: 24px 2px 10px; display: flex; align-items: center; gap: 8px; }
.sec-title .x { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ---------- Bileşenler ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0f1117; } }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 1px solid var(--border); background: var(--surface); cursor: pointer; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); font-size: 16px; display: inline-grid; place-items: center; flex: none; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stack { display: flex; flex-direction: column; gap: 12px; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
label.f input { font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; font-size: 15px; width: 100%; }
label.f input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
label.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.note { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.bad { background: var(--bad-soft); color: var(--bad); } .tag.warn { background: var(--warn-soft); color: var(--warn); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); } .dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }

/* Uyarılar */
.alerts { display: flex; flex-direction: column; gap: 6px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 550; }
.alert.bad { background: var(--bad-soft); color: var(--bad); } .alert.warn { background: var(--warn-soft); color: var(--warn); }
.allok { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: 14px; }

/* Uygulama kutucukları */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .tiles { gap: 10px; } }
a.tile { display: flex; flex-direction: column; gap: 10px; color: var(--text); transition: transform .12s, border-color .12s; }
a.tile:hover { border-color: var(--brand); transform: translateY(-1px); }
.tile .hd { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tile .ic { font-size: 26px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--surface-2); border-radius: 12px; flex: none; }
.tile .nm { font-weight: 750; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .ds { font-size: 12.5px; color: var(--muted); }
.tile .st { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-top: auto; }
.tile .st b { font-weight: 650; }
.tile.down { border-color: var(--bad); }
@media (max-width: 520px) {
  .tile .ic { width: 38px; height: 38px; font-size: 22px; }
  .tile .ds { display: none; }
  a.tile { padding: 12px; }
}

/* Sunucu */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat .lbl { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .val { font-size: 22px; font-weight: 750; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.meter { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--bar); border-radius: 4px; }
.meter i.warn { background: var(--warn); } .meter i.bad { background: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tbl-wrap { overflow-x: auto; margin: -4px -4px 0; padding: 0 4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--faint); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .app { white-space: nowrap; font-weight: 650; }
.tbl .sub2 { display: block; font-size: 12px; color: var(--faint); }
@media (max-width: 560px) {
  table.tbl.cards thead { display: none; }
  table.tbl.cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  table.tbl.cards tr:last-child { border-bottom: 0; }
  table.tbl.cards td { border: 0; padding: 0; }
  table.tbl.cards td.app { grid-column: 1 / -1; }
  table.tbl.cards td[data-l]::before { content: attr(data-l); display: block; font-size: 11.5px; color: var(--faint); font-weight: 700; }
}
.tbl.sizes td.num { white-space: nowrap; text-align: right; }
.tbl.sizes th:not(:first-child) { text-align: right; }
.tbl.sizes td.app { min-width: 150px; }
.mob-total { display: none; }
.tbl.sizes .meter { height: 5px; margin-top: 6px; }
@media (max-width: 560px) {
  table.tbl.sizes tr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tbl.sizes td.num { text-align: left; }
  .tbl.sizes td[data-l="Toplam"] { display: none; }
  .mob-total { display: inline; }
}
.foot { margin-top: 22px; text-align: center; font-size: 12.5px; color: var(--faint); }

/* ---------- Modal / giriş / bildirim ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 10, 25, .45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px 12px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 440px; padding: 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal h3 { margin: 0 0 14px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.modal h3 .x { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 18px; }
.modal h4 { margin: 18px 0 8px; font-size: 14px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.modal .actions .left { margin-right: auto; }
.sess { font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.sess div { display: flex; justify-content: space-between; gap: 10px; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .card { width: 100%; max-width: 360px; padding: 24px; }
.login h1 { font-size: 20px; margin: 10px 0 6px; text-align: center; }
.login img { display: block; margin: 0 auto; width: 56px; height: 56px; border-radius: 14px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: calc(100% - 32px); }
#toast.on { opacity: 1; transform: translateX(-50%); }
