:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --sidebar: #111827;
    --sidebar-soft: #1f2937;

    --text: #111827;
    --muted: #64748b;
    --border: #e2e8f0;

    --accent: #2563eb;
    --accent-hover: #1d4ed8;

    --success: #16a34a;

    --radius: 12px;
    --shadow:
        0 10px 30px rgba(15, 23, 42, 0.08);
}


* {
    box-sizing: border-box;
}


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


body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text);
    background: var(--bg);
}


/* ---------------------------------------------------------
   LOGIN
--------------------------------------------------------- */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 32px;

    background:
        linear-gradient(
            135deg,
            #0f172a 0%,
            #1e293b 55%,
            #0f172a 100%
        );
}


.login-container {
    width: 100%;
    max-width: 430px;
}


.login-card {
    background: var(--surface);

    border-radius: 16px;

    padding: 38px;

    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.28);
}


.brand,
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}


.brand-mark {
    width: 48px;
    height: 48px;

    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--accent);
    color: white;

    font-size: 22px;
    font-weight: 700;
}


.brand-mark.small {
    width: 38px;
    height: 38px;

    border-radius: 9px;

    font-size: 17px;
}


.brand h1 {
    margin: 0;

    font-size: 21px;
}


.brand p {
    margin: 3px 0 0;

    color: var(--muted);

    font-size: 13px;
}


.login-heading {
    margin-top: 38px;
}


.login-heading h2 {
    margin: 0 0 8px;

    font-size: 28px;
}


.login-heading p {
    margin: 0;

    color: var(--muted);

    line-height: 1.55;
}


.login-form {
    margin-top: 28px;

    display: flex;
    flex-direction: column;
}


.login-form label {
    margin-bottom: 7px;

    font-size: 14px;
    font-weight: 600;
}


.login-form input {
    width: 100%;

    padding: 12px 13px;

    margin-bottom: 19px;

    border: 1px solid var(--border);
    border-radius: 8px;

    font: inherit;

    outline: none;
}


.login-form input:focus {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12);
}


.primary-button {
    border: 0;
    border-radius: 8px;

    padding: 12px 16px;

    background: var(--accent);
    color: white;

    font: inherit;
    font-weight: 600;

    cursor: pointer;
}


.primary-button:hover:not(:disabled) {
    background: var(--accent-hover);
}


.primary-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}


.static-notice {
    margin:
        18px 0 0;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.5;

    text-align: center;
}


.login-footer {
    margin-top: 20px;

    color: #94a3b8;

    font-size: 12px;

    text-align: center;
}


/* ---------------------------------------------------------
   APPLICATION
--------------------------------------------------------- */

.app-layout {
    min-height: 100vh;

    display: grid;

    grid-template-columns:
        250px minmax(0, 1fr);
}


.sidebar {
    position: fixed;

    width: 250px;
    height: 100vh;

    padding: 24px 18px;

    display: flex;
    flex-direction: column;

    background: var(--sidebar);
    color: white;
}


.sidebar-brand {
    padding:
        0 8px 24px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);
}


.sidebar-brand strong,
.sidebar-brand span {
    display: block;
}


.sidebar-brand strong {
    font-size: 15px;
}


.sidebar-brand span {
    margin-top: 2px;

    color: #94a3b8;

    font-size: 11px;
}


.sidebar-nav {
    margin-top: 25px;

    display: flex;
    flex-direction: column;

    gap: 5px;
}


.nav-link {
    padding: 11px 13px;

    border-radius: 8px;

    color: #cbd5e1;

    text-decoration: none;

    font-size: 14px;
    font-weight: 500;
}


.nav-link:hover {
    background: var(--sidebar-soft);
    color: white;
}


.nav-link.active {
    background: var(--accent);
    color: white;
}


.sidebar-footer {
    margin-top: auto;

    padding: 16px 8px 0;

    border-top:
        1px solid rgba(255, 255, 255, 0.08);

    color: #94a3b8;

    font-size: 11px;
}


