/* ===== XVERIFIER - light dashboard design system ===== */
:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --line: #e9eef6;
    --line-2: #dbe2ee;
    --navy: #0f1c33;
    --txt: #33415c;
    --muted: #7c8aa0;
    --primary: #2f6bff;
    --primary-dark: #2257d6;
    --ok: #16a34a;
    --bad: #dc2626;
    --warn: #d97706;
    --grad: linear-gradient(120deg, #7c3aed, #2f6bff);
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--txt);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

::selection { background: rgba(47, 107, 255, .18); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #c9d4e6; border-radius: 999px;
    border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: #a9bad6; }

/* ---------- sidebar ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: 232px;
    background: var(--card);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    z-index: 60;
}
.side-logo {
    display: block;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--line);
}
.side-tile {
    display: block;
    background: transparent;
    border-radius: 10px;
    padding: 10px 12px;
}
.side-tile img { display: block; width: 100%; height: auto; }
.nav-tile {
    width: 46px; height: 34px; border-radius: 9px; flex: 0 0 auto;
    background: #000; display: inline-flex; align-items: center;
    justify-content: center; overflow: hidden;
}
.nav-tile img { max-width: 84%; max-height: 72%; display: block; }
.side-logo b { font-size: 13.5px; font-weight: 800; letter-spacing: 1.4px; color: var(--navy); }

.side-cat {
    margin: 20px 18px 6px;
    font-size: 10.5px; font-weight: 800; letter-spacing: 1.3px;
    text-transform: uppercase; color: #93a3bb;
}
.side-link {
    display: flex; align-items: center; gap: 10px;
    margin: 2px 10px; padding: 9px 12px;
    border-radius: 10px; text-decoration: none;
    color: #5b6b83; font-size: 13.5px; font-weight: 600;
    transition: background .12s, color .12s;
}
.side-link:hover { background: #f3f6fb; color: var(--navy); }
.side-link.active { background: #eaf1ff; color: var(--primary); }
.side-link svg { flex: 0 0 auto; }

.side-spacer { flex: 1; }
.side-foot { padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.side-user { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.side-user .mono { font-size: 11.5px; color: var(--navy); font-weight: 700; }
.side-user small { font-size: 11px; color: var(--muted); }
.side-logout {
    width: 100%; height: 34px;
    border: 1px solid var(--line-2); border-radius: 9px;
    background: #fff; color: #5b6b83; font-weight: 700; font-size: 12.5px;
    cursor: pointer; transition: background .12s, color .12s;
}
.side-logout:hover { background: #fef2f2; color: var(--bad); border-color: #fecaca; }

/* ---------- main frame ---------- */
.main { margin-left: 232px; min-height: 100vh; display: flex; flex-direction: column; }
.content { padding: 24px 28px; flex: 1; }

.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
    padding: 14px 28px;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; font-weight: 800; color: var(--navy); letter-spacing: .2px; }
.topbar .sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.userbox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.foot {
    padding: 16px 28px; text-align: center;
    color: #9aa8bd; font-size: 11.5px;
}

/* ---------- cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.card h2 {
    font-size: 14.5px; font-weight: 800; color: var(--navy);
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}

.banner {
    display: flex; align-items: center; gap: 10px;
    background: var(--grad);
    color: #fff; font-weight: 600; font-size: 13px;
    border-radius: 14px; padding: 14px 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(84, 79, 255, .28);
}

/* ---------- login ---------- */
.login {
    max-width: 420px; margin: 9vh auto 0;
    text-align: center; padding: 36px 30px 30px;
}
.login-logo {
    display: block;
    margin: 4px auto 16px;
}
.login-logo img {
    display: block;
    width: 290px;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}
.login h1 { font-size: 19px; font-weight: 800; letter-spacing: 3px; color: var(--navy); margin-bottom: 5px; }
.login form { margin-top: 18px; }
.login .input { text-align: center; letter-spacing: 1px; }
.login .err { margin-top: 12px; }

/* ---------- typography helpers ---------- */
.muted { color: var(--muted); font-size: 12.5px; }
.err { color: var(--bad); font-size: 13px; margin-top: 10px; }
.ok-msg { color: var(--ok); }
.msg { margin-top: 12px; font-size: 13px; min-height: 18px; }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; }

