:root {
    --brand-yellow: #f3c53b;
    --brand-orange: #f2724a;
    --brand-pink: #d7387d;
    --brand-cyan: #64bfd4;
    --brand-blue: #2f52b3;
    --brand-navy: #12314f;
    --bg-a: #f3c53b;
    --bg-b: #e65b55;
    --bg-c: #2f52b3;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-border: rgba(255, 255, 255, 0.55);
    --text: #163450;
    --primary: #2f52b3;
    --primary-strong: #1d3f98;
    --danger: #d03f3f;
    --success: #1f9d58;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
}

body {
    background:
        radial-gradient(circle at 8% 12%, rgba(243, 197, 59, 0.94), transparent 32%),
        radial-gradient(circle at 20% 30%, rgba(230, 91, 85, 0.6), transparent 35%),
        radial-gradient(circle at 22% 68%, rgba(100, 191, 212, 0.42), transparent 30%),
        linear-gradient(135deg, #e95d53 0%, #d7387d 34%, #2f52b3 70%, #12314f 100%);
    background-size: 140% 140%;
    animation: bgMove 16s ease infinite;
}

#particles-js {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.auth-page .auth-wrapper,
.topbar,
.dashboard-canvas {
    position: relative;
    z-index: 1;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-stage {
    position: relative;
    transform: translateY(28px);
    width: min(500px, calc(100vw - 48px));
}

.auth-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 18px);
    margin-bottom: 0;
}

.brand-logo {
    max-width: min(430px, 72vw);
    max-height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 12px 24px rgba(16, 40, 68, 0.2));
}

.auth-card {
    width: 100%;
    max-width: none;
    border-radius: 18px;
    padding: 26px 45px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 24px 50px rgba(20, 43, 75, 0.2);
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: var(--brand-navy);
}

.auth-card p {
    margin: 0 0 20px;
    color: #21476a;
}

.auth-card label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #21476a;
}

.auth-card input {
    width: 100%;
    margin-bottom: 14px;
    border-radius: 10px;
    border: 1px solid #aac0df;
    padding: 8px 12px;
    font-size: 0.95rem;
    outline: none;
}

.auth-card input:focus {
    border-color: #658dd6;
    box-shadow: 0 0 0 3px rgba(47, 82, 179, 0.16);
}

.auth-card button {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 11px 12px;
    background: linear-gradient(90deg, var(--brand-pink), var(--brand-blue));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(30, 62, 138, 0.26);
}

.auth-card button:hover {
    background: linear-gradient(90deg, #bb2f6d, var(--primary-strong));
}

.alert {
    margin-bottom: 14px;
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(214, 63, 63, 0.14);
    border: 1px solid rgba(214, 63, 63, 0.22);
    color: #8f1e1e;
    font-size: 0.9rem;
}

.topbar {
    width: min(1400px, calc(100% - 30px));
    margin: 16px auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(16, 36, 61, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar nav a {
    color: #f5f8fd;
    text-decoration: none;
    font-weight: 700;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
}

.topbar nav a.active {
    border-bottom-color: rgba(255, 255, 255, 0.8);
}

.brand-lockup {
    border-bottom: 0 !important;
    padding: 0 !important;
}

.brand-logo-sm {
    height: 34px;
    width: auto;
    object-fit: contain;
    display: block;
}

.logout-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.logout-btn svg {
    width: 20px;
    height: 20px;
}

.dashboard-canvas {
    width: min(1400px, calc(100% - 30px));
    margin: 16px auto 24px;
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    grid-template-rows: 120px 500px;
    gap: 16px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 14px 30px rgba(17, 46, 85, 0.18);
    backdrop-filter: blur(8px);
    padding: 16px;
}

.panel h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    color: var(--brand-navy);
}

.panel.small .metric {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
}

.panel.small p {
    margin: 0;
    color: #28527f;
}

.panel.chart {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
}

.panel.table {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.table-header span {
    font-weight: 700;
    color: var(--brand-blue);
}

.table-scroll {
    overflow: auto;
    max-height: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th,
td {
    text-align: left;
    padding: 8px 6px;
    border-bottom: 1px solid rgba(49, 89, 136, 0.18);
}

th {
    font-weight: 800;
    color: var(--brand-navy);
}

.trend {
    display: inline-block;
    width: 14px;
    margin-right: 8px;
    font-size: 0.92rem;
}

.trend.up {
    color: var(--success);
}

.trend.down {
    color: var(--danger);
}

@keyframes bgMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@media (max-width: 1080px) {
    .brand-logo {
        max-height: 100px;
    }

    .dashboard-canvas {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .panel.chart,
    .panel.table {
        grid-column: auto;
        grid-row: auto;
    }

    .panel.table {
        min-height: 360px;
    }

    .topbar nav {
        gap: 10px;
    }

    .brand-logo-sm {
        height: 28px;
    }
}
