:root,
[data-bs-theme="dark"] {
    --ink: #050505;
    --ink-2: #0c0c0c;
    --panel: #111111;
    --panel-2: #171717;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .14);
    --text: #f3f3f3;
    --muted: #8d8d8d;
    --accent: #f5f5f5;
    --ok: #3dd68c;
    --warn: #f5b942;
    --bad: #ff5c5c;
    --radius: 16px;
    --shadow: 0 24px 48px rgba(0, 0, 0, .45);
    --bs-body-bg: #050505;
    --bs-body-color: #f3f3f3;
    --bs-body-color-rgb: 243, 243, 243;
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: #8d8d8d;
    --bs-tertiary-bg: #141414;
    --bs-secondary-bg: #1a1a1a;
    --bs-border-color: rgba(255, 255, 255, .08);
    --bs-border-color-translucent: rgba(255, 255, 255, .08);
    --bs-link-color: #f5f5f5;
    --bs-link-hover-color: #ffffff;
    --bs-heading-color: #f8f8f8;
    --bs-form-control-bg: #0e0e0e;
    --bs-primary: #f5f5f5;
    --bs-primary-rgb: 245, 245, 245;
}

html { color-scheme: dark; }
* { box-sizing: border-box; }
html, body {
    font-family: Inter, system-ui, sans-serif;
    background: var(--ink);
    color: var(--text);
}
body { margin: 0; }

