/*
 * Admin UX audit (Jul 16 2026, D13) — five `:focus { outline: none }` rules
 * in per-page styles were suppressing keyboard focus indicators across the
 * app. Rather than surgically rewriting each one to `:focus-visible`, apply
 * a global keyboard-only ring here at the source with !important so it wins
 * over any localised `outline: none`. `:focus-visible` matches only when
 * the browser thinks focus was driven by a keyboard (not a mouse click), so
 * pointer users still get the flat, ring-less look the original rules wanted.
 */
:focus-visible {
    outline: 2px solid #0D5642 !important;
    outline-offset: 2px !important;
    border-radius: 4px;
}
/* Inputs and controls get a subtle inset shadow instead of an outline so
   the ring doesn't clip against tight table cells. */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 0 !important;
    box-shadow: 0 0 0 3px rgba(13, 86, 66, 0.35) !important;
}

/* Base colors based on screenshots */
:root {
    --soft-mint-bg: #f0faf6;
    --soft-mint-ink: #004b3a;
    --deep-green: #004b3a;
    --muted-700: #5e6b73;
    --muted-800: #3c4853;
    --muted-600: #8a96a0;
    --gradient-start: #0e5842;
    --gradient-mid: #1a7a5e;
    --gradient-end: #2eb88a;
    --card-radius: 18px;
    --transition-fast: 0.18s ease-out;
    --transition-med: 0.25s ease-out;
    --brand-mint: #0D5642;

    /* Multi-accent palette (approved colour study). Green stays the BRAND
       (sidebars, headers, logo). Each accent has one job so the UI reads at a
       glance instead of blending into one green:
         orange  → primary call-to-action buttons
         purple  → active / selected state (tabs, pills, selected days)
         blue    → links / info
         teal    → data / reports
       Semantic status keeps its own set (success green / warning amber /
       danger red), handled by Bootstrap's badge colours. */
    --tu-orange: #ea580c;
    --tu-orange-hover: #c2410c;
    --tu-purple: #7c3aed;
    --tu-purple-hover: #6a29da;
    --tu-purple-bg: #ece3fe;
    --tu-blue: #2563eb;
    --tu-blue-hover: #1b4fd0;
    --tu-teal: #0891b2;
}


/* Layout width tuning to better match design comps */
.container {
    max-width: 1120px;
}

html,
body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--soft-mint-bg);
    color: var(--soft-mint-ink);
}

/* Typography */
.hero-heading {
    letter-spacing: 0.02em;
}

.lead {
    font-size: 1.02rem;
}

.small {
    font-size: 0.9rem;
}

.tiny {
    font-size: 0.8rem;
}

/* Background helpers */
.bg-soft-mint {
    background: radial-gradient(circle at top, #f7fffb 0, #f0faf6 40%, #e8f6f1 100%);
}

.bg-deep-green {
    background-color: var(--deep-green);
}

/* Logo pill */
.logo-pill,
.logo-pill-sm {
    background: rgba(0, 75, 58, 0.06);
    border-radius: 999px;
}

.logo-pill {
    width: 40px;
    height: 40px;
}

.logo-pill-sm {
    width: 32px;
    height: 32px;
}

/* Cards */
.card {
    border-radius: var(--card-radius);
}

.shadow-soft {
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.06);
}

.how-card {
    padding: 1.25rem 1.25rem 1.2rem;
    border-radius: 16px;
    background: white;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.03);
}

/* Icon circles */
.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(24, 160, 88, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #199c5b;
}

.icon-circle-purple {
    background: rgba(123, 77, 255, 0.12);
    color: #7b4dff;
}

.icon-circle-blue {
    background: rgba(60, 125, 255, 0.12);
    color: #3c7dff;
}

/* Gradient cards */
.gradient-card,
.gradient-card-deep {
    border-radius: 24px;
    padding: 1.9rem 2rem;
    background: linear-gradient(120deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
    color: white;
    position: relative;
    overflow: hidden;
}

.gradient-card-deep {
    padding: 1.8rem 2rem;
}

.gradient-card::before,
.gradient-card-deep::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.08;
    background: radial-gradient(circle at top left, white, transparent 55%);
}

.gradient-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Nav */
.navbar {
    backdrop-filter: blur(12px);
}

/* Buttons */
.app-pill {
    border-radius: 999px;
}

/* Primary call-to-action buttons → orange so they stand out against the green
   chrome. .btn-success is the app's de-facto primary button (Create, Search,
   Apply, Save…); genuine "success" state is still shown by green status
   badges, not buttons. */
