/**
 * Staff / admin portal shell — sidebar layout (distinct from student site).
 */
@import url("ui_scale.css?v=20260824e");
:root {
    --staff-sidebar-w: 15.5rem;
    --staff-topbar-h: 3.5rem;
    --staff-ink: #0f1c1a;
    --staff-muted: #5b6e68;
    --staff-line: rgba(15, 28, 26, 0.1);
    --staff-surface: #f3f6f5;
    --staff-panel: #ffffff;
    --staff-accent: #0f6b5c;
    --staff-accent-soft: #e4f2ee;
    --staff-sidebar-bg: #10231f;
    --staff-sidebar-text: rgba(255, 255, 255, 0.78);
    --staff-sidebar-text-strong: #fff;
    --staff-sidebar-hover: rgba(255, 255, 255, 0.07);
    --staff-sidebar-active: #0f6b5c;
}

body.staff-portal {
    background: var(--staff-surface) !important;
    min-height: 100vh;
}

body.staff-portal #wrapwrap {
    padding-left: var(--staff-sidebar-w);
    padding-top: var(--staff-topbar-h);
    min-height: 100vh;
    background: var(--staff-surface);
}

/* Hide marketing hero — staff pages use the topbar title instead */
body.staff-portal .page-hero {
    display: none !important;
}

body.staff-portal #wrap > main,
body.staff-portal main > #wrap {
    background: transparent;
}

body.staff-portal .site-footer {
    display: none;
}

.staff-sidebar {
    position: fixed;
    z-index: 1040;
    top: 0;
    left: 0;
    width: var(--staff-sidebar-w);
    height: 100vh;
    background: var(--staff-sidebar-bg);
    color: var(--staff-sidebar-text);
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease;
}

.staff-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    color: var(--staff-sidebar-text-strong);
}

.staff-sidebar__brand:hover {
    color: var(--staff-sidebar-text-strong);
}

