:root {
    --font-ui: "Trebuchet MS", "Lucida Sans Unicode", "Gill Sans MT", sans-serif;
    --font-heading: "Palatino Linotype", "Book Antiqua", serif;
    --ink-900: #101726;
    --ink-700: #22314c;
    --ink-500: #3d506f;
    --slate-100: #edf2f7;
    --slate-200: #dce5ef;
    --surface: #ffffff;
    --bg-soft: #f2f5f9;
    --teal-600: #0f6632;
    --teal-500: #0e8f86;
    --amber-500: #b77812;
    --green-500: #1f8a4c;
    --red-500: #b53b3b;
    --blue-500: #2f61c4;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-ui);
    margin: 0;
    background: var(--bg-soft);
    color: #1f2937;
}

img,
video,
svg {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

.container {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
}

.topbar {
    background: linear-gradient(120deg, #121c31, #0d2447);
    color: #fff;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.topbar a {
    color: #d6e8ff;
    margin-right: 16px;
    text-decoration: none;
    font-weight: 600;
}

.topbar a:hover {
    color: #ffffff;
}

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

.cards {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 26px 24px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    border: 1px solid #dbe5f0;
}

.card h3,
.card h2 {
    margin-top: 0;
}

.card .value {
    font-size: 2rem;
    font-weight: 700;
    margin: 12px 0 0;
}

.panel {
    background: #fff;
    border-radius: 16px;
    padding: 26px 24px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    margin-bottom: 24px;
    border: 1px solid #dbe5f0;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.panel-head h3 {
    margin: 0;
}

.panel-action {
    text-decoration: none;
    background: var(--teal-600);
    color: #fff;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.panel-action:hover {
    background: #0c5629;
}

.expense-table-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.expense-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.expense-search-form input {
    min-width: 220px;
}

.table-pagination {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.table-pagination-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pager-link {
    display: inline-block;
    text-decoration: none;
    background: #f1f5f9;
    border: 1px solid #d3dde9;
    border-radius: 8px;
    padding: 8px 12px;
    color: #1f2937;
    font-weight: 600;
}

.pager-link:hover {
    background: #e6edf7;
}

button.pager-link {
    border: 1px solid #d3dde9;
    cursor: pointer;
    background: #0f6632;
    color: #ffffff;
}

button.pager-link:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #0f6632;
    color: #ffffff;
}


button.open-raise-invoice-btn {
    background: #0f6632;
    border-color: #0f6632;
    color: #ffffff;
}

button.open-raise-invoice-btn:hover {
    background: #0c5629;
    border-color: #0c5629;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #dce6f0;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #e7eef6;
    text-align: left;
    font-size: 0.95rem;
}

th {
    background: #0f6632;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.15px;
}

tbody tr:nth-child(even) {
    background: #fbfdff;
}

tbody tr:hover {
    background: #f2f8ff;
}

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

form.inline {
    display: inline-block;
    margin: 0 6px 6px 0;
}

input,
select,
textarea,
button {
    font: inherit;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

form br {
    display: block;
    height: 6px;
    margin: 0;
    content: "";
}

button {
    background: var(--teal-600);
    color: #fff;
    border: none;
    cursor: pointer;
}

button.secondary {
    background: #475569;
}


button.danger {
    background: #b91c1c;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.82rem;
    line-height: 1.15;
    border-radius: 6px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.table-actions form.inline {
    margin: 0;
    display: flex;
}

.icon-action {
    position: relative;
    width: 30px;
    height: 30px;
    min-width: 30px;
    padding: 0;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: #2563eb;
    color: #fff;
}

.icon-action svg {
    width: 15px;
    height: 15px;
    display: block;
}

.icon-edit {
    background: #2563eb;
}

.icon-delete {
    background: #b91c1c !important;
}

.icon-action::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.icon-action:hover::after {
    opacity: 1;
}

#openExpenseModalBtn {
    background: #0f6632;
    color: #fff;
    border: none;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 8px;
}

#openExpenseModalBtn:hover {
    background: #0c5629;
}

#openVendorModalBtn {
    background: #0f6632;
    color: #fff;
    border: none;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 8px;
}

#openVendorModalBtn:hover {
    background: #0c5629;
}

#openVendorAgreementModalBtn {
    background: #0f6632;
    color: #fff;
    border: none;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 8px;
}

#openVendorAgreementModalBtn:hover {
    background: #0c5629;
}

