html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}


/* =========================================================
   Seeds of Hope Assessment Hub
   Global design tokens
   ========================================================= */

:root {
    --sidebar-width: 224px;

    /*
     * SOH-inspired application palette.
     *
     * Warm neutral backgrounds with muted sage/green
     * navigation and controls.
     */

    --brand-primary: #657b69;
    --brand-primary-hover: #566b5b;
    --brand-primary-active: #485b4d;
    --brand-primary-soft: #e5ece5;
    --brand-primary-soft-hover: #dbe5dc;

    --page-bg: #f6f5f1;
    --sidebar-bg: #f0f1ec;
    --surface: #ffffff;
    --surface-soft: #faf9f6;

    --border: #dddcd5;
    --border-light: #ebeae5;

    --text: #303630;
    --heading: #292f2a;
    --muted: #777d75;

    --nav-text: #4e5b50;
    --nav-hover: #e5e9e2;
    --nav-active: #dbe5dc;
    --nav-active-text: #405646;

    --topbar-bg: rgba(255, 255, 255, 0.95);

    /*
     * Workflow/status palette.
     */

    --status-pending-bg: #fff0dc;
    --status-pending-border: #e6a443;
    --status-pending-text: #8a4b00;

    --status-action-bg: #f8e7e8;
    --status-action-border: #d9969f;
    --status-action-text: #8b3440;

    --status-progress-bg: #e2eef4;
    --status-progress-border: #86b5cb;
    --status-progress-text: #285e76;

    --status-complete-bg: #e4efe5;
    --status-complete-border: #91b796;
    --status-complete-text: #35633c;

    --status-na-bg: #eceeeb;
    --status-na-border: #c9cdc8;
    --status-na-text: #626861;

    /*
     * Shared shape for status indicators.
     * Intentionally not pill-shaped.
     */

    --status-radius: 4px;
}


/* =========================================================
   Base
   ========================================================= */

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--page-bg);
    color: var(--text);

    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;

    -webkit-font-smoothing: antialiased;
}


/* =========================================================
   Links
   ========================================================= */

a {
    color: var(--brand-primary);
}

a:hover {
    color: var(--brand-primary-hover);
}


/* =========================================================
   Application shell
   ========================================================= */

.app-shell {
    display: flex;
    min-height: 100vh;
}


/* =========================================================
   Sidebar
   ========================================================= */

.app-sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: var(--sidebar-width);

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background: var(--sidebar-bg);

    border-right:
        1px solid
        var(--border);

    z-index: 1000;
}

.sidebar-main {
    min-height: 0;
    overflow-y: auto;

    padding:
        14px
        10px
        18px;
}


/* =========================================================
   Sidebar brand
   ========================================================= */

.sidebar-brand {
    display: flex;
    align-items: center;

    gap: 10px;

    min-height: 62px;

    padding:
        3px
        6px
        15px;

    margin-bottom: 2px;
}

.sidebar-logo {
    width: 48px;
    height: 48px;

    object-fit: contain;

    flex: 0 0 48px;
}

.sidebar-brand-text {
    min-width: 0;
}

.sidebar-brand-name {
    color: var(--heading);

    font-size: 14px;
    font-weight: 700;

    line-height: 1.2;
}

.sidebar-brand-org {
    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;

    line-height: 1.2;
}


/* =========================================================
   Sidebar sections
   ========================================================= */

.sidebar-section-title {
    margin:
        17px
        8px
        6px;

    color: #8a9088;

    font-size: 10.5px;
    font-weight: 600;

    letter-spacing: 0.035em;

    text-transform: uppercase;
}


/* =========================================================
   Sidebar navigation
   ========================================================= */

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.sidebar-nav-link {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 9px;

    min-height: 36px;

    margin-bottom: 2px;

    padding:
        7px
        9px;

    border: 0;
    border-radius: 7px;

    background: transparent;

    color: var(--nav-text);

    font-family: inherit;
    font-size: 13.5px;
    font-weight: 400;

    line-height: 1.2;

    text-align: left;
    text-decoration: none;

    cursor: pointer;

    transition:
        background-color 120ms ease,
        color 120ms ease;
}