a { color: inherit; }
code { color: #fff; background: rgba(255,255,255,.06); padding: .1em .35em; border-radius: 6px; font-size: .92em; }
pre { color: #d8d8d8; }

.btn-brand {
    background: #f4f4f4;
    border: 0;
    color: #111;
    font-weight: 600;
    border-radius: 11px;
    padding: .55rem 1.15rem;
    letter-spacing: -.01em;
}
.btn-brand:hover, .btn-brand:focus {
    color: #000;
    background: #fff;
    filter: none;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line-2);
    color: #d4d4d4;
    border-radius: 10px;
}
.btn-ghost:hover { background: #fff; color: #111; border-color: #fff; }

.btn-outline-secondary, .btn-outline-light, .btn-outline-primary, .btn-outline-warning, .btn-outline-danger {
    border-radius: 10px;
}
.btn-outline-secondary {
    color: #d0d0d0;
    border-color: var(--line-2);
}
.btn-outline-secondary:hover { background: #1c1c1c; color: #fff; border-color: #fff; }
.btn-outline-primary { color: #eee; border-color: var(--line-2); }
.btn-outline-primary:hover { background: #fff; color: #111; border-color: #fff; }
.btn-outline-light { color: #ddd; border-color: var(--line-2); }
.btn-outline-light:hover { background: #fff; color: #111; }
.btn-outline-warning { color: var(--warn); border-color: rgba(245, 185, 66, .35); }
.btn-outline-danger { color: #ff8a8a; border-color: rgba(255, 92, 92, .35); }

.brand-mark {
    width: 44px; height: 44px; border-radius: 12px;
    display: grid; place-items: center;
    background: #0a0a0a;
    border: 1px solid var(--line-2);
    color: #fff; font-size: 1.05rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.form-control, .form-select {
    background: #0b0b0b;
    border: 1px solid var(--line-2);
    color: #f3f3f3;
    border-radius: 11px;
}
.form-control:focus, .form-select:focus {
    background: #0b0b0b;
    color: #fff;
    border-color: #fff;
    box-shadow: 0 0 0 .2rem rgba(255,255,255,.08);
}
.form-control::placeholder { color: #6f6f6f; }
.form-label { color: #cfcfcf; font-weight: 500; }
.form-text, .text-muted { color: var(--muted) !important; }
.form-check-input {
    background-color: #1a1a1a;
    border-color: #555;
}
.form-check-input:checked {
    background-color: #fff;
    border-color: #fff;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line) !important;
    border-radius: var(--radius);
    box-shadow: none;
    color: var(--text);
}
.card.shadow-sm, .card.shadow-lg { box-shadow: var(--shadow) !important; }
.list-group-item {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}

.table { --bs-table-bg: transparent; --bs-table-color: #eaeaea; --bs-table-border-color: var(--line); color: #eaeaea; }
.table thead th {
    color: #8a8a8a;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-bottom-color: var(--line);
}
.table > :not(caption) > * > * { background: transparent; color: inherit; }
.table-danger, .table-danger > td { --bs-table-bg: rgba(255, 92, 92, .12); color: #ffc9c9; }

.alert { border-radius: 12px; border: 1px solid var(--line); }
.alert-success { background: rgba(61, 214, 140, .12); color: #b8f5d4; border-color: rgba(61, 214, 140, .25); }
.alert-danger { background: rgba(255, 92, 92, .12); color: #ffc4c4; border-color: rgba(255, 92, 92, .28); }
.alert-warning { background: rgba(245, 185, 66, .12); color: #ffe3a3; border-color: rgba(245, 185, 66, .28); }
.alert-info { background: rgba(255,255,255,.06); color: #e6e6e6; border-color: var(--line); }
.alert-secondary, .alert-light { background: #161616; color: #d0d0d0; border-color: var(--line); }

.badge { font-weight: 600; }
.progress { background: #222; }

pre.bg-light {
    background: #0a0a0a !important;
    border: 1px solid var(--line);
    color: #d6d6d6;
}

.pagination .page-link {
    background: #111;
    border-color: var(--line);
    color: #ddd;
}
.pagination .page-item.active .page-link {
    background: #fff;
    border-color: #fff;
    color: #111;
}

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(900px 420px at 12% -10%, rgba(255,255,255,.07), transparent 55%),
        radial-gradient(700px 380px at 100% 0%, rgba(255,255,255,.04), transparent 50%),
        #050505;
}
.auth-card {
    border-radius: 22px;
    background: #101010;
    border: 1px solid var(--line) !important;
}

.admin-body { display: flex; min-height: 100vh; background: var(--ink); }
.admin-sidebar {
    width: 252px;
    background: #080808;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--line);
}
.sidebar-brand {
    display: flex; gap: 12px; align-items: center; padding: 22px 18px 18px;
    color: #fff; text-decoration: none; border-bottom: 1px solid var(--line);
}
.sidebar-brand:hover { color: #fff; }
.sidebar-brand small { display: block; color: #7d7d7d; font-size: .72rem; }
.sidebar-nav { padding: 14px 10px; flex: 1; }
.sidebar-nav .nav-link {
    color: #b5b5b5;
    border-radius: 11px;
    padding: 10px 12px;
    margin-bottom: 3px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.sidebar-nav .nav-link i { width: 18px; text-align: center; color: #7a7a7a; }
.sidebar-nav .nav-link:hover {
    background: #161616;
    color: #fff;
}
.sidebar-nav .nav-link.active {
    background: #f4f4f4;
    color: #111;
}
.sidebar-nav .nav-link.active i { color: #111; }
.sidebar-foot { padding: 16px; border-top: 1px solid var(--line); }
.admin-main { flex: 1; min-width: 0; background: var(--ink); }
.admin-top {
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px 28px 8px;
}
.admin-top h1 { font-size: 1.3rem; margin: 0; font-weight: 700; letter-spacing: -.03em; color: #fff; }
.admin-content { padding: 8px 28px 40px; }

.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    position: relative;
    overflow: hidden;
    min-height: 110px;
}
.stat-card span { color: var(--muted); font-size: .82rem; }
.stat-card strong { display: block; font-size: 1.8rem; margin-top: 6px; color: #fff; letter-spacing: -.04em; }
.stat-card i { position: absolute; right: 16px; top: 18px; font-size: 1.25rem; color: #5c5c5c; }
.stat-card.danger i { color: var(--bad); }
.stat-card.warn i { color: var(--warn); }

.term-page {
    --t-bg: #07110c;
    --t-ink: #e8f6ee;
    --t-muted: #8aab98;
    --t-line: rgba(61, 255, 143, .16);
    --t-line-2: rgba(61, 255, 143, .32);
    --t-ok: #3dff8f;
    --t-warn: #f5c451;
    --t-bad: #ff6b6b;
    --t-glass: rgba(8, 18, 13, .72);
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--t-bg);
    color: var(--t-ink);
    overflow-x: hidden;
}
.term-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 480px at 12% -8%, rgba(61, 255, 143, .16), transparent 58%),
        radial-gradient(720px 420px at 100% 0%, rgba(61, 255, 143, .07), transparent 52%),
        radial-gradient(600px 380px at 80% 110%, rgba(20, 80, 50, .35), transparent 50%),
        #07110c;
    z-index: 0;
}
.term-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .35;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0 3px,
        rgba(0, 0, 0, .18) 3px 4px
    );
}
.term-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    padding: 18px 16px 32px;
}
.term-window {
    width: min(880px, 100%);
    background: var(--t-glass);
    border: 1px solid var(--t-line);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
    backdrop-filter: blur(18px);
    font-family: Outfit, system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.term-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--t-line);
    color: var(--t-muted);
    font-size: 13px;
}
.term-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--t-ink);
    font-weight: 600;
    letter-spacing: -.02em;
}
.term-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--t-ok);
    color: #05210f;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}
.term-title { font-size: 14px; }
.term-quota {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 12px;
    color: var(--t-ok);
    margin-left: auto;
    margin-right: 14px;
}
.term-quota strong { color: #f4fff8; }
.term-clock {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
    color: var(--t-ok);
    opacity: .9;
}
.term-screen {
    padding: clamp(22px, 4vw, 40px) clamp(18px, 4vw, 36px) clamp(28px, 4vw, 44px);
    font-size: 16px;
    line-height: 1.55;
}
.term-hero { margin: 0 0 22px; }
.term-kicker {
    margin: 0 0 8px;
    color: var(--t-ok);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.term-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(1.7rem, 4.4vw, 2.35rem);
    font-weight: 600;
    letter-spacing: -.04em;
    line-height: 1.15;
    color: #f4fff8;
}
.term-sub {
    margin: 0 0 10px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #e8f6ee;
}
.term-lead {
    margin: 0 0 12px;
    max-width: 62ch;
    color: var(--t-muted);
    font-size: 1.02rem;
}
.skip-link {
    position: absolute;
    left: 12px;
    top: -48px;
    z-index: 20;
    padding: 8px 12px;
    background: #3dff8f;
    color: #07110c;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
}
.skip-link:focus {
    top: 12px;
}
.term-seo {
    margin-top: clamp(28px, 5vw, 40px);
    padding-top: 8px;
    border-top: 1px solid var(--t-line);
    color: #c5ddd0;
}
.term-seo h2 {
    margin: 18px 0 10px;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -.02em;
    color: #f4fff8;
}
.term-seo h3 {
    margin: 16px 0 8px;
    font-size: 1.02rem;
    font-weight: 600;
    color: #e8f6ee;
}
.term-seo p {
    margin: 0 0 12px;
    max-width: 62ch;
    color: var(--t-muted);
}
.term-article p {
    max-width: 68ch;
    line-height: 1.65;
}
.term-feat,
.term-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}
.term-feat li,
.term-steps li {
    padding: 10px 12px;
    border: 1px solid var(--t-line);
    border-radius: 10px;
    background: rgba(5, 10, 7, .65);
    color: #c5ddd0;
}
.term-feat > li > strong,
.term-steps > li > strong {
    display: block;
    color: #f4fff8;
    font-weight: 600;
    margin-bottom: 2px;
}
.term-seo strong {
    color: #e8f6ee;
    font-weight: 600;
}
.term-step-body p,
.term-faq-body p {
    margin: 0 0 8px;
    max-width: none;
    color: var(--t-muted);
}
.term-step-body p:last-child,
.term-faq-body p:last-child {
    margin-bottom: 0;
}
.term-seo-list {
    margin: 4px 0 10px;
    padding-left: 1.15rem;
    color: #c5ddd0;
}
.term-seo-list li {
    margin: 3px 0;
}
.term-faq {
    display: grid;
    gap: 8px;
}
.term-faq-item {
    border: 1px solid var(--t-line);
    border-radius: 10px;
    background: rgba(5, 10, 7, .65);
    padding: 12px 14px;
}
.term-faq-item h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #f4fff8;
}
.term-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.term-pills li,
.term-chip {
    border: 1px solid var(--t-line);
    background: rgba(61, 255, 143, .06);
    color: #c9f5da;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 500;
}
.term-panel {
    display: grid;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--t-line);
    border-radius: 14px;
    background: #050a07;
}
.term-you { display: grid; gap: 4px; }
.term-field-label {
    margin: 0 0 6px;
    color: var(--t-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.term-echo {
    margin: 0;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    color: #e8f6ee;
    font-size: 15px;
}
.term-own { margin: 8px 0 0; }
.term-cmd { display: grid; gap: 8px; }
.term-cmd-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 14px;
    border: 1px solid var(--t-line-2);
    border-radius: 14px;
    background: #030705;
}
.term-cmd-row:focus-within {
    border-color: var(--t-ok);
    box-shadow: 0 0 0 3px rgba(61, 255, 143, .12);
}
.term-cmd-row input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--t-ok);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 1.05rem;
    caret-color: var(--t-ok);
    caret-shape: underscore;
}
.term-cmd-row input::placeholder { color: #2f5a42; }
.term-hint {
    margin: 0;
    color: #6d8f7c;
    font-size: 13px;
}
.term-btn {
    background: var(--t-ok);
    border: 0;
    color: #05210f;
    font-family: Outfit, system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
}
.term-btn:hover { filter: brightness(1.08); }
.term-btn:disabled { opacity: .65; cursor: wait; }
.term-btn-ghost {
    background: transparent;
    border: 1px solid var(--t-line-2);
    color: var(--t-ok);
}
.term-btn-ghost:hover { background: rgba(61, 255, 143, .12); filter: none; }
.term-busy-line {
    margin: 0;
    color: #7dffb0;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.is-busy .term-btn { pointer-events: none; }
.term-err {
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 107, 107, .1);
    border: 1px solid rgba(255, 107, 107, .28);
    color: #ffb4b4;
}
.term-report {
    margin-top: 14px;
    padding: 14px 16px 16px;
    border: 1px solid var(--t-line);
    border-radius: 14px;
    background: #050a07;
}
.term-dump {
    margin: 0;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 14px;
    line-height: 1.55;
    color: var(--t-ok);
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 1.5em;
}
.term-dump.is-typing::after {
    content: "_";
    display: inline-block;
    margin-left: 1px;
    animation: term-blink 1.05s step-end infinite;
    color: var(--t-ok);
}
@keyframes term-blink {
    50% { opacity: 0; }
}
.term-high .term-dump { color: #ffb4b4; }
.term-medium .term-dump { color: #ffe3a3; }
.term-low .term-dump { color: var(--t-ok); }
.term-trust {
    margin-top: clamp(28px, 6vw, 48px);
    padding-top: 8px;
    border-top: 1px solid var(--t-line);
    color: #6d8f7c;
    font-size: 13px;
    line-height: 1.65;
}
.term-trust h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -.02em;
    color: #c5ddd0;
}
.term-trust h3 {
    margin: 16px 0 8px;
    font-size: .92rem;
    font-weight: 600;
    color: #a8c9b6;
}
.term-trust p { margin: 0 0 10px; }
.term-trust p:last-child { margin-bottom: 0; }
.term-trust strong { color: #9fbfae; font-weight: 600; }
.term-seo a,
.term-trust a { color: var(--t-ok); text-decoration: none; }
.term-seo a:hover,
.term-trust a:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .term-wrap { padding: 10px 10px 20px; }
    .term-window { border-radius: 18px; }
    .term-cmd-row { flex-wrap: wrap; padding: 10px; }
    .term-btn { width: 100%; }
}

@media (max-width: 900px) {
    .admin-body { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; position: relative; }
    .sidebar-nav { display: flex; overflow: auto; }
    .sidebar-nav .nav-link { white-space: nowrap; }
    .sidebar-foot { display: none; }
    .admin-content, .admin-top { padding-left: 16px; padding-right: 16px; }
}
