:root {
    --brand: #2f86ef;
    --brand-deep: #2373db;
    --brand-soft: #eff6ff;
    --line: #e5eaf2;
    --text: #1f2d3d;
    --muted: #7b8794;
    --panel: #ffffff;
    --bg: #f5f7fb;
    --danger: #d64545;
    --success: #2f8f65;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    background: var(--bg);
}

a {
    color: var(--brand);
    text-decoration: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 66%) minmax(420px, 34%);
    background: #fff;
}

.brand-side {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: #fff;
    background:
        radial-gradient(circle at 20% 75%, rgba(255, 255, 255, .10) 0 0, transparent 118px),
        radial-gradient(circle at 85% 32%, rgba(255, 255, 255, .10) 0 0, transparent 140px),
        linear-gradient(135deg, #216ed3 0%, #318bf2 48%, #4b9bf3 100%);
}

.brand-side::before,
.brand-side::after {
    content: "";
    position: absolute;
    border: 2px solid rgba(255, 255, 255, .14);
    pointer-events: none;
}

.brand-side::before {
    width: 70px;
    height: 70px;
    top: 15%;
    left: 10%;
    border-radius: 50%;
}

.brand-side::after {
    width: 48px;
    height: 48px;
    right: 15%;
    bottom: 34%;
    border-radius: 10px;
}

.brand-content {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    text-align: center;
}

.brand-logo {
    width: 110px;
    height: 110px;
    margin: 0 auto 28px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, .78);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0;
}

