/* ==========================================================================
   Acorn Gifts and Hotline look and feel: a cream page in a warm yellow frame, white rounded cards, deep green and
   sunflower yellow for emphasis. Everything the app needs lives in this one file.
   ========================================================================== */

/* ---- Colours and sizes -------------------------------------------------- */
:root {
    --cf-frame: #f6e4b0;          /* the warm yellow around the app */
    --cf-bg: #fdf8ec;             /* the cream page */
    --cf-surface: #ffffff;        /* cards */
    --cf-surface-soft: #f7f0dd;   /* muted cards and hovers */
    --cf-border: #eee5cd;
    --cf-text: #17241f;
    --cf-muted: #7d857f;

    --cf-green: #135a4c;          /* buttons, accents */
    --cf-green-hover: #0f4a3f;
    --cf-green-dark: #0e463b;     /* the dark panel */
    --cf-green-card: #165e50;     /* cards on the dark panel */
    --cf-green-soft: rgba(19, 90, 76, 0.1);
    --cf-yellow: #f8cd5f;
    --cf-yellow-strong: #eab53a;
    --cf-yellow-soft: #fdf0c8;

    --cf-danger: #c2414b;
    --cf-danger-soft: rgba(194, 65, 75, 0.1);
    --cf-warning: #a86d10;
    --cf-warning-soft: rgba(234, 181, 58, 0.22);

    --cf-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --cf-radius: 0.75rem;
    --cf-radius-lg: 1.25rem;
    --cf-shadow: 0 1px 2px rgba(70, 55, 15, 0.04), 0 10px 30px rgba(70, 55, 15, 0.06);

    color-scheme: light;
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
}

body {
    background-color: var(--cf-frame);
    color: var(--cf-text);
    font-family: var(--cf-font);
    font-size: 0.95rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    margin: 0 0 0.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }

h1:focus {
    outline: none;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--cf-green);
}

    a:hover {
        color: var(--cf-green-hover);
    }

code {
    font-size: 0.875em;
    color: var(--cf-green);
}

.icon {
    flex-shrink: 0;
    vertical-align: -0.15em;
}

