:root {
    --bg: #0f141b;
    --panel: #171e28;
    --panel-2: #1e2733;
    --line: #2a3644;
    --txt: #e6edf5;
    --muted: #8ea0b5;
    --ok: #34d399;
    --bad: #f87171;
    --warn: #fbbf24;
    --accent: #38bdf8;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--txt);
    font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Üst bar ---------- */
.topbar {
    display: flex; align-items: center; gap: 24px;
    padding: 0 20px; height: 56px;
    background: var(--panel); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; white-space: nowrap; }
.brand-eye { font-size: 20px; }
.brand-text strong { color: var(--accent); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
    padding: 7px 14px; border-radius: var(--radius);
    color: var(--muted); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--panel-2); color: var(--txt); text-decoration: none; }
.nav a.on { background: var(--panel-2); color: var(--txt); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.who { color: var(--muted); font-size: 13px; }
.inline { display: inline; }

.wrap { max-width: 1400px; margin: 0 auto; padding: 22px 20px 60px; }

/* ---------- Başlıklar ---------- */
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 20px; font-weight: 600; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
h2.section { font-size: 15px; margin: 26px 0 12px; font-weight: 600; color: var(--txt); }

/* ---------- Butonlar ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: var(--radius);
    border: 1px solid var(--line); background: var(--panel-2); color: var(--txt);
    font: inherit; font-weight: 500; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #06202b; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); }

/* ---------- Kartlar ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.card {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px;
}
.card .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.card .value { font-size: 26px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.card .foot { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ---------- Durum göstergeleri ---------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(52,211,153,.15); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(248,113,113,.15); }
.dot.unk { background: var(--muted); box-shadow: 0 0 0 3px rgba(142,160,181,.12); }

.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500;
    border: 1px solid var(--line); background: var(--panel-2); white-space: nowrap;
}
.pill.ok { color: var(--ok); border-color: rgba(52,211,153,.35); }
.pill.bad { color: var(--bad); border-color: rgba(248,113,113,.35); }
.pill.unk { color: var(--muted); }

/* ---------- Şube panelleri ---------- */
.branch { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.branch-head {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.branch-head .name { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.branch-head .meta { color: var(--muted); font-size: 12px; }
.branch-head .spacer { flex: 1; }
.branch-body { padding: 16px; }

.kasa-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kasa {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 14px; background: var(--panel-2);
}
.kasa .k-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kasa .k-name { font-weight: 600; }
.kasa .k-ip { color: var(--muted); font-size: 12px; margin-left: auto; font-variant-numeric: tabular-nums; }
.kasa .k-dirs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.kasa .k-foot { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 10px; }

/* Terazi ızgarası: şube başına 10-15 cihaz rahat sığsın */
.terazi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.terazi {
    border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px;
    background: var(--panel-2); position: relative;
}
.terazi.off { border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.07); }
.terazi .t-top { display: flex; align-items: center; gap: 6px; }
.terazi .t-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.terazi .t-ip { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; margin-top: 3px; }
.terazi .t-ms { color: var(--muted); font-size: 11px; }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; background: var(--panel-2); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: rgba(255,255,255,.02); }
tfoot td { font-weight: 600; background: var(--panel-2); }

/* ---------- Saatlik grafik ---------- */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding: 10px 0; }
.chart .bar { flex: 1; background: linear-gradient(180deg, var(--accent), #1d6a8c); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.chart .bar span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); }
.chart-wrap { padding-bottom: 22px; }

/* ---------- Formlar ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
input[type=text], input[type=password], input[type=number], select, textarea {
    width: 100%; padding: 9px 11px; border-radius: 8px;
    border: 1px solid var(--line); background: var(--bg); color: var(--txt);
    font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 76px; resize: vertical; font-family: Consolas, monospace; font-size: 13px; }
.field { margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- Uyarılar ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; font-size: 13px; }
.alert.ok { color: var(--ok); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.alert.bad { color: var(--bad); border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.08); }
.alert.warn { color: var(--warn); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }

.empty { color: var(--muted); text-align: center; padding: 30px; font-size: 13px; }

/* ---------- Giriş ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 30px; }
.login-box .logo { text-align: center; font-size: 20px; margin-bottom: 4px; }
.login-box .logo .eye { font-size: 34px; display: block; margin-bottom: 8px; }
.login-box .tag { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 24px; }

.muted { color: var(--muted); }
.mono { font-family: Consolas, monospace; font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

@media (max-width: 720px) {
    .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
    .nav { order: 3; width: 100%; overflow-x: auto; }
    .wrap { padding: 16px 14px 40px; }
}
