/* OPS/PAYMENTS — dark operations panel */

:root {
    --bg0: #07090e;
    --bg1: #0c1017;
    --bg2: #121926;
    --bg3: #182231;
    --line: #1e2836;
    --line2: #2a3850;
    --text: #e9eef7;
    --muted: #8291a7;
    --dim: #55637a;
    --accent: #2dd4a7;
    --accent2: #7c6cf6;
    --accent-ink: #04150f;
    --green: #2dd4a7;
    --red: #ff5d6c;
    --amber: #f5b34a;
    --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
    --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    color: var(--text);
    font: 14px/1.5 var(--sans);
    background:
        radial-gradient(1100px 480px at 72% -12%, rgba(124, 108, 246, .10), transparent 60%),
        radial-gradient(900px 420px at 8% -12%, rgba(45, 212, 167, .07), transparent 55%),
        var(--bg0);
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(45, 212, 167, .28); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg0); }
::-webkit-scrollbar-thumb { background: #1e2836; border-radius: 8px; border: 2px solid var(--bg0); }
::-webkit-scrollbar-thumb:hover { background: #2a3850; }

/* ── top bar ───────────────────────────────────────────────────────── */
.top {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 20px;
    height: 58px; padding: 0 26px;
    background: rgba(12, 16, 23, .84);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.brand {
    display: flex; align-items: center; gap: 10px;
    color: var(--text); text-decoration: none;
    font-weight: 650; font-size: 14.5px; letter-spacing: .6px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 22px; height: 22px; border-radius: 6px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    position: relative; box-shadow: 0 0 14px rgba(45, 212, 167, .35);
}
.brand-mark::after {
    content: ""; position: absolute; inset: 6px; border-radius: 3px;
    background: rgba(4, 21, 15, .6);
}
.brand-dim { color: var(--dim); font-weight: 400; margin: 0 1px; }
.top nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.top nav a {
    padding: 8px 14px; border-radius: 9px;
    color: var(--muted); font-size: 13.5px; letter-spacing: .2px;
    border: 1px solid transparent;
}
.top nav a:hover { color: var(--text); background: var(--bg2); text-decoration: none; }
.top nav a.active {
    color: var(--text);
    background: linear-gradient(180deg, var(--bg3), var(--bg2));
    border-color: var(--line2);
}

main { max-width: 1200px; margin: 0 auto; padding: 28px 26px 60px; }

/* ── cards ─────────────────────────────────────────────────────────── */
.card {
    background: linear-gradient(180deg, var(--bg2), var(--bg1));
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 18px;
    min-width: 0;
    overflow-x: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.card h2 {
    font-size: 14px; font-weight: 600; letter-spacing: .4px;
    margin: 0 0 14px; color: var(--text);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card label {
    display: block; color: var(--muted);
    font: 600 11px/1.4 var(--sans); letter-spacing: .9px; text-transform: uppercase;
    margin-top: 12px; margin-bottom: 4px;
}

.grid { display: grid; gap: 18px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid.two { grid-template-columns: 1fr 1fr; align-items: start; }

/* ── stat cards ────────────────────────────────────────────────────── */
.stat { position: relative; }
.stat::before {
    content: ""; position: absolute; top: -1px; left: 12%; right: 12%; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(45, 212, 167, .6), transparent);
    opacity: 0; transition: opacity .2s;
}
.stat:hover { border-color: var(--line2); }
.stat:hover::before { opacity: 1; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.label {
    color: var(--muted); font: 600 11px/1 var(--sans);
    letter-spacing: 1.1px; text-transform: uppercase;
}
.stat-ico {
    width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px;
    display: grid; place-items: center;
    color: var(--accent); background: rgba(45, 212, 167, .10);
    border: 1px solid rgba(45, 212, 167, .22);
}
.stat-ico svg { width: 17px; height: 17px; stroke: currentColor; }
.stat-ico.violet { color: var(--accent2); background: rgba(124, 108, 246, .10); border-color: rgba(124, 108, 246, .25); }
.stat-ico.amber  { color: var(--amber);  background: rgba(245, 179, 74, .10);  border-color: rgba(245, 179, 74, .25); }
.stat-ico.red    { color: var(--red);    background: rgba(255, 93, 108, .10);  border-color: rgba(255, 93, 108, .25); }
.value {
    font: 600 27px/1.1 var(--sans); letter-spacing: -.5px;
    margin: 0 0 8px; font-variant-numeric: tabular-nums;
}
.value.accent { color: var(--accent); }
.value.danger { color: var(--red); }
.sub { color: var(--dim); font-size: 12px; }

/* ── tables ────────────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
    text-align: left; color: var(--dim);
    font: 600 11px/1 var(--sans); letter-spacing: 1px; text-transform: uppercase;
    padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, .022); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td a { color: var(--text); }
.tbl td a:hover { color: var(--accent); }

/* ── rows / misc ───────────────────────────────────────────────────── */
.row {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 11px 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.accent { color: var(--accent); }
.danger { color: var(--red); }

/* ── buttons ───────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    cursor: pointer; border: 1px solid var(--line2);
    background: var(--bg3); color: var(--text);
    border-radius: 9px; padding: 9px 15px;
    font: 600 13px/1 var(--sans); letter-spacing: .2px;
    text-decoration: none; transition: border-color .15s, background .15s, filter .15s;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
    background: linear-gradient(135deg, #2dd4a7, #1fb387);
    border-color: transparent; color: var(--accent-ink);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: rgba(255, 93, 108, .10); border-color: rgba(255, 93, 108, .40); color: var(--red); }
.btn.danger:hover { background: rgba(255, 93, 108, .18); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn.small { padding: 6px 12px; font-size: 12.5px; }
.btn.tiny { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.inline { display: inline-block; margin: 0 2px; }

/* ── tags ──────────────────────────────────────────────────────────── */
.tag {
    display: inline-block; padding: 2px 9px; border-radius: 99px;
    font: 600 11px/1.7 var(--sans); letter-spacing: .3px;
    background: var(--bg3); color: var(--muted); border: 1px solid var(--line2);
}
.tag.open, .tag.due { color: var(--amber); border-color: rgba(245, 179, 74, .35); background: rgba(245, 179, 74, .08); }
.tag.paid { color: var(--green); border-color: rgba(45, 212, 167, .35); background: rgba(45, 212, 167, .08); }
.tag.overdue, .tag.danger, .tag.locked { color: var(--red); border-color: rgba(255, 93, 108, .35); background: rgba(255, 93, 108, .08); }
.tag.void { color: var(--dim); }

/* ── forms ─────────────────────────────────────────────────────────── */
input, select, textarea {
    background: var(--bg0); color: var(--text);
    border: 1px solid var(--line); border-radius: 9px;
    padding: 10px 12px; font: 14px/1.4 var(--sans); width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(45, 212, 167, .12);
}
input::placeholder, textarea::placeholder { color: var(--dim); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
form.stack { display: flex; flex-direction: column; gap: 4px; }
form.stack label { margin-bottom: 2px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; text-transform: none; letter-spacing: 0; }
.check input { width: auto; }

/* ── code / wiring ─────────────────────────────────────────────────── */
.code {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg0); border: 1px solid var(--line);
    border-radius: 9px; padding: 10px 12px; margin: 0 0 10px;
    word-break: break-all; color: var(--text);
}
.code .txt { flex: 1; }
.code.blurred .txt { filter: blur(6px); user-select: none; pointer-events: none; }
textarea.code { display: block; width: 100%; resize: vertical; }
.copy {
    flex: 0 0 auto; cursor: pointer;
    background: var(--bg3); border: 1px solid var(--line2); color: var(--muted);
    border-radius: 7px; padding: 4px 10px;
    font: 600 11px/1 var(--sans); letter-spacing: .3px;
}
.copy:hover { color: var(--text); border-color: var(--muted); }
textarea.code + .copy { margin-bottom: 12px; }

/* ── login ─────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 380px; padding: 34px 32px; text-align: center; position: relative; }
.login::before {
    content: ""; position: absolute; inset: -1px; border-radius: 15px; z-index: -1;
    background: linear-gradient(135deg, rgba(45, 212, 167, .28), rgba(124, 108, 246, .28));
    filter: blur(22px); opacity: .5;
}
.login-mark {
    width: 46px; height: 46px; margin: 0 auto 16px; border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: grid; place-items: center;
    box-shadow: 0 8px 30px rgba(45, 212, 167, .28);
}
.login-mark svg { width: 24px; height: 24px; }
.login h1 { font-size: 20px; margin: 0 0 6px; letter-spacing: .3px; }
.login p { margin: 0; }
.login form { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.login-err { color: var(--red) !important; font-size: 13px; margin-top: 14px !important; }

/* ── responsive ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .grid.two { grid-template-columns: 1fr; }
    .top { padding: 0 16px; gap: 12px; }
    main { padding: 18px 14px 50px; }
    .value { font-size: 23px; }
}