.btn-success {
    background-color: var(--tu-orange);
    border-color: var(--tu-orange);
}

.btn-success:hover {
    background-color: var(--tu-orange-hover);
    border-color: var(--tu-orange-hover);
}

.btn-outline-success {
    color: var(--tu-orange);
    border-color: var(--tu-orange);
}

.btn-outline-success:hover {
    background-color: var(--tu-orange);
    color: #fff;
}

.text-soft-mint-ink {
    color: var(--soft-mint-ink);
}

.text-muted-700 {
    color: var(--muted-700) !important;
}

.text-muted-800 {
    color: var(--muted-800) !important;
}

.text-muted-600 {
    color: var(--muted-600) !important;
}

/* Stats tiles */
.stat-tile {
    border-radius: 18px;
    background: white;
    padding: 1rem 1.15rem;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.03);
    border: 0;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(0, 75, 58, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-mint);
    font-size: 1rem;
}

.stat-icon-next {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

.next-lesson-date-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}


/* Progress */
.progress-thick {
    height: 0.6rem;
    border-radius: 999px;
    background-color: #e2efe8;
}

.progress-thick .progress-bar {
    border-radius: 999px;
}

.progress-animate {
    animation: progressSlide 1.3s ease-out forwards;
}

@keyframes progressSlide {
    from {
        width: 0;
    }
}

/* Current lesson */
.current-lesson-icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #ffffff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.current-lesson-card {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

.lesson-hero-card {
    border-radius: 32px;
    padding: 1.9rem 2.2rem;
    background: linear-gradient(120deg, #00563b, #058f65);
    position: relative;
    overflow: hidden;
}

.lesson-hero-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.25), transparent 55%);
    opacity: 0.18;
}

.lesson-hero-card .hero-primary-btn {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
    color: #004b3a;
}

.lesson-hero-card .hero-secondary-btn {
    border-width: 1px;
}

/* Privacy */
.privacy-card {
    max-width: 720px;
    width: 100%;
}

.privacy-icon,
.privacy-icon-sm {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0, 75, 58, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-mint);
    font-size: 1.4rem;
}

.privacy-icon-sm {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
}

/* Alerts */
.alert-soft-info {
    border-radius: 14px;
    background: #edf5ff;
    border: 1px solid #d7e3ff;
    color: var(--muted-800);
}

/* Login card */
.login-card {
    width: 420px;
    max-width: 100%;
}

/* Forms */
.app-input {
    border-radius: 999px;
    border: 1px solid #d9e3dd;
    background-color: #f7fbf9;
    font-size: 0.88rem;
}

.app-input:focus {
    border-color: var(--brand-mint);
    box-shadow: 0 0 0 0.12rem rgba(11, 124, 74, 0.15);
}

/* List group */
.list-group-item {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

/* Footer */
footer {
    font-size: 0.75rem;
}

/* Completion banner */
.completion-banner {
    border-radius: 999px;
}

/* Toast */
.app-toast {
    border-radius: 999px;
}

/* Badges */
.bg-soft-badge {
    background-color: rgba(255, 255, 255, 0.12);
}

/* Animations */
.app-fade-up {
    opacity: 0;
    transform: translateY(18px);
    animation: fadeUp 0.6s var(--transition-med) forwards;
}

.app-fade-up-delayed {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.7s 0.12s forwards;
}

.app-fade-down {
    opacity: 0;
    transform: translateY(-10px);
    animation: fadeDown 0.5s var(--transition-fast) forwards;
}

.app-card-zoom {
    animation: cardIn 0.5s 0.25s ease-out forwards;
    transform-origin: center;
    opacity: 0;
}

.app-hover-raise {
    transition: transform var(--transition-med), box-shadow var(--transition-med);
}

.app-hover-raise:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}

.app-hover-float {
    transition: transform var(--transition-med), box-shadow var(--transition-med);
}

.app-hover-float:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

.app-hover-bounce {
    transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
}

.app-hover-bounce:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardIn {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.99);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Utility max width */
.max-w-xl {
    max-width: 640px;
}