/* ---- Text helpers ------------------------------------------------------- */
.muted { color: var(--cf-muted); }
.small { font-size: 0.82rem; }
.strong { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.hint { color: var(--cf-muted); font-size: 0.78rem; font-weight: 400; }

/* Small uppercase label, e.g. above a section */
.eyebrow {
    color: var(--cf-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

/* Long text cut off after two lines with "…" */
.clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* Text typed into a textarea: keep its line breaks */
.prose {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* ---- Layout helpers ----------------------------------------------------- */
.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.push-right {
    margin-left: auto;
}

/* A white rounded card: the basic building block of every page */
.card,
.panel {
    background-color: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius-lg);
    box-shadow: var(--cf-shadow);
    padding: 1.4rem;
    margin-bottom: 1.25rem;
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

    .card-head h3 {
        margin: 0;
    }

.card-label {
    color: var(--cf-muted);
    font-size: 0.85rem;
}

.big-number {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

/* "Gift register →" */
.link-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

    .link-more.light {
        color: var(--cf-yellow);
    }

/* Nothing to show yet: an icon and a sentence, centred */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--cf-muted);
    text-align: center;
}

    .empty p {
        margin: 0;
    }

.empty-icon {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: var(--cf-yellow-soft);
    color: var(--cf-green);
}

/* ---- The app frame and top bar ------------------------------------------- */
.frame {
    min-height: calc(100vh - 1.5rem);
    margin: 0.75rem;
    background-color: var(--cf-bg);
    border-radius: 1.75rem;
    box-shadow: 0 0 0 1px rgba(160, 120, 20, 0.08);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 2rem;
    padding: 1.1rem 2rem;
    background-color: color-mix(in srgb, var(--cf-bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-radius: 1.75rem 1.75rem 0 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--cf-text);
    text-decoration: none;
}

    .brand:hover {
        color: var(--cf-text);
    }

/* The logo: an acorn (acorn-mark.svg used as a stencil, so CSS picks its colour) */
.brand-mark {
    display: inline-block;
    width: 1.4rem;
    height: 1.8rem;
    background-color: var(--cf-green-dark);
    -webkit-mask: url("acorn-mark.svg") center / contain no-repeat;
    mask: url("acorn-mark.svg") center / contain no-repeat;
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

    .brand-name em,
    .auth-title em {
        font-style: italic;
        text-decoration: underline;
        text-decoration-color: var(--cf-yellow);
        text-decoration-thickness: 3px;
        text-underline-offset: 3px;
    }

.topbar-menu {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0 auto;
}

.topnav-link {
    position: relative;
    padding: 0.5rem 0.9rem;
    color: var(--cf-muted);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 999px;
    transition: color 0.15s, background-color 0.15s;
}

    .topnav-link:hover {
        color: var(--cf-text);
        background-color: var(--cf-surface-soft);
    }

    /* The page you are on: dark and bold, with a short bar underneath */
    .topnav-link.active {
        color: var(--cf-text);
        font-weight: 700;
    }

        .topnav-link.active::after {
            content: "";
            position: absolute;
            left: 50%;
            bottom: 0.1rem;
            width: 1.4rem;
            height: 3px;
            border-radius: 3px;
            background-color: var(--cf-text);
            transform: translateX(-50%);
        }

/* Account: name and role next to a round avatar; opens a small menu (<details>, so no JavaScript) */
.account-menu {
    position: relative;
}

    .account-menu summary {
        list-style: none;
        user-select: none;
    }

        .account-menu summary::-webkit-details-marker {
            display: none;
        }

    /* While open, an invisible layer covers the page so a click anywhere else closes the menu */
    .account-menu[open] summary::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 20;
        cursor: default;
    }

.account-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.3rem 0.3rem 0.3rem 1rem;
    border-radius: 999px;
    background-color: var(--cf-green-dark);
    color: #fff;
    cursor: pointer;
}

.account-text {
    display: flex;
    flex-direction: column;
    text-align: right;
    line-height: 1.2;
    white-space: nowrap;
}

.account-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.account-role {
    font-size: 0.7rem;
    opacity: 0.7;
}

.avatar {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    background-color: var(--cf-yellow);
    color: var(--cf-green-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.avatar-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.72rem;
}

.avatar-lg {
    width: 3.4rem;
    height: 3.4rem;
    font-size: 1.1rem;
}

.account-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 30;
    min-width: 15rem;
    padding: 0.5rem 0;
    background-color: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    box-shadow: 0 1rem 2.5rem rgba(40, 30, 5, 0.14);
}

.account-info {
    padding: 0.5rem 1rem 0.75rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid var(--cf-border);
}

.account-email {
    overflow-wrap: anywhere;
}

.account-dropdown form {
    margin: 0;
}

.account-link {
    display: block;
    width: 100%;
    padding: 0.45rem 1rem;
    background: none;
    border: 0;
    color: var(--cf-muted);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

    .account-link:hover {
        background-color: var(--cf-surface-soft);
        color: var(--cf-text);
    }

/* The page under the top bar */
.page {
    padding: 0.75rem 2rem 2rem;
}

/* Page title (with a line of explanation) and its main button on the right */
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

    .page-head h1 {
        margin-bottom: 0.2rem;
    }

    .page-head p {
        margin: 0;
    }

.back-link {
    display: inline-block;
    margin-bottom: 0.75rem;
    color: var(--cf-muted);
    font-size: 0.85rem;
    text-decoration: none;
}

/* The ☰ button on phones: a hidden checkbox and its label, so no JavaScript is needed */
.nav-toggle,
.nav-toggle-button {
    display: none;
}

@media (max-width: 899.98px) {
    .frame {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }

    .topbar {
        padding: 0.9rem 1rem;
        border-radius: 0;
    }

    .page {
        padding: 0.5rem 1rem 1.5rem;
    }

    .nav-toggle-button {
        display: block;
        margin-left: auto;
        width: 2.75rem;
        height: 2.25rem;
        border: 1px solid var(--cf-border);
        border-radius: var(--cf-radius);
        cursor: pointer;
        background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2317241f' stroke-linecap='round' stroke-width='2' d='M5 8h20M5 15h20M5 22h20'/%3e%3c/svg%3e") no-repeat center / 1.4rem;
    }

    .topbar-menu {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        padding-bottom: 0.5rem;
    }

    .nav-toggle:checked ~ .topbar-menu {
        display: flex;
    }

    .topnav {
        flex-direction: column;
        align-items: stretch;
        margin: 0;
    }

        .topnav-link.active::after {
            display: none;
        }

        .topnav-link.active {
            background-color: var(--cf-surface-soft);
        }

    .account-menu[open] summary::before {
        display: none;
    }

    .account-pill {
        justify-content: space-between;
    }

    .account-text {
        text-align: left;
    }

    .account-dropdown {
        position: static;
        margin-top: 0.5rem;
        box-shadow: none;
    }
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

    .btn:active:not(:disabled) {
        transform: translateY(1px);
    }

    .btn:focus-visible {
        outline: 2px solid var(--cf-green);
        outline-offset: 2px;
    }

    .btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

/* Main action: solid deep green */
.btn-primary {
    background-color: var(--cf-green);
    color: #fff;
}

    .btn-primary:hover:not(:disabled) {
        background-color: var(--cf-green-hover);
        color: #fff;
    }

/* Bright action on a dark background: yellow */
.btn-accent {
    background-color: var(--cf-yellow);
    color: var(--cf-green-dark);
}

    .btn-accent:hover:not(:disabled) {
        background-color: var(--cf-yellow-strong);
        color: var(--cf-green-dark);
    }

/* Secondary action: outline only */
.btn-secondary {
    background-color: var(--cf-surface);
    border-color: var(--cf-border);
    color: var(--cf-text);
}

    .btn-secondary:hover:not(:disabled) {
        border-color: var(--cf-green);
        color: var(--cf-green);
    }

/* Destructive action, e.g. delete */
.btn-danger {
    background-color: transparent;
    border-color: color-mix(in srgb, var(--cf-danger) 45%, transparent);
    color: var(--cf-danger);
}

    .btn-danger:hover:not(:disabled) {
        background-color: var(--cf-danger);
        border-color: var(--cf-danger);
        color: #fff;
    }

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* A round button with only an icon, e.g. the pencil on a hotline card */
.icon-button {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    background-color: var(--cf-surface-soft);
    color: var(--cf-muted);
    cursor: pointer;
}

    .icon-button:hover {
        background-color: var(--cf-yellow-soft);
        color: var(--cf-green);
    }

/* A button that looks like a link (for actions that must POST, such as Log out) */
.link-button {
    padding: 0;
    background: none;
    border: 0;
    color: var(--cf-green);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.editor-buttons {
    margin-top: 1.25rem;
}

/* ---- Forms --------------------------------------------------------------- */
.field {
    margin-bottom: 1rem;
}

label {
    display: inline-block;
}

.field > label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--cf-text);
    font-size: 0.82rem;
    font-weight: 600;
}

/* Two (or more) fields side by side, one under the other on a phone */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0 1rem;
}

/* :where() keeps this rule weak, so a class can override it */
input:where(:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]):not([type=button])),
select,
textarea {
    display: block;
    width: 100%;
    padding: 0.6rem 0.85rem;
    background-color: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    color: var(--cf-text);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    input::placeholder,
    textarea::placeholder {
        color: #a8ada9;
        opacity: 1;
    }

    input:focus,
    select:focus,
    textarea:focus {
        border-color: var(--cf-green);
        box-shadow: 0 0 0 3px var(--cf-green-soft);
        outline: none;
    }

    input:disabled,
    select:disabled,
    textarea:disabled {
        opacity: 0.55;
    }

select {
    appearance: none;
    padding-right: 2.25rem;
    background: var(--cf-surface) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%237d857f' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 0.85rem center / 0.75rem;
}

textarea {
    min-height: 5rem;
    resize: vertical;
}

/* Checkbox with its text: <label class="checkbox"><input type="checkbox" /> Text</label> */
.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--cf-text);
    font-size: 0.88rem;
    cursor: pointer;
}

