:root {
    --green-950: #052e16;
    --green-900: #064e3b;
    --green-800: #065f46;
    --green-700: #047857;
    --green-600: #059669;
    --green-500: #10b981;
    --green-100: #d1fae5;
    --green-50: #ecfdf5;

    --slate-950: #0f172a;
    --slate-900: #111827;
    --slate-800: #1f2937;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;

    --white: #ffffff;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --warning: #d97706;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;

    --shadow-sm:
        0 1px 2px rgba(15, 23, 42, 0.04);

    --shadow:
        0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    color: var(--slate-900);
    background: var(--slate-50);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

/* =========================
   COMMON
========================= */

.eyebrow {
    margin: 0 0 6px;
    color: var(--green-700);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.eyebrow.light {
    color: #a7f3d0;
}

.button {
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    transition:
        transform 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: var(--white);
    background: var(--green-700);
}

.button-primary:hover {
    background: var(--green-800);
}

.button-secondary {
    color: var(--slate-700);
    background: var(--white);
    border: 1px solid var(--slate-200);
}

.button-secondary:hover {
    background: var(--slate-50);
}

.button-full {
    width: 100%;
}

.alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-error {
    color: #991b1b;
    background: var(--danger-bg);
    border: 1px solid #fecaca;
}

/* =========================
   LOGIN
========================= */

.auth-body {
    min-height: 100vh;
    background:
        linear-gradient(
            135deg,
            var(--green-950),
            var(--green-800)
        );
}

.auth-wrapper {
    display: grid;
    grid-template-columns:
        minmax(0, 1.1fr)
        minmax(420px, 0.9fr);
    min-height: 100vh;
}

.auth-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 80px max(60px, 8vw);
    color: var(--white);
    overflow: hidden;
}

.auth-brand::after {
    content: "";
    position: absolute;
    width: 450px;
    height: 450px;
    right: -180px;
    bottom: -180px;
    border: 80px solid rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

.brand-mark {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    color: var(--green-950);
    background: var(--white);
    border-radius: 24px;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand-mark.small {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    color: var(--white);
    background: var(--green-700);
    font-size: 16px;
}

.auth-brand .eyebrow {
    color: #a7f3d0;
}

.auth-brand h1 {
    max-width: 600px;
    margin: 0;
    font-size: clamp(42px, 5vw, 68px);
    line-height: 1;
    letter-spacing: -0.05em;
}

.auth-brand h1 span {
    display: block;
    color: #a7f3d0;
}

.auth-description {
    max-width: 580px;
    margin: 24px 0 0;
    color: #d1fae5;
    font-size: 17px;
    line-height: 1.7;
}

.brand-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 36px;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: #d1fae5;
    background: rgba(255, 255, 255, 0.06);
    font-size: 13px;
    font-weight: 600;
}

.brand-feature span {
    color: #6ee7b7;
    font-size: 11px;
}

.auth-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
    background: var(--slate-50);
}

.auth-card-inner {
    width: 100%;
    max-width: 430px;
}

.mobile-brand {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.auth-heading {
    margin-bottom: 30px;
}

.auth-heading h2 {
    margin: 0;
    color: var(--slate-950);
    font-size: 31px;
    letter-spacing: -0.035em;
}

.auth-heading > p:last-child {
    margin: 10px 0 0;
    color: var(--slate-500);
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 20px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    color: var(--slate-700);
    font-size: 14px;
    font-weight: 700;
}

.form-group input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    color: var(--slate-900);
    background: var(--white);
    border: 1px solid var(--slate-300);
    border-radius: 10px;
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-group input:focus {
    border-color: var(--green-600);
    box-shadow:
        0 0 0 3px
        rgba(5, 150, 105, 0.12);
}

.auth-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    color: var(--slate-500);
    font-size: 12px;
}

.security-dot {
    width: 7px;
    height: 7px;
    background: var(--green-500);
    border-radius: 50%;
}

/* =========================
   APPLICATION LAYOUT
========================= */

.app-body {
    min-height: 100vh;
    background: #f6f8f7;
}

.app-shell {
    display: grid;
    grid-template-columns: 255px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 24px 16px;
    color: var(--white);
    background: var(--green-950);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 26px;
    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .brand-mark {
    color: var(--green-950);
    background: var(--white);
}

.sidebar-brand strong,
.sidebar-brand small {
    display: block;
}

.sidebar-brand strong {
    font-size: 15px;
}

.sidebar-brand small {
    margin-top: 2px;
    color: #a7f3d0;
    font-size: 11px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 18px 0;
}

.nav-label {
    margin: 20px 10px 8px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.11em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 4px 0;
    padding: 8px 10px;
    color: #d1fae5;
    border-radius: 9px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.nav-item.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
}

.nav-item.disabled {
    cursor: default;
    opacity: 0.58;
}

.nav-item small {
    margin-left: auto;
    color: #6ee7b7;
    font-size: 9px;
    text-transform: uppercase;
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    color: #a7f3d0;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 7px;
    font-size: 9px;
    font-weight: 900;
}

.sidebar-footer {
    padding-top: 16px;
    border-top:
        1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px;
}

.sidebar-user strong,
.sidebar-user small {
    display: block;
}

.sidebar-user strong {
    max-width: 130px;
    overflow: hidden;
    color: var(--white);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user small {
    margin-top: 2px;
    color: #a7f3d0;
    font-size: 10px;
}

.user-avatar {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--green-900);
    background: var(--green-100);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 900;
}

.main-content {
    min-width: 0;
}

.topbar {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 16px 30px;
    background: var(--white);
    border-bottom: 1px solid var(--slate-200);
}

.topbar h1 {
    margin: 0;
    color: var(--slate-950);
    font-size: 24px;
    letter-spacing: -0.03em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.user-summary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-summary strong,
.user-summary small {
    display: block;
}

.user-summary strong {
    color: var(--slate-800);
    font-size: 12px;
}

.user-summary small {
    margin-top: 2px;
    color: var(--slate-500);
    font-size: 10px;
}

.page-content {
    padding: 30px;
}

/* =========================
   DASHBOARD
========================= */

.welcome-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 30px;
    color: var(--white);
    background:
        linear-gradient(
            120deg,
            var(--green-900),
            var(--green-700)
        );
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.welcome-panel h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.04em;
}

.welcome-panel p:last-child {
    margin: 8px 0 0;
    color: #d1fae5;
}

.welcome-date {
    flex-shrink: 0;
    padding: 10px 14px;
    color: #d1fae5;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 13px;
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.stat-card {
    padding: 21px;
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 700;
}

.stat-symbol {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: var(--green-700);
    background: var(--green-50);
    border-radius: 9px;
    font-weight: 900;
}

.stat-symbol.warning {
    color: var(--warning);
    background: #fffbeb;
}

.stat-value {
    display: block;
    margin: 18px 0 6px;
    color: var(--slate-950);
    font-size: 28px;
    letter-spacing: -0.04em;
}

.stat-card > small {
    color: var(--slate-500);
    font-size: 11px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(300px, 0.5fr);
    gap: 18px;
    margin-top: 22px;
}

.panel {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.panel-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--slate-100);
}

.panel-header h3 {
    margin: 0;
    font-size: 16px;
}

.empty-state {
    padding: 60px 30px;
    text-align: center;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    color: var(--green-800);
    background: var(--green-50);
    border-radius: 15px;
    font-weight: 900;
}

.empty-state h4 {
    margin: 0;
    font-size: 17px;
}

.empty-state p {
    max-width: 460px;
    margin: 8px auto 0;
    color: var(--slate-500);
    font-size: 13px;
    line-height: 1.6;
}

.status-list {
    padding: 8px 20px 16px;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    color: var(--slate-600);
    border-bottom: 1px solid var(--slate-100);
    font-size: 12px;
    font-weight: 600;
}

.status-row:last-child {
    border-bottom: 0;
}

.status-ok,
.status-badge {
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.status-ok {
    color: var(--green-800);
    background: var(--green-50);
}

.status-badge {
    color: var(--slate-700);
    background: var(--slate-100);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 900px) {

    .auth-wrapper {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        display: none;
    }

    .auth-card {
        min-height: 100vh;
        padding: 35px 24px;
    }

    .mobile-brand {
        display: flex;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 14px 18px;
    }

    .sidebar-brand {
        padding-bottom: 14px;
    }

    .sidebar-nav {
        display: flex;
        gap: 8px;
        padding: 12px 0 0;
        overflow-x: auto;
    }

    .nav-label,
    .sidebar-footer,
    .nav-item.disabled {
        display: none;
    }

    .nav-item {
        flex-shrink: 0;
        margin: 0;
    }

    .topbar {
        padding: 15px 20px;
    }

    .page-content {
        padding: 20px;
    }

}

@media (max-width: 650px) {

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .user-summary {
        display: none;
    }

    .welcome-panel {
        align-items: flex-start;
        flex-direction: column;
        padding: 24px;
    }

    .welcome-panel h2 {
        font-size: 23px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-content {
        padding: 15px;
    }

}

@media (max-width: 420px) {

    .auth-card {
        padding: 28px 18px;
    }

    .auth-heading h2 {
        font-size: 26px;
    }

}