.status {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}

.s-submitted,
.s-pending_project_lead,
.s-open {
    background: #dbeafe;
    color: #1d4ed8;
}

.s-pending_boss,
.s-pending_disbursement,
.s-pending_transfer,
.s-partial,
.s-reserved {
    background: #fef3c7;
    color: #92400e;
}

.s-paid,
.s-sold {
    background: #dcfce7;
    color: #166534;
}

.s-active {
    background: #dcfce7;
    color: #166534;
}

.s-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.s-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.alert {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

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

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.required-star {
    color: #b91c1c;
    font-weight: 700;
}

.muted {
    color: #64748b;
    font-size: 0.9rem;
}

.dashboard-page {
    background:
        radial-gradient(circle at 0% 0%, #dde8f6 0%, transparent 34%),
        radial-gradient(circle at 100% 100%, #d7e8e3 0%, transparent 36%),
        #f4f7fb;
    min-height: 100vh;
}

.dashboard-layout {
    width: 100%;
    margin: 0;
    display: block;
    padding: 0;
}

.sidebar {
    background: linear-gradient(165deg, #0b2f25 0%, #0f4a38 52%, #145b45 100%);
    color: #e7eef9;
    border-radius: 0 16px 16px 0;
    padding: 20px 16px;
    box-shadow: 0 16px 40px rgba(16, 23, 38, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 100vh;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.brand-badge {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.02rem;
    letter-spacing: 0.2px;
    color: #f5f8ff;
}

.brand-subtitle {
    margin: 3px 0 0;
    color: #b6c7df;
    font-size: 0.85rem;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.sidebar-badge {
    margin-left: auto;
    min-width: 26px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-weight: 800;
    font-size: 0.76rem;
    letter-spacing: 0.2px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.14);
}

.sidebar-badge--expenses {
    color: #2a1b00;
    background: linear-gradient(120deg, rgba(254, 240, 138, 0.98), rgba(251, 191, 36, 0.98));
}

.sidebar-badge--vendor {
    color: #042a2b;
    background: linear-gradient(120deg, rgba(165, 243, 252, 0.92), rgba(167, 243, 208, 0.92));
}

.sidebar-badge.is-warn {
    filter: saturate(1.15) contrast(1.05);
}

.sidebar-badge.is-urgent {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    background: linear-gradient(120deg, rgba(239, 68, 68, 0.95), rgba(245, 158, 11, 0.95));
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: #c3d4ec;
    padding: 10px 11px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 600;
}

.sidebar-link:hover {
    background: rgba(206, 226, 250, 0.09);
    color: #fff;
}

.sidebar-link.active {
    background: linear-gradient(120deg, rgba(27, 140, 130, 0.36), rgba(19, 113, 168, 0.34));
    color: #fff;
    border-color: rgba(213, 233, 255, 0.18);
    box-shadow: 0 8px 16px rgba(5, 11, 25, 0.2);
}

.sidebar-dropdown {
    margin-top: 4px;
}

.sidebar-dropdown summary {
    list-style: none;
}

.sidebar-dropdown summary::-webkit-details-marker {
    display: none;
}

.sidebar-dropdown-trigger {
    width: 100%;
    cursor: pointer;
}

.sidebar-caret {
    margin-left: auto;
    display: inline-grid;
    place-items: center;
}

.sidebar-caret svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.sidebar-dropdown[open] .sidebar-caret svg {
    transform: rotate(180deg);
}

.sidebar-subnav {
    display: grid;
    gap: 8px;
    margin-top: 6px;
}

.sidebar-subitem {
    margin-left: 8px;
    transition: margin-left 0.2s ease;
}

.sidebar-dropdown[open] .sidebar-subitem {
    margin-left: 16px;
}

.sidebar-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(236, 245, 255, 0.1);
}

.sidebar-icon svg {
    width: 17px;
    height: 17px;
}

.sidebar-user {
    margin-top: 28px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user-name {
    margin: 0;
    font-weight: 700;
    color: #f5f8ff;
}

.sidebar-user-role {
    margin: 4px 0 12px;
    font-size: 0.86rem;
    color: #cae0ff;
}

.sidebar-secondary-link {
    display: block;
    color: #d7e6ff;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(78, 111, 155, 0.3);
}

.sidebar-secondary-link:hover,
.sidebar-secondary-link.active {
    background: rgba(78, 111, 155, 0.5);
}

.sidebar-logout {
    display: inline-block;
    color: #ffe6e6;
    text-decoration: none;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(181, 59, 59, 0.35);
}

.sidebar-logout:hover {
    background: rgba(181, 59, 59, 0.55);
}

.dashboard-main {
    display: grid;
    gap: 24px;
    align-content: start;
    margin-left: 300px;
    padding: 24px;
    padding-left: 0;
}

.dashboard-content {
    margin-top: 0;
    max-width: 1240px;
    width: 100%;
    margin-left: 0;
    margin-right: auto;
}

.hero-card {
    border-radius: 16px;
    padding: 20px 22px;
    background:
        radial-gradient(circle at 85% 12%, rgba(24, 122, 171, 0.18), transparent 35%),
        linear-gradient(160deg, #ffffff, #eff4fa);
    border: 1px solid #d7e2ef;
    box-shadow: 0 10px 24px rgba(34, 49, 76, 0.08);
}

.hero-card h1 {
    margin: 0;
    font-family: var(--font-heading);
    color: #12213d;
    font-size: 1.9rem;
}

.hero-card p {
    margin: 10px 0 0;
    max-width: 820px;
    color: #3f5573;
}

.hero-subtitle {
    margin: 4px 0 0;
    font-family: var(--font-heading);
    color: #203456;
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 20, 37, 0.55);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 22px 14px;
    overflow-y: auto;
    z-index: 1000;
}

.modal-backdrop.is-open {
    display: flex;
}

.modal-card {
    width: min(720px, 100%);
    background: #fff;
    border-radius: 12px;
    border: 1px solid #d5e0ec;
    box-shadow: 0 20px 44px rgba(10, 20, 36, 0.25);
    padding: 16px;
    max-height: calc(100vh - 44px);
    overflow-y: auto;
    margin: 0 auto;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.modal-head h3 {
    margin: 0;
}

.modal-title-green {
    background: #0f6632;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.2;
}

.modal-close {
    border: 1px solid #d5deea;
    background: #fff;
    color: #243551;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.project-lead-assignments {
    margin-top: 6px;
}

.house-checkboxes {
    margin-top: 8px;
    display: grid;
    gap: 8px;
    max-height: 180px;
    overflow: auto;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #d5e0ec;
    background: #f8fbff;
}

.house-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.92rem;
    color: #243551;
    cursor: pointer;
}

.house-check input {
    margin-top: 2px;
    accent-color: #0f6632;
}

.expense-lines-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.expense-lines {
    margin-top: 12px;
    display: grid;
    gap: 12px;
}

.expense-lines select,
.expense-lines input,
.expense-lines textarea {
    width: 100%;
}

.expense-line {
    position: relative;
    border-radius: 14px;
    border: 1px solid #d5e0ec;
    background: #f8fbff;
    padding: 12px;
}

.expense-line-grid {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 10px;
}

.expense-line textarea {
    min-height: 80px;
    resize: vertical;
}

.expense-line-remove {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(213, 224, 236, 0.9);
    background: #fff;
    color: #243551;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.expense-line-remove:hover {
    background: rgba(181, 59, 59, 0.1);
    border-color: rgba(181, 59, 59, 0.4);
    color: #9c2f2f;
}

@media (max-width: 720px) {
    .expense-lines-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .expense-line-grid {
        grid-template-columns: 1fr;
    }
}

#expenseModalBackdrop .modal-actions button[type="submit"] {
    background: #0f6632;
}

#expenseModalBackdrop .modal-actions button[type="submit"]:hover {
    background: #0c5629;
}

#vendorModalBackdrop .modal-actions button[type="submit"] {
    background: #0f6632;
}

#vendorModalBackdrop .modal-actions button[type="submit"]:hover {
    background: #0c5629;
}

#vendorAgreementModalBackdrop .modal-actions button[type="submit"] {
    background: #0f6632;
}

#vendorAgreementModalBackdrop .modal-actions button[type="submit"]:hover {
    background: #0c5629;
}

