/* ============================================================
   AffPlex Cloud — SaaS design system
   Dark industrial ops-console. Lime on ink. Syne + IBM Plex.
   ============================================================ */

:root {
    --ink: #0b0d08;
    --ink-2: #0f120a;
    --surface: #12150d;
    --surface-2: #181c11;
    --line: #272d1c;
    --line-soft: #1d2214;
    --text: #e9eddf;
    --muted: #98a187;
    --faint: #5f684f;
    --accent: #c6f24e;
    --accent-dim: #9fc73a;
    --accent-ink: #161c04;
    --amber: #e8a33d;
    --red: #e8604a;
    --font-display: 'Syne', sans-serif;
    --font-body: 'IBM Plex Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--ink);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Grid texture + glow backdrop */
.backdrop {
    position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background:
        radial-gradient(900px 480px at 78% -10%, rgba(198, 242, 78, 0.07), transparent 60%),
        radial-gradient(700px 420px at 8% 110%, rgba(232, 163, 61, 0.05), transparent 60%),
        linear-gradient(rgba(198, 242, 78, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(198, 242, 78, 0.028) 1px, transparent 1px);
    background-size: auto, auto, 48px 48px, 48px 48px;
}
.backdrop::after {
    content: ''; position: absolute; inset: 0; opacity: .5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; letter-spacing: -0.01em; }

.mono { font-family: var(--font-mono); }

.kicker {
    font-family: var(--font-mono); font-size: 11px; font-weight: 500;
    letter-spacing: .22em; text-transform: uppercase; color: var(--accent);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 13px; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase;
    background: var(--accent); color: var(--accent-ink);
    border: 1px solid var(--accent); border-radius: 3px;
    padding: 11px 20px; cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 rgba(198, 242, 78, .25); }
.btn:active { transform: translate(0, 0); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
    background: transparent; color: var(--text); border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: 4px 4px 0 rgba(198, 242, 78, .12); }

.btn-danger { background: transparent; color: var(--red); border-color: rgba(232, 96, 74, .4); }
.btn-danger:hover { border-color: var(--red); box-shadow: 4px 4px 0 rgba(232, 96, 74, .15); }

.btn-sm { padding: 6px 12px; font-size: 11px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label {
    display: block; font-family: var(--font-mono); font-size: 11px;
    letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
    margin-bottom: 7px;
}
.field input, .field select, .field textarea {
    width: 100%; background: var(--ink-2); color: var(--text);
    border: 1px solid var(--line); border-radius: 3px;
    font-family: var(--font-mono); font-size: 14px;
    padding: 11px 13px; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px rgba(198, 242, 78, .12);
}
.field .hint { font-size: 12px; color: var(--faint); margin-top: 5px; }
.field-error { color: var(--red); font-size: 12.5px; margin-top: 6px; font-family: var(--font-mono); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch .track {
    width: 40px; height: 22px; border-radius: 22px; background: var(--line);
    position: relative; transition: background .2s; flex: 0 0 auto;
}
.switch .track::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
    border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s;
}
.switch input:checked + .track { background: rgba(198, 242, 78, .25); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--accent); }

/* ---------- Cards / panels ---------- */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
}
.card-pad { padding: 22px; }

/* ---------- Status pills ---------- */
.pill {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--font-mono); font-size: 11px; font-weight: 500;
    letter-spacing: .08em; text-transform: uppercase;
    border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.pill.ok { color: var(--accent); border-color: rgba(198, 242, 78, .3); }
.pill.ok::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.pill.off { color: var(--red); border-color: rgba(232, 96, 74, .35); }
.pill.off::before { background: var(--red); }
.pill.dim { color: var(--muted); }
.pill.dim::before { background: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
    letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
    text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.data td {
    padding: 14px 16px; border-bottom: 1px solid var(--line-soft);
    font-size: 14px; vertical-align: middle;
}
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: rgba(198, 242, 78, .035); }
table.data .mono { font-size: 13px; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(7, 9, 5, .78); backdrop-filter: blur(4px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 9vh 20px 40px; overflow-y: auto;
}
.modal {
    background: var(--surface); border: 1px solid var(--line); border-radius: 5px;
    width: 100%; max-width: 520px; padding: 26px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 4px rgba(198, 242, 78, .05);
    animation: modal-in .18s ease;
}
.modal.wide { max-width: 640px; }
.modal h3 { font-size: 20px; margin-bottom: 4px; }
.modal .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* ---------- Toast ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: var(--surface-2); border: 1px solid var(--accent); border-radius: 4px;
    color: var(--text); font-family: var(--font-mono); font-size: 13px;
    padding: 12px 16px; min-width: 260px; max-width: 380px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
    animation: toast-in .2s ease;
}
.toast.error { border-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } }

/* ============================================================
   LANDING
   ============================================================ */

.landing { overflow-x: hidden; }

