:root {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    color: #20352a;
    background: #f2f6f3;
}

.site-dropdown {
    position: relative;
    width: 100%;
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.stock-request-table [data-selected-stock] {
    display: block;
    margin-top: 7px;
    color: #1d6b48;
    font-weight: 800;
}

@media (max-width: 760px) {
    .stock-request-table {
        display: block;
        border: 0;
        background: transparent;
    }

    .stock-request-table thead {
        display: none;
    }

    .stock-request-table tbody,
    .stock-request-table tr,
    .stock-request-table td {
        display: block;
        width: 100%;
    }

    .stock-request-table tbody {
        display: grid;
        gap: 12px;
    }

    .stock-request-table tr {
        padding: 14px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
    }

    .stock-request-table td {
        min-width: 0;
        padding: 7px 0;
        border: 0;
    }

    .stock-request-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 6px;
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 800;
    }

    .stock-request-table [data-selected-stock] {
        min-height: 20px;
    }

    .stock-request-table td:last-child .button {
        width: 100%;
    }

    .branch-inventory-table {
        display: block;
        border: 0;
        background: transparent;
    }

    .branch-inventory-table thead {
        display: none;
    }

    .branch-inventory-table tbody,
    .branch-inventory-table tr,
    .branch-inventory-table td {
        display: block;
        width: 100%;
    }

    .branch-inventory-table tbody {
        display: grid;
        gap: 10px;
    }

    .branch-inventory-table tr {
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
    }

    .branch-inventory-table td {
        min-width: 0;
        padding: 5px 0;
        border: 0;
        overflow-wrap: anywhere;
    }

    .branch-inventory-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 3px;
        color: var(--text-muted);
        font-size: 10px;
        font-weight: 800;
    }

    .branch-data-card .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .branch-data-card .tile {
        min-width: 0;
        padding: 12px;
    }

    .branch-data-card .actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .branch-data-card .actions .button {
        width: 100%;
        text-align: center;
    }
}

.site-dropdown-search {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
}

.site-dropdown-filter {
    width: calc(100% - 16px);
    min-height: 40px;
    margin: 8px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 8px 10px;
}

.site-dropdown-options {
    height: min(360px, calc(100vh - 180px));
    max-height: 360px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

.site-dropdown-options::-webkit-scrollbar {
    width: 8px;
}

.site-dropdown-options::-webkit-scrollbar-track {
    background: var(--surface-muted);
}

.site-dropdown-options::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: #9bb1a5;
}

.site-dropdown-empty {
    min-height: 40px;
    padding: 10px 12px;
    color: var(--text-muted);
}

.site-dropdown-panel {
    position: fixed;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-height: min(440px, calc(100vh - 120px));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

@media (max-width: 700px) {
    .site-dropdown-options {
        height: min(300px, calc(100vh - 180px));
        max-height: 300px;
    }
    .site-dropdown-panel {
        max-height: min(380px, calc(100vh - 140px));
    }
}

.site-dropdown-option {
    display: block;
    width: 100%;
    min-height: 40px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 9px 12px;
    cursor: pointer;
}

.site-dropdown-option:hover,
.site-dropdown-option:focus-visible {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
}

a {
    color: inherit;
}

.portal-shell {
    min-height: 100vh;
}

.topbar {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px clamp(16px, 4vw, 48px);
    background: #153e2c;
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 38px;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 8px;
    background: #d7f0df;
    color: #176b43;
    font-size: 20px;
    font-weight: 800;
}

.brand small {
    display: block;
    margin-top: 3px;
    color: #b8d7c2;
    font-size: 9px;
    font-weight: 700;
}

.top-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.top-actions small {
    color: #c5ddcd;
}

.top-actions form {
    margin: 0;
}

.logout-button {
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.logout-button:hover {
    text-decoration: underline;
}

.main {
    width: min(1320px, 100%);
    margin: 0 auto;
    padding: 30px clamp(16px, 4vw, 48px) 50px;
}

.eyebrow {
    margin: 0;
    color: #688273;
    font-size: 10px;
    font-weight: 800;
}

.page-heading,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-heading {
    margin-bottom: 28px;
}

h1 {
    margin: 6px 0 0;
    font-size: 28px;
}

h2 {
    margin: 0;
    font-size: 18px;
}

h3 {
    margin: 0;
    font-size: 16px;
}

.section {
    margin-top: 26px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 14px;
    margin-top: 14px;
}

.tile,
.panel,
.announcement {
    min-width: 0;
    border: 1px solid #d9e4dc;
    border-radius: 8px;
    background: #fff;
}

.tile {
    display: flex;
    min-height: 210px;
    flex-direction: column;
    padding: 18px;
    border-top: 3px solid #16794b;
}

.tile.locked {
    border-top-color: #b5c3b9;
}

.tile-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.tile p,
.muted {
    color: #68766d;
    font-size: 12px;
    line-height: 1.55;
}

.tile-link {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    color: #176b43;
    font-weight: 700;
    text-decoration: none;
}

.tile-link:hover {
    text-decoration: underline;
}

.status {
    color: #587261;
    font-size: 11px;
    font-weight: 700;
}

.panel {
    margin-bottom: 16px;
    padding: 18px;
}

.panel h2 {
    margin-bottom: 14px;
}

.announcements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 14px;
    margin-top: 14px;
}

.announcement {
    overflow: hidden;
}

.announcement img {
    display: block;
    width: 100%;
    max-height: 260px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #e7eee8;
}

.announcement-copy {
    padding: 15px;
}

.announcement-copy time {
    color: #688273;
    font-size: 11px;
}

.announcement-copy h3 {
    margin: 7px 0;
}

.announcement-body {
    color: #455f50;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.button {
    display: inline-flex;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 0;
    border-radius: 7px;
    background: #16794b;
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: #105c38;
}

.button.secondary {
    border: 1px solid #d1e2d5;
    background: #edf5ef;
    color: #22583b;
}

.button.danger {
    background: #a93030;
}

.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 12px;
}

.field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.field[hidden] {
    display: none !important;
}

[data-ownership-field][hidden] {
    display: none !important;
}

.field label {
    color: #455f50;
    font-size: 12px;
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid #cddbd1;
    border-radius: 7px;
    background: #fff;
    font: inherit;
}

.field textarea {
    min-height: 160px;
    resize: vertical;
}

.alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 7px;
}

.alert.error {
    border: 1px solid #efc3c0;
    background: #fff0ef;
    color: #842b24;
}

.alert.success {
    border: 1px solid #b9dfc5;
    background: #effaf2;
    color: #205a34;
}

.alert.success.branch-save-success {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 18px;
    border-left: 5px solid #258354;
    border-radius: 12px;
    background: linear-gradient(110deg, #effaf2, #f8fdf9);
    box-shadow: 0 6px 20px rgba(20, 65, 41, .1);
}

.branch-save-success-icon {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    background: #d8f1df;
    color: #17643c;
    font-weight: 800;
}

.branch-save-success-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.branch-save-success-copy strong { font-size: 14px; }
.branch-save-success-copy span { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }

.alert.warning {
    border: 1px solid #ecd89c;
    background: #fff9e8;
    color: #684f0b;
}

.table-wrap {
    max-width: 100%;
    overflow: auto;
    border: 1px solid #d5e1d8;
    border-radius: 7px;
    background: #fff;
}

table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

th,
td {
    padding: 10px 9px;
    border-bottom: 1px solid #dce6df;
    text-align: left;
    vertical-align: middle;
}

thead th {
    background: #edf4ef;
    color: #526b5b;
    font-size: 10px;
    text-transform: uppercase;
}

td {
    font-size: 12px;
}

.check-list {
    display: grid;
    gap: 8px;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dce6df;
    border-radius: 7px;
    cursor: pointer;
}

.check-row input {
    margin-top: 2px;
    accent-color: #16794b;
}

.check-row span {
    display: grid;
    gap: 4px;
}

.check-row small {
    color: #68766d;
}

.branch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    list-style: none;
}

