:root {
    --green: #176b45;
    --green-dark: #105036;
    --green-light: #e8f5ee;
    --navy: #172033;
    --muted: #667085;
    --border: #e4e7ec;
    --background: #f5f7fa;
    --white: #ffffff;
    --red: #b42318;
    --red-light: #fef3f2;
    --orange-light: #fff7e8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    color: var(--navy);
    background: var(--background);
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, #dff4e8, transparent 42%),
        var(--background);
}

.login-card {
    width: min(430px, 100%);
    padding: 38px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(16, 24, 40, .10);
}

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

.brand-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    color: white;
    background: var(--green);
    border-radius: 14px;
    font-weight: bold;
}

.brand h1 {
    margin: 0 0 4px;
    font-size: 25px;
}

.brand p,
.page-heading p,
.empty-state p {
    margin: 0;
    color: var(--muted);
}

label {
    display: block;
    margin: 18px 0 7px;
    font-weight: bold;
    font-size: 14px;
}

input {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #cfd4dc;
    border-radius: 9px;
    font-size: 16px;
}

input:focus {
    border-color: var(--green);
    outline: 3px solid rgba(23, 107, 69, .12);
}

button {
    height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 9px;
    color: white;
    background: var(--green);
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

form button {
    width: 100%;
    margin-top: 24px;
}

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

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

.alert {
    padding: 12px 14px;
    border-radius: 9px;
    font-size: 14px;
}

.alert-error {
    color: var(--red);
    background: var(--red-light);
}

.login-card footer {
    margin-top: 26px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.topbar {
    min-height: 68px;
    padding: 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    background: var(--green-dark);
}

.topbar > div,
.user-menu {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar a {
    color: white;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 38px auto;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.page-heading h1 {
    margin: 0 0 8px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 28px;
}

.card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
}

.card span {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
}

.card strong {
    font-size: 34px;
}

.card-warning {
    background: var(--orange-light);
}

.empty-state {
    margin-top: 24px;
    padding: 48px;
    border: 1px dashed #cfd4dc;
    border-radius: 14px;
    background: var(--white);
    text-align: center;
}

.empty-state h2 {
    margin-top: 0;
}

@media (max-width: 720px) {
    .topbar,
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        padding: 18px 22px;
    }

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

    .login-card {
        padding: 28px 22px;
    }
}

.brand-link {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.main-nav {
    display: flex;
    gap: 6px;
}

.main-nav a {
    padding: 9px 12px;
    border-radius: 7px;
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
}

.main-nav a:hover,
.main-nav a.active {
    color: white;
    background: rgba(255, 255, 255, .12);
}

.button {
    display: inline-flex;
    min-height: 46px;
    padding: 0 20px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: white;
    background: var(--green);
    text-decoration: none;
    font-weight: bold;
}

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

.button-secondary {
    color: var(--navy);
    background: #eef1f5;
}

.button-secondary:hover {
    background: #e0e5eb;
}

.container-narrow {
    max-width: 850px;
}

.table-card,
.form-card {
    margin-top: 26px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    background: #fafbfc;
    font-size: 13px;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: 0;
}

td small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.actions {
    text-align: right;
}

.actions a {
    color: var(--green);
    font-weight: bold;
}

.badge {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.badge-success {
    color: #166534;
    background: #dcfce7;
}

.badge-muted {
    color: #475467;
    background: #eef1f5;
}

.form-card {
    padding: 28px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 20px;
}

.form-span {
    grid-column: 1 / -1;
}

select {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #cfd4dc;
    border-radius: 9px;
    color: var(--navy);
    background: white;
    font-size: 15px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 24px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

@media (max-width: 850px) {
    .main-nav {
        order: 3;
        width: 100%;
    }

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

    .form-span {
        grid-column: auto;
    }

    .table-card {
        overflow-x: auto;
    }

    table {
        min-width: 780px;
    }
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumbs a {
    color: var(--green);
}

.heading-actions {
    display: flex;
    gap: 10px;
}

.section-card {
    margin-top: 26px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
}

.section-heading {
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
}

.section-heading h2 {
    margin: 0 0 6px;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
}

.inline-empty {
    padding: 38px 24px;
    color: var(--muted);
    text-align: center;
}

.table-responsive {
    overflow-x: auto;
}

@media (max-width: 720px) {
    .heading-actions {
        width: 100%;
        flex-direction: column;
    }

    .heading-actions .button {
        width: 100%;
    }
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumbs a {
    color: var(--green);
}

.heading-actions {
    display: flex;
    gap: 10px;
}

.section-card {
    margin-top: 26px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
}

.section-heading {
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
}

.section-heading h2 {
    margin: 0 0 6px;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
}

.inline-empty {
    padding: 38px 24px;
    color: var(--muted);
    text-align: center;
}

.table-responsive {
    overflow-x: auto;
}

@media (max-width: 720px) {
    .heading-actions {
        width: 100%;
        flex-direction: column;
    }

    .heading-actions .button {
        width: 100%;
    }
}

.field-help {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.calculation {
    margin-top: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.calculation > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 18px;
    border-bottom: 1px solid var(--border);
}

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

.calculation-total {
    color: var(--green-dark);
    background: var(--green-light);
}

.section-actions {
    padding: 28px 24px;
    text-align: center;
}

.card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}