.sidebar-nav-link:hover {
    background: var(--nav-hover);

    color: var(--heading);

    text-decoration: none;
}

.sidebar-nav-link.active {
    background: var(--nav-active);

    color: var(--nav-active-text);

    font-weight: 600;
}


/* =========================================================
   Sidebar icons
   ========================================================= */

.sidebar-icon {
    width: 18px;
    height: 18px;

    flex: 0 0 18px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-icon svg {
    width: 17px;
    height: 17px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.7;

    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   Sidebar footer
   ========================================================= */

.sidebar-footer {
    flex: 0 0 auto;

    padding: 10px;

    background: var(--sidebar-bg);

    border-top:
        1px solid
        var(--border);
}

.sidebar-logout {
    font-family: inherit;
}


/* =========================================================
   Main application area
   ========================================================= */

.app-main {
    width:
        calc(
            100% - var(--sidebar-width)
        );

    min-width: 0;
    min-height: 100vh;

    margin-left:
        var(--sidebar-width);
}


/* =========================================================
   Top bar
   ========================================================= */

.app-topbar {
    position: sticky;

    top: 0;

    z-index: 900;

    height: 64px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding:
        0
        26px;

    background: var(--topbar-bg);

    border-bottom:
        1px solid
        var(--border);

    backdrop-filter: blur(8px);
}

.topbar-title {
    color: var(--heading);

    font-size: 16px;
    font-weight: 600;
}


/* =========================================================
   Current user
   ========================================================= */

.topbar-user {
    display: flex;
    align-items: center;

    gap: 10px;

    padding:
        5px
        7px;

    border-radius: 7px;

    color: inherit;

    text-decoration: none;

    transition:
        background-color 120ms ease;
}

.topbar-user:hover {
    background: var(--brand-primary-soft);

    color: inherit;

    text-decoration: none;
}

.topbar-user-text {
    text-align: right;
}

.topbar-user-name {
    font-size: 13px;
    font-weight: 600;

    line-height: 1.2;
}

.topbar-user-role {
    margin-top: 2px;

    color: var(--muted);

    font-size: 11px;

    line-height: 1.2;
}

.topbar-avatar {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 34px;

    border-radius: 50%;

    background: var(--brand-primary-soft);

    color: var(--brand-primary-active);

    font-size: 13px;
    font-weight: 700;
}


/* =========================================================
   Page content
   ========================================================= */

.app-content {
    width: 100%;

    max-width: 1500px;

    padding: 26px;

    margin: 0 auto;
}


/* =========================================================
   Typography
   ========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--heading);
}

h1 {
    font-size: 27px;
    font-weight: 700;

    letter-spacing: -0.015em;
}

h2 {
    font-size: 20px;
    font-weight: 650;
}

.text-muted {
    color: var(--muted) !important;
}


/* =========================================================
   Cards
   ========================================================= */

.card {
    background: var(--surface);

    border:
        1px solid
        var(--border);

    border-radius: 9px;

    box-shadow:
        0 1px 2px
        rgba(40, 50, 42, 0.025);
}

.card-body {
    padding: 20px;
}

.card-header,
.card-footer {
    border-color: var(--border);
}


/* =========================================================
   List groups
   ========================================================= */

.list-group-item {
    border-color: var(--border-light);
}

.list-group-item-action {
    color: var(--text);

    transition:
        background-color 100ms ease,
        color 100ms ease;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background: #f7f8f5;

    color: var(--text);
}


/* =========================================================
   Tables
   ========================================================= */

.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #f7f8f5;
}

.table > :not(caption) > * > * {
    padding-top: 0.72rem;
    padding-bottom: 0.72rem;
}

.table thead th {
    color: #737a72;

    font-size: 11px;
    font-weight: 600;

    letter-spacing: 0.035em;

    text-transform: uppercase;

    border-bottom-color:
        var(--border);
}

.table tbody td {
    border-bottom-color:
        var(--border-light);
}

.table-hover > tbody > tr:hover > * {
    --bs-table-bg-state:
        #f7f8f5;
}


/* =========================================================
   Forms
   ========================================================= */

.form-label {
    color: #4d554e;

    font-weight: 500;
}

.form-control,
.form-select {
    color: var(--text);

    background-color: var(--surface);

    border-color: #d2d4ce;

    border-radius: 7px;
}

.form-control:hover,
.form-select:hover {
    border-color: #bfc5bc;
}

.form-control:focus,
.form-select:focus {
    border-color: #8ea294;

    box-shadow:
        0 0 0 0.15rem
        rgba(101, 123, 105, 0.16);
}


/* =========================================================
   Buttons
   ========================================================= */

.btn {
    border-radius: 7px;

    font-weight: 500;

    transition:
        background-color 120ms ease,
        border-color 120ms ease,
        color 120ms ease,
        box-shadow 120ms ease;
}

.btn-primary {
    background: var(--brand-primary);

    border-color: var(--brand-primary);

    color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--brand-primary-hover);

    border-color: var(--brand-primary-hover);

    color: #ffffff;
}