.status-dot {
    width: 8px;
    height: 8px;

    display: inline-block;

    margin-right: 6px;

    border-radius: 50%;

    background: var(--success);
}


.main-area {
    grid-column: 2;

    min-width: 0;
}


.topbar {
    min-height: 88px;

    padding: 20px 32px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: var(--surface);

    border-bottom:
        1px solid var(--border);
}


.topbar h1 {
    margin: 0;

    font-size: 22px;
}


.topbar p {
    margin: 4px 0 0;

    color: var(--muted);

    font-size: 13px;
}


.user-menu {
    display: flex;
    align-items: center;

    gap: 10px;
}


.user-avatar {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #e0e7ff;
    color: #3730a3;

    font-weight: 700;
}


.user-menu strong,
.user-menu span {
    display: block;
}


.user-menu strong {
    font-size: 13px;
}


.user-menu span {
    margin-top: 2px;

    color: var(--muted);

    font-size: 11px;
}


.content {
    padding: 32px;
}


.welcome-panel {
    padding: 28px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}


.eyebrow {
    color: var(--accent);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.08em;
}


.welcome-panel h2 {
    margin: 8px 0;

    font-size: 24px;
}


.welcome-panel p {
    max-width: 720px;

    margin: 0;

    color: var(--muted);

    line-height: 1.6;
}


.service-status {
    white-space: nowrap;

    padding: 9px 12px;

    background: #f0fdf4;

    border: 1px solid #bbf7d0;
    border-radius: 20px;

    color: #166534;

    font-size: 12px;
    font-weight: 600;
}


.stat-grid {
    margin-top: 22px;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}


.stat-card,
.panel {
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);
}


.stat-card {
    padding: 21px;
}


.stat-label,
.stat-description {
    display: block;
}


.stat-label {
    color: var(--muted);

    font-size: 12px;
    font-weight: 600;
}


.stat-value {
    display: block;

    margin: 10px 0 6px;

    font-size: 29px;
}


.stat-description {
    color: var(--muted);

    font-size: 11px;
}


.dashboard-grid {
    margin-top: 22px;

    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(280px, 1fr);

    gap: 18px;
}


.panel {
    padding: 22px;
}


.panel-heading h3 {
    margin: 0;

    font-size: 16px;
}


.panel-heading p {
    margin: 5px 0 0;

    color: var(--muted);

    font-size: 12px;
}


.action-grid {
    margin-top: 20px;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;
}


.action-card {
    padding: 17px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--surface-soft);

    text-align: left;
}


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


.action-card strong {
    color: var(--text);

    font-size: 13px;
}


.action-card span {
    margin-top: 5px;

    color: var(--muted);

    font-size: 11px;
}


.system-list {
    margin-top: 16px;
}


.system-list > div {
    padding: 12px 0;

    display: flex;
    justify-content: space-between;

    gap: 20px;

    border-bottom:
        1px solid var(--border);

    font-size: 12px;
}


.system-list > div:last-child {
    border-bottom: 0;
}


.system-list span {
    color: var(--muted);
}


/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */

@media (max-width: 1000px) {

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

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


@media (max-width: 760px) {

    .app-layout {
        display: block;
    }

    .sidebar {
        position: relative;

        width: 100%;
        height: auto;
    }

    .main-area {
        width: 100%;
    }

    .topbar {
        padding: 18px 20px;
    }

    .content {
        padding: 20px;
    }

    .welcome-panel {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .user-menu {
        display: none;
    }
}


/* ---------------------------------------------------------
   LOGIN STATUS MESSAGE
--------------------------------------------------------- */

.login-message {
    min-height: 20px;

    margin: 15px 0 0;

    font-size: 13px;
    line-height: 1.45;

    text-align: center;
}

.login-message.error {
    color: #b91c1c;
}

.login-message.success {
    color: #166534;
}