#raiseVendorInvoiceModalBackdrop .modal-actions button[type="submit"] {
    background: #0f6632;
}

#raiseVendorInvoiceModalBackdrop .modal-actions button[type="submit"]:hover {
    background: #0c5629;
}

.section-block {
    border-radius: 16px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #d7e1ed;
    margin-bottom: 24px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.section-head h2 {
    margin: 0;
    font-family: var(--font-heading);
    color: var(--ink-900);
    font-size: 1.35rem;
}

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

.metric-grid.three {
    grid-template-columns: repeat(3, minmax(200px, 1fr));
}

.metric-grid.two {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.metric-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 22px 20px;
    background: #fff;
    border: 1px solid #d9e3ef;
    box-shadow: 0 8px 18px rgba(31, 53, 86, 0.08);
}

.dashboard-content .grid.cards + .grid.cards {
    margin-top: 26px !important;
}

.metric-card::before {
    content: "";
    position: absolute;
    right: -20px;
    top: -26px;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    opacity: 0.13;
}

.metric-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.metric-title-row h3 {
    margin: 0;
    font-size: 0.96rem;
    color: var(--ink-700);
}

.metric-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.metric-icon svg {
    width: 19px;
    height: 19px;
}

.metric-value {
    margin: 12px 0 0;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--ink-900);
    letter-spacing: 0.4px;
}

