:root {
    --bg: #eef4fb;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: #ffffff;
    --text: #17202d;
    --muted: #64748b;
    --primary: #176087;
    --primary-deep: #0c3950;
    --accent: #dff0f8;
    --success: #0e9f6e;
    --danger: #d1485f;
    --warning: #b7791f;
    --border: rgba(23, 96, 135, 0.12);
    --shadow: 0 20px 60px rgba(15, 35, 61, 0.12);
    --radius-xl: 30px;
    --radius-lg: 24px;
    --radius-md: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(23, 96, 135, 0.18), transparent 30%),
        radial-gradient(circle at top right, rgba(14, 159, 110, 0.09), transparent 26%),
        linear-gradient(180deg, #eef4fb 0%, #f7fafc 24%, #edf3f9 100%);
}

a {
    color: var(--primary);
}

.auth-body {
    overflow-x: hidden;
}

.login-screen {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.login-screen::before,
.login-screen::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.login-screen::before {
    width: 460px;
    height: 460px;
    top: -160px;
    right: -160px;
    background: radial-gradient(circle, rgba(23, 96, 135, 0.22), transparent 70%);
}

.login-screen::after {
    width: 380px;
    height: 380px;
    bottom: -130px;
    left: -130px;
    background: radial-gradient(circle, rgba(14, 159, 110, 0.18), transparent 70%);
}

.login-layout {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.login-brand-panel,
.login-card,
.system-sidebar,
.system-header,
.content-card,
.stat-card,
.system-user__card,
.metric-card {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.login-brand-panel,
.login-card,
.content-card,
.stat-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: var(--radius-xl);
}

.login-brand-panel {
    padding: 2.5rem;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(12, 57, 80, 0.96), rgba(23, 96, 135, 0.92)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    justify-content: space-between;
}

.login-brand-panel h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    margin: 0 0 0.9rem;
}

.login-brand-panel p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

.brand-pill,
.sidebar-brand__pill,
.table-chip,
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
}

.brand-pill,
.sidebar-brand__pill {
    width: fit-content;
    padding: 0.5rem 0.9rem;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.login-points {
    display: grid;
    gap: 0.9rem;
}

.login-point {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.12);
}

.login-point strong,
.login-point span {
    display: block;
}

.login-point span {
    margin-top: 0.3rem;
    color: rgba(255, 255, 255, 0.72);
}

.login-card {
    padding: 2rem;
}

.login-help {
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(23, 96, 135, 0.08);
}

.system-body {
    overflow-x: hidden;
}

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

.system-sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    padding: 1.5rem;
    background:
        linear-gradient(180deg, rgba(12, 57, 80, 0.98), rgba(16, 89, 123, 0.92)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
    color: #fff;
}

.sidebar-brand {
    margin-bottom: 1.6rem;
}

.sidebar-brand h2 {
    font-size: 1.45rem;
    margin: 1rem 0 0.45rem;
}

.sidebar-brand p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
}

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

.sidebar-link {
    display: block;
    text-decoration: none;
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.82);
    transition: all 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-shortcuts {
    margin-top: 1.8rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-title {
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.system-panel {
    min-width: 0;
    padding: 1.5rem;
}

.system-header {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.2rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.system-kicker {
    color: #5a8ca8;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    font-weight: 800;
}

.system-title {
    font-size: clamp(1.5rem, 2.2vw, 2.2rem);
}

.system-subtitle {
    color: var(--muted);
    max-width: 680px;
}

.system-user {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.system-user__card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.95rem;
    min-width: 150px;
}

.system-user__card small,
.system-user__card strong {
    display: block;
}

.system-user__card small {
    color: var(--muted);
    margin-bottom: 0.15rem;
}

.system-main {
    min-width: 0;
}

.content-card {
    padding: 1.35rem;
    border: 1px solid var(--border);
    height: 100%;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-title h2,
.section-title h3 {
    margin: 0;
}

.section-title p {
    margin: 0.2rem 0 0;
    color: var(--muted);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.stat-card small,
.stat-card strong,
.stat-card span {
    display: block;
}

.stat-card small {
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.stat-card strong {
    font-size: clamp(1.55rem, 3vw, 2rem);
    margin-bottom: 0.35rem;
}

.stat-card span {
    color: var(--muted);
}

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

.metric-card {
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 249, 252, 0.92));
}

.metric-card small,
.metric-card strong {
    display: block;
}

.metric-card small {
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.metric-card strong {
    font-size: 1.2rem;
}

.status-list {
    display: grid;
    gap: 0.85rem;
}

.status-item {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: #f8fbfd;
}

.status-item__top {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.55rem;
}

.status-item__top strong {
    display: block;
}

.status-item__top span,
.status-item__meta {
    color: var(--muted);
    font-size: 0.92rem;
}

.status-badge {
    padding: 0.38rem 0.7rem;
    font-size: 0.78rem;
}

.status-badge--ok {
    background: rgba(14, 159, 110, 0.13);
    color: var(--success);
}

.status-badge--pending {
    background: rgba(209, 72, 95, 0.12);
    color: var(--danger);
}

.table-chip {
    padding: 0.32rem 0.62rem;
    font-size: 0.78rem;
}

.table-chip--income {
    background: rgba(14, 159, 110, 0.14);
    color: var(--success);
}

.table-chip--expense {
    background: rgba(209, 72, 95, 0.12);
    color: var(--danger);
}

.table-chip--neutral {
    background: rgba(23, 96, 135, 0.12);
    color: var(--primary);
}

.table-clean > :not(caption) > * > * {
    background: transparent;
}

.receipt-link {
    text-decoration: none;
    font-weight: 700;
}

.empty-state {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(23, 96, 135, 0.22);
    color: var(--muted);
    text-align: center;
}

.form-control,
.form-select,
.btn {
    border-radius: 16px;
}

.form-control,
.form-select {
    border-color: rgba(23, 96, 135, 0.18);
    padding: 0.85rem 0.95rem;
}

.form-control:focus,
.form-select:focus,
.btn:focus {
    border-color: rgba(23, 96, 135, 0.35);
    box-shadow: 0 0 0 0.25rem rgba(23, 96, 135, 0.12);
}

.btn {
    font-weight: 700;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #2289ba);
    border-color: transparent;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #145674, #1977a6);
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.note-box {
    border-radius: var(--radius-md);
    background: rgba(23, 96, 135, 0.08);
    border: 1px solid rgba(23, 96, 135, 0.12);
    padding: 1rem;
    color: var(--primary-deep);
}

.student-selector {
    max-width: 340px;
}

.file-hint {
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 0.4rem;
}

.report-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

@media (max-width: 1199.98px) {
    .login-layout,
    .report-grid {
        grid-template-columns: 1fr;
    }

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

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

    .system-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 300px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 40;
    }

    .system-sidebar.is-open {
        transform: translateX(0);
    }

    .system-header {
        flex-direction: column;
        align-items: stretch;
    }

    .system-user {
        justify-content: flex-start;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .login-brand-panel,
    .login-card,
    .content-card,
    .stat-card,
    .system-header {
        border-radius: var(--radius-lg);
    }

    .login-brand-panel,
    .login-card,
    .content-card,
    .system-header,
    .system-panel {
        padding: 1.2rem;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .system-user__card {
        width: 100%;
    }
}