/* Wave emoji tweak */
.wave-emoji {
    display: inline-block;
    animation: wave 2.2s infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {

    0%,
    60%,
    100% {
        transform: rotate(0deg);
    }

    15% {
        transform: rotate(16deg);
    }

    30% {
        transform: rotate(-10deg);
    }

    45% {
        transform: rotate(12deg);
    }
}

/* Responsive tweaks */
@media (max-width: 767.98px) {

    .gradient-card,
    .gradient-card-deep {
        padding: 1.5rem 1.4rem;
    }

    .current-lesson-card {
        padding: 1.6rem 1.4rem;
    }
}


/* Inner width shell for app pages (dashboard, lesson) */
.main-shell {
    max-width: 920px;
    margin: 0 auto;
}

@media (max-width: 991.98px) {
    .main-shell {
        max-width: 100%;
    }
}


/* Lesson Calendar specific */
.calendar-shell {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.5fr);
    gap: 1.5rem;
}

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

.calendar-card {
    border-radius: 20px;
}

.calendar-month-toggle .btn {
    min-width: 84px;
}

/* Simple calendar day grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 32px);
    gap: 0.35rem;
    justify-content: center;
}

.calendar-day {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    color: var(--muted-700);
}

.calendar-day-muted {
    color: #c0c8cd;
}

.calendar-day-active {
    background-color: #00573f;
    color: #ffffff;
}

.calendar-day-has-event {
    border: 1px solid #00573f;
}

/* Community */
.community-tabs {
    border-radius: 999px;
    background-color: #f2f5f7;
    padding: 3px;
}

.community-tabs .btn {
    border-radius: 999px;
    font-size: 0.8rem;
}

.community-tabs .btn-active {
    background-color: #ffffff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.channel-card {
    border-radius: 18px;
    border-width: 2px;
}

.channel-card-active {
    border-color: #00573f !important;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.05);
}

.chat-scroll {
    max-height: 360px;
    overflow-y: auto;
}

.chat-bubble {
    border-radius: 18px;
    background-color: #f5f7f9;
    padding: 0.45rem 0.8rem;
}

.chat-bubble-me {
    background-color: var(--brand-mint);
    color: #ffffff;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background-color: #e1e5ea;
    font-size: 0.78rem;
}


/* ===========================
   Admin Dashboard Layout
   =========================== */

.admin-layout {
    min-height: 100vh;
    display: flex;
    gap: 0;
}

.admin-sidebar {
    width: 240px;
    background-color: #ffffff;
    border-right: 1px solid rgba(15, 52, 46, 0.06);
    padding: 1.5rem 1.25rem;
}

.admin-sidebar-header .logo-pill {
    width: 40px;
    height: 40px;
}

.admin-sidebar-nav {
    margin-top: 0.5rem;
    gap: 0.25rem;
}

.admin-sidebar-link {
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    color: #355b52;
    display: flex;
    align-items: center;
}

.admin-sidebar-link i {
    font-size: 0.9rem;
}

.admin-sidebar-link:hover {
    background-color: rgba(3, 142, 79, 0.06);
    color: #0f342e;
}

.admin-sidebar-link.active {
    background-color: #0f5842;
    color: #ffffff;
}

/* The flex child of .admin-layout is #admin-main-content — .admin-main sits
   INSIDE it, so the flex:1 below never actually applied to the flex item.
   Without this the content column shrinks to its intrinsic width, leaving
   180–630px of dead space beside every admin page (and the width jumped
   around per page). min-width:0 lets wide tables scroll inside the column
   instead of stretching it past the viewport. */
#admin-main-content {
    flex: 1;
    min-width: 0;
}

.admin-main {
    flex: 1;
    padding: 1.5rem 1.5rem 2rem;
}

.admin-main-header .btn {
    font-size: 0.7rem;
}

/* Stat cards */
.admin-stat-card {
    background-color: #ffffff;
    border-radius: 18px;
    padding: 1rem 1.1rem;
    box-shadow: 0 12px 30px rgba(15, 52, 46, 0.07);
}

/* Chart cards */
.admin-chart-card {
    background-color: #ffffff;
    border-radius: 18px;
    padding: 1rem 1.1rem 1.2rem;
    box-shadow: 0 12px 30px rgba(15, 52, 46, 0.07);
}

/* Bar chart */
.chart-bar-row {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    height: 140px;
    padding-top: 0.5rem;
}

.chart-bar {
    flex: 1;
    background-color: #0f5842;
    border-radius: 10px 10px 2px 2px;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.chart-bar span {
    position: absolute;
    bottom: -1.35rem;
    font-size: 0.65rem;
    color: #6c757d;
}

/* Line chart */
.chart-line-shell {
    padding-top: 0.25rem;
}

.chart-line-track {
    position: relative;
    height: 130px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(15, 52, 46, 0.04), rgba(15, 52, 46, 0.01));
    overflow: hidden;
}