.metric-link-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    cursor: pointer;
}

.metric-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(31, 53, 86, 0.14);
}

.approval-card-btn {
    width: 100%;
    text-align: left;
    font: inherit;
}

.metric-link-card.is-active {
    border-color: #4d6e95;
    box-shadow: 0 0 0 2px rgba(77, 110, 149, 0.18);
}

.metric-footnote {
    margin: 8px 0 0;
    font-size: 0.9rem;
}

.tone-blue::before {
    background: #2f61c4;
}

.tone-blue .metric-icon {
    background: rgba(47, 97, 196, 0.15);
    color: #2657b6;
}

.tone-amber::before {
    background: #b77812;
}

.tone-amber .metric-icon {
    background: rgba(183, 120, 18, 0.16);
    color: #925f0a;
}

.tone-green::before {
    background: #1f8a4c;
}

.tone-green .metric-icon {
    background: rgba(31, 138, 76, 0.16);
    color: #19713f;
}

.tone-red::before {
    background: #b53b3b;
}

.tone-red .metric-icon {
    background: rgba(181, 59, 59, 0.15);
    color: #9c2f2f;
}

.tone-teal::before {
    background: #0e8f86;
}

.tone-teal .metric-icon {
    background: rgba(14, 143, 134, 0.15);
    color: #0b6f68;
}

.admin-user-chart {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.admin-user-bar-row {
    display: grid;
    grid-template-columns: 150px 1fr 40px;
    gap: 10px;
    align-items: center;
}

.admin-user-bar-label {
    font-weight: 700;
    color: var(--ink-700);
    font-size: 0.92rem;
}

.admin-user-bar-track {
    height: 12px;
    border-radius: 999px;
    background: #e3ebf4;
    overflow: hidden;
}

.admin-user-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2f61c4, #0e8f86);
}