input[type=checkbox] {
    appearance: none;
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    border: 1.5px solid #cfc6ae;
    border-radius: 0.3rem;
    background: var(--cf-surface) no-repeat center / 0.8rem;
    cursor: pointer;
}

    input[type=checkbox]:checked {
        background-color: var(--cf-green);
        border-color: var(--cf-green);
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
    }

    input[type=checkbox]:focus-visible {
        outline: 2px solid var(--cf-green);
        outline-offset: 2px;
    }

/* Two buttons that work as a switch, e.g. "I received it | I gave it" */
.segmented {
    display: inline-flex;
    padding: 0.25rem;
    margin-bottom: 1.25rem;
    border-radius: 999px;
    background-color: var(--cf-surface-soft);
}

    .segmented button {
        padding: 0.45rem 1.1rem;
        border: 0;
        border-radius: 999px;
        background: none;
        color: var(--cf-muted);
        font: inherit;
        font-size: 0.88rem;
        font-weight: 600;
        cursor: pointer;
    }

        .segmented button.active {
            background-color: var(--cf-green);
            color: #fff;
        }

/* Validation (Blazor adds the "invalid" class and the messages) */
input.invalid,
select.invalid,
textarea.invalid {
    border-color: var(--cf-danger);
}

.validation-message,
.validation-errors {
    color: var(--cf-danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Checkboxes for modules (Users page) */
.module-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0;
    border: 0;
}

    .module-picks legend {
        width: 100%;
        padding: 0;
        margin-bottom: 0.4rem;
        font-size: 0.82rem;
        font-weight: 600;
    }

/* A scrolling list of people to tick (Users page: Reports to) */
.pick-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 0.5rem;
    max-height: 18rem;
    overflow-y: auto;
}