.chart-line-svg {
    position: absolute;
    inset: 0.75rem 0.75rem 0.9rem 0.75rem;
    width: calc(100% - 1.5rem);
    height: calc(100% - 1.65rem);
    color: #2b77ff;
}

.chart-line-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background-color: #2b77ff;
    transform: translate(-50%, -50%);
}

/* Recent activity */
.admin-activity-card {
    background-color: #ffffff;
    border-radius: 18px;
    padding: 1rem 1.1rem;
    box-shadow: 0 12px 30px rgba(15, 52, 46, 0.07);
}

.admin-activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
}

.admin-activity-item+.admin-activity-item {
    border-top: 1px dashed rgba(15, 52, 46, 0.08);
    margin-top: 0.35rem;
    padding-top: 0.7rem;
}

.activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
}

.activity-icon.purple {
    background: linear-gradient(135deg, #a765ff, #6b7bff);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0.75rem 1rem;
        border-right: 0;
        border-bottom: 1px solid rgba(15, 52, 46, 0.06);
        overflow-x: auto;
    }

    .admin-sidebar-header {
        margin-bottom: 0;
        margin-right: 1rem;
    }

    .admin-sidebar-nav {
        flex-direction: row;
        white-space: nowrap;
    }

    .admin-main {
        padding: 1rem 1rem 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .admin-main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .admin-stat-card {
        padding: 0.9rem;
    }

    .admin-chart-card {
        padding: 0.9rem;
    }

    .admin-activity-card {
        padding: 0.9rem;
    }
}



/* Coach dashboard layout & sidebar */
.coach-layout {
    min-height: 100vh;
    display: flex;
    background: var(--soft-mint-bg);
}

.coach-sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.04);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
}

.coach-sidebar-brand .logo-pill {
    background-color: #0d5642;
    color: #ffffff;
}

.logo-initials {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.coach-sidebar-section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-700);
    margin-bottom: 0.5rem;
}

.coach-nav-link {
    display: flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.9rem;
    color: var(--muted-800);
    text-decoration: none;
    margin-bottom: 0.25rem;
    transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.coach-nav-link:hover {
    background-color: #f1f5f9;
    color: var(--soft-mint-ink);
    transform: translateY(-1px);
}

.coach-nav-link.active {
    background-color: #e0f3ec;
    color: var(--soft-mint-ink);
    font-weight: 600;
}

.coach-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.coach-topbar {
    padding: 1rem 2.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    /* TW008-642: the topbar carries a dropdown (Active sessions / Logout).
       backdrop-filter creates a new stacking context, so without a higher
       z-index its dropdown menu paints UNDER the next sibling (.coach-main-scroll)
       and the green hero card eats it. Lift the topbar above the scroll area. */
    position: relative;
    z-index: 30;
}

/* Belt-and-suspenders: ensure the dropdown menu itself stacks above
   anything inside .coach-main-scroll. */
.coach-topbar .dropdown-menu {
    z-index: 1080;
}

.coach-main-scroll {
    flex: 1;
    padding: 1.75rem 2.5rem 2.5rem;
}

.coach-portal-logo-img {
    height: 32px;
    width: auto;
    display: block;
}

/* Keep sidebar fixed on the left while content scrolls */
.coach-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    align-self: flex-start;
}

@media (max-width: 991.98px) {
    .coach-sidebar {
        position: static;
        height: auto;
        overflow: visible;
    }
}


/* Make dashboard fill wider desktop view while keeping content centered */
.coach-main-scroll .container {
    max-width: 1120px;
}

/* Responsive tweaks */
@media (max-width: 991.98px) {
    .coach-layout {
        flex-direction: column;
    }

    .coach-sidebar {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        padding: 1rem 1.25rem 0.75rem;
    }

    .coach-main {
        width: 100%;
    }

    .coach-topbar {
        padding: 0.75rem 1.25rem;
    }

    .coach-main-scroll {
        padding: 1.25rem 1.25rem 1.75rem;
    }
}

@media (max-width: 575.98px) {
    .coach-sidebar-brand {
        margin-bottom: 1rem;
    }

    .coach-sidebar {
        padding-bottom: 1rem;
    }
}


/* ===========================
   Mobile Drawer Menu (Admin + Coach) - MOBILE ONLY
   =========================== */
/* Mobile controls are injected by JS, so hide them on desktop by default.
   They will be shown again inside the mobile breakpoint below. */
