:root {
    --bg: #0f1117;
    --bg-soft: #171a22;
    --panel: #1a1f2a;
    --panel-strong: #202737;
    --border: rgba(255, 255, 255, 0.1);
    --text: #f4f7fb;
    --muted: #a7b0c1;
    --accent: #7c7cff;
    --accent-soft: #9eb0ff;
    --success: #3fca7a;
    --danger: #ff6c6c;
    --warning: #ffcc66;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    --radius: 22px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(124, 124, 255, 0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(158, 176, 255, 0.06), transparent 26%),
        linear-gradient(180deg, #10131a 0%, #0c0e13 100%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.95rem 1rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

textarea { resize: vertical; }
label { display: grid; gap: 0.45rem; margin-bottom: 1rem; }
label span, .muted, .tagline, .eyebrow, .breadcrumbs, .list-card span, .stat-card span { color: var(--muted); }

.app-shell, .marketing-shell {
    width: min(1220px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

.marketing-shell { padding-top: 2rem; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; }

.page, .stats-grid, .two-column, .feature-grid, .login-card, .count-layout, .admin-grid {
    display: grid;
    gap: 1rem;
}

.topbar, .panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.topbar {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem 1.2rem;
    background: rgba(20, 25, 35, 0.92);
}

.panel {
    padding: 1rem;
    background: linear-gradient(180deg, rgba(29, 35, 47, 0.96), rgba(24, 29, 40, 0.98));
}

.brand { display: inline-block; font-size: 1.5rem; font-weight: 800; letter-spacing: 0.02em; }
.tagline { margin: 0.25rem 0 0; }
.topnav, .hero-actions, .action-row, .inline-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.topnav a { padding: 0.7rem 0.95rem; border-radius: 999px; background: rgba(255, 255, 255, 0.04); }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; font-size: 0.95rem; }
.breadcrumbs a { color: var(--accent-soft); }

.hero, .section-heading, .landing-hero {
    display: grid;
    gap: 1rem;
    align-items: center;
}

.hero h1, .section-heading h1, .login-copy h1, .hero-copy h1 {
    margin: 0.25rem 0;
    line-height: 0.95;
    font-size: clamp(2rem, 6vw, 4.3rem);
}

.eyebrow {
    margin: 0;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.lead { max-width: 54ch; font-size: 1.1rem; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0.85rem 1.2rem;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 700;
}

.button-primary { color: #fff; background: linear-gradient(135deg, #6573ff, #7c7cff); }
.button-secondary { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.button-large { min-height: 56px; }
.button-small { min-height: 40px; padding: 0.55rem 0.8rem; border-radius: 12px; }
.button-full { width: 100%; }

.landing-hero { grid-template-columns: 1.25fr 0.9fr; min-height: 68vh; }
.hero-panel { display: grid; align-items: stretch; }
.metric-stack { display: grid; gap: 1rem; }
.metric-stack strong { display: block; margin-top: 0.4rem; font-size: clamp(1.7rem, 4vw, 3rem); }

.feature-grid article h2, .section-heading h2, .panel h2 { margin-top: 0; }
.feature-grid { grid-template-columns: repeat(3, 1fr); }

.login-card { width: min(100%, 980px); grid-template-columns: 1fr 0.95fr; align-items: center; }
.login-copy { padding: 1rem; }

.flash { padding: 1rem 1.1rem; border-radius: 16px; }
.flash-success { background: rgba(63, 202, 122, 0.12); border: 1px solid rgba(63, 202, 122, 0.32); }
.flash-error { background: rgba(255, 108, 108, 0.12); border: 1px solid rgba(255, 108, 108, 0.32); }

.stats-grid { grid-template-columns: repeat(4, 1fr); }
.stat-card p, .stat-card strong { margin: 0; }
.stat-card strong { display: block; margin-top: 0.4rem; font-size: clamp(1.9rem, 4vw, 3.1rem); line-height: 1; }

.data-list { display: grid; gap: 0.85rem; }
.data-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; text-align: right; }

.stack-list { display: grid; gap: 0.8rem; }
.list-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.9rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border); }

.variance-positive, .variance-positive strong, .variance-positive td, .variance-positive dd { color: var(--success); }
.variance-negative, .variance-negative strong, .variance-negative td, .variance-negative dd { color: var(--danger); }
.variance-neutral { color: var(--text); }

.count-layout { grid-template-columns: minmax(290px, 340px) 1fr; align-items: start; }
.sticky-summary {
    position: sticky;
    top: 1rem;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(11, 14, 20, 0.96);
}
.sticky-summary p, .sticky-summary strong { margin: 0; }
.sticky-summary strong { display: block; margin-top: 0.25rem; font-size: clamp(1.4rem, 3vw, 2.3rem); }
.warning-banner { margin-bottom: 1rem; padding: 0.95rem 1rem; border-radius: 16px; color: #2f2200; background: var(--warning); }
.hidden { display: none; }

.denomination-list { display: grid; gap: 0.85rem; }
.denomination-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(190px, 260px) minmax(120px, 160px);
    gap: 0.8rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}
.denomination-subtotal { font-weight: 800; font-size: 1.15rem; }
.stepper { display: grid; grid-template-columns: 64px 1fr 64px; gap: 0.65rem; align-items: center; }
.stepper input { text-align: center; font-size: 1.2rem; min-height: 60px; }
.stepper-button {
    min-height: 60px;
    border: 0;
    border-radius: 18px;
    cursor: pointer;
    font-size: 1.8rem;
    color: var(--text);
    background: rgba(101, 115, 255, 0.16);
}

.inline-form { display: flex; gap: 0.6rem; align-items: center; }
.checkbox-row { display: flex; gap: 0.7rem; align-items: center; }
.checkbox-row input { width: auto; }
.empty-state, .empty-panel { text-align: center; }
.empty-panel h1 { margin: 0.25rem 0; font-size: 3rem; }

@media (max-width: 900px) {
    .landing-hero, .login-card, .feature-grid, .stats-grid, .count-layout, .two-column, .admin-grid { grid-template-columns: 1fr; }
    .topbar { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .app-shell, .marketing-shell { width: min(100% - 1rem, 1220px); }
    .denomination-row { grid-template-columns: 1fr; }
    .sticky-summary { position: sticky; bottom: 0; top: auto; }
}

@media print {
    body { background: #fff; color: #000; }
    .topbar, .breadcrumbs, .button { display: none !important; }
    .panel, .sticky-summary { background: #fff; color: #000; box-shadow: none; border-color: #ddd; }
    .print-single-column { grid-template-columns: 1fr !important; }
}