.admin-user-bar-fill.role-admin {
    background: linear-gradient(90deg, #334155, #2563eb);
}

.admin-user-bar-fill.role-boss {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.admin-user-bar-fill.role-accountant {
    background: linear-gradient(90deg, #14b8a6, #22c55e);
}

.admin-user-bar-fill.role-project_lead {
    background: linear-gradient(90deg, #a855f7, #ec4899);
}

.admin-user-bar-fill.role-worker {
    background: linear-gradient(90deg, #22c55e, #84cc16);
}

.admin-user-bar-value {
    text-align: right;
    font-weight: 700;
    color: var(--ink-700);
}

@media (max-width: 1150px) {
    .sidebar {
        width: 260px;
    }

    .dashboard-main {
        margin-left: 260px;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
    }

    .metric-grid.three {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
    }

    .metric-grid.two {
        grid-template-columns: repeat(2, minmax(170px, 1fr));
    }

    .cards {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 860px) {
    .dashboard-layout {
        padding: 10px;
    }

    .sidebar {
        min-height: auto;
        position: static;
        width: auto;
        border-radius: 16px;
    }

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

    .dashboard-main {
        margin-left: 0;
        padding: 10px 0;
    }

    .hero-card h1 {
        font-size: 1.45rem;
    }

    .container {
        margin: 0;
        padding: 0 10px;
    }

    .panel {
        padding: 18px;
        margin-bottom: 16px;
    }

    .card {
        padding: 18px;
    }

    .card .value {
        font-size: 1.65rem;
    }

    .panel form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .panel form input,
    .panel form select,
    .panel form textarea,
    .panel form button {
        width: 100%;
        margin-left: 0 !important;
    }

    .panel table {
        min-width: 760px;
    }

    .panel {
        overflow-x: auto;
    }
}

@media (max-width: 640px) {
    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .expense-search-form {
        width: 100%;
    }

    .expense-search-form input,
    .expense-search-form button {
        width: 100%;
    }

    .expense-table-tools {
        width: 100%;
        justify-content: stretch;
    }

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

    .metric-grid,
    .metric-grid.three,
    .metric-grid.two {
        grid-template-columns: 1fr;
    }

    .admin-user-bar-row {
        grid-template-columns: 110px 1fr 34px;
    }

    th,
    td {
        padding: 8px;
        font-size: 0.88rem;
    }
}

@media (max-width: 720px) {
    .panel table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .panel table form {
        display: grid;
        gap: 6px;
    }

    .panel table input,
    .panel table select,
    .panel table button {
        width: 100%;
    }

    .panel-head {
        flex-wrap: wrap;
    }
}

.login-page {
    min-height: 100vh;
    margin: 0;
    background: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.login-shell {
    width: min(1120px, 100%);
    min-height: min(680px, calc(100vh - 44px));
    border-radius: 28px;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(300px, 1.05fr) minmax(320px, 1fr);
    box-shadow: 0 18px 40px rgba(17, 30, 24, 0.18);
    background: #ffffff;
}

.login-card {
    background: #f4f4f4;
    padding: 52px 44px;
    display: grid;
    align-content: center;
}

.login-visual {
    position: relative;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: #114F28;
    color: #fff;
}

.login-visual h1 {
    margin: 0;
    max-width: 320px;
    font-size: clamp(1.9rem, 2.2vw, 2.4rem);
    line-height: 1.05;
    letter-spacing: 0.6px;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.login-slogan {
    margin: -4px 0 0;
    max-width: 280px;
    font-size: 1.35rem;
    line-height: 1.1;
    font-weight: 700;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
}

.login-visual-image {
    width: 100%;
    height: calc(100% - 128px);
    min-height: 360px;
    object-fit: cover;
    object-position: center;
    border-radius: 14px;
    display: block;
    box-shadow: 0 14px 26px rgba(4, 16, 12, 0.28);
}

.login-main {
    width: min(420px, 100%);
    margin: 0 auto;
}

.login-logo {
    width: 130px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.login-main h2 {
    margin: 14px 0 22px;
    text-align: center;
    font-size: 2.35rem;
    color: #062d25;
    font-family: var(--font-heading);
}

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

.login-form label {
    font-weight: 500;
    color: #2e3a39;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
}

.login-form input {
    width: 100%;
    height: 44px;
    border-radius: 8px;
    border: 1px solid #b8c4bf;
    padding: 10px 12px;
    background: #fff;
    color: #152726;
}

.password-field {
    position: relative;
    width: 100%;
}

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

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: rgba(15, 102, 50, 0.08);
    color: #0f6632;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.password-toggle:hover {
    background: rgba(15, 102, 50, 0.14);
    transform: translateY(-50%) scale(1.02);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.password-toggle .icon-hide {
    display: none;
}

.password-toggle[aria-pressed="true"] .icon-show {
    display: none;
}

.password-toggle[aria-pressed="true"] .icon-hide {
    display: block;
}

.login-form input::placeholder {
    color: #87938f;
}

.login-meta {
    margin: 3px 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.remember-control {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    color: #43504d;
    cursor: pointer;
}

.remember-control input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #0f6632;
}

.forgot-link {
    font-size: 0.82rem;
    color: #455f58;
    text-decoration: none;
}

.forgot-link:hover {
    color: #22473a;
    text-decoration: underline;
}

.login-submit {
    margin-top: 2px;
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 8px;
    background: #0f6632;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
}

.login-submit:hover {
    background: #0c5629;
}

@media (max-width: 860px) {
    .login-page {
        padding: 14px;
    }

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

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

    .login-visual h1 {
        max-width: 300px;
        font-size: 2rem;
    }

    .login-slogan {
        max-width: 260px;
        font-size: 1.2rem;
    }

    .login-visual-image {
        height: 240px;
        min-height: 0;
    }

    .login-card {
        padding: 30px 20px;
    }

    .login-main {
        width: 100%;
    }

    .login-main h2 {
        font-size: 2rem;
    }
}