.branch-list li {
    padding: 8px 11px;
    border: 1px solid #d5e2d8;
    border-radius: 6px;
    background: #fff;
    color: #355643;
    font-size: 12px;
}

.announcement-existing-file {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
}

.announcement-existing-file img {
    width: min(240px, 100%);
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
}

.announcement-existing-file label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 12px;
}

.announcement-existing-file a {
    overflow-wrap: anywhere;
    color: var(--brand);
    font-weight: 700;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
    background: #edf3ee;
}

.login-card {
    width: min(440px, 100%);
    padding: 28px;
    border: 1px solid #dfe9e2;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(20, 65, 41, .09);
}

.login-card h1 {
    margin: 7px 0 20px;
}

.login-card .field+.field {
    margin-top: 12px;
}

@media (max-width: 700px) {
    .topbar {
        align-items: flex-start;
        padding: 12px 14px;
    }

    .top-actions {
        max-width: 52%;
        justify-content: flex-end;
    }

    .main {
        padding: 22px 14px 36px;
    }

    h1 {
        font-size: 23px;
    }
}

:root {
    color-scheme: light;
    --page-background: #f3f6fb;
    --surface: #ffffff;
    --surface-muted: #f7f9fc;
    --text: #17243b;
    --text-muted: #66748a;
    --border: #dfe6f0;
    --brand: #176b58;
    --brand-strong: #105341;
    --brand-soft: #e7f3ef;
    --accent: #d99a2b;
    --shadow: 0 16px 38px rgba(27, 45, 70, .07);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --page-background: #0c1421;
    --surface: #151f2e;
    --surface-muted: #1b2839;
    --text: #edf3fa;
    --text-muted: #a4b2c4;
    --border: #2c3b4e;
    --brand: #54c6a0;
    --brand-strong: #2da47e;
    --brand-soft: #1d3b37;
    --accent: #f1bd61;
    --shadow: 0 16px 38px rgba(0, 0, 0, .22);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    background: var(--page-background);
    color: var(--text);
    transition: background-color .2s ease, color .2s ease;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    min-height: 70px;
    background: #12392f;
    box-shadow: 0 5px 20px rgba(13, 37, 31, .12);
}

.branch-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 252px minmax(0, 1fr);
}

.branch-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    gap: 20px;
    padding: 22px 14px;
    overflow-y: auto;
    background: #12392f;
    color: #e6f4ed;
}

.branch-sidebar .brand {
    padding: 0 7px;
}

.branch-sidebar-label {
    padding: 10px 11px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 9px;
    background: rgba(255, 255, 255, .06);
    color: #b8d7c2;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
}

.branch-side-nav {
    display: grid;
    align-content: start;
    gap: 18px;
}

.branch-nav-group {
    display: grid;
    gap: 4px;
}

.branch-nav-group h2 {
    margin: 0 10px 4px;
    color: #91b9a2;
    font-size: 9px;
    letter-spacing: .1em;
}

.branch-nav-group a,
.branch-nav-disabled {
    display: flex;
    min-height: 39px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #e6f4ed;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}

.branch-nav-group a:hover,
.branch-nav-group a:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, .12);
}

.branch-nav-group a span,
.branch-nav-disabled span {
    width: 18px;
    text-align: center;
}

.branch-nav-disabled {
    flex-wrap: wrap;
    color: #9ab6a5;
    cursor: help;
}

.branch-nav-disabled small {
    width: 100%;
    padding-left: 28px;
    color: #91b9a2;
    font-size: 9px;
    font-weight: 450;
    line-height: 1.4;
}

.branch-main-shell {
    min-width: 0;
}

.branch-main select,
.branch-main .field select,
.branch-main [data-request-lines] select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    overflow: visible;
}

.branch-topbar {
    position: sticky;
    z-index: 15;
    top: 0;
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px clamp(18px, 3vw, 40px);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 5px 20px rgba(13, 37, 31, .07);
}

.branch-topbar > div:first-child {
    display: grid;
    gap: 3px;
}

.branch-topbar-label {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .1em;
}

.branch-topbar strong {
    font-size: 14px;
}

.branch-top-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 12px;
}

.branch-top-actions form {
    margin: 0;
}

.branch-top-actions .logout-button {
    color: var(--text);
}

.branch-top-actions .theme-toggle {
    border-color: var(--border);
    color: var(--text);
}

.main.branch-main {
    width: min(1500px, 100%);
    padding: 28px clamp(18px, 3vw, 40px) 50px;
}

.restaurant-workspace-toolbar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    background: var(--page-background);
}