.btn-primary:active,
.btn-primary.active,
.show > .btn-primary.dropdown-toggle {
    background: var(--brand-primary-active);

    border-color: var(--brand-primary-active);

    color: #ffffff;
}

.btn-primary:focus {
    box-shadow:
        0 0 0 0.2rem
        rgba(101, 123, 105, 0.20);
}

.btn-outline-primary {
    color: var(--brand-primary-hover);

    border-color: #899b8c;

    background: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: #ffffff;

    background: var(--brand-primary);

    border-color: var(--brand-primary);
}

.btn-outline-primary:focus {
    box-shadow:
        0 0 0 0.2rem
        rgba(101, 123, 105, 0.18);
}

.btn-outline-secondary {
    color: #666c65;

    border-color: #c7cbc5;
}

.btn-outline-secondary:hover {
    color: #444b45;

    background: #eceeea;

    border-color: #bcc1bb;
}


/* =========================================================
   Badges / statuses
   ========================================================= */

/*
 * Statuses are intentionally not pill-shaped.
 */

.badge {
    padding:
        5px
        8px;

    border-radius:
        var(--status-radius) !important;

    font-weight: 600;
}

.badge.rounded-pill,
.status-pill,
.status-badge {
    border-radius:
        var(--status-radius) !important;
}


/*
 * Shared custom status indicators.
 */

.status-pill,
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding:
        4px
        8px;

    font-size: 0.78rem;
    font-weight: 600;

    line-height: 1.2;

    white-space: nowrap;
}


/*
 * IMPORTANT:
 *
 * Status colours are deliberately scoped to badges/status
 * indicators. Workflow-step buttons use the same semantic
 * class names but should remain white unless they are active.
 */


/* Pending / Incomplete */

.status-pill.status-pending,
.status-badge.status-pending,
.badge.status-pending {
    background: var(--status-pending-bg);

    border:
        1px solid
        var(--status-pending-border);

    color: var(--status-pending-text);
}


/* To Be Booked / To Be Sent */

.status-pill.status-action,
.status-badge.status-action,
.badge.status-action {
    background: var(--status-action-bg);

    border:
        1px solid
        var(--status-action-border);

    color: var(--status-action-text);
}


/* Booked / Sent */

.status-pill.status-progress,
.status-badge.status-progress,
.badge.status-progress {
    background: var(--status-progress-bg);

    border:
        1px solid
        var(--status-progress-border);

    color: var(--status-progress-text);
}


/* Completed / Received */

.status-pill.status-complete,
.status-badge.status-complete,
.badge.status-complete {
    background: var(--status-complete-bg);

    border:
        1px solid
        var(--status-complete-border);

    color: var(--status-complete-text);
}


/* N/A */

.status-pill.status-na,
.status-badge.status-na,
.badge.status-na {
    background: var(--status-na-bg);

    border:
        1px solid
        var(--status-na-border);

    color: var(--status-na-text);
}


/* =========================================================
   Bootstrap badge colour cleanup
   ========================================================= */

.text-bg-success,
.text-bg-secondary,
.text-bg-primary,
.text-bg-info,
.text-bg-warning,
.text-bg-danger {
    border-radius:
        var(--status-radius) !important;
}


/*
 * Standard green Bootstrap success badges are softened so
 * they fit the overall application palette.
 */