.l-nav {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 1180px; margin: 0 auto; padding: 22px 28px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .mark {
    width: 30px; height: 30px; background: var(--accent); border-radius: 3px;
    display: grid; place-items: center; color: var(--accent-ink);
    font-family: var(--font-display); font-weight: 800; font-size: 17px;
}
.brand .name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .01em; }
.l-nav .links { display: flex; align-items: center; gap: 26px; }
.l-nav .links a {
    font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted); transition: color .15s;
}
.l-nav .links a:not(.btn):hover { color: var(--accent); }

.hero {
    max-width: 1180px; margin: 0 auto; padding: 92px 28px 70px;
    position: relative;
}
.hero .kicker { animation: rise .6s ease both; }
.hero h1 {
    font-size: clamp(46px, 7.2vw, 96px); font-weight: 800; margin: 22px 0 26px;
    max-width: 13ch; animation: rise .6s .08s ease both;
}
.hero h1 .hl { color: var(--accent); position: relative; white-space: nowrap; }
.hero h1 .hl::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: .04em; height: .1em;
    background: var(--accent); opacity: .35; transform: skewX(-12deg);
}
.hero p.lede { color: var(--muted); font-size: 17.5px; max-width: 56ch; animation: rise .6s .16s ease both; }
.hero .cta-row { display: flex; gap: 14px; margin-top: 38px; flex-wrap: wrap; animation: rise .6s .24s ease both; }

.hero .coords {
    position: absolute; top: 96px; right: 28px; text-align: right;
    font-family: var(--font-mono); font-size: 11px; color: var(--faint);
    letter-spacing: .12em; line-height: 2.1; display: none;
}
@media (min-width: 980px) { .hero .coords { display: block; } }

@keyframes rise { from { opacity: 0; transform: translateY(22px); } }

.statbar {
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    background: rgba(18, 21, 13, .6);
}
.statbar .inner {
    max-width: 1180px; margin: 0 auto; padding: 0 28px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.statbar .stat { padding: 26px 22px; border-left: 1px solid var(--line); }
.statbar .stat:first-child { border-left: none; }
.statbar .num { font-family: var(--font-mono); font-size: 26px; font-weight: 600; color: var(--accent); }
.statbar .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-top: 4px; }

/* marquee */
.ticker { overflow: hidden; border-bottom: 1px solid var(--line); padding: 13px 0; }
.ticker .track { display: flex; gap: 48px; width: max-content; animation: ticker 36s linear infinite; }
.ticker span {
    font-family: var(--font-mono); font-size: 12px; letter-spacing: .2em;
    text-transform: uppercase; color: var(--faint); white-space: nowrap;
}
.ticker span::before { content: '◆'; color: var(--accent); margin-right: 48px; font-size: 9px; }
@keyframes ticker { to { transform: translateX(-50%); } }

.section { max-width: 1180px; margin: 0 auto; padding: 90px 28px; }
.section .heading { margin-bottom: 52px; }
.section h2 { font-size: clamp(30px, 4vw, 48px); font-weight: 800; margin-top: 14px; max-width: 22ch; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.feature {
    background: var(--surface); padding: 30px 26px; position: relative;
    transition: background .2s;
}
.feature:hover { background: var(--surface-2); }
.feature .idx { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: .15em; }
.feature h3 { font-size: 19px; margin: 14px 0 10px; }
.feature p { color: var(--muted); font-size: 14px; }
.feature::after {
    content: ''; position: absolute; top: 0; left: 0; width: 0; height: 2px;
    background: var(--accent); transition: width .25s ease;
}
.feature:hover::after { width: 100%; }

/* pricing */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; align-items: stretch; }
.plan-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 5px;
    padding: 30px 28px; display: flex; flex-direction: column; position: relative;
    transition: transform .2s ease, border-color .2s;
}
.plan-card:hover { transform: translateY(-4px); border-color: var(--faint); }
.plan-card.featured { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(198, 242, 78, .08), 0 24px 60px rgba(0,0,0,.4); }
.plan-card .flag {
    position: absolute; top: -11px; left: 24px; background: var(--accent); color: var(--accent-ink);
    font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .14em;
    text-transform: uppercase; padding: 4px 10px; border-radius: 2px;
}
.plan-card .p-name { font-family: var(--font-display); font-weight: 700; font-size: 21px; }
.plan-card .p-tag { color: var(--muted); font-size: 13px; margin-top: 5px; min-height: 20px; }
.plan-card .p-price { margin: 22px 0 4px; font-family: var(--font-mono); }
.plan-card .p-price .amt { font-size: 40px; font-weight: 600; color: var(--text); }
.plan-card .p-price .per { color: var(--faint); font-size: 13px; }
.plan-card ul { list-style: none; margin: 20px 0 26px; flex: 1; }
.plan-card li {
    padding: 7px 0 7px 24px; position: relative; color: var(--muted); font-size: 13.5px;
    border-bottom: 1px dashed var(--line-soft);
}
.plan-card li::before { content: '▸'; position: absolute; left: 2px; color: var(--accent); }
.plan-card .limits { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: .06em; margin-bottom: 18px; line-height: 2; }