.pick {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    cursor: pointer;
}

    .pick > span:last-child {
        display: flex;
        flex-direction: column;
        min-width: 0;
        line-height: 1.3;
    }

    .pick:has(input:checked) {
        border-color: var(--cf-green);
        background-color: var(--cf-green-soft);
    }

.editor-layout .card h3 {
    margin-bottom: 0.9rem;
}

/* Delete user: a separate small line at the bottom */
.danger-zone {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px dashed var(--cf-border);
}

/* ---- Alerts -------------------------------------------------------------- */
.alert {
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid;
    border-radius: var(--cf-radius);
    font-size: 0.88rem;
}

.alert-success {
    background-color: var(--cf-green-soft);
    border-color: color-mix(in srgb, var(--cf-green) 30%, transparent);
    color: var(--cf-green);
}

.alert-danger {
    background-color: var(--cf-danger-soft);
    border-color: color-mix(in srgb, var(--cf-danger) 30%, transparent);
    color: var(--cf-danger);
}

.alert-warning {
    background-color: var(--cf-warning-soft);
    border-color: color-mix(in srgb, var(--cf-warning) 30%, transparent);
    color: var(--cf-warning);
}

/* ---- Badges (small status labels) --------------------------------------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background-color: var(--cf-surface-soft);
    color: var(--cf-muted);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-success { background-color: var(--cf-green-soft); color: var(--cf-green); }
.badge-danger { background-color: var(--cf-danger-soft); color: var(--cf-danger); }
.badge-warning { background-color: var(--cf-warning-soft); color: var(--cf-warning); }
.badge-strong { background-color: var(--cf-green); color: #fff; }

/* Received (in) or Given (out) */
.direction {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

    .direction::before {
        content: "";
        width: 0.5rem;
        height: 0.5rem;
        border-radius: 50%;
    }

    .direction.in::before { background-color: var(--cf-green); }
    .direction.out::before { background-color: var(--cf-yellow-strong); }

/* ---- Tabs and filter pills ---------------------------------------------- */
.tabs-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tabs {
    display: flex;
    gap: 1.5rem;
}

.tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0;
    border: 0;
    background: none;
    color: var(--cf-muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

    .tab.active {
        color: var(--cf-text);
    }

        .tab.active::after {
            content: "";
            position: absolute;
            left: 0;
            bottom: -0.1rem;
            width: 1.6rem;
            height: 3px;
            border-radius: 3px;
            background-color: var(--cf-text);
        }

.tab-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background-color: var(--cf-yellow);
    color: var(--cf-green-dark);
    font-size: 0.72rem;
    font-weight: 700;
}

.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pill {
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--cf-border);
    border-radius: 999px;
    background-color: var(--cf-surface);
    color: var(--cf-muted);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

    .pill:hover {
        color: var(--cf-text);
    }

    .pill.active {
        background-color: var(--cf-green-dark);
        border-color: var(--cf-green-dark);
        color: #fff;
    }

/* ---- Tables -------------------------------------------------------------- */
.table {
    width: 100%;
    border-collapse: collapse;
}

    .table th,
    .table td {
        padding: 0.8rem 0.75rem;
        border-bottom: 1px solid var(--cf-border);
        text-align: left;
        vertical-align: middle;
    }

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

    .table th {
        color: var(--cf-muted);
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .table th.num,
    .table td.num {
        text-align: right;
    }

    .table tbody tr:hover {
        background-color: #fdfaf1;
    }

/* Rows that open something when clicked */
.table-click tbody tr {
    cursor: pointer;
}

    .table-click tbody tr:focus-visible {
        outline: 2px solid var(--cf-green);
        outline-offset: -2px;
    }

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

.table td form {
    margin: 0;
}

/* A person's avatar next to their name and email */
.person {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* ---- Popups (Shared/Modal.razor) ----------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1rem;
    overflow-y: auto;
    background-color: rgba(14, 40, 34, 0.35);
    backdrop-filter: blur(2px);
}

body:has(.modal-backdrop) {
    overflow: hidden;
}

.modal {
    position: relative;
    width: 100%;
    max-width: 40rem;
    padding: 1.75rem;
    background-color: var(--cf-surface);
    border-radius: 1.5rem;
    box-shadow: 0 1.5rem 4rem rgba(14, 40, 34, 0.25);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: var(--cf-surface-soft);
    color: var(--cf-muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

    .modal-close:hover {
        color: var(--cf-text);
    }

/* One gift's details */
.detail-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.detail-value {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: -0.2rem 0 1.25rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 1rem 1.5rem;
    margin: 0 0 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: var(--cf-radius);
    background-color: var(--cf-surface-soft);
}

    .detail-grid dt {
        color: var(--cf-muted);
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .detail-grid dd {
        margin: 0.15rem 0 0;
        overflow-wrap: anywhere;
    }

.detail-block {
    margin-bottom: 1rem;
}

    .detail-block p {
        margin: 0.25rem 0 0;
    }

/* The reviewer's decision on a gift */
.review-note {
    padding: 0.85rem 1rem;
    border-left: 4px solid;
    border-radius: 0.5rem;
}

    .review-note.ok { border-color: var(--cf-green); background-color: var(--cf-green-soft); }
    .review-note.no { border-color: var(--cf-danger); background-color: var(--cf-danger-soft); }

/* ---- Hotlines -------------------------------------------------------------- */
/* The dark green banner at the top */
.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 2rem;
    margin-bottom: 1.75rem;
    border-radius: 1.5rem;
    background:
        radial-gradient(circle at 92% 10%, rgba(248, 205, 95, 0.25), transparent 40%),
        var(--cf-green-dark);
    color: #fff;
}

.hero-text {
    max-width: 44rem;
}

    .hero-text p {
        margin: 0;
        color: rgba(255, 255, 255, 0.8);
    }

.hero-icon,
.tile-icon {
    display: inline-grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    margin-bottom: 0.85rem;
    border-radius: 0.8rem;
    background-color: var(--cf-yellow);
    color: var(--cf-green-dark);
}

.section-title {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
}

.hotline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

    .hotline-grid .card {
        margin: 0;
    }

.hotline-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.hotline p {
    font-size: 0.88rem;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--cf-radius);
    background-color: var(--cf-surface-soft);
    color: var(--cf-text);
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

    .contact:hover {
        background-color: var(--cf-yellow-soft);
        color: var(--cf-green-dark);
    }

.contact-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background-color: var(--cf-green);
    color: #fff;
}

/* ---- Home dashboard -------------------------------------------------------- */
/* Main content on the left, the dark green panel on the right */
.dash {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 21rem;
    gap: 1.75rem;
    align-items: start;
}

.greeting {
    margin-bottom: 1.25rem;
}

    .greeting h1 {
        margin-bottom: 0.15rem;
    }

    .greeting p {
        margin: 0;
    }

/* Chart | green tile | yellow tile | stack, then the notice card, recent gifts and the hotlines underneath */
.dash-grid {
    display: grid;
    grid-template-columns: minmax(18rem, 2.3fr) 1fr 1fr 1fr;
    gap: 1.1rem;
}

    .dash-grid > * {
        margin: 0;
        min-width: 0;
    }

.chart-card { grid-column: 1; grid-row: 1 / span 2; }
.stack { grid-column: 4; grid-row: 1 / span 2; }
.notice-card { grid-column: 2 / span 2; grid-row: 2; }
.recent-card,
.home-hotlines { grid-column: 1 / -1; }

/* The monthly bars: yellow, with this month in green and its number in a small dark bubble */
.bars {
    display: flex;
    align-items: stretch;
    gap: 0.45rem;
    height: 12rem;
    margin-top: 1.25rem;
}

.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

/* The bubble sits just above its bar */
.bar-track {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    width: 100%;
}

.bar {
    width: 100%;
    max-width: 1.6rem;
    border-radius: 0.45rem;
    background-color: var(--cf-yellow);
    transition: background-color 0.15s;
}

    .bar.current {
        background-color: var(--cf-green-dark);
    }

.bar-col:hover .bar:not(.current) {
    background-color: var(--cf-yellow-strong);
}

.bar-tip {
    padding: 0.1rem 0.45rem;
    border-radius: 0.4rem;
    background-color: var(--cf-text);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

    .bar-tip.show,
    .bar-col:hover .bar-tip {
        opacity: 1;
    }

.bar-label {
    color: var(--cf-muted);
    font-size: 0.7rem;
}

    .bar-label.current {
        color: var(--cf-text);
        font-weight: 700;
    }

/* The coloured number tiles */
.tile {
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.2rem;
    border-radius: var(--cf-radius-lg);
    text-decoration: none;
    transition: transform 0.15s;
}

    .tile:hover {
        transform: translateY(-2px);
    }

.tile-green {
    background-color: var(--cf-green-dark);
    color: #fff;
}

    .tile-green:hover { color: #fff; }

.tile-yellow {
    background-color: var(--cf-yellow);
    color: var(--cf-green-dark);
}

    .tile-yellow:hover { color: var(--cf-green-dark); }

    .tile-yellow .tile-icon {
        background-color: #fff;
    }

.tile-small {
    font-size: 0.8rem;
    opacity: 0.85;
}

.tile-number {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.tile-note {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* A column of small cream cards; the highlighted one is white and lifted */
.stack {
    display: flex;
    flex-direction: column;
    border-radius: var(--cf-radius-lg);
    background-color: var(--cf-surface-soft);
    overflow: hidden;
}

.stack-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 1.2rem;
    color: var(--cf-text);
    text-decoration: none;
}

    .stack-item + .stack-item {
        border-top: 1px solid var(--cf-border);
    }

    .stack-item.highlight {
        margin: 0.35rem;
        border-radius: 1rem;
        background-color: var(--cf-surface);
        box-shadow: var(--cf-shadow);
    }

        .stack-item.highlight + .stack-item {
            border-top: 0;
        }

    a.stack-item:hover {
        color: var(--cf-green);
    }

.stack-label {
    color: var(--cf-muted);
    font-size: 0.8rem;
}

.stack-number {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* No approval needed: a dark green card beside the tiles */
.notice-card {
    background-color: var(--cf-green-dark);
    border-color: var(--cf-green-dark);
    color: #fff;
}

    .notice-card h3 {
        margin-bottom: 0.2rem;
    }

    .notice-card p {
        color: rgba(255, 255, 255, 0.75);
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

/* Every hotline on the home page, in a grid of small blocks */
.home-hotline-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .home-hotline-list li {
        padding: 0.85rem 1rem;
        border: 1px solid var(--cf-border);
        border-radius: var(--cf-radius);
        background: var(--cf-surface-soft);
        min-width: 0;
    }

    .home-hotline-list p {
        margin: 0.35rem 0 0;
    }

.home-hotline-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.home-hotline-links {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.6rem;
}

    .home-hotline-links a {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        color: var(--cf-green);
        font-weight: 600;
        text-decoration: none;
        overflow-wrap: anywhere;
    }

        .home-hotline-links a:hover {
            text-decoration: underline;
        }

/* Recent gifts */
.recent-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .recent-list li {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        padding: 0.7rem 0;
        border-top: 1px solid var(--cf-border);
    }

.recent-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.75rem;
}

    .recent-icon.in { background-color: var(--cf-green-soft); color: var(--cf-green); }
    .recent-icon.out { background-color: var(--cf-yellow-soft); color: var(--cf-warning); }

.recent-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.recent-value {
    font-weight: 700;
    white-space: nowrap;
}

/* The dark green panel on the right of the home page */
.dash-side {
    position: sticky;
    top: 5.5rem;
    padding: 1.4rem;
    border-radius: 1.75rem;
    background-color: var(--cf-green-dark);
    color: #fff;
}

.profile-card {
    padding: 1.3rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--cf-radius-lg);
    background-color: var(--cf-green-card);
}

.profile-top {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.1rem;
}

    .profile-top h2 {
        margin: 0 0 0.15rem;
        font-size: 1.3rem;
    }

.profile-company {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.verified {
    color: var(--cf-yellow);
    display: inline-flex;
}

.profile-stats,
.side-split {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.8rem;
    border-radius: 0.9rem;
    background-color: rgba(0, 0, 0, 0.16);
    text-align: center;
}

    .profile-stats span,
    .side-split span {
        display: block;
        font-size: 0.72rem;
        opacity: 0.75;
    }

    .profile-stats strong,
    .side-split strong {
        font-size: 1rem;
    }

.profile-managers {
    margin-top: 1rem;
}

.side-label {
    display: block;
    font-size: 0.78rem;
    opacity: 0.8;
}

.side-muted {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.65rem 0.2rem 0.2rem;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
}

.chip-avatar {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: var(--cf-yellow);
    color: var(--cf-green-dark);
    font-size: 0.62rem;
    font-weight: 700;
}

.side-title {
    margin: 0 0 0.9rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* A status card on the dark panel; the highlighted (open) one is yellow */
.side-card {
    margin-bottom: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--cf-radius-lg);
    background-color: var(--cf-green-card);
}

    .side-card summary {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        list-style: none;
        cursor: pointer;
    }

        .side-card summary::-webkit-details-marker {
            display: none;
        }

    .side-card[open] .side-chevron {
        transform: rotate(180deg);
    }

    .side-card .side-split,
    .side-card .side-muted {
        margin-top: 0.85rem;
    }

    .side-card.highlight {
        background-color: var(--cf-yellow);
        border-color: var(--cf-yellow);
        color: var(--cf-green-dark);
    }

        .side-card.highlight .side-split {
            background-color: rgba(255, 255, 255, 0.4);
        }

        .side-card.highlight .side-chevron {
            background-color: #fff;
            color: var(--cf-green-dark);
        }

.side-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background-color: #fff;
    color: var(--cf-green-dark);
}

    .side-icon.yellow {
        background-color: var(--cf-yellow);
    }

.side-number {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
}

.side-chevron {
    display: grid;
    place-items: center;
    width: 1.7rem;
    height: 1.7rem;
    margin-left: auto;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    transition: transform 0.15s;
}

@media (max-width: 1279.98px) {
    .dash {
        grid-template-columns: minmax(0, 1fr);
    }

    .dash-side {
        position: static;
    }
}

@media (max-width: 1099.98px) {
    .dash-grid {
        grid-template-columns: 1fr 1fr;
    }

    .chart-card,
    .recent-card,
    .home-hotlines { grid-column: 1 / -1; grid-row: auto; }
    .stack,
    .notice-card { grid-column: auto; grid-row: auto; }
}

@media (max-width: 559.98px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }

    .chart-card,
    .recent-card,
    .home-hotlines { grid-column: auto; }

    .recent-list li {
        flex-wrap: wrap;
    }
}

/* ---- Sign-in pages: a green panel with the app name, beside the form ------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.auth {
    display: flex;
    width: 100%;
    max-width: 860px;
    border-radius: 1.75rem;
    background-color: var(--cf-bg);
    box-shadow: 0 1.5rem 4rem rgba(70, 55, 15, 0.15);
    overflow: hidden;
}

.auth-brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 26rem;
    padding: 2.5rem;
    background:
        radial-gradient(circle at 85% 15%, rgba(248, 205, 95, 0.3), transparent 45%),
        var(--cf-green-dark);
    color: #fff;
}

    .auth-brand p {
        margin: 0;
        color: rgba(255, 255, 255, 0.75);
        max-width: 22rem;
    }

.brand-mark-lg {
    width: 2.4rem;
    height: 3.05rem;
    margin-bottom: auto;
    background-color: var(--cf-yellow);
}

.auth-title {
    font-size: 2.4rem;
    margin: 0 0 0.6rem;
}

.auth-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem;
}

    .auth-form h2 {
        margin-bottom: 0.25rem;
    }

    .auth-form .btn-primary {
        margin-top: 1.25rem;
    }

.auth-footer {
    margin: 1rem 0 0;
}

@media (max-width: 699.98px) {
    .auth {
        flex-direction: column;
    }

    .auth-brand {
        min-height: 0;
        padding: 2rem;
    }

    .brand-mark-lg {
        margin-bottom: 1.5rem;
    }

    .auth-form {
        padding: 2rem;
    }
}

/* ---- Blazor's built-in error messages ----------------------------------- */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    padding: 0.6rem 1.25rem 0.7rem;
    background-color: var(--cf-danger);
    color: #fff;
}

    #blazor-error-ui a {
        color: #fff;
    }

    #blazor-error-ui .dismiss {
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
        cursor: pointer;
    }

.blazor-error-boundary {
    padding: 1rem 1.25rem;
    border-radius: var(--cf-radius);
    background-color: var(--cf-danger);
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ---------- Organisation ---------- */
.org-index {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.org-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.45rem 0.35rem 0.85rem;
    border: 1px solid var(--cf-border);
    border-radius: 999px;
    background-color: var(--cf-surface);
    color: var(--cf-text);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
}

.org-chip:hover {
    border-color: var(--cf-green);
}

.org-chip-count {
    display: grid;
    place-items: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background-color: var(--cf-green-soft);
    color: var(--cf-green);
    font-size: 0.75rem;
    font-weight: 700;
}

.org-unit {
    margin-bottom: 1.25rem;
    scroll-margin-top: 1rem;
}

.org-unit-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.org-unit-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.org-unit-icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background-color: var(--cf-green);
    color: var(--cf-yellow);
}

.org-tree {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Each level is indented, with a line from its manager */
.org-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: calc(var(--depth, 0) * 2rem);
    padding: 0.6rem 0.75rem;
    border-radius: var(--cf-radius);
}

.org-row:hover {
    background-color: var(--cf-surface-soft);
}

.org-row[style*="--depth: 0"] {
    margin-top: 0.35rem;
}

.org-row:not([style*="--depth: 0"])::before {
    content: "";
    position: absolute;
    left: -1.1rem;
    top: 0;
    width: 0.9rem;
    height: 50%;
    border-left: 2px solid var(--cf-border);
    border-bottom: 2px solid var(--cf-border);
    border-bottom-left-radius: 0.5rem;
}

.org-row.is-disabled {
    opacity: 0.55;
}

.org-person {
    flex: 1;
    min-width: 0;
}

.org-person .badge {
    margin-left: 0.35rem;
}

.readonly-value {
    padding: 0.6rem 0.8rem;
    border-radius: var(--cf-radius);
    background-color: var(--cf-surface-soft);
    color: var(--cf-text);
}

/* ---------- Activity (audit trail) ---------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.filter-bar .field {
    margin: 0;
    min-width: 12rem;
}

.audit-when {
    white-space: nowrap;
}

.audit-action {
    white-space: nowrap;
    font-weight: 600;
}

@media (max-width: 559.98px) {
    .org-row {
        margin-left: calc(var(--depth, 0) * 1rem);
        padding: 0.5rem;
    }

    .org-unit-head {
        flex-wrap: wrap;
    }
}

/* The error page's details for super admins */
.error-details pre {
    margin: 0;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    background: var(--cf-surface-soft);
    font-size: 0.78rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
