:root {
    --bg: #f3efe5;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: #fffaf1;
    --text: #16213d;
    --muted: #5f677b;
    --line: rgba(22, 33, 61, 0.12);
    --brand: #c6612f;
    --brand-dark: #8d3f18;
    --brand-soft: #efc7a1;
    --ink-blue: #183153;
    --success: #1b7f5d;
    --warning: #9a5c0c;
    --danger: #9e3847;
    --shadow: 0 20px 50px rgba(24, 49, 83, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(198, 97, 47, 0.18), transparent 28%),
        radial-gradient(circle at right 20%, rgba(24, 49, 83, 0.16), transparent 26%),
        linear-gradient(180deg, #f6f1e8 0%, #efe7da 100%);
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.container {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: rgba(243, 239, 229, 0.74);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}

.brand strong,
.hero-title,
h1,
h2,
h3 {
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -0.03em;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, var(--brand), var(--ink-blue));
    color: white;
    font-weight: 800;
    box-shadow: var(--shadow);
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: grid;
    grid-template-rows: auto auto auto 1fr auto;
    gap: 1.25rem;
    padding: 1.4rem;
    background: linear-gradient(180deg, rgba(18, 31, 55, 0.98), rgba(26, 49, 80, 0.98));
    color: white;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-brand small {
    color: rgba(255, 255, 255, 0.64);
}

.admin-sidebar-section {
    display: grid;
    gap: 0.8rem;
}

.sidebar-label {
    margin: 0;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.sidebar-nav {
    display: grid;
    gap: 0.55rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.sidebar-link:hover {
    transform: translateX(2px);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-link.is-active {
    color: white;
    background: linear-gradient(135deg, rgba(198, 97, 47, 0.92), rgba(141, 63, 24, 0.92));
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.18);
}

.sidebar-link-mark {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.9;
}

.sidebar-user-card,
.sidebar-note {
    padding: 1rem;
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-card strong,
.sidebar-user-card small,
.sidebar-note p {
    display: block;
}

.sidebar-user-card strong {
    margin: 0.45rem 0 0.2rem;
    font-size: 1.05rem;
}

.sidebar-user-card small,
.sidebar-note p {
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.6;
}

.sidebar-note p {
    margin: 0.55rem 0 0;
}

.admin-sidebar-footer {
    display: grid;
    gap: 0.8rem;
    align-self: end;
}

.admin-main {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.6rem;
    border-bottom: 1px solid var(--line);
    background: rgba(243, 239, 229, 0.58);
    backdrop-filter: blur(16px);
}

.admin-header-title {
    margin: 0.35rem 0 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.admin-header-meta {
    display: grid;
    gap: 0.15rem;
    justify-items: end;
    text-align: right;
}

.admin-header-meta span {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-header-meta strong {
    font-size: 1rem;
}

.admin-content {
    padding: 1.6rem;
}

.admin-content .dashboard-section {
    padding: 0;
}

.admin-content .container {
    width: min(1220px, 100%);
}

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav a,
.nav-button {
    color: var(--muted);
    font-weight: 600;
}

.nav a.is-active {
    color: var(--ink-blue);
}

.nav-button,
.primary-button,
.secondary-button {
    border: 0;
    border-radius: 999px;
    padding: 0.9rem 1.3rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-button,
.secondary-button {
    background: rgba(24, 49, 83, 0.08);
}

.primary-button {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: white;
    box-shadow: 0 14px 30px rgba(141, 63, 24, 0.28);
}

.secondary-button {
    color: var(--ink-blue);
}

.nav-button:hover,
.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-1px);
}

.nav-user {
    display: grid;
    gap: 0.1rem;
    padding: 0.65rem 0.9rem;
    border-radius: 1rem;
    background: rgba(24, 49, 83, 0.06);
}

.nav-user span {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-user strong {
    font-size: 0.92rem;
    color: var(--ink-blue);
}

.hero-section,
.dashboard-section,
.auth-section {
    padding: 4.5rem 0 3rem;
}

.hero-grid,
.league-layout,
.two-column,
.auth-wrap,
.detail-grid,
.content-grid,
.dashboard-stack,
.dashboard-strip,
.dashboard-insights,
.dashboard-content-grid,
.dashboard-rail,
.hero-panel-grid,
.status-grid {
    display: grid;
    gap: 1.5rem;
}

.hero-grid,
.auth-wrap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
}

.hero-title {
    font-size: clamp(2.8rem, 6vw, 5.2rem);
    line-height: 0.95;
    margin: 0.6rem 0 1rem;
}

.hero-copy,
.section-copy,
.footer-copy,
.muted-copy,
.solution-card p,
.metric-card p,
.contact-card p,
.league-card p {
    color: var(--muted);
    line-height: 1.7;
}

.eyebrow,
.panel-label,
.card-kicker,
.mini-label {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--brand-dark);
}

.hero-actions,
.hero-points {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-actions {
    margin: 2rem 0 1.4rem;
}

.hero-points span {
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(198, 97, 47, 0.18);
    background: rgba(255, 255, 255, 0.55);
    color: var(--ink-blue);
    font-weight: 700;
}

.hero-panel,
.panel-card,
.metric-card,
.solution-card,
.league-card,
.checklist-card,
.contact-card,
.auth-card,
.stat-card,
.table-card,
.stack-card,
.filter-card,
.detail-card,
.endpoint-box,
.flash-message {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.panel-card,
.metric-card,
.solution-card,
.league-card,
.checklist-card,
.contact-card,
.auth-card,
.stat-card,
.table-card,
.stack-card,
.filter-card,
.detail-card {
    border-radius: 1.6rem;
    padding: 1.5rem;
}

.signal-list {
    display: grid;
    gap: 1rem;
}

.dashboard-stack {
    gap: 1.6rem;
}

.dashboard-hero-card {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 1.5rem;
    padding: 1.8rem;
    border-radius: 2rem;
    background:
        radial-gradient(circle at top left, rgba(239, 199, 161, 0.88), transparent 35%),
        linear-gradient(140deg, rgba(255, 250, 241, 0.96), rgba(255, 255, 255, 0.78));
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.dashboard-hero-copy h1 {
    margin: 0.4rem 0 0.8rem;
    font-size: clamp(2.2rem, 4vw, 3.6rem);
}

.dashboard-hero-panel {
    padding: 1.4rem;
    border-radius: 1.7rem;
    background: linear-gradient(160deg, rgba(24, 49, 83, 0.98), rgba(40, 67, 96, 0.94));
    color: white;
}

.hero-panel-grid,
.status-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.hero-stat {
    padding: 1.1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-stat:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.hero-stat strong,
.insight-card strong,
.strip-card strong,
.status-card strong {
    display: block;
}

.hero-stat strong {
    font-size: 1.9rem;
    margin: 0.45rem 0 0.3rem;
}

.hero-stat small,
.strip-card small,
.insight-card small,
.status-card small {
    color: var(--muted);
    line-height: 1.6;
}

.dashboard-hero-panel .hero-stat small {
    color: rgba(255, 255, 255, 0.72);
}

.dashboard-strip,
.dashboard-insights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-insights {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.strip-card,
.insight-card,
.status-card {
    padding: 1.3rem 1.4rem;
    border-radius: 1.5rem;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.strip-card strong,
.insight-card strong {
    margin: 0.55rem 0 0.25rem;
    font-size: 1.35rem;
}

.insight-card strong {
    font-size: 1.8rem;
    color: var(--ink-blue);
}

.attention-card strong {
    color: var(--danger);
}

.dashboard-content-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
    align-items: start;
}

.dashboard-rail {
    gap: 1.2rem;
}

.status-grid {
    gap: 0.9rem;
}

.status-card {
    border: 1px solid transparent;
}

.status-card span {
    color: var(--muted);
    font-weight: 700;
}

.status-card strong {
    margin: 0.35rem 0 0.3rem;
    font-size: 1.65rem;
}

.tone-success {
    background: rgba(27, 127, 93, 0.08);
    border-color: rgba(27, 127, 93, 0.18);
}

.tone-warning {
    background: rgba(154, 92, 12, 0.08);
    border-color: rgba(154, 92, 12, 0.18);
}

.tone-danger {
    background: rgba(158, 56, 71, 0.08);
    border-color: rgba(158, 56, 71, 0.18);
}

.signal-list article,
.receipt-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.signal-list article:last-child,
.receipt-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.signal-list strong,
.metric-card strong,
.solution-card h3,
.league-card h3,
.stat-card strong {
    display: block;
    font-size: 1.15rem;
}

.signal-list span,
.receipt-item span,
.receipt-item small {
    display: block;
    color: var(--muted);
    line-height: 1.6;
}

.metrics-section,
.content-section {
    padding: 1rem 0 3rem;
}

.metric-grid,
.solution-grid,
.stats-grid {
    display: grid;
    gap: 1rem;
}

.metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card strong {
    font-size: 2rem;
    color: var(--brand);
}

.section-heading {
    margin-bottom: 1.5rem;
}

.section-heading h2,
.dashboard-heading h1,
.auth-intro h1 {
    margin: 0.4rem 0 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.solution-grid,
.league-layout,
.two-column,
.content-grid,
.detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.solution-card ul {
    margin: 1rem 0 0;
    padding-left: 1rem;
    color: var(--ink-blue);
}

.accent-section {
    position: relative;
}

.league-card {
    background: linear-gradient(135deg, rgba(24, 49, 83, 0.96), rgba(198, 97, 47, 0.86));
    color: white;
}

.league-card p,
.league-card .league-pill {
    color: rgba(255, 255, 255, 0.86);
}

.league-pill {
    display: inline-flex;
    margin-bottom: 1rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.checklist-card {
    display: grid;
    gap: 0.85rem;
    align-content: start;
}

.checklist-card div {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: rgba(24, 49, 83, 0.06);
    font-weight: 700;
}

.contact-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.contact-side {
    display: grid;
    gap: 0.7rem;
    justify-items: start;
}

.footer {
    padding: 1rem 0 2.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.footer-heading {
    font-weight: 800;
    margin-bottom: 0.45rem;
}

.auth-card {
    max-width: 30rem;
    justify-self: end;
    width: 100%;
}

.form-stack {
    display: grid;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 700;
}

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

textarea {
    resize: vertical;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.checkbox-row input {
    width: auto;
}

.full-width {
    width: 100%;
}

.error-text {
    color: var(--danger);
    font-size: 0.9rem;
    margin: 0.5rem 0 0;
}

.dashboard-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.stats-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.8rem;
}

.stat-card strong {
    font-size: 2rem;
}

.card-head {
    margin-bottom: 1rem;
}

.card-head h2,
.detail-card h2 {
    margin: 0;
    font-size: 1.35rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.type-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5.5rem;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.type-credit,
.status-reconciled {
    background: rgba(27, 127, 93, 0.12);
    color: var(--success);
}

.type-debit,
.status-failed,
.status-flagged {
    background: rgba(158, 56, 71, 0.12);
    color: var(--danger);
}

.type-unknown,
.status-received,
.status-processing {
    background: rgba(154, 92, 12, 0.12);
    color: var(--warning);
}

.stack-card {
    align-self: start;
}

.receipt-list {
    display: grid;
}

.endpoint-box,
.flash-message {
    border-radius: 1.2rem;
    padding: 1rem 1.1rem;
}

.endpoint-box code {
    display: block;
    margin-top: 0.6rem;
    word-break: break-all;
}

.filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.filter-actions {
    display: flex;
}

.pagination-wrap {
    padding-top: 1.2rem;
}

.detail-stack {
    display: grid;
    gap: 1.5rem;
}

.detail-list {
    display: grid;
    gap: 0.8rem;
}

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--line);
}

.detail-list dt {
    color: var(--muted);
}

.detail-list dd {
    margin: 0;
    text-align: right;
    font-weight: 700;
}

.description-box {
    margin-top: 1rem;
}

pre {
    margin: 0;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(24, 49, 83, 0.06);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.flash-wrapper {
    padding-top: 1rem;
}

@media (max-width: 980px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        grid-template-rows: auto;
    }

    .admin-header,
    .hero-grid,
    .auth-wrap,
    .solution-grid,
    .league-layout,
    .two-column,
    .content-grid,
    .detail-grid,
    .footer-grid,
    .metric-grid,
    .stats-grid,
    .filter-grid,
    .dashboard-strip,
    .dashboard-insights,
    .dashboard-content-grid,
    .dashboard-hero-card {
        grid-template-columns: 1fr;
    }

    .contact-card,
    .dashboard-heading,
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-header-meta {
        justify-items: start;
        text-align: left;
    }

    .auth-card {
        justify-self: stretch;
        max-width: none;
    }
}

@media (max-width: 720px) {
    .hero-section,
    .dashboard-section,
    .auth-section {
        padding-top: 3rem;
    }

    .nav {
        width: 100%;
    }

    .admin-content,
    .admin-header {
        padding: 1.1rem;
    }

    .dashboard-hero-card,
    .dashboard-hero-panel,
    .strip-card,
    .insight-card,
    .status-card {
        padding: 1.2rem;
    }
}