.brand-title {
    margin: 0;
    font-size: 42px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-subtitle {
    margin: 22px 0 58px;
    font-size: 22px;
    color: rgba(255, 255, 255, .82);
}

.feature-row {
    display: flex;
    justify-content: center;
    gap: clamp(42px, 8vw, 118px);
    margin-bottom: 66px;
}

.feature {
    display: grid;
    gap: 15px;
    justify-items: center;
    font-size: 18px;
    font-weight: 700;
}

.feature-icon {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 18px;
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.module-strip {
    width: min(500px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 18px;
    background: rgba(255, 255, 255, .12);
}

.module {
    padding: 30px 20px 28px;
}

.module + .module {
    border-left: 1px solid rgba(255, 255, 255, .24);
}

.module strong {
    display: block;
    margin-bottom: 10px;
    font-size: 30px;
    line-height: 1;
}

.module span {
    font-size: 14px;
    color: rgba(255, 255, 255, .78);
}

.auth-side {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 48px min(5vw, 72px);
    background: #fff;
}

.auth-panel {
    width: min(450px, 100%);
}

.auth-panel h1 {
    margin: 0 0 18px;
    font-size: 34px;
    line-height: 1.2;
    color: #111827;
}

.auth-panel .lead {
    margin: 0 0 64px;
    color: #4b5563;
    font-size: 16px;
}

.form-field {
    margin-bottom: 25px;
}

.input {
    width: 100%;
    height: 60px;
    padding: 0 20px;
    border: 1px solid #dfe3ea;
    border-radius: 8px;
    color: #273444;
    font-size: 18px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(47, 134, 239, .12);
}

.form-extra {
    min-height: 22px;
    margin: 0 6px 32px;
    text-align: right;
    font-size: 16px;
}

.button {
    width: 100%;
    height: 60px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--brand);
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 6px;
    transition: background .18s ease, transform .18s ease;
}

.button:hover {
    background: var(--brand-deep);
}

.button:active {
    transform: translateY(1px);
}

.switch-link {
    margin: 32px 0 64px;
    text-align: center;
    color: #8a94a6;
}

.switch-link a {
    margin-left: 10px;
    font-weight: 700;
}

.muted-link {
    color: #8a94a6;
    cursor: default;
}

.copyright {
    text-align: center;
    color: #70492f;
    font-size: 14px;
}

.alert {
    margin: -34px 0 28px;
    padding: 13px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.alert.error {
    color: var(--danger);
    background: #fff2f2;
    border: 1px solid #ffd5d5;
}

.alert.success {
    color: var(--success);
    background: #effaf5;
    border: 1px solid #c9efdc;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    background: #f3f6fb;
}

.sidebar {
    color: #fff;
    background: linear-gradient(180deg, #2373db 0%, #318bf2 100%);
    padding: 26px 18px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .75);
    font-weight: 700;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
}

.nav-item {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .92);
    font-weight: 600;
}

.nav-item.active {
    background: rgba(255, 255, 255, .18);
}

.main-area {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
}

.userbox {
    display: flex;
    align-items: center;
    gap: 18px;
    color: #657080;
}

.logout {
    padding: 9px 16px;
    border: 1px solid #d7e3f5;
    border-radius: 6px;
    color: var(--brand);
    background: #fff;
}

.dashboard {
    padding: 32px;
}

.report-dashboard {
    display: grid;
    gap: 22px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    display: block;
    min-height: 126px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 58, 105, .05);
}

.stat-card.active {
    border-color: rgba(47, 134, 239, .42);
    background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
}

.stat-card span {
    display: block;
    color: #667085;
    font-size: 14px;
}

.stat-card strong {
    display: block;
    margin: 12px 0 8px;
    color: #111827;
    font-size: 30px;
    line-height: 1;
}

.stat-card em {
    color: #7b8794;
    font-size: 13px;
    font-style: normal;
}

.filter-panel {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.filter-panel form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 14px;
}

.filter-panel label {
    display: grid;
    gap: 8px;
    min-width: 180px;
    color: #667085;
    font-size: 13px;
}

.filter-panel input,
.filter-panel select {
    height: 40px;
    min-width: 180px;
    padding: 0 12px;
    border: 1px solid #dfe3ea;
    border-radius: 6px;
    color: #1f2d3d;
    background: #fff;
    outline: none;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(47, 134, 239, .10);
}

.filter-button {
    height: 40px;
    padding: 0 22px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: var(--brand);
    cursor: pointer;
    font-weight: 700;
}

.download-button {
    height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 22px;
    border: 1px solid rgba(47, 134, 239, .32);
    border-radius: 6px;
    color: var(--brand);
    background: #f4f9ff;
    font-weight: 700;
}

.reset-link {
    height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    color: #7b8794;
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.metric {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.metric span {
    display: block;
    margin-bottom: 10px;
    color: #667085;
    font-size: 14px;
}

.metric strong {
    color: #1f5fae;
    font-size: 28px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(320px, .85fr) minmax(0, 1.65fr);
    gap: 16px;
    align-items: start;
}

.report-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.report-card h2 {
    margin: 0;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 17px;
}

.report-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.report-card th,
.report-card td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf1f7;
    text-align: left;
    white-space: nowrap;
}

.report-card th {
    color: #667085;
    background: #f8fafc;
    font-weight: 700;
}

.report-card td {
    color: #273444;
}

.report-card tbody tr:hover {
    background: #f8fbff;
}

.report-card.wide {
    overflow-x: auto;
}

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

    .brand-side {
        min-height: 48vh;
        padding: 40px 24px;
    }

    .brand-title {
        font-size: 32px;
    }

    .brand-subtitle {
        margin-bottom: 34px;
        font-size: 18px;
    }

    .feature-row,
    .module-strip {
        display: none;
    }

    .auth-side {
        min-height: auto;
        padding: 40px 24px 50px;
    }

    .auth-panel .lead {
        margin-bottom: 36px;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .topbar {
        padding: 0 18px;
    }

    .dashboard {
        padding: 18px;
    }

    .stats-row,
    .metric-row,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .filter-panel form {
        display: grid;
    }

    .filter-panel label,
    .filter-panel input,
    .filter-panel select {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 520px) {
    .brand-logo {
        width: 82px;
        height: 82px;
        font-size: 25px;
    }

    .brand-title {
        font-size: 27px;
    }

    .auth-panel h1 {
        font-size: 30px;
    }

    .input,
    .button {
        height: 54px;
        font-size: 16px;
    }
}