.badge.bg-success,
.badge.text-bg-success {
    background-color:
        var(--status-complete-bg) !important;

    border:
        1px solid
        var(--status-complete-border);

    color:
        var(--status-complete-text) !important;
}


/*
 * Neutral secondary badges.
 */

.badge.bg-secondary,
.badge.text-bg-secondary {
    background-color:
        var(--status-na-bg) !important;

    border:
        1px solid
        var(--status-na-border);

    color:
        var(--status-na-text) !important;
}


/* =========================================================
   Tabs
   ========================================================= */

.nav-tabs {
    border-bottom-color:
        var(--border);
}

.nav-tabs .nav-link {
    color: #687169;

    border: 0;

    border-bottom:
        2px solid
        transparent;

    border-radius: 0;

    background: transparent;

    font-weight: 500;

    transition:
        color 120ms ease,
        border-color 120ms ease;
}

.nav-tabs .nav-link:hover {
    color: var(--brand-primary-hover);

    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--brand-primary-active);

    background: transparent;

    border-bottom-color:
        var(--brand-primary);
}


/* =========================================================
   Pagination
   ========================================================= */

.page-link {
    color: var(--brand-primary-hover);
}

.page-link:hover {
    color: var(--brand-primary-active);

    background: var(--brand-primary-soft);

    border-color: var(--border);
}

.page-item.active .page-link {
    color: #ffffff;

    background: var(--brand-primary);

    border-color: var(--brand-primary);
}


/* =========================================================
   Alerts
   ========================================================= */

.alert {
    border-radius: 7px;
}


/* =========================================================
   Dropdowns
   ========================================================= */

.dropdown-menu {
    border-color: var(--border);

    border-radius: 8px;

    box-shadow:
        0 5px 18px
        rgba(40, 50, 42, 0.08);
}

.dropdown-item:active,
.dropdown-item.active {
    color: var(--nav-active-text);

    background: var(--nav-active);
}


/* =========================================================
   Modals
   ========================================================= */

.modal-content {
    border-color: var(--border);

    border-radius: 10px;

    box-shadow:
        0 12px 40px
        rgba(40, 50, 42, 0.14);
}

.modal-header,
.modal-footer {
    border-color: var(--border);
}


/* =========================================================
   Collapse / light panels
   ========================================================= */

.bg-light {
    background-color:
        var(--surface-soft) !important;
}


/* =========================================================
   Focus visibility
   ========================================================= */

a:focus-visible,
button:focus-visible,
.sidebar-nav-link:focus-visible {
    outline:
        2px solid
        rgba(101, 123, 105, 0.55);

    outline-offset: 2px;
}


/* =========================================================
   Miscellaneous
   ========================================================= */

hr {
    margin: 28px 0;

    border-color: var(--border);

    opacity: 1;
}


/* =========================================================
   Scrollbars
   ========================================================= */

.sidebar-main {
    scrollbar-width: thin;

    scrollbar-color:
        #c4cbc3
        transparent;
}

.sidebar-main::-webkit-scrollbar {
    width: 7px;
}

.sidebar-main::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-main::-webkit-scrollbar-thumb {
    background: #c4cbc3;

    border-radius: 4px;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {

    :root {
        --sidebar-width: 190px;
    }

    .sidebar-logo {
        width: 42px;
        height: 42px;

        flex-basis: 42px;
    }

    .sidebar-brand-name {
        font-size: 13px;
    }

    .sidebar-nav-link {
        font-size: 13px;
    }

    .app-content {
        padding: 20px;
    }

    .app-topbar {
        padding:
            0
            20px;
    }
}


@media (max-width: 700px) {

    .app-shell {
        display: block;
    }

    .app-sidebar {
        position: static;

        width: 100%;

        min-height: auto;

        border-right: 0;

        border-bottom:
            1px solid
            var(--border);
    }

    .sidebar-main {
        padding-bottom: 10px;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-section-title {
        width: 100%;
    }

    .sidebar-nav-link {
        width: auto;

        margin-right: 3px;
    }

    .sidebar-footer {
        display: none;
    }

    .app-main {
        width: 100%;

        margin-left: 0;
    }

    .app-topbar {
        padding:
            0
            16px;
    }

    .topbar-user-text {
        display: none;
    }

    .app-content {
        padding: 16px;
    }
}