.l-footer { border-top: 1px solid var(--line); }
.l-footer .inner {
    max-width: 1180px; margin: 0 auto; padding: 36px 28px;
    display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.l-footer .fine { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); letter-spacing: .08em; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   PANEL
   ============================================================ */

.panel { display: flex; min-height: 100vh; }

.sidebar {
    width: 234px; flex: 0 0 auto; border-right: 1px solid var(--line);
    background: var(--ink-2); display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 22px 20px; border-bottom: 1px solid var(--line); }
.sidebar nav { padding: 18px 12px; flex: 1; }
.sidebar nav a {
    display: flex; align-items: center; gap: 12px;
    font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .1em;
    text-transform: uppercase; color: var(--muted);
    padding: 11px 12px; border-radius: 3px; border-left: 2px solid transparent;
    transition: color .15s, background .15s;
}
.sidebar nav a .n { color: var(--faint); font-size: 10px; }
.sidebar nav a:hover { color: var(--text); background: rgba(198, 242, 78, .05); }
.sidebar nav a.active {
    color: var(--accent); background: rgba(198, 242, 78, .07);
    border-left-color: var(--accent);
}
.sidebar .foot { padding: 16px 20px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); letter-spacing: .1em; line-height: 1.9; }

.main { flex: 1; min-width: 0; }

.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 30px; border-bottom: 1px solid var(--line);
    background: rgba(11, 13, 8, .8); backdrop-filter: blur(8px);
    position: sticky; top: 0; z-index: 40;
}
.topbar h1 { font-size: 19px; font-weight: 700; }
.topbar .crumb { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 3px; }
.topbar .who { display: flex; align-items: center; gap: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.content { padding: 30px; width: 100%; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 20px; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: linear-gradient(90deg, var(--accent), transparent 70%); opacity: .55; }
.stat-card .lbl { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.stat-card .num { font-family: var(--font-mono); font-size: 32px; font-weight: 600; margin-top: 8px; }
.stat-card .num.lime { color: var(--accent); }
.stat-card .num.red { color: var(--red); }
.stat-card .num.amber { color: var(--amber); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 6px 0 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 17px; }
.search-input {
    background: var(--ink-2); border: 1px solid var(--line); border-radius: 3px;
    color: var(--text); font-family: var(--font-mono); font-size: 13px;
    padding: 9px 13px; width: 250px; outline: none;
}
.search-input:focus { border-color: var(--accent); }

/* bar chart (CSS only) */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars .fill { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--accent), rgba(198, 242, 78, .25)); border-radius: 2px 2px 0 0; min-height: 3px; }
.bars .m { font-family: var(--font-mono); font-size: 10px; color: var(--faint); letter-spacing: .08em; }

.empty {
    text-align: center; padding: 56px 20px; color: var(--faint);
    font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em;
}

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 420px; }
.login-box .card-pad { padding: 34px; }
.login-box h1 { font-size: 26px; margin: 18px 0 6px; }
.login-box .sub { color: var(--muted); font-size: 14px; margin-bottom: 26px; }

/* suspended page */
.suspend-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.suspend-wrap h1 { font-size: 34px; margin: 20px 0 10px; }
.suspend-wrap p { color: var(--muted); max-width: 46ch; }

/* ---------- Responsive grids ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 860px) {
    .grid-2, .form-2, .form-3 { grid-template-columns: 1fr; }
}

/* ---------- Responsive panel ---------- */
.burger {
    display: none; background: transparent; border: 1px solid var(--line);
    color: var(--text); border-radius: 3px; padding: 7px 12px;
    font-size: 15px; cursor: pointer; line-height: 1;
}
.side-overlay { display: none; }

@media (max-width: 860px) {
    .burger { display: inline-flex; }
    .sidebar {
        position: fixed; left: 0; top: 0; height: 100vh; z-index: 75;
        transform: translateX(-100%); transition: transform .22s ease;
        box-shadow: 24px 0 60px rgba(0, 0, 0, .55);
    }
    .sidebar.open { transform: none; }
    .side-overlay.show {
        display: block; position: fixed; inset: 0; z-index: 70;
        background: rgba(7, 9, 5, .65); backdrop-filter: blur(2px);
    }
    .topbar { padding: 13px 16px; }
    .topbar h1 { font-size: 16px; }
    .topbar .who span { display: none; }
    .content { padding: 18px 14px; }
    .stat-card .num { font-size: 25px; }
    .section-head { flex-direction: column; align-items: stretch; }
    .search-input { width: 100%; }
    table.data th, table.data td { padding: 10px 10px; font-size: 13px; }
    .modal { padding: 20px 16px; }
    .modal-overlay { padding: 4vh 10px 30px; }
}
