/* ============================================================================
   Staff/admin "app shell" styling (StaffLayout.razor), applied only to
   /admin/* pages via Components/Pages/Admin/_Imports.razor's "@layout
   StaffLayout". This file is global (linked from App.razor next to
   app.css) rather than a scoped .razor.css for two reasons: (1) it also
   lightly reskins Bootstrap classes the existing admin pages already use
   (.btn-primary, table.table, .form-control, etc.) -- scoped CSS can't
   reach into markup rendered by pages other than StaffLayout.razor itself,
   and every reskin rule below is scoped under ".staff-shell" so it never
   leaks onto the public marketing site (MainLayout.razor / app.css, which
   this file does not touch). (2) The mobile drawer toggle needs plain
   global selectors for the checkbox+label sibling-combinator trick, same
   CSS-only approach (no JS interop) as NavMenu.razor/NavMenu.razor.css use
   for the public site's own mobile menu -- distinct class/id names here
   ("staff-*") so the two mechanisms can never collide.

   Palette mirrors DoulaEHR's React AppShell/NavMenu (Tailwind teal/slate):
     teal-700 #0f766e  - top bar
     teal-600 #0d9488  - active nav item / primary buttons / focus accents
     slate-800 #1e293b - sidebar background / headings
     slate-700 #334155 - sidebar hover state
     slate-200 #e2e8f0 - sidebar text / borders on dark backgrounds
     slate-100 #f1f5f9 - content area background
   Mobile breakpoint: 768px, matching Tailwind's default "md:" that
   DoulaEHR's own breakpoint is built on.
   ============================================================================ */

.staff-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f1f5f9;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Hidden checkbox driving the mobile drawer -- see the sibling-combinator
   rules under "Mobile drawer behavior" below. */
.staff-nav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* ---------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------- */

.staff-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 56px;
    flex: 0 0 auto;
    padding: 0 1rem;
    background: #0f766e;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 30;
}

.staff-nav-toggle-label {
    display: none;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    user-select: none;
}

.staff-nav-toggle-label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.staff-brand {
    font-size: 1.05rem;
    font-weight: 600;
    white-space: nowrap;
}

.staff-topbar-spacer {
    flex: 1 1 auto;
}

.staff-user-info {
    font-size: 0.85rem;
    color: #ccfbf1;
    white-space: nowrap;
}

.staff-user-email {
    color: #99f6e4;
}

.staff-build-info {
    /* Dimmer than staff-user-email -- it's a secondary/diagnostic detail, not identity. */
    color: #5eead4;
    opacity: 0.75;
}

.staff-topbar-link {
    color: #ccfbf1;
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    border: 1px solid transparent;
}

.staff-topbar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.staff-logout-form {
    margin: 0;
    display: inline-flex;
}

.staff-logout-button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    font: inherit;
}

/* ---------------------------------------------------------------------
   Body: sidebar + content
   --------------------------------------------------------------------- */

.staff-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.staff-nav-overlay {
    display: none;
}

.staff-sidebar {
    flex: 0 0 auto;
    width: 256px;
    background: #1e293b;
    overflow-y: auto;
}

.staff-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem;
}

.staff-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.92rem;
}

.staff-nav a:hover {
    background: rgba(51, 65, 85, 0.6);
    color: #fff;
}

.staff-nav a.active {
    background: #0d9488;
    color: #fff;
}

/* Unread-record indicator on a sidebar nav item (StaffLayout.razor) -- Grading Queue, Orders &
   Payments, Leads, Info Sessions. Cleared for a section once its own page has been visited (see
   StaffNotificationService.MarkSeenAsync); suppressed for whichever page is currently open. */
.staff-nav-badge {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
}

/* Wraps the Orders nav item's badge(s) as ONE flex child so `.staff-nav a`'s
   justify-content: space-between still puts a single group at the right edge, whether it's
   showing one badge or both (Paid + Unfinished) side by side. */
.staff-nav-badges {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 0.25rem;
}

/* Orders sidebar badge, split by kind (added 2026-09-18 per Weston) -- a completed sale (green,
   matches .order-tick) reads very differently from an abandoned checkout (amber, matches
   .order-followup's "worth a phone call" color) even before you open the page. */
.staff-nav-badge.staff-nav-badge-paid {
    background: #2f7a3f;
}

.staff-nav-badge.staff-nav-badge-unfinished {
    background: #c9a227;
}

.staff-content {
    flex: 1 1 auto;
    min-width: 0;
    overflow-y: auto;
    padding: 1.5rem;
}