.restaurant-workspace-toolbar .theme-toggle {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.restaurant-workspace-toolbar .theme-toggle:hover {
    border-color: var(--brand);
    background: var(--surface-muted);
}

.branch-main .page-heading {
    scroll-margin-top: 90px;
}

.branch-main .branch-overview-cards,
.branch-main .section .grid {
    gap: 8px;
}

.branch-main .branch-overview-cards .tile,
.branch-main .section .grid > .tile {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-content: center;
    align-items: center;
    column-gap: 9px;
    row-gap: 2px;
    min-height: 0;
    padding: 8px 11px;
    border-top-width: 3px;
}

.branch-main .branch-overview-cards .tile .status,
.branch-main .section .grid > .tile .status {
    grid-column: 1;
    grid-row: 1;
    font-size: 9px;
}

.branch-main .branch-overview-cards .tile h3,
.branch-main .section .grid > .tile h3 {
    grid-column: 2;
    grid-row: 1;
    font-size: 12px;
}

.branch-main .branch-overview-cards .tile p,
.branch-main .section .grid > .tile p {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 10px;
    line-height: 1.25;
}

.portal-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.portal-nav a,
.theme-toggle {
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #e6f4ed;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

.portal-nav a:hover,
.theme-toggle:hover {
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .1);
}

.main {
    width: min(1440px, 100%);
}

.page-heading {
    position: relative;
    overflow: hidden;
    min-height: 168px;
    align-items: center;
    padding: clamp(22px, 4vw, 42px);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    background:
        radial-gradient(circle at 85% 15%, rgba(245, 196, 103, .23), transparent 25%),
        linear-gradient(120deg, #12392f, #206c59 70%, #34866d);
    color: #fff;
    box-shadow: var(--shadow);
}

.page-heading .eyebrow {
    color: #c8e9dc;
}

.page-heading h1 {
    font-size: clamp(25px, 3.4vw, 36px);
    letter-spacing: -.035em;
}

.page-heading .muted {
    margin-bottom: 0;
    color: #d8e9e3;
}

.dashboard-date {
    display: grid;
    gap: 5px;
    min-width: 125px;
    padding: 13px 16px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(8px);
}

.dashboard-date span {
    color: #c8e9dc;
    font-size: 11px;
}

.dashboard-date strong {
    font-size: 18px;
}

.dashboard-nav {
    position: relative;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: -13px 12px 25px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.dashboard-nav a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-nav a:hover {
    background: var(--brand-soft);
    color: var(--brand);
}

.dashboard-nav .nav-count {
    display: inline-grid;
    min-width: 20px;
    min-height: 20px;
    place-items: center;
    border-radius: 99px;
    background: var(--surface-muted);
    color: var(--text);
    font-size: 10px;
}

.dashboard-nav .nav-emoji,
.section-icon {
    display: inline-block;
    margin-right: 5px;
    font-size: 1.05em;
    vertical-align: -1px;
}

.dashboard-nav .nav-emoji {
    margin-right: 0;
}

.executive-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    align-items: start;
    gap: 22px;
}

.executive-sidebar {
    position: sticky;
    top: 20px;
    display: grid;
    gap: 12px;
    padding: 18px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.executive-sidebar-eyebrow {
    margin: 0;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
}

.executive-sidebar > strong {
    font-size: 13px;
}

.executive-sidebar nav {
    display: grid;
    gap: 4px;
}

.executive-sidebar nav a,
.executive-sidebar-home {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.executive-sidebar nav a:hover,
.executive-sidebar-home:hover {
    background: var(--brand-soft);
    color: var(--brand);
}

.executive-sidebar-home {
    border-top: 1px solid var(--border);
    border-radius: 0;
}

.executive-dashboard-content {
    min-width: 0;
}

.executive-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 14px;
}

.executive-stat {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.executive-stat-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    background: var(--brand-soft);
    font-size: 20px;
}

.executive-stat small,
.executive-stat strong {
    display: block;
}

.executive-stat small {
    color: var(--text-muted);
    font-size: 12px;
}

.executive-stat strong {
    margin-top: 4px;
    font-size: 22px;
}

.executive-announcements {
    display: grid;
    gap: 10px;
}

.executive-data-note {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.section {
    margin-top: 32px;
    scroll-margin-top: 100px;
}

.section-heading {
    margin-bottom: 14px;
}

.section-heading .eyebrow {
    margin-bottom: 5px;
}

.tile,
.panel,
.announcement,
.branch-card,
.empty-state {
    border-color: var(--border);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(27, 45, 70, .035);
}

.tile {
    min-height: 190px;
    padding: 20px;
    border-top-width: 4px;
    border-top-color: var(--brand);
    transition: transform .18s ease, box-shadow .18s ease;
}

.tile:hover,
.branch-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tile.locked {
    border-top-color: #9aa8b8;
}

.tile p,
.muted {
    color: var(--text-muted);
}

.tile-link {
    color: var(--brand);
}

.status {
    color: var(--text-muted);
}

.module-badge,
.branch-card-icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 13px;
    font-weight: 800;
}

.module-infrastructure {
    background: #edf1ff;
    color: #5064b4;
}

.module-inventory {
    background: #fff4df;
    color: #9d6c13;
}

.module-restaurant {
    background: #fff0ed;
    color: #ba5941;
}

.workspace-description {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.55;
}

.module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.module-card {
    --module-accent: var(--brand);
    --module-glow: rgba(84, 198, 160, .11);
    position: relative;
    min-height: 204px;
    overflow: hidden;
    padding: 18px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--module-accent);
    border-radius: 14px;
    background: radial-gradient(circle at 100% 0%, var(--module-glow), transparent 38%), var(--surface);
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.module-card:hover {
    transform: translateY(-4px);
    border-color: var(--module-accent);
    box-shadow: 0 18px 38px rgba(27, 45, 70, .12);
}

.module-card-hr { --module-accent: #6074d5; --module-glow: rgba(96, 116, 213, .13); }
.module-card-infrastructure { --module-accent: #6574bd; --module-glow: rgba(101, 116, 189, .13); }
.module-card-inventory { --module-accent: #c38b2c; --module-glow: rgba(195, 139, 44, .14); }
.module-card-restaurant { --module-accent: #c26b54; --module-glow: rgba(194, 107, 84, .13); }
.module-card-finance { --module-accent: #25866d; --module-glow: rgba(37, 134, 109, .13); }
.module-card-production { --module-accent: #708095; --module-glow: rgba(112, 128, 149, .13); }

.module-card .module-card-top {
    align-items: flex-start;
}

.module-card .module-badge {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    font-size: 20px;
}

.module-card .status {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 10px;
    white-space: nowrap;
}

.module-card .status::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.module-card .status-available {
    background: #e7f5ec;
    color: #16794b;
}

.module-card .status-link-required,
.module-card .status-restricted {
    background: #fff2df;
    color: #8c5c10;
}

.module-card .status-upcoming {
    background: var(--surface-muted);
    color: var(--text-muted);
}

.module-card-copy h3 {
    margin: 14px 0 6px;
    font-size: 17px;
    letter-spacing: -.02em;
}

.module-card-copy p {
    max-width: 46ch;
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
}

.module-card .tile-link {
    min-height: 38px;
    align-items: center;
    margin-top: 14px;
    padding-top: 9px;
    border-top: 1px solid var(--border);
    color: var(--module-accent);
    font-size: 12px;
    text-decoration: none;
}

.module-card a.tile-link:hover {
    text-decoration: none;
}

.module-card a.tile-link span {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: var(--module-glow);
    font-size: 17px;
    transition: transform .18s ease;
}

.module-card a.tile-link:hover span {
    transform: translateX(3px);
}

.module-card a.tile-link:focus-visible {
    border-radius: 6px;
    outline: 3px solid rgba(83, 198, 160, .42);
    outline-offset: 3px;
}

.module-card.locked {
    border-left-color: #9aa8b8;
}

.module-card.locked:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.module-card .tile-link.muted {
    color: var(--text-muted);
    cursor: default;
}

html[data-theme="dark"] .module-card .status-available {
    background: #203b30;
    color: #85ddb6;
}

html[data-theme="dark"] .module-card .status-link-required,
html[data-theme="dark"] .module-card .status-restricted {
    background: #403522;
    color: #f0c879;
}

html[data-theme="dark"] .module-hr {
    background: #293452;
    color: #aab9ff;
}

.section .tile-top {
    align-items: center;
}

.announcements {
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 18px;
}

.announcement {
    overflow: hidden;
    box-shadow: var(--shadow);
}

.announcement img {
    max-height: 230px;
}

.announcement-copy {
    padding: 19px;
}

.announcement-copy time,
.announcement-expiry {
    color: var(--text-muted);
    font-size: 11px;
}

.announcement-copy h3 {
    margin: 9px 0;
    font-size: 18px;
    line-height: 1.35;
}

.announcement-body {
    color: var(--text-muted);
    line-height: 1.7;
}

.announcement-expiry {
    margin: 12px 0 0;
}

.announcement.is-unread {
    border: 1px solid rgba(220, 38, 38, .62);
    border-left: 5px solid #dc2626;
    background: linear-gradient(135deg, rgba(220, 38, 38, .09), transparent 58%), var(--surface);
}

.announcement-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.announcement-unread-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 10px;
    font-weight: 700;
}

.announcement-read-form {
    margin-top: 14px;
}

.announcement-read-form .announcement-read-button {
    background: #b91c1c;
    color: #fff;
}

.announcement-read-form .announcement-read-button:hover {
    background: #991b1b;
}

.announcement-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 15px;
}

.announcement-group-title span,
.announcement-archive summary span {
    display: inline-flex;
    min-width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-muted);
    font-size: 11px;
}

.announcement-group + .announcement-archive {
    margin-top: 20px;
}

.announcement-archive {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.announcement-archive summary {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.announcement-archive summary::-webkit-details-marker {
    display: none;
}

.announcement-archive summary::after {
    margin-left: 10px;
    color: var(--text-muted);
    content: "+";
    font-size: 18px;
}

.announcement-archive[open] summary::after {
    content: "−";
}

.announcement-archive[open] summary {
    border-bottom: 1px solid var(--border);
}

.announcement-archive > .announcements,
.announcement-archive > .muted {
    margin: 14px;
}

.announcement.is-read {
    border: 1px solid var(--border);
    background: var(--surface);
}

.announcement-read-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
}

.announcement-read-form .announcement-restore-button {
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text);
}

.announcement-read-form .announcement-restore-button:hover {
    background: var(--border);
}

.announcement-read-error {
    padding: 10px 12px;
    border: 1px solid #fca5a5;
    border-radius: 9px;
    background: #fef2f2;
    color: #991b1b;
}

.announcement-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

html[data-theme="dark"] .announcement.is-unread {
    border-color: rgba(248, 113, 113, .58);
    border-left-color: #f87171;
    background: linear-gradient(135deg, rgba(220, 38, 38, .17), transparent 58%), var(--surface);
}

html[data-theme="dark"] .announcement-unread-badge {
    background: #4a2228;
    color: #fca5a5;
}

html[data-theme="dark"] .announcement-read-error {
    border-color: #7f1d1d;
    background: #3a1c22;
    color: #fecaca;
}

.button {
    border-radius: 9px;
    background: var(--brand);
    transition: background-color .15s ease, transform .15s ease;
}

.button:hover {
    background: var(--brand-strong);
}

.button.secondary {
    border-color: var(--border);
    background: var(--brand-soft);
    color: var(--brand);
}

.actions {
    gap: 9px;
}

.field label {
    color: var(--text);
}

.field input,
.field select,
.field textarea {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.button:focus-visible,
.portal-nav a:focus-visible,
.theme-toggle:focus-visible,
.dashboard-nav a:focus-visible {
    outline: 3px solid rgba(83, 198, 160, .42);
    outline-offset: 2px;
}

.table-wrap {
    border-color: var(--border);
    background: var(--surface);
}

th,
td {
    border-bottom-color: var(--border);
}

thead th {
    background: var(--surface-muted);
    color: var(--text-muted);
}

.branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 14px;
}

.branch-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--border);
    transition: transform .18s ease, box-shadow .18s ease;
}

.branch-card h3 {
    margin-top: 1px;
}

.branch-card p {
    margin: 7px 0 0;
}

.branch-card .tile-link {
    grid-column: 2;
}

.empty-state {
    padding: 23px;
    border: 1px dashed var(--border);
    color: var(--text);
}

.empty-state p {
    margin-bottom: 0;
    color: var(--text-muted);
}

.about-section {
    padding: 23px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.about-grid > div {
    padding: 18px;
    border-radius: 11px;
    background: var(--surface-muted);
}

.about-grid p {
    margin-bottom: 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.branch-list li {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

html[data-theme="dark"] .topbar {
    background: #101b25;
}

html[data-theme="dark"] .brand-mark {
    background: #254a40;
    color: #71d5ae;
}

html[data-theme="dark"] .page-heading {
    background:
        radial-gradient(circle at 85% 15%, rgba(245, 196, 103, .14), transparent 25%),
        linear-gradient(120deg, #142a29, #194c42 70%, #216451);
}

html[data-theme="dark"] .module-infrastructure {
    background: #293452;
    color: #aab9ff;
}

html[data-theme="dark"] .module-inventory {
    background: #453b2b;
    color: #f2c774;
}

html[data-theme="dark"] .module-restaurant {
    background: #482f31;
    color: #ffaaa0;
}

html[data-theme="dark"] .button.secondary {
    background: var(--brand-soft);
    color: var(--brand);
}

html[data-theme="dark"] .alert.error {
    border-color: #713e43;
    background: #3a252a;
    color: #ffc2c2;
}

html[data-theme="dark"] .alert.success {
    border-color: #315d49;
    background: #1b342a;
    color: #b6efc8;
}

html[data-theme="dark"] .alert.success.branch-save-success {
    border-left-color: #55a878;
    background: linear-gradient(110deg, #1b342a, #1e3b2e);
}

html[data-theme="dark"] .branch-save-success-icon {
    background: #244b34;
    color: #b6efc8;
}

html[data-theme="dark"] .alert.warning {
    border-color: #705c32;
    background: #393322;
    color: #f5df9e;
}

@media (max-width: 760px) {
    .branch-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .branch-sidebar {
        position: relative;
        height: auto;
        gap: 12px;
        padding: 14px 16px;
    }

    .branch-sidebar .brand {
        padding: 0;
    }

    .branch-side-nav {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .branch-nav-group {
        min-width: max-content;
        grid-auto-flow: column;
        align-items: center;
    }

    .branch-nav-group h2 {
        margin: 0 6px;
    }

    .branch-nav-group a,
    .branch-nav-disabled {
        min-height: 36px;
        white-space: nowrap;
    }

    .branch-nav-disabled small {
        display: none;
    }

    .branch-topbar {
        position: relative;
        flex-wrap: wrap;
        padding-inline: 16px;
    }

    .branch-top-actions {
        width: 100%;
        justify-content: space-between;
    }

    .main.branch-main {
        padding: 20px 16px 38px;
    }

    .topbar {
        position: relative;
        flex-wrap: wrap;
        align-items: center;
    }

    .portal-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        border-top: 1px solid rgba(255, 255, 255, .14);
        padding-top: 7px;
    }

    .top-actions {
        max-width: none;
    }

    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-nav {
        margin: 14px 0 22px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .executive-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .executive-sidebar {
        position: relative;
        top: auto;
    }

    .executive-sidebar nav {
        display: flex;
        gap: 5px;
        overflow-x: auto;
    }

    .executive-sidebar nav a {
        flex: 0 0 auto;
    }

    .module-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .module-card {
        min-height: 0;
        padding: 18px;
    }

    .module-card-copy h3 {
        margin-top: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

.login-page {
    position: relative;
    isolation: isolate;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    padding:
        max(20px, env(safe-area-inset-top))
        max(12px, env(safe-area-inset-right))
        max(20px, env(safe-area-inset-bottom))
        max(12px, env(safe-area-inset-left));
    background:
        radial-gradient(ellipse at 10% 12%, rgba(176, 230, 190, .8), transparent 38%),
        linear-gradient(135deg, #e8f4eb, #d6e9dc 55%, #c5dfce);
}

.login-page::before {
    position: fixed;
    z-index: 0;
    inset: -24px;
    background: url("images/igisubizo-brand-logo.png") center / min(78vmin, 520px) auto repeat;
    content: "";
    opacity: .34;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    max-width: 100%;
    max-height: none;
    margin: 0 auto;
    padding: clamp(24px, 6vw, 36px);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 20px;
    background: rgba(255, 255, 255, .66);
    box-shadow: 0 24px 70px rgba(20, 65, 41, .18);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-logo {
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
    object-fit: contain;
}

.login-brand .eyebrow {
    margin: 0;
    color: #176b43;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .1em;
}

.brand-motto {
    margin: 5px 0 0;
    color: #557362;
    font-size: 12px;
    font-weight: 600;
}

.login-portal-label {
    margin: 24px 0 0;
    color: #668271;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
}

.login-card h1 {
    margin: 6px 0 20px;
    color: #183e2b;
}

.access-expired-notice {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    margin: 0 0 18px;
    padding: 15px;
    border: 1px solid #c5dfce;
    border-radius: 14px;
    background: linear-gradient(140deg, #f3fbf5, #e8f4eb);
    box-shadow: 0 8px 22px rgba(20, 65, 41, .08);
}

.access-expired-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: #d7f0df;
    color: #176b43;
    font-size: 26px;
    font-weight: 800;
}

.access-expired-notice .eyebrow {
    margin: 0 0 3px;
    color: #328052;
}

.access-expired-notice h2 {
    margin: 0 0 6px;
    color: #183e2b;
    font-size: 17px;
}

.access-expired-notice p {
    margin: 0;
    color: #385a45;
    font-size: 12px;
    line-height: 1.55;
}

.access-expired-notice .access-expired-hint {
    margin-top: 8px;
    color: #607966;
    font-size: 11px;
}

.login-first-access {
    margin: 18px 0 0;
    color: #607966;
    font-size: 12px;
    text-align: center;
}

.login-first-access a {
    color: #176b43;
    font-weight: 800;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.login-home-link {
    display: block;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #dfe9e2;
    color: #176b43;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.login-home-link:hover {
    color: #105535;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.infrastructure-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.infrastructure-kpi {
    display: grid;
    gap: 8px;
    align-content: space-between;
    min-height: 98px;
    margin: 0;
}

.infrastructure-kpi span,
.infrastructure-chart-row > span,
.infrastructure-ownership-list span {
    color: var(--muted, #607966);
    font-size: 12px;
}

.infrastructure-kpi strong {
    color: #176b43;
    font-size: 28px;
    line-height: 1;
}

.infrastructure-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: 16px;
    margin: 16px 0;
}

.infrastructure-chart {
    min-width: 0;
}

.infrastructure-chart-row {
    display: grid;
    grid-template-columns: minmax(110px, 1.15fr) minmax(70px, 2fr) 34px;
    gap: 10px;
    align-items: center;
    margin: 12px 0;
}

.infrastructure-chart-row > span {
    overflow-wrap: anywhere;
}

.infrastructure-chart-row > strong {
    text-align: right;
    font-size: 13px;
}

.infrastructure-chart-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(73, 117, 91, .15);
}

.infrastructure-chart-track > span {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #176b43, #58a979);
}

.infrastructure-ownership-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.infrastructure-ownership-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(73, 117, 91, .18);
    border-radius: 12px;
}

.infrastructure-ownership-list strong {
    font-size: 18px;
}

.infrastructure-category-manager {
    margin-top: 16px;
}

.infrastructure-category-manager > summary {
    cursor: pointer;
    color: #176b43;
}

.infrastructure-category-manager[open] > summary {
    margin-bottom: 12px;
}

.infrastructure-category-manager .table-wrap {
    margin: 10px 0;
}

.infrastructure-category-form {
    padding-top: 14px;
    border-top: 1px solid rgba(73, 117, 91, .2);
}

.infrastructure-quote-decision {
    min-width: 210px;
}

.infrastructure-quote-decision .field textarea {
    min-height: 64px;
}

html[data-theme="dark"] .infrastructure-kpi strong,
html[data-theme="dark"] .infrastructure-category-manager > summary {
    color: #8dd4a8;
}

html[data-theme="dark"] .infrastructure-chart-track {
    background: rgba(173, 205, 182, .18);
}

html[data-theme="dark"] .infrastructure-ownership-list > div,
html[data-theme="dark"] .infrastructure-category-form {
    border-color: rgba(173, 205, 182, .2);
}

.login-card .field label {
    color: #294d38;
    font-weight: 700;
}

.login-card .field input {
    border-color: #d7e5da;
    border-radius: 10px;
    background: #fbfdfb;
}

.login-card .field input:focus {
    border-color: #248653;
    outline: 3px solid rgba(36, 134, 83, .14);
}

.password-control {
    position: relative;
}

.password-control input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #557362;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: #eaf4ed;
    color: #176b43;
}

.password-toggle:focus-visible {
    outline: 2px solid #248653;
    outline-offset: 1px;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.login-card .button {
    border-radius: 10px;
    background: #176b43;
    font-weight: 700;
}

.login-card .button:hover {
    background: #105535;
}

@media (max-width: 480px) {
    .login-page {
        place-items: start center;
    }

    .login-card {
        width: 100%;
        padding: 24px 20px;
    }

    .access-expired-notice {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 9px;
        padding: 12px;
    }

    .access-expired-icon {
        width: 36px;
        height: 36px;
    }

    .login-logo {
        width: 64px;
        height: 64px;
    }

    .brand-motto {
        font-size: 11px;
    }
}

.header-visibility-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 8px;
    background: #176b43;
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.header-visibility-button:hover {
    background: #105535;
}

[data-global-header-show] {
    position: fixed;
    z-index: 9999;
    top: 12px;
    left: 12px;
}

html:not([data-igisubizo-header="hidden"]) [data-global-header-show],
html[data-igisubizo-header="hidden"] [data-global-header-hide] {
    display: none !important;
}

.portal-user-mobile-meta {
    display: none;
}

.portal-create-group {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
}

.portal-create-group h3 {
    margin-bottom: 12px;
    color: var(--text);
    font-size: 15px;
}

.portal-create-group h4 {
    margin: 16px 0 9px;
    color: var(--text);
    font-size: 13px;
}

.portal-create-group > .muted {
    margin: -4px 0 12px;
}

.portal-module-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 8px;
}

.portal-module-grid .check-row {
    min-height: 48px;
    align-items: center;
    margin: 0;
}

.portal-create-submit .button {
    min-height: 44px;
}

.portal-users-table tbody td {
    border-bottom: 1px solid var(--brand);
}

.portal-access-window-form {
    display: grid;
    min-width: 150px;
    gap: 6px;
}

.portal-access-window-form select,
.portal-access-window-form input,
.portal-access-window-form .button {
    width: 100%;
    min-height: 34px;
    margin: 0;
    padding: 6px 8px;
    font-size: 12px;
}

.portal-access-window-times {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.portal-access-window-times[hidden] {
    display: none;
}

.portal-access-review-form {
    display: grid;
    min-width: 120px;
    gap: 6px;
}

.portal-access-review-form .button {
    width: 100%;
    min-height: 34px;
    margin: 0;
    padding: 6px 8px;
    font-size: 12px;
}

.portal-access-window-times label {
    display: grid;
    gap: 3px;
    color: var(--text-muted);
    font-size: 10px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.portal-pending-count {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0 5px;
    border-radius: 999px;
    background: #c62828;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 700px) {
    .portal-create-group {
        margin-top: 12px;
        padding: 12px;
    }

    .portal-create-group .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .portal-module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .portal-module-grid .check-row {
        min-height: 46px;
        gap: 7px;
        padding: 8px;
        font-size: 11px;
    }

    .portal-create-submit,
    .portal-create-submit .button {
        width: 100%;
    }

    .portal-users-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .portal-users-table,
    .portal-users-table tbody {
        display: block;
        min-width: 0;
    }

    .portal-users-table thead {
        display: none;
    }

    .portal-users-table tbody {
        display: grid;
        gap: 9px;
    }

    .portal-users-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 8px 13px;
        border: 1px solid var(--border);
        border-left: 4px solid var(--brand);
        border-radius: 12px;
        background: var(--surface);
        box-shadow: 0 3px 12px rgba(20, 45, 70, .06);
    }

    .portal-users-table td {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 2px;
        padding: 9px 2px;
        border: 0;
        overflow-wrap: anywhere;
        font-size: 12px;
    }

    .portal-users-table td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 9px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .portal-users-table td:nth-child(1),
    .portal-users-table td:nth-child(7),
    .portal-users-table td:nth-child(8),
    .portal-users-table td:nth-child(9),
    .portal-users-table td:nth-child(10) {
        grid-column: 1 / -1;
    }

    .portal-users-table td:nth-child(1) {
        padding-top: 7px;
        padding-bottom: 11px;
        font-size: 15px;
    }

    .portal-users-table td:nth-child(2),
    .portal-users-table td:nth-child(3),
    .portal-users-table td:nth-child(4),
    .portal-users-table td:nth-child(5),
    .portal-users-table td:nth-child(6) {
        display: none;
    }

    .portal-users-table .portal-user-mobile-meta {
        display: block;
        margin-top: 5px;
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 400;
        line-height: 1.5;
    }

    .portal-users-table td:nth-child(7),
    .portal-users-table td:nth-child(8),
    .portal-users-table td:nth-child(9),
    .portal-users-table td:nth-child(10) {
        border-top: 1px solid var(--border);
    }

    .portal-users-table td:last-child {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding-top: 11px;
        padding-bottom: 8px;
    }

    .portal-users-table td:last-child form {
        flex: 1 1 140px;
        margin: 0;
    }

    .portal-users-table td:last-child .button {
        width: 100%;
        min-height: 42px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .portal-access-window-form {
        min-width: 0;
        width: 100%;
    }

    .portal-access-window-form select,
    .portal-access-window-form input,
    .portal-access-window-form .button {
        min-height: 44px;
        font-size: 15px;
    }
}

html[data-igisubizo-header="hidden"] [data-global-header-show] {
    display: inline-flex !important;
}

html[data-igisubizo-header="hidden"] .branch-layout {
    grid-template-columns: minmax(0, 1fr) !important;
}

html[data-igisubizo-header="hidden"] .branch-layout > .branch-sidebar,
html[data-igisubizo-header="hidden"] .branch-layout .branch-topbar,
html[data-igisubizo-header="hidden"] .portal-app-shell > .portal-sidebar,
html[data-igisubizo-header="hidden"] .portal-app-shell .portal-topbar {
    display: none !important;
}

html[data-igisubizo-header="hidden"] .portal-app-shell {
    grid-template-columns: minmax(0, 1fr) !important;
}

:root {
    --page-background: #f4f6f9;
    --brand: #142b4a;
    --brand-strong: #0e1e35;
    --brand-soft: #e9eff6;
    --accent: #d6a84f;
}

html[data-theme="dark"] {
    --brand: #3e78ad;
    --brand-strong: #2e638f;
    --brand-soft: #203349;
    --accent: #e4b85d;
}

.branch-sidebar {
    background: #142b4a;
    color: #e3eaf2;
}

.branch-sidebar .brand-mark {
    background: #fff;
    color: #142b4a;
}

.branch-sidebar .brand small {
    color: #b7c5d6;
}

.branch-sidebar-label {
    color: #d7e0eb;
}

.branch-nav-group h2 {
    color: #9eafc4;
}

.branch-nav-group a,
.branch-nav-disabled {
    color: #e3eaf2;
}

.branch-nav-disabled,
.branch-nav-disabled small {
    color: #aab9ca;
}

.portal-topbar .header-visibility-button,
.branch-topbar .header-visibility-button {
    border-color: var(--border);
    background: var(--surface-muted);
    color: var(--text);
}

.portal-topbar .header-visibility-button:hover,
.branch-topbar .header-visibility-button:hover {
    background: var(--brand-soft);
}

.portal-topbar .theme-toggle {
    border-color: var(--border);
    color: var(--text);
}

.portal-topbar .theme-toggle:hover {
    border-color: var(--border);
    background: var(--surface-muted);
}

.portal-app-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 252px minmax(0, 1fr);
}

.portal-sidebar {
    position: sticky;
    z-index: 25;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 22px 14px 16px;
    overflow-y: auto;
    background: #142b4a;
    color: #fff;
}

.portal-sidebar-brand {
    display: flex;
    min-height: 50px;
    align-items: center;
    gap: 11px;
    padding: 0 8px;
    color: inherit;
    text-decoration: none;
}

.portal-sidebar-brand img {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 9px;
    background: #fff;
    object-fit: contain;
}

.portal-sidebar-close {
    display: none;
}

.portal-sidebar-close[hidden] {
    display: none !important;
}

.portal-sidebar-brand strong,
.portal-sidebar-brand small,
.portal-user-chip strong,
.portal-user-chip small {
    display: block;
}

.portal-sidebar-brand strong {
    font-size: 13px;
    letter-spacing: .06em;
}

.portal-sidebar-brand small {
    margin-top: 4px;
    color: #b7c5d6;
    font-size: 10px;
}

.portal-sidebar-label {
    margin: 28px 10px 9px;
    color: #9eafc4;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .13em;
}

.portal-sidebar-label-secondary {
    margin-top: 24px;
}

.portal-sidebar-nav {
    display: grid;
    align-content: start;
    gap: 4px;
}

.portal-sidebar-link {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-left: 3px solid transparent;
    border-radius: 7px;
    color: #d7e0eb;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.portal-sidebar-link > span {
    width: 20px;
    flex: 0 0 20px;
    text-align: center;
}

.portal-sidebar-link:hover,
.portal-sidebar-link:focus-visible,
.portal-sidebar-link.is-active {
    outline: none;
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.portal-sidebar-link.is-active {
    border-left-color: #d6a84f;
}

.portal-sidebar-accordion {
    min-width: 0;
}

.portal-sidebar-accordion > summary {
    cursor: pointer;
    list-style: none;
}

.portal-sidebar-accordion > summary::-webkit-details-marker {
    display: none;
}

.portal-sidebar-accordion > summary::after {
    margin-left: auto;
    border-top: 5px solid #b7c5d6;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    content: "";
    transition: transform .15s ease;
}

.portal-sidebar-accordion[open] > summary::after {
    transform: rotate(180deg);
}

.portal-sidebar-branch-list {
    display: grid;
    gap: 2px;
    margin: 3px 0 7px 18px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, .18);
}

.portal-sidebar-branch-link {
    display: flex;
    min-width: 0;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 6px 8px;
    border-radius: 6px;
    color: #c7d4e2;
    font-size: 10px;
    font-weight: 550;
    line-height: 1.35;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.portal-sidebar-branch-link > span {
    flex: 0 0 12px;
    color: #d6a84f;
    text-align: center;
}

.portal-sidebar-branch-link[href]:hover,
.portal-sidebar-branch-link[href]:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.portal-sidebar-branch-link.is-disabled {
    color: #8293a8;
}

.portal-sidebar-branch-empty {
    margin: 0;
    padding: 8px 7px;
    color: #b7c5d6;
    font-size: 9px;
    line-height: 1.5;
}

.portal-sidebar-announcement-count {
    display: grid;
    min-width: 20px;
    height: 20px;
    margin-left: auto;
    padding: 0 5px;
    place-items: center;
    border-radius: 99px;
    background: rgba(214, 168, 79, .2);
    color: #f0cd83;
    font-size: 9px;
}

.portal-sidebar-announcements {
    display: grid;
    gap: 5px;
    margin: 3px 0 8px 18px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, .18);
}

.portal-sidebar-announcement {
    min-width: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.portal-sidebar-announcement > summary,
.portal-sidebar-announcement-archive > summary {
    display: flex;
    min-height: 34px;
    align-items: flex-start;
    gap: 6px;
    padding: 7px 4px;
    color: #e0e8f1;
    cursor: pointer;
    font-size: 10px;
    line-height: 1.4;
    list-style: none;
}

.portal-sidebar-announcement > summary::-webkit-details-marker,
.portal-sidebar-announcement-archive > summary::-webkit-details-marker {
    display: none;
}

.portal-sidebar-announcement > summary > span {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

.portal-sidebar-announcement > summary > time {
    flex: 0 0 auto;
    color: #9eafc4;
    font-size: 8px;
}

.portal-sidebar-announcement > summary::after,
.portal-sidebar-announcement-archive > summary::after {
    width: 0;
    height: 0;
    margin: 4px 2px 0 auto;
    border-top: 4px solid #9eafc4;
    border-right: 3px solid transparent;
    border-left: 3px solid transparent;
    content: "";
    transition: transform .15s ease;
}

.portal-sidebar-announcement[open] > summary::after,
.portal-sidebar-announcement-archive[open] > summary::after {
    transform: rotate(180deg);
}

.portal-sidebar-announcement-body {
    padding: 0 5px 10px;
    color: #c7d4e2;
    font-size: 9px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.portal-sidebar-announcement-body img {
    display: block;
    max-width: 100%;
    max-height: 110px;
    margin-bottom: 7px;
    border-radius: 5px;
    object-fit: cover;
}

.portal-sidebar-announcement-body p {
    margin: 6px 0;
    color: #9eafc4;
    font-size: 8px;
}

.portal-sidebar-announcement-body form {
    margin-top: 8px;
}

.portal-sidebar-announcement-body button {
    min-height: 29px;
    padding: 5px 8px;
    border: 1px solid rgba(214, 168, 79, .45);
    border-radius: 5px;
    background: rgba(214, 168, 79, .12);
    color: #f0cd83;
    cursor: pointer;
    font: inherit;
    font-size: 9px;
}

.portal-sidebar-announcement-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    margin-top: 7px;
}

.portal-sidebar-announcement-actions a,
.portal-sidebar-announcement-actions > a,
.portal-sidebar-announcement-actions a:visited {
    color: #f0cd83;
    font-size: 9px;
    text-decoration: underline;
}

.portal-sidebar-announcement-actions > a,
.portal-sidebar-announcement-actions > a:visited {
    display: inline-block;
    padding: 4px 5px;
    color: #d6a84f;
    font-size: 9px;
    text-decoration: none;
}

.portal-sidebar-announcement-archive {
    margin-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.portal-sidebar-announcement-archive > summary {
    justify-content: space-between;
    align-items: center;
    color: #b7c5d6;
}

.portal-sidebar-announcement-archive > summary span {
    margin-left: auto;
    color: #9eafc4;
}

.portal-sidebar-announcement-actions a:hover,
.portal-sidebar-announcement-actions a:focus-visible,
.portal-sidebar-announcement-body button:hover,
.portal-sidebar-announcement-body button:focus-visible {
    outline: 2px solid rgba(214, 168, 79, .7);
    outline-offset: 2px;
}

.portal-sidebar-announcement-error {
    margin: 4px 2px;
    padding: 7px;
    border-radius: 5px;
    background: rgba(164, 64, 54, .24);
    color: #ffd2cc;
    font-size: 9px;
    line-height: 1.4;
}

.portal-sidebar-announcement-actions a + a {
    margin-left: 0;
}

.portal-sidebar-footer {
    display: block;
    margin-top: auto;
    padding: 18px 10px 4px;
    border-top: 1px solid rgba(255, 255, 255, .13);
    color: #b7c5d6;
    font-size: 10px;
    text-decoration: none;
}

.portal-sidebar-hide-header {
    display: none;
}

.portal-main-shell {
    min-width: 0;
}

.portal-topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px clamp(18px, 3vw, 38px);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 4px 16px rgba(20, 43, 74, .045);
}

.portal-topbar-title {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 16px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-top-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.portal-top-actions form {
    margin: 0;
}

.portal-top-actions .logout-button {
    color: var(--text-muted);
    font-size: 12px;
}

.portal-user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
}

.portal-user-chip strong {
    max-width: 150px;
    overflow: hidden;
    color: var(--text);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-user-chip small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 9px;
}

.portal-user-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 13px;
    font-weight: 800;
}

.portal-menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
}

.portal-sidebar-backdrop {
    display: none;
}

.portal-main-shell .main {
    width: min(1440px, 100%);
    padding: 28px clamp(18px, 3vw, 40px) 48px;
}

.portal-hero {
    display: flex;
    min-height: 190px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 27px;
    padding: clamp(22px, 3vw, 34px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 17px;
    background:
        radial-gradient(circle at 88% 18%, rgba(214, 168, 79, .2), transparent 25%),
        linear-gradient(118deg, #142b4a, #1d4167 68%, #245174);
    color: #fff;
    box-shadow: 0 14px 34px rgba(20, 43, 74, .15);
}

.portal-hero-copy {
    min-width: 0;
}

.portal-hero .eyebrow {
    color: #e2bd72;
    letter-spacing: .14em;
}

.portal-hero h1 {
    margin: 9px 0 7px;
    color: #fff;
    font-size: clamp(23px, 3vw, 31px);
}

.portal-hero-copy > p:last-child {
    max-width: 620px;
    margin: 0;
    color: #d5dfeb;
    font-size: 13px;
    line-height: 1.55;
}

.portal-hero-actions {
    display: grid;
    justify-items: end;
    gap: 14px;
}

.portal-hero-date {
    display: grid;
    gap: 4px;
    text-align: right;
}

.portal-hero-date span {
    color: #c3d0df;
    font-size: 10px;
}

.portal-hero-date strong {
    color: #fff;
    font-size: 14px;
}

.portal-app-shell .button.portal-hero-button {
    min-height: 38px;
    background: #d6a84f;
    color: #142b4a;
    white-space: nowrap;
}

.portal-app-shell .button.portal-hero-button:hover {
    background: #e4bd70;
}

.portal-hero-button span {
    margin-left: 7px;
}

.company-overview {
    margin: 0 0 28px;
}

.company-overview .section-heading {
    margin-bottom: 14px;
}

.company-overview h2 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
}

.text-link {
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

.company-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.company-kpi {
    display: flex;
    min-width: 0;
    min-height: 98px;
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 6px 20px rgba(20, 43, 74, .04);
}

.company-kpi-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 12px;
    background: var(--brand-soft);
    font-size: 18px;
}

.company-kpi-gold .company-kpi-icon {
    background: #fbf3e3;
}

.company-kpi-green .company-kpi-icon {
    background: #e8f4ec;
}

.company-kpi-blue .company-kpi-icon {
    background: #eaf1f8;
}

.company-kpi p {
    margin: 0 0 7px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.35;
}

.company-kpi strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: clamp(15px, 1.7vw, 21px);
    line-height: 1.15;
}

.company-overview-note {
    margin: 11px 1px 0;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.5;
}

.portal-app-shell .button {
    background: var(--brand);
}

.portal-app-shell .button:hover {
    background: var(--brand-strong);
}

.portal-app-shell .button.secondary {
    border-color: var(--border);
    background: var(--brand-soft);
    color: var(--brand);
}

.portal-app-shell .tile {
    border-top-color: var(--accent);
}

.portal-app-shell .tile-link {
    color: var(--brand);
}

.portal-app-shell :focus-visible {
    outline: 3px solid rgba(214, 168, 79, .55);
    outline-offset: 2px;
}

html[data-theme="dark"] .portal-hero {
    background:
        radial-gradient(circle at 88% 18%, rgba(214, 168, 79, .15), transparent 25%),
        linear-gradient(118deg, #101c2c, #172b43 68%, #203951);
}

html[data-theme="dark"] .company-kpi-gold .company-kpi-icon,
html[data-theme="dark"] .company-kpi-green .company-kpi-icon,
html[data-theme="dark"] .company-kpi-blue .company-kpi-icon {
    background: var(--surface-muted);
}

@media (max-width: 1100px) {
    .company-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-top-actions {
        gap: 9px;
    }

    .portal-top-actions .header-visibility-button {
        display: none;
    }

    .portal-sidebar-hide-header {
        display: block;
        margin-top: 12px;
        padding: 10px;
        border: 1px solid rgba(255, 255, 255, .18);
        border-radius: 8px;
        background: rgba(255, 255, 255, .07);
        color: #e3eaf2;
        font: inherit;
        font-size: 11px;
        cursor: pointer;
    }

    .portal-sidebar-hide-header:hover {
        background: rgba(255, 255, 255, .13);
    }
}

@media (max-width: 760px) {
    .portal-app-shell {
        display: block;
    }

    .portal-sidebar {
        position: fixed;
        z-index: 51;
        inset: 0 auto 0 0;
        width: min(285px, calc(100vw - 48px));
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform .2s ease;
    }

    .portal-sidebar-close:not([hidden]) {
        position: absolute;
        top: 28px;
        right: 14px;
        display: grid;
        width: 34px;
        height: 34px;
        place-items: center;
        border: 1px solid rgba(255, 255, 255, .18);
        border-radius: 8px;
        background: rgba(255, 255, 255, .08);
        color: #fff;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
    }

    body.portal-sidebar-open .portal-sidebar {
        transform: translateX(0);
    }

    .portal-sidebar-backdrop:not([hidden]) {
        position: fixed;
        z-index: 50;
        inset: 0;
        display: block;
        border: 0;
        background: rgba(8, 18, 31, .55);
    }

    .portal-topbar {
        min-height: 62px;
        gap: 11px;
        padding: 8px 14px;
    }

    .portal-menu-toggle {
        display: grid;
        flex: 0 0 38px;
    }

    .portal-topbar-title {
        flex: 1 1 auto;
        font-size: 14px;
    }

    .portal-top-actions {
        flex: 0 0 auto;
        gap: 9px;
    }

    .portal-top-actions .header-visibility-button {
        display: none;
    }

    .portal-main-shell .main {
        padding: 20px 16px 36px;
    }

    .portal-hero {
        align-items: flex-start;
        gap: 18px;
        padding: 22px 20px;
    }

    .portal-hero-actions {
        justify-items: end;
    }

    .portal-hero-button {
        font-size: 10px !important;
    }
}

@media (max-width: 560px) {
    .portal-topbar {
        gap: 8px;
    }

    .portal-topbar-title {
        font-size: 12px;
    }

    .portal-top-actions {
        gap: 7px;
    }

    .portal-top-actions .theme-toggle {
        padding: 6px 8px;
        font-size: 9px;
    }

    .portal-user-chip > span:last-child {
        display: none;
    }

    .portal-user-avatar {
        width: 30px;
        height: 30px;
    }

    .portal-top-actions .logout-button {
        padding: 0;
        font-size: 10px;
    }

    .portal-hero {
        min-height: 0;
        flex-direction: column;
        gap: 14px;
        padding: 20px 18px;
    }

    .portal-hero h1 {
        font-size: 22px;
    }

    .portal-hero-actions {
        width: 100%;
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .portal-hero-date {
        justify-items: start;
        text-align: left;
    }

    .company-kpi-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 9px;
    }

    .company-kpi {
        min-height: 78px;
        padding: 12px 14px;
    }

    .company-kpi strong {
        font-size: 18px;
    }
}

.portal-app-shell .executive-layout {
    display: block;
}

.portal-app-shell .executive-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 22px;
    padding: 10px 12px;
}

.portal-app-shell .executive-sidebar nav {
    display: flex;
    flex: 1 1 360px;
    gap: 3px;
    overflow-x: auto;
}

.portal-app-shell .executive-sidebar nav a,
.portal-app-shell .executive-sidebar-home {
    min-height: 34px;
    flex: 0 0 auto;
    padding: 7px 9px;
    white-space: nowrap;
}

.portal-app-shell .executive-sidebar-home {
    margin-left: auto;
    border-top: 0;
}

.portal-analytics {
    margin: 0 0 30px;
}

.portal-analytics-heading {
    align-items: flex-end;
    margin-bottom: 15px;
}

.portal-analytics-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
}

.portal-analytics-intro {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}

.portal-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.portal-analytics-card {
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 6px 20px rgba(20, 43, 74, .04);
}

.portal-analytics-card-wide {
    grid-column: 1 / -1;
}

.portal-chart-heading {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.portal-chart-heading h3 {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
}

.portal-chart-heading p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.4;
}

.portal-chart-icon {
    display: grid;
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    place-items: center;
    border-radius: 9px;
    font-size: 17px;
    font-weight: 700;
}

.portal-chart-icon-gold {
    background: #fbf3e3;
    color: #9c6c15;
}

.portal-chart-icon-blue {
    background: #eaf1f8;
    color: #2e5e8b;
}

.portal-chart-icon-green {
    background: #e8f4ec;
    color: #287447;
}

.portal-chart-description {
    min-height: 42px;
    margin: 12px 0 15px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.55;
}

.portal-chart-description strong {
    color: var(--text);
}

.portal-ranked-chart,
.portal-stock-chart {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.portal-ranked-row {
    display: grid;
    grid-template-columns: minmax(72px, 1.1fr) minmax(35px, 2fr) minmax(72px, auto);
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.portal-chart-label {
    overflow: hidden;
    color: var(--text);
    font-size: 10px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-chart-track {
    display: block;
    overflow: hidden;
    height: 8px;
    border-radius: 99px;
    background: var(--surface-muted);
}

.portal-chart-bar {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
}

.portal-chart-bar-sales {
    background: linear-gradient(90deg, #c99a3f, #e1bd70);
}

.portal-chart-bar-employees {
    background: linear-gradient(90deg, #34835a, #72b889);
}

.portal-chart-bar-low {
    background: #426e98;
}

.portal-chart-bar-out {
    background: #c65a52;
}

.portal-chart-value {
    color: var(--text);
    font-size: 10px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.portal-employee-breakdown {
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    gap: 3px 14px;
    color: var(--text-muted);
    font-size: 9px;
}

.portal-employee-breakdown strong {
    color: var(--text);
}

.portal-employee-breakdown-unavailable {
    font-style: italic;
}

.portal-stock-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 0 0 11px;
    color: var(--text-muted);
    font-size: 9px;
}

.portal-stock-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.portal-stock-legend i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.portal-stock-legend-low {
    background: #426e98;
}

.portal-stock-legend-out {
    background: #c65a52;
}

.portal-stock-row {
    display: grid;
    grid-template-columns: minmax(78px, .75fr) minmax(0, 1.25fr);
    align-items: center;
    gap: 10px;
}

.portal-stock-series {
    display: grid;
    grid-template-columns: 43px minmax(24px, 1fr) 22px;
    align-items: center;
    gap: 6px;
}

.portal-stock-series-name,
.portal-stock-count {
    color: var(--text-muted);
    font-size: 9px;
    white-space: nowrap;
}

.portal-stock-count {
    color: var(--text);
    font-weight: 700;
    text-align: right;
}

.portal-chart-empty,
.portal-chart-error {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.5;
}

.portal-chart-error {
    margin: 0 0 12px;
    border-color: #e7c7c3;
    background: #fff5f3;
    color: #8d3932;
}

@media (max-width: 900px) {
    .portal-analytics-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .portal-analytics-card-wide {
        grid-column: auto;
    }
}

@media (max-width: 560px) {
    .portal-analytics-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-analytics-card {
        padding: 14px;
    }

    .portal-chart-description {
        min-height: 0;
    }

    .portal-ranked-row {
        grid-template-columns: minmax(72px, 1fr) minmax(35px, 1.4fr) minmax(72px, auto);
        gap: 7px;
    }

    .portal-stock-row {
        grid-template-columns: minmax(72px, .85fr) minmax(0, 1.15fr);
        gap: 7px;
    }

    .portal-stock-series {
        grid-template-columns: 39px minmax(20px, 1fr) 18px;
        gap: 4px;
    }
}