/* PeerConnect design system.
   Extracted from App/views/includes/design_system.php so the browser can
   cache it. It used to be inlined into every member page, which meant the
   same ~110 KB was re-downloaded on every navigation.
   Edit this file, not a <style> block. */

    :root {
        /* ── Brand / Neutral palette ── */
        --forest: #020547;
        /* primary: dark navy */
        --forest-2: #0077B6;
        /* hover state — lighter blue */
        --mint: #0087CF;
        /* secondary — brightest blue, for links/badges/small accents */
        --mint-soft: #BFE3F4;
        /* light blue tint for chips, hover */
        --mint-faint: #EAF6FB;
        --mint-deep: #00539B;
        /* very light blue for backgrounds */
        --gold: #F2B705;
        /* ratings, alerts — accent gold */
        --gold-light: #FEF6DC;
        /* gold background tint */

        /* ── Neutral scale ── */
        --ink: #181D27;
        /* body text — near-black neutral */
        --gray-900: #181D27;
        --gray-800: #262B36;
        --gray-700: #3D424D;
        --gray-600: #565B66;
        --gray-500: #717680;
        --gray-400: #9A9EA6;
        --gray-300: #C2C5CA;
        --gray-200: #DADCDF;
        --gray-100: #EDEDED;
        --gray-50: #F5F5F5;
        /* cloud — page canvas */

        /* ── Surfaces ── */
        --surface: #ffffff;
        --bg: #EDEDED;
        /* cloud canvas — replaces pure white page bg */
        --border: #C2C5CA;

        /* ── Keep --navy aliased to forest so inline style="color:var(--navy)" still works ── */
        --navy: #023047;
        --navy-2: #0077B6;

        /* ── Keep --accent aliased to mint so focus rings & existing accent refs still work ── */
        --accent: #0087CF;
        --accent-2: #0087CF;
        --accent-soft: #BFE3F4;
        --accent-faint: #EAF6FB;

        /* ── Semantic ── */
        --danger: #C0392B;
        --danger-bg: #FDECEA;
        --success: #1F7A5C;
        --success-bg: #E6F4EE;
        --warning: #B87A10;
        --warning-bg: #FEF3E2;
        --info: #1A5C9A;
        --info-bg: #EAF1FB;
        --purple: #5B4FCF;
        --purple-bg: #EFEDFC;

        /* ── Elevation ── */
        --shadow-xs: 0 1px 3px rgba(24, 29, 39, .06);
        --shadow-sm: 0 4px 16px rgba(24, 29, 39, .08);
        --shadow-md: 0 12px 32px rgba(24, 29, 39, .10);
        --shadow-lg: 0 24px 56px rgba(24, 29, 39, .14);

        /* ── Radius — distinct 3-step scale ── */
        --radius-sm: 6px;
        --radius: 10px;
        --radius-lg: 14px;
        --radius-xl: 20px;
    }

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

    html {
        min-height: 100%;
        scroll-behavior: smooth;
    }

    body {
        margin: 0;
        min-height: 100%;
        background: var(--bg);
        color: var(--ink);
        font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        font-size: 14px;
        line-height: 1.55;
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
    }

    img {
        max-width: 100%;
        display: block;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    button,
    input,
    select,
    textarea {
        font: inherit;
    }

    button {
        letter-spacing: 0;
    }

    .hidden {
        display: none !important;
    }

    .app {
        min-height: 100vh;
        background: var(--bg);
    }

    .app:has(#sidebar) {
        display: grid;
        grid-template-columns: 260px minmax(0, 1fr);
        grid-template-rows: 68px minmax(0, 1fr);
        height: 100vh;
        overflow: hidden;
    }

    /* toggleSidebar() (see app_shell.php) adds/removes .collapsed on #sidebar
       to shrink it to a 68px icon rail — without this, the grid column stayed
       reserved at 220px and the freed space just sat empty next to main. */
    .app:has(#sidebar.collapsed) {
        grid-template-columns: 68px minmax(0, 1fr);
    }

    .main {
        min-width: 0;
        padding: 36px 48px 64px;
        background: var(--bg);
    }

    .app:has(#sidebar) .main {
        grid-column: 2;
        grid-row: 2;
        overflow-y: auto;
    }

    .app-topbar,
    .guest-topbar {
        min-height: 68px;
        background: var(--forest);
        border-bottom: none;
        display: flex;
        align-items: center;
        gap: 20px;
        z-index: 80;
    }

    /* Sidebar now runs the full height on the left (see #sidebar below), so
       the topbar only occupies the column to its right — reference layout,
       not the previous full-width dark bar with the sidebar tucked under it. */
    .app-topbar {
        grid-column: 2;
        grid-row: 1;
        padding: 0 28px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
    }

    .guest-topbar {
        position: sticky;
        top: 0;
        margin: -36px -48px 36px;
        padding: 0 48px;
    }

    .brand {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        color: #ffffff;
        font-size: 18px;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
        letter-spacing: -0.01em;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
        color: #ffffff;
        flex: 0 0 auto;
    }

    /* An uploaded logo keeps the slot's height but sets its own width, so a
       300x100-ish wordmark reads properly instead of being squared off. */
    img.brand-mark.is-custom {
        width: auto;
        max-width: 132px;
        height: 30px;
        object-fit: contain;
    }

    .topbar-center {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
    }

    .topbar-browse {
        height: 40px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 0 16px;
        border: 1px solid rgba(255, 255, 255, .22);
        border-radius: var(--radius-sm);
        background: rgba(255, 255, 255, .10);
        color: rgba(255, 255, 255, .90);
        font-size: 14px;
        font-weight: 500;
        white-space: nowrap;
        transition: background .15s;
    }

    .topbar-browse:hover {
        background: rgba(255, 255, 255, .18);
    }

    .topbar-search {
        width: min(100%, 340px);
        height: 40px;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0 14px;
        border: 1px solid rgba(255, 255, 255, .22);
        border-radius: var(--radius-sm);
        background: rgba(255, 255, 255, .10);
        color: rgba(255, 255, 255, .70);
    }

    .topbar-search input {
        width: 100%;
        min-width: 0;
        border: 0;
        outline: 0;
        background: transparent;
        color: #ffffff;
        font-size: 14px;
        font-family: inherit;
    }

    .topbar-search input::placeholder {
        color: rgba(255, 255, 255, .55);
    }

    .topbar-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
    }

    /* Topbar is a light surface now (see .app-topbar above), so these need
       dark-on-light instead of the old white-on-navy treatment. */
    .icon-btn {
        width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: var(--gray-50);
        color: var(--gray-600);
        cursor: pointer;
        transition: background .15s;
    }

    .icon-btn:hover {
        background: var(--mint-faint);
        color: var(--forest);
    }

    .icon-btn.soft {
        border: 1px solid var(--border);
        background: var(--gray-50);
        color: var(--gray-600);
    }

    .notification-dot {
        position: absolute;
        top: -5px;
        right: -4px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        border-radius: 999px;
        background: var(--gold);
        color: var(--forest);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 9px;
        font-weight: 700;
        border: 2px solid var(--surface);
    }

    /* Logo shown in the topbar only on mobile, where the sidebar becomes a
       bottom tab bar with no room for it (see the 700px breakpoint below). */
    .topbar-brand-mobile {
        display: none;
    }

    .topbar-profile-btn {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        height: 44px;
        padding: 4px 10px 4px 4px;
        border: 1px solid var(--border);
        border-radius: 999px;
        background: var(--surface);
        cursor: pointer;
        font-family: inherit;
    }

    .topbar-profile-btn:hover {
        background: var(--gray-50);
    }

    .tp-avatar {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        background: var(--mint-soft);
        color: var(--forest);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 13px;
        flex-shrink: 0;
        overflow: hidden;
    }

    .tp-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .tp-name {
        font-size: 13.5px;
        font-weight: 600;
        color: var(--gray-800);
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-profile-btn svg {
        width: 14px;
        height: 14px;
        color: var(--gray-400);
        flex-shrink: 0;
    }

    #topbarProfileMenu {
        display: none;
        position: absolute;
        top: 58px;
        right: 28px;
        width: 240px;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--surface);
        box-shadow: var(--shadow-lg);
        z-index: 250;
    }

    #topbarProfileMenu.open {
        display: block;
    }

    #sidebar {
        grid-column: 1;
        grid-row: 1 / -1;
        width: 260px;
        min-width: 260px;
        height: 100vh;
        background: var(--forest);
        border-right: none;
        padding: 20px 12px 16px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        overflow: visible;
        transition: width .2s ease, min-width .2s ease;
        position: relative;
        z-index: 60;
    }

    #sidebar.collapsed {
        width: 68px;
        min-width: 68px;
    }

    .sb-logo {
        display: block;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, .5);
        padding: 0 12px 10px;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
        margin-bottom: 8px;
    }

    /* Sidebar brand block — replaces the old topbar logo; the topbar's own
       pc_logo() call is now mobile-only (see .topbar-brand-mobile). */
    .sb-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 4px 10px 18px;
        margin-bottom: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .sb-brand-mark {
        width: 34px;
        height: 34px;
        flex: 0 0 auto;
        color: #ffffff;
    }

    /* Uppercase wordmark, matching the landing page. */
    .sb-brand-word {
        letter-spacing: .2px;
    }

    .sb-brand-word {
        font-size: 16px;
        font-weight: 800;
        letter-spacing: -0.01em;
        line-height: 1.1;
        white-space: nowrap;
    }

    .sb-brand-word .w-peer {
        color: #ffffff;
    }

    .sb-brand-word .w-connect {
        color: var(--mint);
    }

    .sb-brand-tagline {
        font-size: 10px;
        color: rgba(255, 255, 255, .5);
        margin-top: 2px;
        white-space: nowrap;
    }

    #sidebar.collapsed .sb-brand-word,
    #sidebar.collapsed .sb-brand-tagline {
        display: none;
    }

    /* Motivational card above the user footer — matches the reference. */
    .sb-promo {
        margin: 14px 4px;
        padding: 16px 14px;
        border-radius: var(--radius-lg);
        background: rgba(255, 255, 255, .06);
        border: 1px solid rgba(255, 255, 255, .10);
    }

    .sb-promo-icon {
        width: 34px;
        height: 34px;
        border-radius: var(--radius-sm);
        background: rgba(0, 135, 207, .22);
        color: var(--mint);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 10px;
    }

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

    .sb-promo-title {
        font-size: 13px;
        font-weight: 700;
        color: #ffffff;
        line-height: 1.3;
        margin-bottom: 4px;
    }

    .sb-promo-body {
        font-size: 11.5px;
        color: rgba(255, 255, 255, .6);
        line-height: 1.45;
    }

    #sidebar.collapsed .sb-promo {
        display: none;
    }

    .sb-section-label {
        display: block;
        margin: 0;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: .07em;
        text-transform: uppercase;
        color: var(--gray-400);
        padding: 12px 14px 4px;
    }

    .sb-nav > .sb-section-label:first-child {
        padding-top: 0;
    }

    .sb-nav {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        flex: 1;
    }

    .sb-link {
        width: 100%;
        min-height: 44px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 11px;
        border: 0;
        border-radius: var(--radius-sm);
        background: transparent;
        color: rgba(255, 255, 255, .68);
        cursor: pointer;
        font-size: 13.5px;
        font-weight: 500;
        line-height: 1;
        text-align: left;
        padding: 0 14px;
        transition: background .14s ease, color .14s ease;
        white-space: nowrap;
        text-decoration: none;
        position: relative;
    }

    .sb-link svg {
        width: 18px;
        height: 18px;
        flex: 0 0 auto;
        stroke-width: 1.7;
    }

    .sb-link:hover {
        background: rgba(255, 255, 255, .08);
        color: #ffffff;
    }

    .sb-link.active {
        background: var(--mint);
        color: #ffffff;
        font-weight: 600;
    }

    #sidebar.collapsed .menu-label {
        display: none;
    }

    #sidebar.collapsed .sb-section-label,
    #sidebar.collapsed .sb-logo {
        display: none;
    }

    #sidebar.collapsed .sb-link {
        justify-content: center;
        padding: 0;
        min-height: 44px;
    }

    /* "More" overflow — mobile-only; desktop sidebar already lists everything */

    .sb-footer {
        width: 100%;
        margin-top: auto;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, .12);
        position: relative;
    }

    .sb-footer .sb-link {
        color: #ffffff;
    }

    .sb-footer .menu-label {
        color: rgba(255, 255, 255, .55);
    }

    .sb-user {
        width: 34px;
        height: 34px;
        border-radius: var(--radius-sm);
        background: rgba(255, 255, 255, .14);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 13px;
        flex-shrink: 0;
    }

    #profileMenu {
        display: none;
        position: absolute;
        left: 220px;
        bottom: 0;
        width: 268px;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--surface);
        box-shadow: var(--shadow-lg);
        z-index: 250;
    }

    #profileMenu.open {
        display: block;
    }

    .pm-head {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 6px 6px 10px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 6px;
    }

    .pm-avatar {
        width: 36px;
        height: 36px;
        border-radius: var(--radius-sm);
        background: var(--mint-soft);
        color: var(--forest);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
    }

    .pm-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 9px 10px;
        border-radius: var(--radius-sm);
        color: var(--gray-700);
        font-size: 13.5px;
        font-weight: 500;
    }

    .pm-link svg {
        width: 16px;
        height: 16px;
    }

    .pm-link:hover {
        background: var(--gray-50);
    }

    .pm-link.red {
        color: var(--danger);
    }

    .page-hd {
        margin-bottom: 28px;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--border);
    }

    .page-hd h1 {
        margin: 0;
        color: var(--forest);
        font-size: 26px;
        font-weight: 600;
        letter-spacing: -0.02em;
        line-height: 1.2;
    }

    .page-hd p {
        margin: 6px 0 0;
        max-width: 640px;
        color: var(--gray-600);
        font-size: 14px;
        line-height: 1.55;
    }

    .section-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        margin-bottom: 14px;
    }

    .sec-title,
    .section-title {
        margin: 0 0 14px;
        color: var(--forest);
        font-size: 16px;
        font-weight: 600;
        letter-spacing: -0.01em;
    }

    .muted {
        color: var(--gray-500);
    }

    .card,
    .panel-card,
    .widget,
    .fb-wrap,
    .chart-card,
    .tbl-card,
    .req-row,
    .mentor-card,
    .conv-panel,
    .chat-pane,
    .vstat,
    .stat-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        box-shadow: none;
    }

    .card-p {
        padding: 20px;
    }

    .card:hover,
    .mentor-card:hover,
    .stat-card:hover,
    .vstat:hover {
        box-shadow: var(--shadow-sm);
        transform: none;
    }

    .btn,
    .act-btn,
    .tab-btn,
    .top-tab,
    .session-tab {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-height: 38px;
        padding: 8px 16px;
        border: 1px solid transparent;
        border-radius: var(--radius-sm);
        color: var(--ink);
        background: var(--surface);
        cursor: pointer;
        font-size: 13.5px;
        font-weight: 500;
        text-decoration: none;
        transition: background .14s ease, border-color .14s ease, color .14s ease;
        letter-spacing: 0;
        text-transform: none;
        white-space: nowrap;
        font-family: inherit;
    }

    .btn-blue,
    .btn-primary,
    .act-blue,
    .tab-btn.active,
    .top-tab.t-active,
    .session-tab.st-active {
        background: var(--forest);
        border-color: var(--forest);
        color: #fff;
        box-shadow: none;
    }

    .btn-blue:hover,
    .btn-primary:hover,
    .act-blue:hover {
        background: var(--forest-2);
        border-color: var(--forest-2);
    }

    .btn-ghost,
    .act-gray,
    .top-tab.t-inactive,
    .session-tab.st-inactive {
        background: var(--gray-50);
        border-color: var(--border);
        color: var(--gray-700);
    }

    .btn-ghost:hover,
    .act-gray:hover {
        background: var(--gray-100);
    }

    .btn-red,
    .act-red {
        background: var(--danger-bg);
        color: var(--danger);
        border-color: #f5c0bc;
    }

    .btn-red:hover,
    .act-red:hover {
        background: var(--danger);
        color: #fff;
    }

    .btn-success,
    .act-green {
        background: var(--forest);
        border-color: var(--forest);
        color: #fff;
    }

    .form-label,
    label {
        color: var(--gray-700);
        font-size: 12.5px;
        font-weight: 600;
    }

    .form-input,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        width: 100%;
        min-height: 42px;
        padding: 9px 13px;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: var(--surface);
        color: var(--ink);
        outline: none;
        font-family: inherit;
        font-size: 14px;
        transition: border-color .14s ease, box-shadow .14s ease;
    }

    textarea {
        min-height: 100px;
    }

    .form-input:focus,
    input:focus,
    select:focus,
    textarea:focus {
        border-color: var(--forest);
        box-shadow: 0 0 0 3px rgba(31, 78, 69, .12);
    }

    .search-wrap .form-input,
    .search-input {
        min-height: 44px;
        border-radius: var(--radius-sm);
        background: var(--surface);
    }

    .filter-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        margin-bottom: 24px;
    }

    .badge,
    .role-pill {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 3px 9px;
        border-radius: var(--radius-sm);
        font-size: 11.5px;
        font-weight: 600;
        line-height: 1;
    }

    .badge-pending,
    .badge-orange {
        background: var(--gold-light);
        color: var(--warning);
    }

    .badge-approved,
    .badge-green,
    .badge-completed {
        background: var(--mint-faint);
        color: var(--forest);
    }

    .badge-rejected,
    .badge-missed,
    .badge-red {
        background: var(--danger-bg);
        color: var(--danger);
    }

    .badge-blue {
        background: var(--info-bg);
        color: var(--info);
    }

    .badge-gray,
    .badge-cancelled {
        background: var(--gray-100);
        color: var(--gray-600);
    }

    .tbl,
    table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .tbl th,
    table th {
        padding: 11px 16px;
        background: var(--gray-50);
        border-bottom: 1px solid var(--border);
        color: var(--gray-500);
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .05em;
        text-align: left;
        text-transform: uppercase;
    }

    .tbl td,
    table td {
        padding: 13px 16px;
        border-bottom: 1px solid var(--border);
        color: var(--gray-700);
        vertical-align: middle;
        font-size: 13.5px;
    }

    .tbl tbody tr:hover,
    table tbody tr:hover {
        background: var(--mint-faint);
    }

    .tbl-avatar,
    .avatar {
        width: 36px;
        height: 36px;
        border-radius: var(--radius-sm);
        background: var(--mint-soft);
        color: var(--forest);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        overflow: hidden;
        flex-shrink: 0;
    }

    .empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 54px 24px;
        color: var(--gray-500);
        text-align: center;
    }

    .empty-icon {
        width: 58px;
        height: 58px;
        border-radius: 50%;
        background: var(--gray-100);
        color: var(--gray-500);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 14px;
        font-weight: 800;
    }

    /* Label text for screen readers only — used where an icon already
       carries the meaning visually (e.g. the icon-only select filters). */
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    .stars,
    .stars-on {
        color: var(--gold);
    }

    .stars-empty,
    .stars-off {
        color: var(--gray-200);
    }

    .modal-overlay,
    .m-overlay {
        position: fixed;
        inset: 0;
        display: none;
        align-items: center;
        justify-content: center;
        background: rgba(31, 78, 69, .45);
        backdrop-filter: blur(4px);
        z-index: 300;
        padding: 20px;
    }

    .modal-overlay.open,
    .m-overlay:not(.hidden) {
        display: flex;
    }

    .modal-box,
    .m-box {
        max-width: min(96vw, 680px);
        max-height: 92vh;
        overflow: auto;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
    }

    .fade-in {
        animation: fadeIn .24s ease both;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(8px);
        }

        to {
            opacity: 1;
            transform: none;
        }
    }

    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    ::-webkit-scrollbar-track {
        background: transparent;
    }

    ::-webkit-scrollbar-thumb {
        background: #a5a5a5;
        border-radius: 999px;
    }

    @media (max-width: 1180px) {
        .app-topbar {
            padding: 0 20px;
        }

        .main {
            padding: 28px 28px 56px;
        }

        .guest-topbar {
            margin: -28px -28px 28px;
            padding: 0 28px;
        }

        .topbar-search {
            width: 260px;
        }
    }

    @media (max-width: 960px) {

        /* Collapse sidebar to icon-only at tablet */
        #sidebar {
            width: 68px;
            min-width: 68px;
            padding: 16px 8px;
            align-items: center;
        }

        .app:has(#sidebar) {
            grid-template-columns: 68px minmax(0, 1fr);
        }

        .sb-logo,
        .sb-section-label,
        .menu-label,
        .sb-brand-word,
        .sb-brand-tagline,
        .sb-promo {
            display: none !important;
        }

        .sb-brand {
            justify-content: center;
            padding: 4px 0 14px;
        }

        .sb-link {
            justify-content: center;
            padding: 0;
            border-radius: var(--radius-sm);
        }

        #profileMenu {
            left: 72px;
        }
    }

    @media (max-width: 700px) {
        .app:has(#sidebar) {
            display: grid;
            /* minmax(0, 1fr), not 1fr: a bare 1fr track carries an implicit
               min-width:auto, so any grid item whose min-content is wider than
               the screen stretches the track — and .main, plus every card in
               it, then rendered wider than the viewport and the whole page
               scrolled sideways. The desktop rules above were already guarded
               this way; this one was not. */
            grid-template-columns: minmax(0, 1fr);
            grid-template-rows: 60px minmax(0, 1fr);
            overflow: visible;
            /* The desktop rule fixes this at height:100vh so .main can
               scroll internally — at this breakpoint .main scrolls with
               the page instead, so height:100vh here just clips the 1fr
               row to the viewport and strands .main's own bottom padding
               (and anything after it) behind the fixed bottom nav bar.
               height:auto lets the grid — and the page — grow with the
               actual content. */
            height: auto;
            min-height: 100vh;
        }

        .app-topbar {
            grid-column: 1;
            grid-row: 1;
            min-height: 60px;
            padding: 0 16px;
            position: sticky;
            top: 0;
            /* Sidebar becomes a bottom tab bar at this width (below), so the
               brand has nowhere else to live — restore the dark topbar and
               show the logo that's hidden everywhere above this breakpoint. */
            background: var(--forest);
            border-bottom: none;
        }

        .topbar-brand-mobile {
            display: inline-flex;
            /* The row is brand + 3 icon buttons + the profile chip. Adding the
               menu button pushed that past 390px, and because .app is a grid
               the whole page then scrolled sideways. The actions are all
               fixed-size targets, so the brand is what gives: it shrinks and
               truncates instead of forcing the row wider. */
            min-width: 0;
            overflow: hidden;
            flex: 0 1 auto;
        }

        .topbar-brand-mobile .brand {
            min-width: 0;
        }

        .topbar-brand-mobile .brand span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .topbar-actions {
            flex-shrink: 0;
        }

        .app-topbar {
            gap: 10px;
        }

        .topbar-center {
            display: none;
        }

        .topbar-actions .btn:not(.mobile-keep),
        .topbar-actions .topbar-secondary {
            display: none;
        }

        .icon-btn {
            border-color: rgba(255, 255, 255, .22);
            background: rgba(255, 255, 255, .10);
            color: rgba(255, 255, 255, .90);
        }

        .icon-btn:hover {
            background: rgba(255, 255, 255, .20);
            color: #ffffff;
        }

        .notification-dot {
            border-color: var(--forest);
        }

        .topbar-profile-btn {
            border-color: rgba(255, 255, 255, .22);
            background: rgba(255, 255, 255, .10);
        }

        .topbar-profile-btn:hover {
            background: rgba(255, 255, 255, .18);
        }

        .tp-name {
            display: none;
        }

        @media (max-width: 430px) {
            .app-topbar .icon-btn {
                width: 34px;
                height: 34px;
            }
        }

        .topbar-profile-btn svg {
            color: rgba(255, 255, 255, .7);
        }

        #topbarProfileMenu {
            top: 52px;
            right: 16px;
        }

        #sidebar {
            position: fixed;
            left: 0;
            right: 0;
            bottom: 0;
            top: auto;
            width: 100% !important;
            min-width: 0 !important;
            height: 68px;
            padding: 6px 10px;
            border-right: 0;
            border-top: 1px solid var(--border);
            flex-direction: row;
            background: rgba(255, 255, 255, .97);
            backdrop-filter: blur(14px);
            align-items: stretch;
        }

        .sb-brand,
        .sb-promo {
            display: none;
        }

        .sb-link {
            color: var(--gray-500);
        }

        .sb-link.active {
            background: var(--mint-faint);
            color: var(--forest);
        }

        .sb-nav {
            flex-direction: row;
            gap: 4px;
        }

        .sb-link {
            min-height: 52px;
            flex-direction: column;
            gap: 3px;
            font-size: 10px;
            justify-content: center;
            align-items: center;
            padding: 0;
        }

        .sb-link svg {
            width: 20px;
            height: 20px;
        }

        .sb-link.active::before {
            display: none;
        }

        /* Five real destinations in the bottom bar. The 5th used to be a
           "More" disclosure; everything past the fifth now lives in the
           slide-in menu the topbar button opens, so the last slot can be a
           page you actually go to (Assessments for both roles).

           The bar cannot be "the first five links" any more: the sidebar now
           renders them grouped under section headings, which is a different
           order. PHP stamps each bar link with data-bar="1..5" and the order
           property puts them back in the intended sequence. */
        .sb-nav .sb-link {
            display: none;
        }

        .sb-nav .sb-link[data-bar] {
            display: flex;
        }

        .sb-nav .sb-link[data-bar="1"] { order: 1; }
        .sb-nav .sb-link[data-bar="2"] { order: 2; }
        .sb-nav .sb-link[data-bar="3"] { order: 3; }
        .sb-nav .sb-link[data-bar="4"] { order: 4; }
        .sb-nav .sb-link[data-bar="5"] { order: 5; }







        .sb-footer {
            display: none;
        }

        .app:has(#sidebar) .main {
            grid-column: 1;
            grid-row: 2;
            padding: 22px 16px 96px;
            overflow: visible;
        }

        .main {
            padding: 22px 16px 72px;
        }

        .guest-topbar {
            margin: -22px -16px 22px;
            padding: 0 16px;
            min-height: 60px;
        }

        .guest-topbar .topbar-actions {
            gap: 6px;
        }

        .guest-topbar .btn {
            min-height: 36px;
            padding: 6px 12px;
            font-size: 13px;
        }

        .page-hd h1 {
            font-size: 22px;
        }

        .page-hd p {
            font-size: 13px;
        }

        /* Page headers that lay their title and an action row side by side
           (display:flex is set per page) run out of room here — let the
           actions drop to their own line instead of overflowing the right
           edge. Inert on headers that aren't flex containers. */
        .page-hd {
            flex-wrap: wrap;
        }

        /* The sidebar is a bottom tab bar at this width, so collapsing it
           does nothing — the header's toggle has no job on mobile. */
        .page-hd .btn-icon {
            display: none;
        }
    }

    @media (max-width: 480px) {

        .filter-bar {
            width: 100%;
        }

        /* Only the GUEST topbar wraps its actions onto their own line (see
           .guest-topbar below). Applying width:100% to every .topbar-actions
           also hit the app topbar, where the row does not wrap: the actions
           ate the whole line and squeezed the brand beside them to 0px, so
           the logo silently disappeared under 480px. */
        .guest-topbar .topbar-actions {
            width: 100%;
        }

        .guest-topbar {
            flex-wrap: wrap;
            height: auto;
            padding-top: 12px;
            padding-bottom: 12px;
        }

        .guest-topbar .brand {
            flex: 1;
        }

        .guest-topbar .topbar-actions {
            justify-content: flex-start;
        }

        .page-hd {
            margin-bottom: 18px;
        }

        .btn,
        .act-btn {
            width: auto;
        }
    }

    /* ═══════════════════════════════════════════════════════
       PEERCONNECT COMPONENT LIBRARY v2  — Slate & Mint
       All components below are additive; existing class names
       are preserved for backward-compatibility.
    ═══════════════════════════════════════════════════════ */

    /* ── Focus visible global ring (accessibility) ─────── */
    :focus-visible {
        outline: 2px solid var(--forest);
        outline-offset: 2px;
        border-radius: var(--radius-sm);
    }

    /* ── BUTTONS ────────────────────────────────────────── */

    /* Base — all semantic sizes share the same base */
    .btn,
    .act-btn {
        position: relative;
        overflow: hidden;
        letter-spacing: 0.01em;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* Ripple on click — pure CSS, no JS */
    .btn::after,
    .act-btn::after {
        content: '';
        position: absolute;
        inset: 0;
        background: currentColor;
        opacity: 0;
        transition: opacity .18s ease;
        border-radius: inherit;
    }

    .btn:active::after,
    .act-btn:active::after {
        opacity: .08;
        transition: none;
    }

    /* Size variants */
    .btn-sm {
        min-height: 32px;
        padding: 5px 12px;
        font-size: 12.5px;
    }

    .btn-lg {
        min-height: 44px;
        padding: 10px 22px;
        font-size: 15px;
    }

    /* Outline variant */
    .btn-outline {
        background: transparent;
        border-color: var(--forest);
        color: var(--forest);
    }

    .btn-outline:hover {
        background: var(--mint-faint);
    }

    /* Loading state — spinner via border trick, no JS needed for CSS */
    .btn[aria-busy="true"] {
        pointer-events: none;
        opacity: .72;
    }

    .btn[aria-busy="true"]::before {
        content: '';
        width: 13px;
        height: 13px;
        border: 2px solid currentColor;
        border-top-color: transparent;
        border-radius: 50%;
        display: inline-block;
        animation: pc-spin .65s linear infinite;
        margin-right: 6px;
        flex-shrink: 0;
    }

    @keyframes pc-spin {
        to {
            transform: rotate(360deg);
        }
    }

    /* Icon-only button */
    .btn-icon {
        min-height: 36px;
        width: 36px;
        padding: 0;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        background: var(--surface);
        color: var(--gray-600);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
        transition: background .14s, border-color .14s, color .14s;
    }

    .btn-icon:hover {
        background: var(--mint-faint);
        border-color: var(--mint-soft);
        color: var(--forest);
    }

    .btn-icon svg {
        width: 16px;
        height: 16px;
    }

    /* Danger link (text-only destructive) */
    .btn-link-danger {
        background: none;
        border: none;
        padding: 0;
        color: var(--danger);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        text-decoration: underline;
        text-decoration-color: transparent;
        transition: text-decoration-color .14s;
        font-family: inherit;
    }

    .btn-link-danger:hover {
        text-decoration-color: var(--danger);
    }


    /* ── CARDS ──────────────────────────────────────────── */

    /* Interactive card (clickable) */
    .card-interactive {
        cursor: pointer;
        transition: box-shadow .16s ease, border-color .16s ease, transform .16s ease;
    }

    .card-interactive:hover {
        box-shadow: var(--shadow-md);
        border-color: var(--mint-soft);
        transform: translateY(-1px);
    }

    .card-interactive:focus-visible {
        outline: 2px solid var(--forest);
        outline-offset: 2px;
    }

    /* Stat card — left accent stripe */
    .stat-card {
        position: relative;
        padding: 18px 20px;
        overflow: hidden;
    }

    .stat-card::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    }

    .stat-card.s-pending::before {
        background: var(--warning);
    }

    .stat-card.s-approved::before {
        background: var(--forest);
    }

    .stat-card.s-rejected::before {
        background: var(--danger);
    }

    .stat-card.s-rating::before {
        background: var(--gold);
    }

    .stat-card.s-blue::before {
        background: var(--info);
    }

    .stat-card.s-purple::before {
        background: var(--purple);
    }

    .stat-card.s-orange::before {
        background: var(--warning);
    }

    .stat-card.s-teal::before {
        background: var(--forest);
    }

    .stat-val {
        font-size: 28px;
        font-weight: 600;
        color: var(--forest);
        letter-spacing: -0.03em;
        line-height: 1;
        margin: 2px 0 4px;
    }

    .stat-lbl {
        font-size: 12px;
        font-weight: 500;
        color: var(--gray-500);
        text-transform: uppercase;
        letter-spacing: .05em;
    }

    /* ── Shared "hero banner + card" page components ──────────────────────
       Introduced for the mentee Dashboard redesign and reused as-is by
       Find a Mentor — a plain bordered card with a header row (title + a
       "View all"-style link) and a body of either .prow rows or free
       content, plus a welcome-style banner with an illustration slot. */
    .hero-banner {
        background: linear-gradient(120deg, var(--mint-faint) 0%, var(--surface) 65%);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: 30px 36px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        margin-bottom: 20px;
        overflow: hidden;
    }

    .hero-banner h2 {
        margin: 0 0 8px;
        font-size: 25px;
        font-weight: 700;
        color: var(--forest);
        letter-spacing: -0.02em;
    }

    .hero-banner p {
        margin: 0;
        font-size: 14px;
        color: var(--gray-500);
    }

    .hero-illustration {
        flex-shrink: 0;
        width: 200px;
        height: 130px;
    }

    @media (max-width: 860px) {
        .hero-illustration {
            display: none;
        }
    }

    @media (max-width: 640px) {
        .hero-banner {
            padding: 22px;
        }
    }

    .pcard {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        overflow: hidden;
    }

    .pcard-hd {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 16px 20px 14px;
        border-bottom: 1px solid var(--border);
    }

    .pcard-title {
        font-size: 14px;
        font-weight: 700;
        color: var(--forest);
    }

    .pcard-link {
        font-size: 12.5px;
        font-weight: 600;
        color: var(--mint);
        text-decoration: none;
        background: none;
        border: none;
        cursor: pointer;
        font-family: inherit;
        padding: 0;
        flex-shrink: 0;
    }

    .pcard-link:hover {
        text-decoration: underline;
    }

    .pcard-body {
        padding: 18px 20px;
    }

    .prow {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 13px 20px;
        border-bottom: 1px solid var(--border);
    }

    .prow:last-child {
        border-bottom: none;
    }

    .prow-empty {
        padding: 32px 20px;
        text-align: center;
        font-size: 12.5px;
        color: var(--gray-400);
    }

    .ring-wrap {
        position: relative;
        flex-shrink: 0;
    }

    .ring-wrap svg circle {
        transition: stroke-dashoffset .4s ease;
    }

    .ring-center {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .ring-pct {
        font-size: 19px;
        font-weight: 700;
        color: var(--forest);
        line-height: 1;
    }

    .ring-lbl {
        font-size: 9.5px;
        color: var(--gray-400);
        margin-top: 4px;
        line-height: 1.3;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    /* Card section divider */
    .card-divider {
        height: 1px;
        background: var(--border);
        margin: 16px -20px;
    }

    /* Card header row */
    .card-hd {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 14px;
    }

    .card-hd-title {
        font-size: 14px;
        font-weight: 600;
        color: var(--forest);
        letter-spacing: -0.01em;
    }


    /* ── FORMS & INPUTS ─────────────────────────────────── */

    /* Form group wrapper */
    .form-group {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    /* Label */
    .form-label {
        font-size: 12.5px;
        font-weight: 600;
        color: var(--gray-700);
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .form-label .required {
        color: var(--danger);
        font-size: 13px;
        line-height: 1;
    }

    /* Helper text below input */
    .form-hint {
        font-size: 12px;
        color: var(--gray-500);
        line-height: 1.4;
    }

    /* Error text */
    .form-error {
        font-size: 12px;
        color: var(--danger);
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .form-error::before {
        content: '!';
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: var(--danger);
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    /* Error state on input */
    .input-error,
    input.input-error,
    select.input-error,
    textarea.input-error {
        border-color: var(--danger) !important;
        box-shadow: 0 0 0 3px rgba(192, 57, 43, .10) !important;
    }

    /* Input with left icon */
    .input-wrap {
        position: relative;
        display: flex;
        align-items: center;
    }

    .input-wrap .input-icon {
        position: absolute;
        left: 12px;
        color: var(--gray-400);
        width: 16px;
        height: 16px;
        pointer-events: none;
        flex-shrink: 0;
    }

    .input-wrap input,
    .input-wrap select {
        padding-left: 38px;
    }

    .input-wrap .input-icon-right {
        position: absolute;
        right: 12px;
        color: var(--gray-400);
        pointer-events: none;
    }

    /* Checkbox & Radio — accessible, custom styled */
    .check-label,
    .radio-label {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        cursor: pointer;
        font-size: 13.5px;
        color: var(--gray-700);
    }

    input[type="checkbox"],
    input[type="radio"] {
        width: 16px !important;
        min-height: 0 !important;
        height: 16px;
        margin: 2px 0 0;
        accent-color: var(--forest);
        cursor: pointer;
        flex-shrink: 0;
    }

    /* Toggle / switch — CSS-only */
    .pc-toggle {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        font-size: 13.5px;
        color: var(--gray-700);
    }

    .pc-toggle input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

    .pc-toggle-track {
        width: 36px;
        height: 20px;
        border-radius: 999px;
        background: var(--gray-300);
        position: relative;
        flex-shrink: 0;
        transition: background .16s ease;
    }

    .pc-toggle-track::after {
        content: '';
        position: absolute;
        left: 3px;
        top: 3px;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: #fff;
        transition: transform .16s ease;
        box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    }

    .pc-toggle input:checked+.pc-toggle-track {
        background: var(--forest);
    }

    .pc-toggle input:checked+.pc-toggle-track::after {
        transform: translateX(16px);
    }

    .pc-toggle input:focus-visible+.pc-toggle-track {
        outline: 2px solid var(--forest);
        outline-offset: 2px;
    }

    /* Select — custom arrow */
    select {
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A9490' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 36px !important;
        cursor: pointer;
    }


    /* ── SEARCH BAR ─────────────────────────────────────── */

    .pc-search {
        display: flex;
        align-items: center;
        gap: 0;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 0 0 0 14px;
        transition: border-color .14s, box-shadow .14s;
        overflow: hidden;
    }

    .pc-search:focus-within {
        border-color: var(--forest);
        box-shadow: 0 0 0 3px rgba(31, 78, 69, .10);
    }

    .pc-search svg {
        width: 16px;
        height: 16px;
        color: var(--gray-400);
        flex-shrink: 0;
    }

    .pc-search input {
        flex: 1;
        min-width: 0;
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
        min-height: 40px;
        padding: 0 10px;
        background: transparent;
        font-size: 13.5px;
    }

    .pc-search input::placeholder {
        color: var(--gray-400);
    }

    .pc-search-btn {
        min-height: 40px;
        padding: 0 14px;
        background: var(--forest);
        color: #fff;
        border: none;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        font-family: inherit;
        transition: background .14s;
        white-space: nowrap;
    }

    .pc-search-btn:hover {
        background: var(--forest-2);
    }


    /* ── FILTERS / FILTER CHIPS ─────────────────────────── */

    .filter-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        margin-bottom: 20px;
    }

    /* Filter chip — replaces the per-page .chip definitions */
    .chip,
    .filter-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 5px 13px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        background: var(--surface);
        color: var(--gray-600);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: background .13s, border-color .13s, color .13s;
        user-select: none;
        white-space: nowrap;
        font-family: inherit;
        line-height: 1;
    }

    .chip:hover,
    .filter-chip:hover {
        background: var(--mint-faint);
        border-color: var(--mint-soft);
        color: var(--forest);
    }

    .chip.active,
    .filter-chip.active,
    .chip:checked,
    .chip[aria-pressed="true"] {
        background: var(--forest);
        border-color: var(--forest);
        color: #fff;
    }

    /* Dismissible chip */
    .chip-dismiss {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: rgba(255, 255, 255, .25);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        line-height: 1;
        cursor: pointer;
    }


    /* ── DROPDOWNS ───────────────────────────────────────── */

    .pc-dropdown {
        position: relative;
        display: inline-block;
    }

    .pc-dropdown-menu {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        min-width: 180px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-md);
        z-index: 200;
        padding: 6px;
        list-style: none;
        margin: 0;
    }

    .pc-dropdown-menu.open {
        display: block;
    }

    .pc-dropdown-item {
        display: flex;
        align-items: center;
        gap: 9px;
        padding: 9px 11px;
        border-radius: var(--radius-sm);
        color: var(--gray-700);
        font-size: 13.5px;
        font-weight: 500;
        cursor: pointer;
        transition: background .12s;
        text-decoration: none;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        font-family: inherit;
    }

    .pc-dropdown-item:hover {
        background: var(--mint-faint);
        color: var(--forest);
    }

    .pc-dropdown-item.danger {
        color: var(--danger);
    }

    .pc-dropdown-item.danger:hover {
        background: var(--danger-bg);
    }

    .pc-dropdown-divider {
        height: 1px;
        background: var(--border);
        margin: 5px 0;
    }


    /* ── BADGES — refined ────────────────────────────────── */

    /* Base already defined above — add dot variant */
    .badge-dot {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .badge-dot::before {
        content: '';
        width: 7px;
        height: 7px;
        border-radius: 50%;
        flex-shrink: 0;
        background: currentColor;
        opacity: .7;
    }

    /* Outline badge variant */
    .badge-outline {
        background: transparent;
        border: 1px solid currentColor;
    }

    /* Count bubble */
    .badge-count {
        min-width: 20px;
        height: 20px;
        padding: 0 5px;
        border-radius: 999px;
        background: var(--forest);
        color: #fff;
        font-size: 11px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }


    /* ── ALERTS / BANNERS ───────────────────────────────── */

    .pc-alert {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 13px 16px;
        border-radius: var(--radius);
        border-left: 3px solid transparent;
        font-size: 13.5px;
        line-height: 1.5;
    }

    .pc-alert-icon {
        flex-shrink: 0;
        width: 18px;
        height: 18px;
        margin-top: 1px;
    }

    .pc-alert-body {
        flex: 1;
        min-width: 0;
    }

    .pc-alert-title {
        font-weight: 600;
        margin: 0 0 2px;
        font-size: 13.5px;
    }

    .pc-alert-msg {
        margin: 0;
        color: inherit;
        opacity: .85;
        font-size: 13px;
    }

    /* Alert variants */
    .pc-alert-success {
        background: var(--success-bg);
        color: var(--success);
        border-left-color: var(--success);
    }

    .pc-alert-warning {
        background: var(--warning-bg);
        color: var(--warning);
        border-left-color: var(--warning);
    }

    .pc-alert-danger {
        background: var(--danger-bg);
        color: var(--danger);
        border-left-color: var(--danger);
    }

    .pc-alert-info {
        background: var(--info-bg);
        color: var(--info);
        border-left-color: var(--info);
    }

    .pc-alert-neutral {
        background: var(--gray-50);
        color: var(--gray-700);
        border-left-color: var(--gray-300);
    }

    /* Dismissible — JS sets display:none; we just show the X */
    .pc-alert-close {
        border: none;
        background: none;
        cursor: pointer;
        color: inherit;
        opacity: .6;
        font-size: 18px;
        line-height: 1;
        padding: 0 0 0 8px;
        flex-shrink: 0;
        font-family: inherit;
    }

    .pc-alert-close:hover {
        opacity: 1;
    }

    /* Inline auth-style error/success (already used in home.view.php) */
    .auth-message {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 11px 14px;
        border-radius: var(--radius-sm);
        font-size: 13.5px;
        font-weight: 500;
        border-left: 3px solid transparent;
    }

    .auth-message.error {
        background: var(--danger-bg);
        color: var(--danger);
        border-left-color: var(--danger);
    }

    .auth-message.success {
        background: var(--success-bg);
        color: var(--success);
        border-left-color: var(--success);
    }


    /* ── TOAST NOTIFICATION ─────────────────────────────── */

    .toast {
        position: fixed;
        bottom: 24px;
        right: 24px;
        min-width: 240px;
        max-width: 360px;
        padding: 12px 16px;
        background: var(--ink);
        color: #fff;
        border-radius: var(--radius);
        font-size: 13.5px;
        font-weight: 500;
        box-shadow: var(--shadow-lg);
        z-index: 500;
        display: none;
        align-items: center;
        gap: 10px;
        animation: toastIn .22s cubic-bezier(.34, 1.56, .64, 1) both;
    }

    .toast.show {
        display: flex;
    }

    .toast-success {
        border-left: 3px solid var(--forest);
    }

    .toast-error {
        border-left: 3px solid var(--danger);
    }

    .toast-warn {
        border-left: 3px solid var(--gold);
    }

    @keyframes toastIn {
        from {
            opacity: 0;
            transform: translateY(12px) scale(.96);
        }

        to {
            opacity: 1;
            transform: none;
        }
    }


    /* ── MODALS — enhanced ───────────────────────────────── */

    /* Header inside a modal */
    .modal-hd {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px 24px 16px;
        border-bottom: 1px solid var(--border);
    }

    .modal-hd-title {
        font-size: 17px;
        font-weight: 600;
        color: var(--forest);
        letter-spacing: -0.01em;
        margin: 0;
    }

    .modal-close {
        width: 32px;
        height: 32px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        background: var(--surface);
        color: var(--gray-500);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 18px;
        line-height: 1;
        transition: background .13s, color .13s;
        font-family: inherit;
    }

    .modal-close:hover {
        background: var(--danger-bg);
        color: var(--danger);
        border-color: #f5c0bc;
    }

    /* Modal body */
    .modal-body {
        padding: 20px 24px;
    }

    /* Modal footer */
    .modal-ft {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        padding: 14px 24px 20px;
        border-top: 1px solid var(--border);
    }

    /* Step indicator (booking wizard) */
    .modal-steps {
        display: flex;
        align-items: center;
        gap: 0;
        padding: 14px 24px;
        border-bottom: 1px solid var(--border);
    }

    .modal-step {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        font-size: 12.5px;
        font-weight: 500;
        color: var(--gray-400);
    }

    .modal-step-num {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        border: 1.5px solid var(--gray-300);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: 600;
        flex-shrink: 0;
        transition: background .16s, border-color .16s, color .16s;
    }

    .modal-step.active .modal-step-num {
        background: var(--forest);
        border-color: var(--forest);
        color: #fff;
    }

    .modal-step.active {
        color: var(--forest);
        font-weight: 600;
    }

    .modal-step.done .modal-step-num {
        background: var(--mint-faint);
        border-color: var(--mint-soft);
        color: var(--forest);
    }

    .modal-step-line {
        flex: 1;
        height: 1px;
        background: var(--border);
        margin: 0 6px;
    }


    /* ── TABLES — enhanced ───────────────────────────────── */

    /* Wrapper with rounded corners */
    .tbl-card {
        overflow: hidden;
        /* clips th border-radius */
    }

    /* First/last th corner rounding */
    .tbl th:first-child {
        border-radius: var(--radius-lg) 0 0 0;
    }

    .tbl th:last-child {
        border-radius: 0 var(--radius-lg) 0 0;
    }

    /* Sortable column header */
    .tbl th[data-sort] {
        cursor: pointer;
        user-select: none;
    }

    .tbl th[data-sort]:hover {
        background: var(--gray-100);
        color: var(--forest);
    }

    .tbl th[data-sort]::after {
        content: ' ↕';
        opacity: .4;
        font-size: 10px;
    }

    .tbl th[data-sort="asc"]::after {
        content: ' ↑';
        opacity: .9;
    }

    .tbl th[data-sort="desc"]::after {
        content: ' ↓';
        opacity: .9;
    }

    /* Row action buttons */
    .tbl-actions {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    /* Zebra stripe variant */
    .tbl-zebra tbody tr:nth-child(even) {
        background: var(--gray-50);
    }

    /* No data row */
    .tbl-empty td {
        text-align: center;
        padding: 40px 16px;
        color: var(--gray-400);
        font-size: 13.5px;
    }


    /* ── PAGINATION ──────────────────────────────────────── */

    .pc-pagination {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-wrap: wrap;
    }

    .pc-page-btn {
        min-width: 34px;
        height: 34px;
        padding: 0 8px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        background: var(--surface);
        color: var(--gray-600);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: background .13s, border-color .13s, color .13s;
        font-family: inherit;
        text-decoration: none;
    }

    .pc-page-btn:hover {
        background: var(--mint-faint);
        border-color: var(--mint-soft);
        color: var(--forest);
    }

    .pc-page-btn.active {
        background: var(--forest);
        border-color: var(--forest);
        color: #fff;
        pointer-events: none;
    }

    .pc-page-btn:disabled,
    .pc-page-btn[aria-disabled="true"] {
        opacity: .38;
        pointer-events: none;
    }

    .pc-page-ellipsis {
        min-width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--gray-400);
        font-size: 13px;
    }


    /* ── TABS ────────────────────────────────────────────── */

    /* Tab bar container */
    .pc-tabs {
        display: flex;
        align-items: stretch;
        gap: 0;
        border-bottom: 2px solid var(--border);
        margin-bottom: 20px;
    }

    /* Individual tab */
    .pc-tab {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 10px 18px;
        border: none;
        background: transparent;
        color: var(--gray-500);
        font-size: 13.5px;
        font-weight: 500;
        cursor: pointer;
        position: relative;
        transition: color .14s;
        white-space: nowrap;
        font-family: inherit;
        text-decoration: none;
        border-bottom: 2px solid transparent;
        margin-bottom: -2px;
    }

    .pc-tab:hover {
        color: var(--forest);
        background: var(--mint-faint);
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    }

    .pc-tab.active,
    .pc-tab[aria-selected="true"] {
        color: var(--forest);
        font-weight: 600;
        border-bottom-color: var(--forest);
    }

    .pc-tab .tab-count {
        background: var(--gray-100);
        color: var(--gray-600);
        border-radius: var(--radius-sm);
        padding: 1px 6px;
        font-size: 11px;
        font-weight: 600;
    }

    .pc-tab.active .tab-count {
        background: var(--mint-faint);
        color: var(--forest);
    }

    /* Pill-style tabs (secondary) */
    .pc-tabs-pill {
        display: flex;
        gap: 4px;
        padding: 4px;
        background: var(--gray-100);
        border-radius: var(--radius);
        border: none;
        margin-bottom: 20px;
    }

    .pc-tabs-pill .pc-tab {
        border-bottom: none;
        border-radius: var(--radius-sm);
        margin-bottom: 0;
        padding: 7px 16px;
    }

    .pc-tabs-pill .pc-tab.active {
        background: var(--surface);
        color: var(--forest);
        font-weight: 600;
        box-shadow: var(--shadow-xs);
        border-bottom: none;
    }

    .pc-tabs-pill .pc-tab:hover:not(.active) {
        background: transparent;
    }


    /* ── AVATARS ─────────────────────────────────────────── */

    .pc-avatar {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        overflow: hidden;
        font-weight: 600;
        font-size: 13px;
        line-height: 1;
        border-radius: var(--radius-sm);
        background: var(--mint-soft);
        color: var(--forest);
    }

    .pc-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Sizes */
    .pc-avatar-xs {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .pc-avatar-sm {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .pc-avatar-md {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .pc-avatar-lg {
        width: 52px;
        height: 52px;
        font-size: 18px;
        border-radius: var(--radius);
    }

    .pc-avatar-xl {
        width: 72px;
        height: 72px;
        font-size: 24px;
        border-radius: var(--radius-lg);
    }

    /* Round variant */
    .pc-avatar-round {
        border-radius: 50%;
    }

    /* Avatar group (overlapping) */
    .pc-avatar-group {
        display: flex;
        flex-direction: row-reverse;
        width: max-content;
    }

    .pc-avatar-group .pc-avatar {
        border: 2px solid var(--surface);
        margin-left: -8px;
    }

    .pc-avatar-group .pc-avatar:last-child {
        margin-left: 0;
    }

    /* Online indicator */
    .pc-avatar-wrap {
        position: relative;
        display: inline-flex;
        flex-shrink: 0;
    }

    .pc-avatar-wrap .online-dot {
        position: absolute;
        bottom: -1px;
        right: -1px;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--success);
        border: 2px solid var(--surface);
    }


    /* ── PROGRESS BAR ───────────────────────────────────── */

    .pc-progress {
        height: 6px;
        background: var(--gray-200);
        border-radius: 999px;
        overflow: hidden;
    }

    .pc-progress-fill {
        height: 100%;
        border-radius: 999px;
        background: var(--forest);
        transition: width .4s ease;
    }

    .pc-progress-fill.gold {
        background: var(--gold);
    }

    .pc-progress-fill.info {
        background: var(--info);
    }

    .pc-progress-fill.danger {
        background: var(--danger);
    }

    /* Labeled progress (for rating bars) */
    .pc-progress-row {
        display: grid;
        grid-template-columns: 120px 1fr 36px;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
        font-size: 13px;
    }

    .pc-progress-row-label {
        color: var(--gray-600);
        font-weight: 500;
    }

    .pc-progress-row-val {
        color: var(--forest);
        font-weight: 600;
        text-align: right;
    }

    /* Legacy bar-track / bar-fill — kept for admin/feedback pages */
    .bar-track {
        background: var(--gray-200);
        border-radius: 999px;
        height: 6px;
        overflow: hidden;
        flex: 1;
    }

    .bar-fill {
        height: 100%;
        border-radius: 999px;
        background: var(--forest);
        transition: width .4s ease;
    }


    /* ── SPINNER / LOADING ───────────────────────────────── */

    .pc-spinner {
        width: 20px;
        height: 20px;
        border: 2.5px solid var(--border);
        border-top-color: var(--forest);
        border-radius: 50%;
        animation: pc-spin .65s linear infinite;
        flex-shrink: 0;
    }

    .pc-spinner-sm {
        width: 14px;
        height: 14px;
        border-width: 2px;
    }

    .pc-spinner-lg {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }

    /* Skeleton loading */
    .pc-skeleton {
        background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
        background-size: 200% 100%;
        animation: pc-shimmer 1.4s ease infinite;
        border-radius: var(--radius-sm);
    }

    @keyframes pc-shimmer {
        from {
            background-position: 200% 0;
        }

        to {
            background-position: -200% 0;
        }
    }


    /* ── EMPTY STATE ─────────────────────────────────────── */

    .empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 48px 24px;
        color: var(--gray-500);
        text-align: center;
    }

    .empty-icon {
        width: 52px;
        height: 52px;
        border-radius: var(--radius);
        background: var(--mint-faint);
        color: var(--mint);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 14px;
    }

    .empty-icon svg {
        width: 24px;
        height: 24px;
    }

    .empty-state h3 {
        margin: 0 0 6px;
        font-size: 15px;
        font-weight: 600;
        color: var(--gray-700);
    }

    .empty-state p {
        margin: 0 0 18px;
        font-size: 13.5px;
        max-width: 320px;
        line-height: 1.5;
    }


    /* ── BREADCRUMB ──────────────────────────────────────── */

    .pc-breadcrumb {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        font-size: 13px;
        color: var(--gray-500);
        margin-bottom: 20px;
        list-style: none;
        padding: 0;
    }

    .pc-breadcrumb li {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .pc-breadcrumb li+li::before {
        content: '/';
        color: var(--gray-300);
        font-size: 12px;
    }

    .pc-breadcrumb a {
        color: var(--mint);
        font-weight: 500;
        transition: color .13s;
    }

    .pc-breadcrumb a:hover {
        color: var(--forest);
    }

    .pc-breadcrumb [aria-current="page"] {
        color: var(--gray-700);
        font-weight: 500;
    }


    /* ── EXPERTISE / SKILL TAG PILLS ─────────────────────── */

    .skill-tag,
    .tag-pill,
    .mentor-badge {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 4px 10px;
        border-radius: var(--radius-sm);
        background: var(--mint-faint);
        color: var(--forest);
        font-size: 12px;
        font-weight: 500;
        border: 1px solid var(--mint-soft);
        white-space: nowrap;
        line-height: 1;
    }

    .skill-tag.gold {
        background: var(--gold-light);
        color: var(--warning);
        border-color: #f0d698;
    }


    /* ── TOOLTIP (CSS-only) ──────────────────────────────── */

    [data-tip] {
        position: relative;
        cursor: default;
    }

    [data-tip]::before {
        content: attr(data-tip);
        position: absolute;
        bottom: calc(100% + 6px);
        left: 50%;
        transform: translateX(-50%);
        background: var(--ink);
        color: #fff;
        font-size: 11.5px;
        font-weight: 500;
        white-space: nowrap;
        padding: 5px 9px;
        border-radius: var(--radius-sm);
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s;
        z-index: 400;
        font-family: var(--font-sans, inherit);
    }

    [data-tip]:hover::before {
        opacity: 1;
    }


    /* ── DIVIDERS ────────────────────────────────────────── */

    .pc-divider {
        height: 1px;
        background: var(--border);
        margin: 20px 0;
    }

    .pc-divider-label {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 20px 0;
        color: var(--gray-400);
        font-size: 12px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: .05em;
    }

    .pc-divider-label::before,
    .pc-divider-label::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border);
    }


    /* ── SCROLLBAR — themed ──────────────────────────────── */

    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    ::-webkit-scrollbar-track {
        background: transparent;
    }

    ::-webkit-scrollbar-thumb {
        background: var(--gray-300);
        border-radius: 999px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: var(--gray-400);
    }


    /* ── MOTION PREFERENCE ──────────────────────────────── */

    @media (prefers-reduced-motion: reduce) {

        *,
        *::before,
        *::after {
            animation-duration: .01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: .01ms !important;
        }
    }
    /* ══ Slide-in menu (app_shell.php) ══
       Anchored right and translated off-screen, so opening it slides right to
       left. Hidden above the bottom-bar breakpoint, where the topbar button
       collapses the sidebar instead. */
    .pc-drawer {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(320px, 86vw);
        z-index: 300;
        display: flex;
        flex-direction: column;
        background: var(--forest);
        color: #fff;
        transform: translateX(100%);
        transition: transform .24s ease;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .pc-drawer.open {
        transform: translateX(0);
    }

    .pc-drawer-scrim {
        position: fixed;
        inset: 0;
        z-index: 299;
        background: rgba(2, 5, 71, .45);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s;
    }

    .pc-drawer-scrim.open {
        opacity: 1;
        pointer-events: auto;
    }

    .pc-drawer-hd {
        display: flex;
        align-items: center;
        gap: 11px;
        padding: 18px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .pc-drawer-mark {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
        color: var(--mint);
    }

    .pc-drawer-word {
        font-size: 15px;
        font-weight: 800;
        letter-spacing: .2px;
    }

    .pc-drawer-word .w-peer { color: #fff; }
    .pc-drawer-word .w-connect { color: var(--mint); }

    .pc-drawer-sub {
        font-size: 11.5px;
        color: rgba(255, 255, 255, .6);
        margin-top: 1px;
    }

    .pc-drawer-x {
        margin-left: auto;
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        border-radius: 9px;
        border: 0;
        background: rgba(255, 255, 255, .1);
        color: #fff;
        display: grid;
        place-items: center;
        cursor: pointer;
    }

    .pc-drawer-x:hover {
        background: rgba(255, 255, 255, .18);
    }

    .pc-drawer-nav {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 12px 10px 28px;
    }

    .pc-drawer-label {
        font-size: 10.5px;
        font-weight: 700;
        letter-spacing: .09em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, .45);
        padding: 14px 12px 6px;
    }

    /* The drawer reuses .sb-link, which is styled for the light bottom bar at
       this width — restate it for the dark panel. */
    .pc-drawer .sb-link {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 12px;
        min-height: 44px;
        padding: 0 12px;
        font-size: 13.5px;
        border-radius: 10px;
        color: rgba(255, 255, 255, .82);
    }

    .pc-drawer .sb-link svg {
        width: 18px;
        height: 18px;
    }

    .pc-drawer .sb-link:hover {
        background: rgba(255, 255, 255, .09);
        color: #fff;
    }

    .pc-drawer .sb-link.active {
        background: var(--mint);
        color: #fff;
    }

    .pc-drawer .sb-link.active::before {
        display: none;
    }

    /* A rule at <=960px hides .menu-label with !important so the collapsed
       rail and the bottom bar stay icon-only. The drawer is the one place at
       that width where the labels are the whole point, so it has to win. */
    .pc-drawer .menu-label {
        display: inline !important;
    }


    /* ═══════════════════════════════════════════════════════════════════
   P4 — Mobile responsive improvements for page-level grids
   Empty states, skeleton loaders, AJAX loading indicators
   ═══════════════════════════════════════════════════════════════════ */

    /* ── Skeleton loader ─────────────────────────────────────────────── */
    @keyframes shimmer {
        0% {
            background-position: -600px 0;
        }

        100% {
            background-position: 600px 0;
        }
    }

    .skeleton {
        background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
        background-size: 600px 100%;
        animation: shimmer 1.4s infinite linear;
        border-radius: var(--radius-sm);
        display: block;
    }

    .skeleton-text {
        height: 14px;
        margin-bottom: 8px;
        width: 100%;
    }

    .skeleton-text.w-75 {
        width: 75%;
    }

    .skeleton-text.w-50 {
        width: 50%;
    }

    .skeleton-text.w-33 {
        width: 33%;
    }

    .skeleton-title {
        height: 20px;
        margin-bottom: 10px;
        width: 60%;
    }

    .skeleton-avatar {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .skeleton-card {
        height: 120px;
        border-radius: var(--radius-lg);
    }

    .skeleton-btn {
        height: 36px;
        width: 100px;
        border-radius: var(--radius-sm);
    }

    /* Skeleton mentor card */
    .skeleton-mentor-card {
        background: white;
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        overflow: hidden;
    }

    .skeleton-mentor-photo {
        height: 200px;
    }

    .skeleton-mentor-body {
        padding: 14px;
    }

    /* ── Empty states ────────────────────────────────────────────────── */
    .empty-state-lg {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 64px 24px;
        gap: 12px;
    }

    .empty-state-lg .es-icon {
        width: 72px;
        height: 72px;
        border-radius: 50%;
        background: var(--mint-faint);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 4px;
    }

    .empty-state-lg .es-icon svg {
        width: 32px;
        height: 32px;
        stroke: var(--forest);
        fill: none;
        stroke-width: 1.5;
    }

    .empty-state-lg .es-title {
        font-size: 16px;
        font-weight: 700;
        color: var(--gray-800);
        margin: 0;
    }

    .empty-state-lg .es-body {
        font-size: 13.5px;
        color: var(--gray-500);
        margin: 0;
        max-width: 320px;
        line-height: 1.5;
    }

    .empty-state-sm {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 32px 16px;
        gap: 8px;
        color: var(--gray-400);
    }

    .empty-state-sm .es-icon-sm {
        font-size: 32px;
    }

    .empty-state-sm p {
        font-size: 13px;
        margin: 0;
    }

    /* ── AJAX loading overlay ────────────────────────────────────────── */
    .pc-loading-overlay {
        display: none;
        position: absolute;
        inset: 0;
        background: rgba(255, 255, 255, .75);
        border-radius: inherit;
        z-index: 20;
        align-items: center;
        justify-content: center;
    }

    .pc-loading-overlay.active {
        display: flex;
    }

    .pc-spinner {
        width: 28px;
        height: 28px;
        border: 3px solid var(--mint-soft);
        border-top-color: var(--forest);
        border-radius: 50%;
        animation: spin 0.7s linear infinite;
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    /* Inline button spinner */
    .btn-loading .btn-spinner {
        display: inline-block !important;
    }

    .btn-spinner {
        display: none;
        width: 14px;
        height: 14px;
        border: 2px solid rgba(255, 255, 255, .4);
        border-top-color: white;
        border-radius: 50%;
        animation: spin 0.7s linear infinite;
        flex-shrink: 0;
    }

    /* ── Toast notifications ─────────────────────────────────────────── */
    /* Toast styling lives in includes/toasts.php, which both this
       shell and the admin layout include, so one corner of the screen
       behaves the same everywhere. */

    /* ── Page-level responsive grid fixes ───────────────────────────── */

    /* Stats grid — mentor/mentee dashboards */
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
        margin-bottom: 20px;
    }

    /* Profile grid — mentor profile, 2-col layout */
    .profile-grid {
        display: grid;
        grid-template-columns: 300px 1fr;
        gap: 24px;
        align-items: start;
    }

    /* Dashboard grid — 2-col sidebar layout. minmax(0, 1fr), not plain 1fr —
       a wide non-shrinking descendant (e.g. a data table) would otherwise
       force this track past its fair share instead of scrolling internally
       via its own overflow-x. */
    .dash-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 20px;
        align-items: start;
    }

    /* Admin analytics 4-col */
    .an-grid-4 {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
        margin-bottom: 20px;
    }

    /* ── 1280px — wide desktop: minor tightening ───────────────────── */
    @media (max-width: 1280px) {
        .stats-grid {
            grid-template-columns: repeat(4, 1fr);
        }

        .an-grid-4 {
            grid-template-columns: repeat(4, 1fr);
        }
    }

    /* ── 1024px — laptop: 2-col grids start collapsing ─────────────── */
    @media (max-width: 1024px) {
        .stats-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .an-grid-4 {
            grid-template-columns: repeat(2, 1fr);
        }

        .an-grid-3 {
            grid-template-columns: repeat(2, 1fr);
        }

        .profile-grid {
            grid-template-columns: 260px 1fr;
        }

        .dash-grid {
            grid-template-columns: minmax(0, 1fr) 300px;
        }
    }

    /* ── 860px — tablet: most multi-col grids go 1-col ─────────────── */
    @media (max-width: 860px) {
        .stats-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .an-grid-4 {
            grid-template-columns: repeat(2, 1fr);
        }

        .an-grid-3 {
            grid-template-columns: 1fr;
        }

        .an-grid-2 {
            grid-template-columns: 1fr;
        }

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

        .dash-grid {
            grid-template-columns: minmax(0, 1fr);
        }

        /* Mentor grid on find_mentor — 3 col max */
        .mentor-grid {
            grid-template-columns: repeat(3, 1fr) !important;
        }

        /* Matching grid — 2 col */
        .match-grid {
            grid-template-columns: repeat(2, 1fr) !important;
        }
    }

    /* ── 640px — large mobile: 2 stat cards per row ────────────────── */
    @media (max-width: 640px) {
        .stats-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }

        .an-grid-4 {
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }

        .an-grid-3 {
            grid-template-columns: 1fr;
        }

        .an-grid-2 {
            grid-template-columns: 1fr;
        }

        .mentor-grid {
            grid-template-columns: repeat(2, 1fr) !important;
        }

        .match-grid {
            grid-template-columns: 1fr !important;
        }

        /* Profile left col becomes horizontal strip */
        .profile-hero {
            padding: 20px 16px !important;
        }

        .profile-avatar,
        .profile-avatar-placeholder {
            width: 60px !important;
            height: 60px !important;
        }

        /* Explore search row — minmax(0, 1fr): an 'fr' track's implicit
           minimum is auto (its widest item's own content width), so without
           the explicit 0 floor an unshrinkable child (the AI-search pill,
           a <select>) forces this row wider than the viewport. */
        .explore-search-row {
            grid-template-columns: minmax(0, 1fr) !important;
        }

        .advanced-box {
            display: none !important;
        }

        /* hide advanced toggle on mobile */
    }

    /* ── 480px — small mobile: single col everything ───────────────── */
    @media (max-width: 480px) {
        .stats-grid {
            grid-template-columns: 1fr;
        }

        .an-grid-4 {
            grid-template-columns: 1fr;
        }

        .mentor-grid {
            grid-template-columns: 1fr !important;
        }

        /* Modal full-width */
        .modal-box,
        .modal-box.cat-modal-box {
            width: 100% !important;
            max-width: 100vw !important;
            border-radius: 16px 16px 0 0 !important;
        }

        .modal-overlay,
        .cat-modal {
            align-items: flex-end !important;
        }

        /* Tables scroll horizontally */
        .lb-table,
        .cert-table,
        .cats-table {
            font-size: 12px;
        }

        .lb-table th,
        .cert-table th,
        .cats-table th {
            padding: 8px 10px;
        }

        .lb-table td,
        .cert-table td,
        .cats-table td {
            padding: 9px 10px;
        }

        /* Buttons full-width in forms */
        .award-form,
        .pref-actions {
            flex-direction: column;
        }

        .award-form .btn-primary,
        .award-form .btn-green {
            width: 100%;
        }
    }

    /* ── Icon-kit stat cards (Dashboard, Sessions, …) ──────────────────
       Icon sits above the value by default, same footprint as the rest
       of .stats-grid; only below 700px does the card flip to icon-beside-
       value and shrink — it stays full-size at every width above that,
       not just phones. */
    .stat-card-icon {
        position: relative;
        padding: 20px;
        overflow: hidden;
    }

    .stat-card-icon::before {
        display: none;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 14px;
        flex-shrink: 0;
    }

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

    .si-teal {
        background: var(--mint-faint);
        color: var(--forest);
    }

    .si-blue {
        background: var(--info-bg);
        color: var(--info);
    }

    .si-purple {
        background: #EFEBFC;
        color: var(--purple);
    }

    .si-orange {
        background: var(--gold-light);
        color: var(--warning);
    }

    .stat-trend {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 11.5px;
        font-weight: 600;
        margin-top: 10px;
    }

    .stat-trend svg {
        width: 11px;
        height: 11px;
        flex-shrink: 0;
    }

    .stat-trend.trend-up {
        color: var(--success);
    }

    .stat-trend.trend-down {
        color: var(--danger);
    }

    .stat-fact {
        font-size: 11.5px;
        font-weight: 500;
        color: var(--gray-400);
        margin-top: 10px;
    }

    /* ── 700px — phones only: icon-kit cards go compact (icon beside the
       value) instead of shrinking the same stacked layout used at every
       larger width. :has() scopes this to grids that actually hold
       .stat-card-icon cards, so other .stats-grid users (admin, mentor
       accent-stripe cards) keep their existing 480px 1-column behavior
       untouched — :has() also gives this rule enough specificity to win
       over the plain .stats-grid column rules regardless of source order. */
    @media (max-width: 700px) {

        .stats-grid:has(.stat-card-icon),
        .ss-stats:has(.stat-card-icon) {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
        }

        .stat-card-icon {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 10px;
            padding: 12px 14px;
        }

        .stat-card-icon .stat-icon {
            margin-bottom: 0;
            width: 34px;
            height: 34px;
        }

        .stat-card-icon .stat-icon svg {
            width: 15px;
            height: 15px;
        }

        .stat-card-icon .stat-val {
            font-size: 18px;
            margin: 0;
            line-height: 1.1;
        }

        .stat-card-icon .stat-lbl {
            font-size: 10px;
            text-transform: none;
            letter-spacing: 0;
            line-height: 1.2;
            white-space: nowrap;
        }

        .stat-card-icon .stat-trend,
        .stat-card-icon .stat-fact {
            display: none;
        }
    }

    /* ── Accessibility: reduce motion ──────────────────────────────── */
    @media (prefers-reduced-motion: reduce) {

        .skeleton,
        .pc-spinner,
        .btn-spinner {
            animation: none !important;
        }
    }