.mobile-topbar,
.mobile-menu-toggle,
.mobile-menu-close,
.mobile-drawer-backdrop {
    display: none;
}

/* Mobile drawer engages below 992px so tablets in portrait + large phones in
   landscape also get the off-canvas drawer instead of a cramped horizontal nav. */
@media (max-width: 991.98px) {

    /* Admin layout: avoid flex-related positioning issues on mobile.
     Desktop layout remains unchanged. */
    .admin-layout {
        display: block;
    }

    /* Top bars */
    .mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 1040;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(8px);
        border-bottom: 1px solid rgba(15, 52, 46, 0.06);
    }

    .mobile-topbar .mobile-menu-toggle,
    .mobile-topbar .mobile-menu-close,
    .coach-topbar .mobile-menu-toggle {
        display: inline-flex;
        border: 0;
        background: transparent;
        padding: 0.35rem 0.5rem;
        border-radius: 0.65rem;
        line-height: 1;
    }

    /* Close button inside coach drawer (JS injects the same class) */
    .coach-sidebar .mobile-menu-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 0.75rem;
        color: #0f342e;
    }

    .coach-sidebar .mobile-menu-close:hover {
        background: rgba(15, 52, 46, 0.06);
    }

    .coach-sidebar .mobile-menu-close i {
        font-size: 1.1rem;
    }

    /* Backdrop */
    .mobile-drawer-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1045;
        background: rgba(0, 0, 0, 0.35);
        display: none;
    }

    body.mobile-menu-open .mobile-drawer-backdrop {
        display: block;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    /* Admin sidebar becomes drawer */
    .admin-sidebar {
        /* override tablet responsive header styles (max-width: 991.98px) */
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        max-height: 100vh;
        width: 280px;
        max-width: 86vw;
        z-index: 1050;
        transform: translateX(-110%);
        transition: transform 220ms ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-top: 1rem;
    }

    /* Reset responsive nav layout (tablet breakpoint sets row/nowrap) */
    .admin-sidebar-nav {
        flex-direction: column;
        white-space: normal;
    }

    /* Drawer header (JS injects .mobile-drawer-header for admin) */
    .admin-sidebar .mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .admin-sidebar .mobile-drawer-header .admin-sidebar-header {
        margin: 0;
    }

    .admin-sidebar .mobile-drawer-header .admin-sidebar-header .d-flex.flex-column {
        min-width: 0;
    }

    .admin-sidebar .mobile-drawer-header .admin-sidebar-header .small,
    .admin-sidebar .mobile-drawer-header .admin-sidebar-header .tiny {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Close button inside admin drawer */
    .admin-sidebar .mobile-menu-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 0.75rem;
        color: #0f342e;
    }

    .admin-sidebar .mobile-menu-close:hover {
        background: rgba(15, 52, 46, 0.06);
    }

    .admin-sidebar .mobile-menu-close i {
        font-size: 1.1rem;
    }

    body.mobile-menu-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-main {
        padding-top: 1rem;
    }

    /* Coach sidebar becomes drawer */
    .coach-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        max-height: 100vh;
        width: 300px;
        max-width: 86vw;
        z-index: 1050;
        transform: translateX(-110%);
        transition: transform 220ms ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.mobile-menu-open .coach-sidebar {
        transform: translateX(0);
    }

    /* Coach topbar becomes the mobile top bar */
    .coach-topbar {
        position: sticky;
        top: 0;
        z-index: 1040;
        padding: 0.75rem 1rem;
    }

    .coach-topbar.coach-mobile-topbar {
        gap: 0.5rem;
    }

    /* Empty spacer pill isn't needed on mobile — reclaim the space. */
    .coach-topbar.coach-mobile-topbar .coach-portal-pill {
        display: none;
    }

    /* Let the global search shrink to fit between the hamburger and logout
       instead of overflowing at its fixed 280px desktop width. */
    .coach-topbar.coach-mobile-topbar .global-search {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
    }

    /* The hamburger should not shrink. */
    .coach-topbar .mobile-menu-toggle {
        flex: 0 0 auto;
    }

    /* Ensure main content sits below top bar nicely */
    .coach-main-scroll {
        padding-top: 0.25rem;
    }

    /* ---- Compact brand/logo on mobile ----
       The brand logo is rendered with an inline height=100 which dominates the
       screen on phones (both in the off-canvas drawer and in the cloned mobile
       topbar). CSS overrides the presentational attribute, so cap it here. */
    .mobile-topbar img,
    .admin-sidebar img,
    .coach-sidebar img,
    .coach-sidebar-brand img {
        height: 44px !important;
        width: auto !important;
    }

    /* Keep the mobile topbar itself slim. */
    .mobile-topbar {
        min-height: 56px;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    /* The admin topbar clones .admin-sidebar-header (logo block); strip its
       desktop margins so it sits neatly beside the hamburger. */
    .mobile-topbar .admin-sidebar-header {
        margin: 0;
        flex: 1;
        min-width: 0;
        justify-content: flex-end;
    }

    /* Trim the big bottom margins under the brand inside the drawer so the nav
       starts higher up the screen. */
    .admin-sidebar .mobile-drawer-header,
    .coach-sidebar-brand,
    .admin-sidebar-header {
        margin-bottom: 0.5rem !important;
    }

    /* The drawer brand blocks center a column with an offset on desktop; reset
       that so the small logo aligns left in the narrow drawer. */
    .coach-sidebar-brand .offset-2,
    .admin-sidebar-header .offset-2 {
        margin-left: 0 !important;
    }

    /* ---- Admin in-content header (topheader.blade.php) ----
       Title + global search + user + logout. Wrap so the search drops to its
       own full-width row and nothing overflows the viewport. */
    .admin-main-header {
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;
    }

    .admin-main-header .global-search {
        width: 100%;
        order: 5;
    }

    /* Allow page titles to wrap rather than force horizontal overflow. */
    .admin-main-header h1,
    .admin-main-header .h5 {
        white-space: normal;
        word-break: break-word;
    }
}


.live-search-hidden {
    display: none !important;
}


.btn-primary{
    background-color:var(--tu-orange) !important;
    border-color:var(--tu-orange) !important;
}
.btn-primary:hover{
    background-color:var(--tu-orange-hover) !important;
    border-color:var(--tu-orange-hover) !important;
}

/* ==========================================================================
   Multi-accent roles (colour study) — appended last so they win the cascade.
   Green stays the brand; these add the "second voice".
   ========================================================================== */

/* Coach re-test #64 (Jul 11 2026): the outline "View" / "Open" buttons on
   coach lists were still Bootstrap blue because these rules used
   var(--tu-blue) with !important, out-specificing the layout override.
   Recolour to brand green so nothing on the coach portal shows the blue
   token. .btn-link is left blue — it's used inside coach chat as a
   subtle "reply" affordance where blue reads correctly as a link. */
.btn-link{ color: var(--tu-blue) !important; }
.btn-link:hover{ color: var(--tu-blue-hover) !important; }
.btn-outline-primary{ color: #0D5642 !important; border-color: #0D5642 !important; }
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active{ background-color: #0D5642 !important; border-color: #0D5642 !important; color:#fff !important; }

/* Active / selected state → purple (tabs, pills, selected calendar day,
   selected community channel). Brand-green sidebars are intentionally left
   untouched. */
.nav-tabs .nav-link.active,
.nav-pills .nav-link.active{
    color:#fff !important;
    background-color: var(--tu-purple) !important;
    border-color: var(--tu-purple) !important;
}
.nav-tabs .nav-link.active{
    color: var(--tu-purple) !important;
    background-color:#fff !important;
    border-bottom-color:#fff !important;
    box-shadow: inset 0 -3px 0 var(--tu-purple);
}
.community-tabs .btn-active{
    background-color: var(--tu-purple) !important;
    border-color: var(--tu-purple) !important;
    color:#fff !important;
}
.calendar-day-active{
    background-color: var(--tu-purple) !important;
    border-color: var(--tu-purple) !important;
    color:#fff !important;
}
.channel-card-active{
    border-color: var(--tu-purple) !important;
    box-shadow: 0 0 0 2px var(--tu-purple-bg) !important;
}
/* Bootstrap "primary" text/links used inline for actions → blue, so they read
   as interactive rather than brand chrome. */
a.text-primary, .text-primary{ color: var(--tu-blue) !important; }

/* Shared phone-width container reset (previously duplicated in 4 layout files) */
@media (max-width: 576px) {
    body { margin: 0; padding: 0; }

    .container,
    .container-fluid,
    .admin-shell,
    .coach-shell,
    .content-wrapper {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        margin: 0 !important;
    }

    .card,
    .card-body { width: 100% !important; }

    table {
        display: block;
        width: 100% !important;
        overflow-x: auto;
    }

    /* Pagination must wrap to multiple rows rather than overflow the viewport. */
    .pagination {
        flex-wrap: wrap;
        row-gap: 0.25rem;
    }
}
