:root {
    --sidebar-width: 260px;
    --primary: #136f63;
    --primary-dark: #0d554c;
    --primary-soft: #e7f5f2;
    --accent: #ef9b36;
    --background: #f4f7f8;
    --surface: #ffffff;
    --surface-muted: #f8fafb;
    --text: #172126;
    --text-muted: #69777d;
    --border: #dfe7e9;
    --danger: #c83e4d;
    --danger-soft: #fff0f1;
    --success: #16805f;
    --shadow: 0 16px 45px rgba(23, 33, 38, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.login-page {
    display: grid;
    grid-template-columns: minmax(360px, 0.92fr) minmax(460px, 1.08fr);
    min-height: 100vh;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 28px;
    background: var(--surface);
}

.login-card {
    width: min(100%, 420px);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 42px;
}

.brand-symbol {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 52px;
    height: 52px;
    color: #fff;
    border-radius: 16px;
    background: var(--primary);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.05em;
    box-shadow: 0 12px 30px rgba(19, 111, 99, 0.25);
}

.brand-copy strong {
    display: block;
    font-size: 18px;
}

.brand-copy span {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 13px;
}

.login-card h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.login-intro {
    margin: 14px 0 30px;
    color: var(--text-muted);
    line-height: 1.65;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #344249;
    font-size: 14px;
    font-weight: 700;
}

.form-control {
    display: block;
    width: 100%;
    height: 52px;
    padding: 0 16px;
    color: var(--text);
    outline: none;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(19, 111, 99, 0.1);
}

.password-wrap {
    position: relative;
}

.password-wrap .form-control {
    padding-right: 74px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 13px;
    padding: 8px;
    color: var(--primary);
    border: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 800;
    transform: translateY(-50%);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 13px 20px;
    color: #fff;
    border: 0;
    border-radius: 13px;
    background: var(--primary);
    font-weight: 800;
    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 12px 28px rgba(19, 111, 99, 0.2);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    cursor: wait;
    opacity: 0.7;
    transform: none;
}

.login-links {
    margin-top: 22px;
    text-align: center;
}

.login-links a {
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
}

.alert {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 13px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-error {
    color: #8e2632;
    border-color: #ffd6db;
    background: var(--danger-soft);
}

.alert-success {
    color: #0f644b;
    border-color: #cbeade;
    background: #eaf8f3;
}

.login-visual {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 100vh;
    overflow: hidden;
    padding: 64px;
    color: #fff;
    background:
        radial-gradient(
            circle at 75% 20%,
            rgba(255, 255, 255, 0.12),
            transparent 26%
        ),
        linear-gradient(145deg, #0c514a, #136f63 58%, #1d8477);
}

.login-visual::before,
.login-visual::after {
    position: absolute;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

.login-visual::before {
    top: -130px;
    right: -130px;
    width: 430px;
    height: 430px;
}

.login-visual::after {
    top: 125px;
    right: 120px;
    width: 220px;
    height: 220px;
}

.login-visual-content {
    position: relative;
    z-index: 1;
    max-width: 570px;
}

.login-kicker {
    display: inline-flex;
    margin-bottom: 20px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-visual h2 {
    max-width: 560px;
    margin: 0;
    font-size: clamp(38px, 5vw, 66px);
    line-height: 1;
    letter-spacing: -0.055em;
}

.login-visual p {
    max-width: 500px;
    margin: 22px 0 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 17px;
    line-height: 1.7;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    padding: 22px 16px;
    color: #fff;
    background: #102d2a;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 24px;
}

.sidebar-brand .brand-symbol {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: #fff;
    color: var(--primary);
    box-shadow: none;
}

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

.sidebar-brand span {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
}

.sidebar-section {
    margin: 18px 10px 8px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 13px;
    color: rgba(255, 255, 255, 0.72);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    transition:
        color 0.2s ease,
        background 0.2s ease;
}

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

.sidebar-icon {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    font-size: 17px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
}

.sidebar-user {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-user strong,
.sidebar-user span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.sidebar-user span {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 0 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
}

.topbar-title {
    margin: 0;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.topbar-context {
    color: var(--text-muted);
    font-size: 13px;
}

.page-content {
    padding: 32px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(26px, 3vw, 38px);
    letter-spacing: -0.045em;
}

.page-header p {
    margin: 8px 0 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.grid {
    display: grid;
    gap: 20px;
}

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

.card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card-label {
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.card-value {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.card-text {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.empty-state {
    display: grid;
    min-height: 340px;
    place-items: center;
    padding: 40px;
    text-align: center;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    margin: 0 auto 18px;
    color: var(--primary);
    border-radius: 22px;
    background: var(--primary-soft);
    font-size: 30px;
}

.empty-state h2 {
    margin: 0;
    font-size: 22px;
}

.empty-state p {
    max-width: 480px;
    margin: 10px auto 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
}

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

    .login-visual {
        display: none;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

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

    .app-main {
        margin-left: 0;
    }

    .mobile-menu-button {
        display: inline-grid;
        place-items: center;
    }

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

@media (max-width: 640px) {
    .login-panel {
        padding: 32px 20px;
    }

    .topbar {
        padding: 0 18px;
    }

    .topbar-context {
        display: none;
    }

    .page-content {
        padding: 24px 18px;
    }
}