/* ---------- inputs ---------- */
.input, textarea {
    width: 100%;
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    color: var(--navy);
    padding: 10px 13px;
    font-size: 13px;
    margin-top: 12px;
    font-family: "Cascadia Mono", Consolas, monospace;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, .14);
}
.input::placeholder, textarea::placeholder { color: #a6b3c8; }
.input.num {
    width: 72px; padding: 5px 8px; margin: 0; font-size: 12px;
    display: inline-block; vertical-align: middle;
}
textarea { resize: vertical; line-height: 1.65; min-height: 150px; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px;
    height: 36px; padding: 0 16px;
    border-radius: 10px;
    font-weight: 700; font-size: 12.5px; letter-spacing: .2px;
    cursor: pointer; text-decoration: none;
    color: #44546c;
    background: #fff;
    border: 1px solid var(--line-2);
    transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
    white-space: nowrap;
}
.btn:hover { background: #f4f7fc; border-color: #c4d2e8; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid rgba(47, 107, 255, .5); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.btn.primary {
    background: var(--primary); color: #fff; border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(47, 107, 255, .30);
}
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn.danger {
    background: #fef2f2; border-color: #fecaca; color: var(--bad);
}
.btn.danger:hover { background: #fee2e2; border-color: #fca5a5; }

.btn.warn {
    background: #fffbeb; border-color: #fde68a; color: var(--warn);
}
.btn.warn:hover { background: #fef3c7; border-color: #fcd34d; }

.btn.sm { height: 28px; padding: 0 10px; font-size: 11px; border-radius: 8px; }
.btn.wide { width: 100%; height: 40px; margin-top: 14px; }
.btn.tabbtn { height: 32px; padding: 0 15px; }
.btn.tabbtn.active { background: #eaf1ff; border-color: #bcd3ff; color: var(--primary); }

/* ---------- layout ---------- */
.row { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.row.wrap { align-items: stretch; }
.row.wrap .input { margin-top: 0; flex: 1 1 150px; }
.stretch { flex: 1; }
.inline { display: inline-flex; align-items: center; gap: 6px; }

.cols { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.col-l { flex: 1 1 520px; min-width: 0; }
.col-r { flex: 0 0 330px; min-width: 290px; }
.tabpane[hidden], #result[hidden] { display: none; }

/* ---------- chips ---------- */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: .3px;
    white-space: nowrap;
    background: #eef2f8; border: 1px solid transparent; color: #51617d;
}
.chip::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; opacity: .85; flex: 0 0 auto;
}
.chip-ok { background: #e8f7ee; color: var(--ok); }
.chip-bad { background: #fee9e9; color: var(--bad); }
.chip-warn { background: #fef6e7; color: var(--warn); }
.chip-off { background: #eef2f8; color: #93a3bb; }
.chip-blue { background: #eaf1ff; color: var(--primary); }

/* ---------- metrics widgets ---------- */
.metrics {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-top: 14px;
}
.metric {
    background: #f8fafc; border: 1px solid var(--line);
    border-radius: 11px; padding: 11px 13px;
}
.metric .muted {
    display: block; margin-bottom: 3px;
    font-size: 10px; font-weight: 800; letter-spacing: 1.2px;
    text-transform: uppercase; color: #93a3bb;
}
.metric b { font-size: 20px; font-weight: 800; color: var(--navy); }
.metric.hi b { font-size: 26px; }
.metric b.c-ok { color: var(--ok); }
.metric b.c-bad { color: var(--bad); }

.chart { margin-top: 12px; }
.chart svg { width: 100%; height: 84px; display: block; }

/* ---------- progress ---------- */
.progresswrap {
    height: 8px; border-radius: 999px; overflow: hidden;
    background: #edf1f8; border: 1px solid var(--line);
    margin-top: 14px;
}
#progressBar {
    height: 100%; width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2f6bff, #7c3aed);
    transition: width .35s ease;
}

/* ---------- tables ---------- */
.results {
    margin-top: 16px;
    max-height: 430px; overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
    position: sticky; top: 0; z-index: 2;
    text-align: left;
    padding: 10px 13px;
    font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #93a3bb;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}
td {
    padding: 9px 13px;
    border-bottom: 1px solid #eef2f8;
    vertical-align: middle;
    color: var(--txt);
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f7faff; }
tbody tr:last-child td { border-bottom: none; }

.actions { white-space: nowrap; }
.actions .btn { margin-right: 6px; }
.actions .btn:last-child { margin-right: 0; }

/* ---------- valid list panel ---------- */
.vlist {
    margin: 14px 0 2px;
    max-height: 430px; overflow: auto;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 12px;
    display: flex; flex-direction: column; gap: 2px;
}
.vlist div { padding: 5px 10px; border-radius: 7px; transition: background .12s; }
.vlist div:hover { background: #eaf1ff; }
.vlist .muted { padding: 6px 10px; text-align: center; font-family: Inter, "Segoe UI", sans-serif; }

/* ---------- modal ---------- */
.modal-back {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(15, 28, 51, .45);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.modal {
    background: var(--card); border-radius: 16px;
    border: 1px solid var(--line);
    box-shadow: 0 24px 60px rgba(16, 24, 40, .3);
    padding: 24px; width: 420px; max-width: 94vw;
}
.modal h3 { font-size: 15.5px; font-weight: 800; color: var(--navy); }
.modal .mrow { display: flex; gap: 8px; align-items: center; }
.modal .mrow .input { flex: 1; }
.mlabel {
    display: block; font-size: 10.5px; font-weight: 800;
    letter-spacing: 1.1px; text-transform: uppercase; color: #93a3bb;
    margin: 14px 0 2px;
}
.issued-box {
    background: #f8fafc; border: 1px solid var(--line);
    border-radius: 11px; padding: 12px 16px; margin-top: 14px;
}
.issued-box .muted {
    display: block; font-size: 10px; font-weight: 800;
    letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 3px;
}
.issued-box b { font-size: 19px; color: var(--navy); }

/* ---------- plan cards (pricing / user plans) ---------- */
.plans {
    display: grid; gap: 16px; margin-top: 20px;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}
.plan {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow);
    display: flex; flex-direction: column; position: relative;
}
.plan.popular { border-color: #bcd3ff; box-shadow: 0 10px 30px rgba(47, 107, 255, .14); }
.plan.current { border-color: #c9f3dd; box-shadow: 0 10px 30px rgba(22, 163, 74, .12); }
.plan .tag {
    position: absolute; top: -11px; left: 18px;
    background: var(--grad); color: #fff; font-size: 10px;
    font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
    padding: 4px 12px; border-radius: 999px;
}
.plan .ptag {
    font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px;
    text-transform: uppercase; color: #93a3bb;
}
.plan h3 { font-size: 16px; color: var(--navy); margin: 4px 0 2px; }
.plan .limit { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.plan .price {
    font-size: 30px; font-weight: 800; color: var(--navy);
    margin: 12px 0 2px;
}
.plan .price small { font-size: 12px; color: var(--muted); font-weight: 600; }
.plan .btn { width: 100%; margin-top: 14px; }
.plan-note { margin-top: 8px; font-size: 11.5px; color: var(--muted); text-align: center; }
.current-badge {
    position: absolute; top: -11px; right: 14px;
    background: var(--ok); color: #fff; font-size: 10px;
    font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
    padding: 4px 12px; border-radius: 999px;
}

/* ---------- team widget ---------- */
.teamlist { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.team-row {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 8px; border-radius: 10px;
}
.team-row:hover { background: #f7faff; }
.avatar {
    width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
    background: #eaf1ff; color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px;
}
.team-info { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.team-info b { font-size: 12.5px; color: var(--navy); }
.team-info small { font-size: 10.5px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(217, 119, 6, .15); }

/* ---------- misc ---------- */
.summary {
    display: grid; gap: 10px; margin-top: 14px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.summary div {
    background: #f8fafc; border: 1px solid var(--line);
    border-radius: 11px; padding: 11px 13px; font-size: 12.5px;
}
.summary .muted {
    display: block; margin-bottom: 5px;
    font-size: 10px; font-weight: 800; letter-spacing: 1.2px;
    text-transform: uppercase;
}

.mobiletabs {
    display: none;
    position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
    z-index: 80; padding: 6px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 12px; box-shadow: 0 10px 30px rgba(16, 24, 40, .18);
}
@media (max-width: 880px) {
    .sidebar { display: none; }
    .main { margin-left: 0; }
    .mobiletabs {
        display: flex; gap: 8px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        max-width: 96vw;
    }
    .mobiletabs .tabbtn { height: 40px; padding: 0 18px; font-size: 12px; }
    .content { padding: 16px 14px 120px; }
    .topbar { padding: 12px 16px; gap: 10px; }
    .topbar h1 { font-size: 15.5px; }
    .col-r { flex: 1 1 100%; }
    .userbox .chip { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; }
    .foot { padding: 14px 16px 18px; }

    /* comfortable touch targets */
    input, select, textarea { font-size: 16px; }
    input.input, select.input, .confirm input, .confirm select { font-size: 16px; }
    td .btn { height: 32px; padding: 0 12px; }
    .side-logout { height: 40px; }

    /* wide tables scroll horizontally instead of squishing */
    .results { -webkit-overflow-scrolling: touch; }
    .results.wide table { min-width: 680px; }
    th, td { padding-left: 10px; padding-right: 10px; }

    .modal { padding: 18px; }
    .banner { padding: 12px 16px; border-radius: 12px; }
    .card { padding: 16px 15px; border-radius: 13px; }
    .login { margin-top: 4vh; padding: 26px 18px 24px; }
    .plans { margin-top: 14px; }
}
