:root {
    --bg: #eef1f4;
    --card: #fff;
    --ink: #1c2430;
    --muted: #667085;
    --line: #e4e7ec;
    --accent: #0f6e6a;
    --accent-ink: #fff;
    --soft: #f7f8fa;
    --ok: #067647;
    --ok-bg: #e7f6ee;
    --wait: #9a6700;
    --wait-bg: #fff6e0;
    --bad: #b42318;
    --bad-bg: #fdecec;
    --sidebar: 196px;
    --font: "IBM Plex Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.4;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
code { font-size: 12px; }

.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar);
    flex: 0 0 var(--sidebar);
    background: #17202c;
    color: #d5dbe3;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 10px 8px;
}
.brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 12px; }
.mark {
    width: 22px; height: 22px; border-radius: 6px;
    display: grid; place-items: center;
    background: #0f6e6a; color: white; font-size: 12px; font-weight: 600;
}
.brand strong { font-size: 13px; font-weight: 600; color: white; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-label {
    margin: 10px 8px 4px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b97a8;
}
.nav a {
    color: #d5dbe3;
    padding: 5px 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav a.active, .nav a:hover { background: rgba(255,255,255,0.08); color: white; }
.count {
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 99px; background: #0f6e6a; color: white;
    font-size: 10px; font-weight: 600; display: grid; place-items: center;
}
.side-foot {
    margin-top: auto; padding: 8px;
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid rgba(255,255,255,0.08); font-size: 12px;
}
.sidebar .muted, .side-foot a { color: #b7c0cc; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 44px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.topbar-title { display: flex; align-items: center; gap: 8px; }
.topbar h1 { margin: 0; font-size: 15px; font-weight: 600; }
.menu-btn { display: none; }
.content {
    padding: 12px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.content > .card,
.content > .stats,
.content > form,
.content > .grid-2,
.content > .inline { margin: 0 !important; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat, .card, .login-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.stat { padding: 8px 10px; }
.stat span { display: block; color: var(--muted); font-size: 11px; }
.stat b { display: block; margin-top: 2px; font-size: 18px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 10px; }
.card { padding: 12px; }
.card h2 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 11px; font-weight: 600; background: var(--soft); }
tr:last-child td { border-bottom: 0; }
.thumb { width: 36px; height: 28px; object-fit: cover; border-radius: 4px; background: var(--soft); }
.badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 1px 6px; font-size: 11px; font-weight: 600; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-wait { background: var(--wait-bg); color: var(--wait); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-neutral { background: var(--soft); color: var(--muted); }
.btn {
    border: 1px solid var(--line); cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; padding: 5px 9px; background: white; color: var(--ink); font-size: 12px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-danger { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.btn-small { padding: 3px 7px; font-size: 12px; }
.row-actions, .filters, .inline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filters, .content > .inline { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.card .inline { background: transparent; border: 0; padding: 0; }
.filters input, .filters select, .inline input, .inline select { width: auto; min-width: 160px; }
.flash { padding: 8px 10px; border-radius: 6px; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-err { background: var(--bad-bg); color: var(--bad); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); }
label.inline input { width: auto; }
input, select, textarea {
    width: 100%; background: white; border: 1px solid #d0d5dd; border-radius: 6px;
    padding: 6px 8px; color: var(--ink);
}
textarea { min-height: 68px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15, 110, 106, 0.2); border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.span-2 { grid-column: 1 / -1; }
.muted, .help { color: var(--muted); }
.help { font-size: 12px; line-height: 1.45; margin: 6px 0 0; }
.quota-wrap { display: flex; align-items: center; gap: 6px; min-width: 120px; }
.quota { flex: 1; height: 5px; background: #e4e7ec; border-radius: 99px; overflow: hidden; }
.quota-fill { height: 100%; background: var(--accent); }
.quota-fill.is-full { background: var(--bad); }
.pager { display: flex; gap: 4px; }
.pager a { padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink); }
.pager a.is-current { background: var(--accent); border-color: var(--accent); color: white; }
.empty { padding: 14px 4px; color: var(--muted); }
.check { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.check b { font-weight: 600; }
.pill { border-radius: 99px; padding: 2px 8px; font-size: 11px; background: var(--soft); color: var(--muted); }
.pill.on { background: var(--ok-bg); color: var(--ok); }
.pill.off { background: var(--bad-bg); color: var(--bad); }
.guest { display: grid; place-items: center; padding: 24px 12px; background: var(--bg); }
.login-wrap { width: min(440px, 100%); }
.login-card { padding: 18px; }
.login-card h1 { margin: 0 0 4px; font-size: 18px; }
.eyebrow { margin: 0 0 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.lead { color: var(--muted); margin: 0 0 10px; }
.cred { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.cred div { background: var(--soft); border-radius: 6px; padding: 8px; }
.cred dt { color: var(--muted); font-size: 11px; }
.cred dd { margin: 2px 0 0; font-weight: 600; color: var(--ink); }
.proof { max-width: 280px; border-radius: 8px; border: 1px solid var(--line); }
details { border-top: 1px solid var(--line); padding: 6px 0; }
summary { cursor: pointer; font-size: 12px; font-weight: 600; }
.menu-btn { background: white; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.profile-card { display: flex; gap: 12px; align-items: center; }
.avatar {
    width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
    background: var(--soft); border: 1px solid var(--line); flex: 0 0 auto;
}
.avatar-fallback { display: grid; place-items: center; font-size: 18px; font-weight: 600; color: var(--accent); }
.profile-card h2 { margin: 0; font-size: 15px; }
.profile-card p { margin: 2px 0; }
.count-live { font-size: 11px; color: var(--muted); }

@media (max-width: 1100px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .grid-2, .form-grid, .cred { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .menu-btn { display: inline-flex; }
    .sidebar {
        position: fixed; z-index: 20; transform: translateX(-105%);
        transition: transform .18s ease;
    }
    .sidebar.open { transform: none; }
    .stats, .form-grid, .cred { grid-template-columns: 1fr; }
    .profile-card { align-items: flex-start; }
    .content, .topbar { padding-left: 12px; padding-right: 12px; }
}
