:root {
    --ink: #172026;
    --muted: #5b6670;
    --line: #d9e1e7;
    --surface: #ffffff;
    --page: #f4f7f4;
    --accent: #21735b;
    --accent-dark: #15523f;
    --warning: #9f2d20;
    --warning-bg: #fff0ed;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background: var(--page);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

.app-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    text-decoration: none;
}

.brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-switcher label {
    color: var(--muted);
    font-size: 14px;
}

select,
input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    padding-right: 82px;
}

.password-toggle {
    position: absolute;
    right: 6px;
    min-height: 32px;
    width: 64px;
    border-radius: 5px;
    padding: 6px 8px;
    color: var(--accent-dark);
    background: transparent;
    font-size: 13px;
}

.password-toggle:hover {
    color: #fff;
    background: var(--accent);
}

.site-switcher select {
    width: 180px;
}

.header-link {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
}

.app-main {
    flex: 1;
    width: 100%;
}

.app-footer {
    padding: 18px 32px;
    color: var(--muted);
    background: var(--surface);
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.login-page .app-main {
    display: grid;
    place-items: center;
    padding: 40px 20px;
}

.login-shell {
    width: min(980px, 100%);
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(320px, 440px) 1fr;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(23, 32, 38, 0.12);
}

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 46px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.login-copy h1 {
    margin-bottom: 28px;
    font-size: 32px;
    line-height: 1.15;
}

.login-form {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

button {
    min-height: 46px;
    border: 0;
    border-radius: 6px;
    padding: 12px 16px;
    color: #fff;
    background: var(--accent);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: var(--accent-dark);
}

.alert {
    margin-bottom: 18px;
    border: 1px solid #f0b0a7;
    border-radius: 6px;
    padding: 12px 14px;
    color: var(--warning);
    background: var(--warning-bg);
    font-weight: 700;
}

.login-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100%;
    padding: 42px;
    color: #fff;
    background: linear-gradient(145deg, #183028, #2c7a63 60%, #e8c76f);
}

.login-visual img {
    position: absolute;
    top: 34px;
    right: 34px;
    width: 86px;
    height: 86px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
}

.login-visual h2 {
    max-width: 360px;
    margin-bottom: 10px;
    font-size: 30px;
    line-height: 1.15;
}

.login-visual p {
    max-width: 390px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.5;
}

.dashboard {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 48px 0;
}

.page-heading,
.dashboard-section {
    margin-bottom: 34px;
}

.page-heading h1 {
    margin-bottom: 8px;
    font-size: 34px;
}

.page-heading p:last-child,
.section-heading p {
    color: var(--muted);
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin-bottom: 0;
    font-size: 22px;
}

.section-heading p {
    max-width: 560px;
    margin-bottom: 0;
    line-height: 1.45;
}

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

.module-card {
    min-height: 170px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.module-link {
    display: block;
    text-decoration: none;
}

.module-link:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 30px rgba(23, 32, 38, 0.08);
}

.module-card h2,
.module-card h3 {
    margin-bottom: 10px;
    font-size: 21px;
}

.module-card p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.5;
}

.admin-link-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.admin-link-grid a {
    display: flex;
    align-items: center;
    min-height: 54px;
    padding: 14px 16px;
    color: var(--accent-dark);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
}

.admin-link-grid a:hover {
    border-color: var(--accent);
}

.site-list {
    display: grid;
    gap: 10px;
}

.site-row {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.site-id {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.site-row a {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 900px) {
    .module-grid,
    .admin-link-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .app-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 20px;
    }

    .header-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .site-switcher {
        align-items: stretch;
        flex-direction: column;
    }

    .site-switcher select {
        width: 100%;
    }

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

    .login-panel,
    .login-visual {
        padding: 30px;
    }

    .login-visual {
        min-height: 280px;
    }

    .module-grid,
    .admin-link-grid {
        grid-template-columns: 1fr;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-row {
        grid-template-columns: 1fr;
    }
}