/* ---------------------------------------------------------------------
   Mobile drawer behavior (<768px): sidebar becomes an off-canvas overlay
   toggled by the hidden "staff-nav-toggle" checkbox via its label(s).
   The checkbox and .staff-body are siblings inside .staff-shell, so the
   general sibling combinator reaches into .staff-body's descendants.
   --------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    .staff-nav-toggle-label {
        display: block;
    }

    .staff-sidebar {
        position: fixed;
        top: 56px;
        bottom: 0;
        left: 0;
        z-index: 40;
        width: 260px;
        max-width: 80vw;
        transform: translateX(-100%);
        transition: transform 0.2s ease-out;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
    }

    .staff-nav-toggle:checked ~ .staff-body .staff-sidebar {
        transform: translateX(0);
    }

    .staff-nav-toggle:checked ~ .staff-body .staff-nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        top: 56px;
        z-index: 35;
        background: rgba(0, 0, 0, 0.4);
        cursor: pointer;
    }
}

/* ---------------------------------------------------------------------
   Light reskin of Bootstrap classes already used by the existing admin
   pages (Admin/Pages, Admin/Courses, Admin/Users) -- scoped under
   .staff-shell so nothing here touches the public site.
   --------------------------------------------------------------------- */

.staff-shell h1,
.staff-shell h2,
.staff-shell h3,
.staff-shell h4 {
    color: #1e293b;
    font-weight: 600;
}

.staff-shell a {
    color: #0f766e;
}

/* color is !important here because .btn-primary is sometimes an <a> (e.g. "+ New Page"), and app.css's
   site-wide "a, .btn-link { color: var(--baa-ink); }" rule (charcoal text, for ordinary marketing-site
   links) needs to lose even if a browser has an old cached copy of this stylesheet from before this
   rule existed -- belt-and-suspenders so a stale cache reads as "not yet updated" instead of "broken". */
.staff-shell .btn-primary,
.staff-shell .btn-primary:hover,
.staff-shell .btn-primary:focus,
.staff-shell .btn-primary:active {
    color: #fff !important;
}

.staff-shell .btn-primary {
    background-color: #0d9488;
    border-color: #0d9488;
    border-radius: 6px;
}

.staff-shell .btn-primary:hover,
.staff-shell .btn-primary:focus {
    background-color: #0f766e;
    border-color: #0f766e;
}

.staff-shell .btn-secondary {
    background-color: #fff;
    border-color: #cbd5e1;
    color: #334155;
    border-radius: 6px;
}

.staff-shell .btn-secondary:hover,
.staff-shell .btn-secondary:focus {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

.staff-shell .btn-danger {
    border-radius: 6px;
}

.staff-shell .btn {
    border-radius: 6px;
}

.staff-shell .form-control,
.staff-shell .form-select {
    border-radius: 6px;
    border-color: #cbd5e1;
}

.staff-shell .form-control:focus,
.staff-shell .form-select:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 0.2rem rgba(13, 148, 136, 0.25);
}

.staff-shell table.table {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.staff-shell table.table thead th {
    background: #1e293b;
    color: #f1f5f9;
    border-bottom: none;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.staff-shell table.table td,
.staff-shell table.table th {
    vertical-align: middle;
}

.staff-shell .card {
    border-radius: 8px;
    border-color: #e2e8f0;
}

/* --- Orders & Payments --- */

.order-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    margin: 1rem 0 1.5rem;
}

.order-stat {
    display: flex;
    flex-direction: column;
}

.order-stat-value {
    font-size: 1.9rem;
    font-weight: 600;
    line-height: 1.1;
}

.order-stat-label {
    font-size: 0.85rem;
    color: #666;
}

.order-followup {
    background: #fff6d5;
    border: 1px dashed #c9a227;
    padding: 0.6rem 0.9rem;
    color: #6b5300;
    font-size: 0.92rem;
}

.order-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.25rem 0 0.75rem;
}

.order-filter {
    text-decoration: none;
    font-size: 0.92rem;
    padding-bottom: 0.15rem;
    border-bottom: 2px solid transparent;
}

.order-filter.is-active {
    font-weight: 600;
    border-bottom-color: #ffd966;
}

/* Unfinished checkouts are the actionable rows -- they should catch the eye without shouting. */
.order-unfinished {
    background: #fffaf0;
}

.order-stripe-id {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.75rem;
    word-break: break-all;
}

.order-table th.order-col,
.order-table td.order-col {
    text-align: center;
    white-space: nowrap;
}

.order-tick {
    color: #2f7a3f;
    font-weight: 700;
}

.order-no {
    color: #bbb;
}

.order-pending {
    font-size: 0.85rem;
}

/* --- Offering schedule: dates that are shown rather than entered --- */

.derived-dates {
    background: #faf8f2;
    border: 1px solid #e8e2d0;
    border-radius: 6px;
    padding: 1rem 1.25rem 1.25rem;
    margin-bottom: 1.5rem;
}

.derived-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #7a7a7a;
}

.derived-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: #303033;
}

/* Archived rows shown via a "Show archived" toggle (/admin/leads, /admin/users) -- dimmed so
   they read as retired, not actionable, next to the live rows. */
.lead-archived,
.archived-row {
    opacity: 0.55;
}