.staff-sidebar__brand-mark {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.55rem;
    background: var(--staff-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.staff-sidebar__brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.staff-sidebar__brand-text strong {
    font-size: 0.92rem;
    font-weight: 700;
}

.staff-sidebar__brand-text span {
    font-size: 0.7rem;
    opacity: 0.65;
    font-weight: 500;
}

.staff-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.7rem 1rem;
}

.staff-nav-group {
    margin-bottom: 1.05rem;
}

.staff-nav-group__label {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.45;
    padding: 0 0.55rem 0.4rem;
}

.staff-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.5rem;
    color: var(--staff-sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.15rem;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
}

.staff-nav-link i {
    width: 1.15rem;
    text-align: center;
    opacity: 0.85;
    font-size: 0.92rem;
}

.staff-nav-link:hover {
    background: var(--staff-sidebar-hover);
    color: var(--staff-sidebar-text-strong);
}

.staff-nav-link.active {
    background: var(--staff-sidebar-active);
    color: #fff;
}

.staff-nav-link .staff-nav-badge,
.staff-tool-card .staff-nav-badge,
a.nav-link .pending-receipts-badge,
a.nav-link .inbox-unread-badge {
    margin-left: auto;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #dc3545 !important;
    color: #fff !important;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.staff-tool-card .staff-nav-badge {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    margin-left: 0;
}

.staff-sidebar__foot {
    padding: 0.75rem 0.7rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.staff-sidebar__foot a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.5rem;
    color: var(--staff-sidebar-text);
    text-decoration: none;
    font-size: 0.85rem;
}

.staff-sidebar__foot a:hover {
    background: var(--staff-sidebar-hover);
    color: #fff;
}

.staff-topbar {
    position: fixed;
    z-index: 1035;
    top: 0;
    left: var(--staff-sidebar-w);
    right: 0;
    height: var(--staff-topbar-h);
    background: var(--staff-panel);
    border-bottom: 1px solid var(--staff-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.25rem;
}

.staff-topbar__left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.staff-topbar__menu {
    display: none;
    border: 1px solid var(--staff-line);
    background: var(--hx-surface, #fff);
    width: 2.75rem;
    height: 2.75rem;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    padding: 0;
    border-radius: 0.5rem;
    align-items: center;
    justify-content: center;
    color: var(--staff-ink);
    font-size: 1rem;
}

.staff-topbar__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--staff-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staff-topbar__subtitle {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--staff-muted);
    margin-top: 0.1rem;
}

.staff-topbar__right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.staff-role-pill {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: var(--staff-accent-soft);
    color: var(--staff-accent);
}

.staff-topbar__profile {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--staff-line);
    background: var(--hx-surface, #fff);
    border-radius: 999px;
    padding: 0.25rem 0.65rem 0.25rem 0.3rem;
    color: var(--staff-ink);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.staff-topbar__profile:hover {
    background: var(--staff-surface);
    color: var(--staff-ink);
}

.staff-topbar__avatar {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: var(--staff-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.staff-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1038;
    background: rgba(15, 28, 26, 0.45);
}

body.staff-portal main {
    padding: 1.15rem 1.25rem 2.5rem;
}

body.staff-portal main > #wrap > section.pt-4,
body.staff-portal main > #wrap > section.py-4,
body.staff-portal main > #wrap > section.pb-4 {
    padding-top: 0.5rem !important;
}

body.staff-portal .container {
    max-width: 1140px;
}

/* Dashboard tool tiles */
.staff-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(11.5rem, 100%), 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.staff-tool-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1rem 0.95rem;
    background: var(--staff-panel);
    border: 1px solid var(--staff-line);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--staff-ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    position: relative;
}

.staff-tool-card:hover {
    border-color: rgba(15, 107, 92, 0.35);
    box-shadow: 0 8px 22px rgba(15, 28, 26, 0.07);
    transform: translateY(-2px);
    color: var(--staff-ink);
}

.staff-tool-card__icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.55rem;
    background: var(--staff-accent-soft);
    color: var(--staff-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.staff-tool-card strong {
    font-size: 0.92rem;
    font-weight: 700;
}

.staff-tool-card span {
    font-size: 0.75rem;
    color: var(--staff-muted);
    line-height: 1.35;
}

@media (max-width: 991.98px) {
    body.staff-portal #wrapwrap {
        padding-left: 0;
    }

    .staff-sidebar {
        transform: translateX(-105%);
    }

    body.staff-nav-open .staff-sidebar {
        transform: translateX(0);
    }

    body.staff-nav-open .staff-backdrop {
        display: block;
    }

    .staff-topbar {
        left: 0;
        overflow: hidden;
    }

    .staff-topbar__left {
        flex: 1 1 auto;
        min-width: 0;
    }

    .staff-topbar__left > div {
        min-width: 0;
        flex: 1 1 auto;
        overflow: hidden;
    }

    .staff-topbar__title,
    .staff-topbar__subtitle {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .staff-topbar__menu {
        display: inline-flex;
    }

    .staff-role-pill {
        display: none;
    }
}

/* Phone-only: tighter profile name. Tablets keep the compact topbar
   ellipsis above without the 5.5rem cap. */
@media (max-width: 767.98px) {
    .staff-topbar__profile #staff-topbar-name {
        max-width: 5.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

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

/* Student ID tag shown before a student's name ("#4512 Farida Hossam"),
   matching the IDs used in the WhatsApp focus groups. */
.student-id-tag {
    display: inline-block;
    margin-right: 0.4rem;
    padding: 0.05rem 0.4rem;
    border: 1px solid var(--hx-line-strong, rgba(15, 28, 26, 0.17));
    border-radius: var(--hx-r-xs, 6px);
    background: var(--hx-surface-3, #eef3f2);
    color: var(--hx-muted, #5c7671);
    font-size: 0.8em;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
