/* ==============================================================
   mobile.css — site-wide responsive overrides
   Loaded on every template AFTER the per-page CSS so it wins.
   Breakpoints follow Bootstrap 5: md = 768px, sm = 576px.
   ============================================================== */

/* ============================================================
   PHONE & SMALL TABLET (<= 768px)
   ============================================================ */
@media (max-width: 768px) {

    /* ===========================================================
       SIDEBAR -> HORIZONTAL TOP NAVBAR
       =========================================================== */
    .padel-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 8px 12px !important;
        z-index: 1050;
        gap: 6px;
        overflow: visible !important;
    }

    /* Logo block — collapse to a single small logo, hide the title text */
    .padel-sidebar > .text-center {
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center;
        flex-shrink: 0;
    }
    .padel-sidebar .logo-container {
        margin: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    .padel-sidebar .logo {
        width: 38px !important;
        height: 38px !important;
        margin: 0 !important;
        border-radius: 8px;
    }
    .padel-sidebar h5,
    .padel-sidebar small {
        display: none !important;
    }

    /* Nav: horizontal row of icon-only links, scrollable if it overflows */
    .padel-sidebar .nav {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 2px !important;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        flex-grow: 1;
        justify-content: center;
        align-items: center;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .padel-sidebar .nav::-webkit-scrollbar {
        display: none;
    }

    /* Each nav link becomes a compact icon button */
    .padel-sidebar .nav-link {
        padding: 8px 10px !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
        flex-shrink: 0;
    }
    .padel-sidebar .nav-link span {
        display: none !important;
    }
    .padel-sidebar .nav-link i {
        font-size: 1.1rem !important;
        margin: 0 !important;
    }

    /* Active link: bottom underline instead of left border */
    .padel-sidebar .nav-link.active {
        border-left: none !important;
        border-right: none !important;
        border-top-left-radius: 8px !important;
        border-top-right-radius: 8px !important;
        border-bottom: 3px solid #d3db46 !important;
        background-color: #516ca4 !important;
        color: #ffffff !important;
    }

    /* Logout: small icon on the far end */
    .padel-sidebar > div.mt-auto,
    .padel-sidebar > .mt-auto {
        margin: 0 !important;
        padding: 0 !important;
        flex-shrink: 0;
    }
    .padel-sidebar .mt-auto hr {
        display: none !important;
    }
    .padel-sidebar .btn-logout {
        width: auto !important;
        padding: 8px 10px !important;
        border-radius: 8px !important;
        font-size: 0 !important;            /* hides label text */
        background: transparent !important; /* blend into navbar */
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #e26d5c !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    .padel-sidebar .btn-logout:hover,
    .padel-sidebar .btn-logout:focus,
    .padel-sidebar .btn-logout:active {
        background: rgba(255, 255, 255, 0.08) !important;
        background-color: rgba(255, 255, 255, 0.08) !important;
        color: #ff8575 !important;
    }
    .padel-sidebar .btn-logout i {
        font-size: 1.2rem !important;
        margin: 0 !important;
        color: inherit !important;
    }

    /* Kill desktop toggle button and the now-unused drawer helpers */
    .padel-sidebar .toggle-btn,
    .mobile-hamburger,
    .mobile-sidebar-backdrop {
        display: none !important;
    }

    /* Cancel the desktop collapsed-slim behaviour */
    .padel-sidebar.collapsed {
        width: 100% !important;
        max-width: none !important;
    }

    /* ===========================================================
       MAIN CONTENT — push below the fixed top bar
       =========================================================== */
    .main-wrapper {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
    }
    .padel-main,
    .main-content,
    .main-wrapper > main,
    .main-wrapper > .main-container,
    .main-wrapper > .content-area,
    .main-wrapper > .container,
    .main-wrapper > .container-fluid {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        padding-top: 70px !important;   /* clear the fixed navbar */
    }

    /* Don't double-up: if .main-container is nested inside .content-area,
       only the outer wrapper carries the navbar offset. */
    .content-area > .main-container {
        padding-top: 0 !important;
    }

    /* If the first child is a hero with its own background,
       pull it up under the navbar so the gradient is flush,
       and re-add the 70px as internal padding so its content
       still sits below the navbar. */
    .padel-main > .hero-section:first-child,
    .main-content > .hero-section:first-child,
    .main-wrapper > main > .hero-section:first-child {
        margin-top: -70px !important;
        padding-top: 90px !important;
    }
    .hero-section {
        margin-top: 0;
    }

    /* ===========================================================
       GENERIC RESPONSIVE TUNING
       =========================================================== */
    .display-1 { font-size: 2.5rem !important; }
    .display-2 { font-size: 2.2rem !important; }
    .display-3 { font-size: 2rem !important; }
    .display-4 { font-size: 1.9rem !important; }
    .display-5 { font-size: 1.7rem !important; }
    .display-6 { font-size: 1.4rem !important; }
    h1 { font-size: 1.6rem !important; }
    h2 { font-size: 1.4rem !important; }
    h3 { font-size: 1.25rem !important; }
    .lead { font-size: 1rem !important; }

    .hero-section {
        min-height: auto !important;
        padding: 40px 20px !important;
        border-radius: 0 0 30px 30px !important;
    }
    .hero-logo-container {
        width: 150px !important;
        height: 90px !important;
    }

    .btn-lg {
        padding: 0.65rem 1.4rem !important;
        font-size: 1rem !important;
    }
    .d-flex.gap-3.justify-content-center,
    .d-flex.gap-2.justify-content-center {
        flex-wrap: wrap;
    }

    .row > [class*="col-"] { margin-bottom: 1rem; }
    .card { margin-bottom: 1rem; }

    .form-control,
    .form-select { font-size: 16px !important; }   /* iOS won't zoom */
    .form-control-lg,
    .form-select-lg { font-size: 1rem !important; }

    .table-responsive-auto,
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Modals stay as compact centered cards on mobile,
       NOT forced to full-screen. */
    .modal-dialog {
        margin: 1rem auto !important;
        max-width: calc(100% - 2rem) !important;
        min-height: auto !important;
    }
    .modal-content {
        border-radius: 14px !important;
        min-height: auto !important;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    .modal-dialog-centered {
        min-height: calc(100% - 2rem) !important;
    }

    .container,
    .container-fluid,
    .container-lg,
    .container-md,
    .container-sm,
    .container-xl,
    .container-xxl {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
    .p-4 { padding: 1rem !important; }
    .p-5 { padding: 1.25rem !important; }
    .py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .px-5 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }

    img { max-width: 100%; height: auto; }

    /* Page must scroll vertically on mobile.
       Some per-page stylesheets set `html,body { overflow: hidden }`
       (e.g. applicants_club.css) which kills scrolling. Force unlock. */
    html, body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100vh;
    }
    .vh-100 { height: auto !important; min-height: 100vh; }
    .overflow-hidden { overflow: visible !important; }

    /* Inner scrollable wrappers (`.content-area` with inline `height:100vh;
       overflow-y:auto`) should let the body scroll instead of trapping
       scroll inside themselves. */
    .content-area,
    .main-container {
        height: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
    }

    /* ===========================================================
       VIDEO SCORE PANEL — formula badge wraps under the score
       =========================================================== */
    .video-score-panel .d-flex.justify-content-between {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    .video-score-panel .badge {
        white-space: normal !important;
        text-align: start !important;
        max-width: 100%;
        font-size: 0.7rem !important;
        line-height: 1.35;
        padding: 6px 10px !important;
        word-wrap: break-word;
    }

    /* ===========================================================
       ANALYSIS BOXES — keep <ul> bullets inside the colored card
       =========================================================== */
    .analysis-box {
        padding: 12px 14px !important;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
    .analysis-box ul {
        padding-inline-start: 1.25rem !important;
        margin-inline-start: 0 !important;
        list-style-position: outside !important;
    }
    .analysis-box li {
        margin-bottom: 4px;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    /* Generic safety: any <ul> nested in a coloured/padded card
       gets the same treatment so bullets never escape. */
    [class*="bg-"][class*="-soft"] ul,
    .bg-success-soft ul,
    .bg-orange-soft ul,
    .analysis-box-bestplay ul,
    .analysis-box-tips ul {
        padding-inline-start: 1.25rem !important;
        margin-inline-start: 0 !important;
    }

    /* ===========================================================
       CITY / TAG FILTER BAR — horizontally scrollable on mobile
       =========================================================== */
    .filter-wrapper {
        display: flex !important;
        flex-wrap: nowrap !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 6px 10px !important;
        gap: 6px !important;
        border-radius: 40px !important;
        justify-content: flex-start !important;
    }
    .filter-wrapper::-webkit-scrollbar {
        display: none;
    }
    .btn-filter {
        padding: 6px 14px !important;
        font-size: 0.82rem !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }

    /* ===========================================================
       CLUB DETAIL — apply / disabled buttons were 127% wide,
       which overflows the viewport on mobile.
       =========================================================== */
    .btn-apply-custom,
    .btn-disabled-custom {
        width: 100% !important;
        max-width: 100% !important;
        padding: 14px !important;
        font-size: 1rem !important;
        border-radius: 14px !important;
        white-space: normal !important;
        word-wrap: break-word;
    }
    .apply-button-wrapper {
        width: 100% !important;
        padding: 0 !important;
        margin-top: 1rem;
    }

    /* ===========================================================
       OPPORTUNITY INFO-GRID — all 4 colored boxes equal size
       (Level / Seats / Applicants / Age Group)
       =========================================================== */
    .info-grid-item {
        height: 100% !important;
        min-height: 105px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 10px 4px !important;
        border-radius: 12px !important;
        text-align: center !important;
        overflow: hidden;
    }
    .info-grid-item i {
        font-size: 1.05rem !important;
        margin-bottom: 4px !important;
    }
    .info-grid-item small {
        font-size: 0.7rem !important;
        line-height: 1.15 !important;
        min-height: 2.3em;                /* room for 2 lines so all labels align */
        display: flex !important;
        align-items: center;
        justify-content: center;
        text-align: center;
        margin-bottom: 4px !important;
        word-break: break-word;
    }
    .info-grid-item .fw-bold,
    .info-grid-item span {
        font-size: 0.9rem !important;
        line-height: 1.1 !important;
        word-break: break-word;
        text-align: center !important;
    }
    /* The row of 4 boxes — stretch cells to same height, no extra side gap */
    .row.g-2:has(.info-grid-item) {
        --bs-gutter-x: 0.5rem;
        align-items: stretch !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .row > .col-3:has(.info-grid-item) {
        display: flex;
        padding-left: 3px !important;
        padding-right: 3px !important;
    }
    /* Force the box to fill the column's full width
       (flex children don't stretch on the main axis by default) */
    .row > .col-3:has(.info-grid-item) > .info-grid-item {
        width: 100% !important;
        flex: 1 1 100% !important;
    }

    /* ===========================================================
       APPLY FORM — equal-size Submit / Cancel buttons
       =========================================================== */
    .footer-actions {
        display: flex !important;
        flex-direction: row !important;     /* match document direction (LTR or RTL) */
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: stretch !important;    /* both buttons share the tallest height */
        gap: 10px !important;
        margin-top: 24px !important;
    }
    .footer-actions .btn-send,
    .footer-actions .btn-cancel {
        flex: 1 1 50% !important;
        min-height: 52px !important;        /* identical floor height */
        padding: 10px 14px !important;
        font-size: 0.95rem !important;
        text-align: center !important;
        margin: 0 !important;
        white-space: normal !important;
        word-wrap: break-word;
        display: flex !important;           /* center label vertically */
        align-items: center !important;
        justify-content: center !important;
        line-height: 1.2 !important;
    }

    /* Apply form card — fit inside viewport (currently uses .apply-card) */
    .apply-card {
        max-width: 100% !important;
        padding: 18px !important;
        margin-top: 1rem !important;
    }

    /* ===========================================================
       PERSONAL PROFILE — Age / City / Phone / Email cards all equal
       =========================================================== */
    .row > .col-6:has(.glass-info-item),
    .row > .col-md-3:has(.glass-info-item) {
        display: flex !important;
    }
    .glass-info-item {
        width: 100% !important;
        height: 100% !important;
        min-height: 140px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 16px 10px !important;
        text-align: center !important;
        overflow: hidden;
    }
    .glass-info-item .icon-neon-circle {
        margin-bottom: 8px !important;
        flex-shrink: 0;
    }
    .glass-info-item small {
        display: block !important;
        margin-bottom: 4px !important;
        min-height: 1.4em;
        line-height: 1.2 !important;
    }
    .glass-info-item span {
        display: block !important;
        font-size: 0.85rem !important;
        line-height: 1.25 !important;
        word-break: break-word;
        overflow-wrap: anywhere;            /* email won't overflow the box */
    }
    .glass-info-item .small-email {
        font-size: 0.72rem !important;
    }
    /* Stretch the row so both 2-per-row cells match the taller one */
    .row:has(> .col-6 > .glass-info-item) {
        align-items: stretch !important;
    }

    /* ===========================================================
       PROFILE VIDEO CARDS — keep within viewport, no overflow
       =========================================================== */
    .video-analysis-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }
    .video-card-item {
        min-width: 0 !important;        /* override desktop's 320px floor */
        max-width: 100% !important;
        width: 100% !important;
        flex: 1 1 100% !important;
    }
    .video-card {
        max-width: 100% !important;
        overflow: hidden !important;    /* clip the rounded corners cleanly */
    }
    .video-thumb-container {
        min-height: 180px !important;   /* shorter on mobile */
        max-height: 56vw !important;    /* responsive to viewport */
        overflow: hidden !important;
    }
    .video-thumb-container img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
    }
    /* Any inline <video> tag (modals, hero, etc.) */
    video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    /* ===========================================================
       APPLICANT DETAIL MODAL — 6 info boxes equal size
       (Email / Phone / Applied for / Application Date / Age / Gender)
       =========================================================== */
    .row > .col-6:has(.info-box) {
        display: flex !important;
    }
    .info-box {
        width: 100% !important;
        height: 100% !important;
        min-height: 80px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 10px 12px !important;
        border-radius: 12px !important;
        background: #f8fafc;
        border: 1px solid #e8edf5;
        overflow: hidden;
    }
    .info-box-icon {
        flex-shrink: 0 !important;
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
        font-size: 0.95rem !important;
    }
    .info-box > div:not(.info-box-icon) {
        flex: 1 1 auto !important;
        min-width: 0 !important;            /* allow text inside to shrink */
        overflow: hidden;
    }
    .info-box small {
        display: block !important;
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
        margin-bottom: 2px !important;
    }
    .info-box span {
        display: block !important;
        font-size: 0.78rem !important;
        line-height: 1.25 !important;
        word-break: break-word;
        overflow-wrap: anywhere;            /* long emails wrap inside the box */
    }
    /* Stretch row so every pair of cells matches the taller one */
    .row:has(> .col-6 > .info-box) {
        align-items: stretch !important;
    }

    /* ===========================================================
       OPPORTUNITY DETAIL (coach) — applicant rows wrap properly
       =========================================================== */
    .app-row {
        padding: 12px !important;
    }
    .app-row > .d-flex {
        flex-wrap: wrap !important;
        gap: 10px !important;
        align-items: flex-start !important;
    }
    /* Avatar stays its size */
    .app-row .p-avatar {
        flex: 0 0 44px !important;
    }
    /* Name + meta line takes the rest of row 1 */
    .app-row > .d-flex > .flex-grow-1 {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }
    /* Status dropdown + View button drop onto row 2, full width */
    .app-row > .d-flex > .d-flex.gap-2 {
        flex: 1 1 100% !important;
        justify-content: space-between !important;
        gap: 8px !important;
        margin-top: 4px;
        align-items: center !important;
    }
    .app-row .status-sel {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: 60% !important;
    }
    .app-row .btn.btn-navy.btn-sm {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* ===========================================================
       BACK BUTTON — keep it pill-shaped, not pulled by main padding
       =========================================================== */
    .btn-back {
        display: inline-flex !important;
        align-items: center !important;
        padding: 8px 18px !important;
        font-size: 0.9rem !important;
        white-space: nowrap;
    }

    /* "View Applicants" header button shouldn't squash the count badge */
    .d-flex.justify-content-between.align-items-center:has(.btn-navy.rounded-pill) {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    /* ===========================================================
       .modal-chip — applicant modal info chips (Email/Phone/etc.)
       =========================================================== */
    .row > .col-6:has(.modal-chip) {
        display: flex !important;
    }
    .modal-chip {
        width: 100% !important;
        height: 100% !important;
        min-height: 78px !important;
        padding: 10px 12px !important;
        gap: 8px !important;
        align-items: center !important;
        overflow: hidden;
    }
    /* Icon stays its size on the side */
    .modal-chip > div:first-child {
        flex: 0 0 36px !important;
        width: 36px !important;
        height: 36px !important;
    }
    /* Text block fills remaining width and clips/wraps */
    .modal-chip > div:not(:first-child) {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow: hidden;
    }
    .modal-chip small {
        display: block !important;
        font-size: 0.72rem !important;
        line-height: 1.25 !important;
        word-break: break-word;
        overflow-wrap: anywhere;          /* long emails wrap inside the chip */
    }
    .modal-chip small.text-muted {
        font-size: 0.65rem !important;
        margin-bottom: 2px !important;
    }
    /* Stretch row so all 2-per-row chips match height of tallest */
    .row:has(> .col-6 > .modal-chip) {
        align-items: stretch !important;
    }

    /* ===========================================================
       CLUB OPPORTUNITIES PAGE — fit cards within phone viewport
       =========================================================== */
    /* Card itself: tighter padding, never overflow */
    .opp-card {
        padding: 16px !important;
        overflow: hidden;
        max-width: 100% !important;
        margin: 0;
    }

    /* Header row: stack icon+title on row 1, action buttons on row 2 */
    .opp-card > .d-flex.align-items-start {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    /* Icon + title block takes row 1 */
    .opp-card > .d-flex.align-items-start > .icon-box {
        flex: 0 0 44px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 1rem !important;
    }
    .opp-card > .d-flex.align-items-start > .flex-grow-1 {
        flex: 1 1 calc(100% - 60px) !important;
        min-width: 0 !important;
    }
    .opp-card .flex-grow-1 h5 {
        font-size: 1.05rem !important;
        word-break: break-word;
    }
    /* Action buttons drop to a new row and wrap */
    .opp-card > .d-flex.align-items-start > .d-flex.gap-2 {
        flex: 1 1 100% !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        justify-content: flex-start !important;
    }
    .opp-card .btn-sm {
        font-size: 0.75rem !important;
        padding: 5px 10px !important;
        white-space: nowrap;
    }

    /* Tags row: wrap freely */
    .opp-card .d-flex.flex-wrap.gap-2 {
        gap: 6px !important;
    }
    .opp-card .tag {
        font-size: 0.72rem !important;
        padding: 4px 9px !important;
        white-space: nowrap;
    }

    /* Footer (count + requirements) */
    .opp-card > .d-flex.gap-4.border-top {
        flex-wrap: wrap !important;
        gap: 12px !important;
        padding-top: 10px !important;
    }

    /* Page header (title + Add button) */
    .btn-add {
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
        white-space: nowrap;
    }

    /* ===========================================================
       CLUB APPLICANTS PAGE — status cards, filter, applicant cards
       =========================================================== */

    /* Grid layout — was minmax(420px, 1fr), overflowed phone viewport */
    .applicants-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        margin-top: 16px !important;
    }

    /* Status summary cards (Rejected / Accepted / Under Review) */
    .status-card {
        padding: 14px 16px !important;
        min-height: 80px !important;
        border-radius: 16px !important;
        gap: 12px !important;
    }
    .status-icon {
        font-size: 1.8rem !important;
    }
    .status-count {
        font-size: 1.5rem !important;
        line-height: 1.1;
    }
    .status-card small {
        font-size: 0.85rem;
    }
    /* The 3 status cards row was col-md-4 (stacks on mobile) — give it tighter gap */
    .row.g-4.mb-5:has(.status-card) {
        gap: 12px 0 !important;
        margin-bottom: 1.5rem !important;
    }

    /* Filter header (title + 2 dropdowns) */
    main .d-flex.justify-content-between.align-items-center.mb-4.mt-4:has(.form-select) {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    main h5#title-text,
    main #title-text {
        font-size: 1rem !important;
    }
    .form-select.rounded-pill {
        font-size: 0.78rem !important;
        padding: 6px 24px 6px 12px !important;
        width: 100% !important;
    }
    /* The two-dropdown wrapper goes full width and stacks */
    .d-flex.gap-2.flex-wrap.align-items-center:has(> form > .form-select) {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .d-flex.gap-2.flex-wrap.align-items-center > form {
        width: 100%;
    }

    /* Applicant card — tighter padding, no overflow */
    .applicant-card {
        padding: 16px !important;
        border-radius: 18px !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    .applicant-card .avatar-box {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.2rem !important;
        flex-shrink: 0;
    }
    .applicant-card h6 {
        font-size: 0.95rem !important;
        word-break: break-word;
    }
    .applicant-card .info-list small,
    .applicant-card .info-list span {
        font-size: 0.75rem !important;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    /* Coach evaluation block: stacks stars + comment vertically */
    .applicant-card .bg-light .d-flex.justify-content-between {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }
    /* Action buttons row */
    .card-actions {
        gap: 8px !important;
        margin-top: 14px !important;
    }
    .btn-action {
        padding: 10px 6px !important;
        font-size: 0.85rem !important;
    }
    .rank-badge {
        top: 12px !important;
        inset-inline-end: 12px !important;
        font-size: 0.72rem !important;
        padding: 3px 10px !important;
    }

    /* Dashboard title block */
    .dashboard-title {
        font-size: 1.4rem !important;
    }
    main > .container-fluid > .mb-5:first-child {
        margin-bottom: 1.5rem !important;
    }

    /* ===========================================================
       APPLICATION DETAIL PAGE — player card, info pills, video
       =========================================================== */

    /* Outer container respects viewport */
    .main-container {
        max-width: 100% !important;
        padding: 16px 12px !important;
    }

    /* Cards — tighter padding on mobile */
    .custom-card {
        padding: 16px !important;
        margin-bottom: 16px !important;
        border-radius: 14px !important;
        max-width: 100% !important;
        overflow: hidden;
    }

    /* Top status badge + back button row */
    .main-container > .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .main-container .badge.bg-warning,
    .main-container .btn-outline-primary.rounded-pill {
        font-size: 0.78rem !important;
        padding: 6px 14px !important;
    }

    /* Player card: stack avatar above content on phone */
    .custom-card.d-flex.align-items-center {
        flex-direction: column-reverse !important;
        text-align: center !important;
        gap: 14px !important;
    }
    .custom-card.d-flex.align-items-center > .flex-grow-1 {
        width: 100%;
        text-align: center !important;
    }
    /* The squashed-oval avatar — flex children shrink on main axis */
    .profile-avatar {
        flex-shrink: 0 !important;
        width: 90px !important;
        height: 90px !important;
        font-size: 2.2rem !important;
        aspect-ratio: 1 / 1;
    }
    .player-name {
        font-size: 1.25rem !important;
        text-align: center !important;
    }
    .badge-status,
    .info-pill {
        font-size: 0.78rem !important;
        padding: 5px 12px !important;
    }
    .custom-card .d-flex.flex-wrap.gap-2 {
        justify-content: center !important;
        gap: 6px !important;
    }

    /* Card section headings */
    .custom-card h5 {
        font-size: 1rem !important;
    }
    .title-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.78rem !important;
    }

    /* Pill containers (Email/Phone/etc.) */
    .pill-container {
        padding: 12px !important;
        border-radius: 12px !important;
        word-break: break-word;
        overflow-wrap: anywhere;
        font-size: 0.85rem;
    }
    .pill-container span,
    .pill-container small {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    /* Coach rating row */
    .custom-card .d-flex.align-items-center.justify-content-start.mb-3 {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .custom-card .text-warning.fs-5,
    .custom-card .fw-bold.fs-5 {
        font-size: 1rem !important;
    }

    /* Video box: keep 16:9 aspect within viewport */
    .video-box {
        max-width: 100% !important;
        aspect-ratio: 16 / 9;
        height: auto !important;
    }
    .video-box video {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain;
    }

    /* ===========================================================
       CURRENT PLAYERS PAGE (club) — stats row, header, player cards
       =========================================================== */

    /* Page header: title block above the Add button — applies to
       both .btn-add-new (current_players) and .btn-add-action (addCoach) */
    .page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        margin-bottom: 16px !important;
    }
    .page-header .title-section h1 {
        font-size: 1.4rem !important;
    }
    .btn-add-new,
    .btn-add-action {
        padding: 12px 18px !important;
        font-size: 0.95rem !important;
        gap: 8px !important;
        transform: none !important;            /* kill the desktop "floating" lift */
        box-shadow: 0 4px 12px rgba(211, 219, 70, 0.25) !important;
        width: 100% !important;
        justify-content: center !important;
        border-radius: 14px !important;
    }

    /* Stats row: 5 cards don't fit in one line on mobile.
       Switch to a 2-col grid (5th card spans both cols). */
    .stats-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 18px !important;
    }
    .stats-row > .stat-box:last-child {
        grid-column: 1 / -1;            /* last card takes full row */
    }
    .stat-box {
        padding: 12px 8px !important;
        border-radius: 12px !important;
        min-height: 70px;
    }
    .stat-box .number {
        font-size: 1.25rem !important;
    }
    .stat-box .label {
        font-size: 0.8rem !important;
        margin-top: 2px !important;
        text-align: center;
    }

    /* Search container: tighter padding */
    .search-container {
        padding: 10px 12px !important;
        margin-bottom: 18px !important;
    }

    /* Card grid: single column on phone */
    .cards-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Player card itself */
    .player-card {
        padding: 18px !important;
        border-radius: 16px !important;
        max-width: 100% !important;
        overflow: hidden;
    }
    .player-card .avatar {
        width: 80px !important;
        height: 80px !important;
        font-size: 2rem !important;
        flex-shrink: 0 !important;
        aspect-ratio: 1 / 1;
    }
    .player-card h3 {
        font-size: 1.15rem !important;
        word-break: break-word;
    }
    .contact-info p {
        font-size: 0.82rem !important;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    .details-row {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .details-row > div {
        flex: 1 1 45%;
        min-width: 0;
    }
    .detail-label,
    .detail-value {
        font-size: 0.78rem !important;
    }
    .achievement-badge {
        font-size: 0.8rem !important;
        padding: 8px 10px !important;
    }
    .card-actions {
        gap: 8px !important;
    }
    .card-actions button,
    .card-actions a {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.9rem !important;
    }

    /* ===========================================================
       ADD COACH PAGE — coach cards + modal form
       =========================================================== */

    /* ── KILL addCoach.css desktop overrides ─────────────────
       addCoach.css forces:
         .items-grid       = flex + gap:30px + width:100%
         .items-grid .col  = min-width:520px (wider than a phone!)
         .card             = min-height:380px (empty space)
       All with !important. Override here. */
    section.items-grid,
    .items-grid {
        display: block !important;
        gap: 0 !important;
        flex-wrap: nowrap !important;
    }
    section.items-grid .row,
    .items-grid .row {
        align-items: flex-start !important;
        --bs-gutter-x: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
    }
    .items-grid .col-md-6,
    section.items-grid .row > .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;             /* kill the 520px floor */
        width: 100% !important;
        align-self: stretch !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-bottom: 0 !important;
    }
    /* Card itself: no min-height, no forced 380px empty space */
    section.items-grid .card,
    .items-grid .card {
        min-height: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    /* Defeat Bootstrap's h-100 + force card to hug its content */
    section.items-grid .card,
    section.items-grid .card.h-100 {
        padding: 14px !important;
        height: auto !important;
        min-height: 0 !important;
    }
    /* Hammer ALL Bootstrap spacing utilities inside the card on mobile */
    section.items-grid .card .mt-5 { margin-top: 10px !important; }
    section.items-grid .card .mt-4 { margin-top: 8px !important; }
    section.items-grid .card .mb-3 { margin-bottom: 10px !important; }
    section.items-grid .card .my-1 { margin-top: 2px !important; margin-bottom: 2px !important; }
    /* Coach avatar box: keep square */
    section.items-grid .icon-avatar {
        width: 56px !important;
        height: 56px !important;
        flex-shrink: 0 !important;
        aspect-ratio: 1 / 1;
    }
    section.items-grid .icon-avatar i {
        font-size: 1.4rem !important;
    }
    section.items-grid .card h5 {
        font-size: 1.05rem !important;
        word-break: break-word;
    }
    section.items-grid .contact-details {
        margin-top: 4px;
    }
    section.items-grid .contact-details p {
        font-size: 0.78rem !important;
        word-break: break-word;
        overflow-wrap: anywhere;
        margin-bottom: 2px !important;
    }
    section.items-grid .bio-box {
        padding: 10px 12px !important;
        margin-bottom: 12px !important;
    }
    section.items-grid .bio-box p {
        font-size: 0.78rem !important;
    }
    /* Kill the desktop mt-5 (3rem) above the delete button —
       was leaving a huge empty gap on mobile */
    section.items-grid .card-action.mt-5,
    section.items-grid .card-action {
        margin-top: 0 !important;
    }
    section.items-grid .card-action .btn {
        padding: 10px !important;
        font-size: 0.9rem !important;
    }
    /* Header row: ensure icon is on the start side (right in RTL) */
    section.items-grid .card > .d-flex.align-items-center {
        gap: 12px !important;
    }

    /* Modal "Add new coach" — make form 1-col on mobile and keep submit
       button inside the modal footer (not floating outside). */
    #addCoachModal .modal-body {
        padding: 16px !important;
    }
    #addCoachModal .row.g-4 > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    #addCoachModal .modal-header {
        padding: 16px !important;
    }
    #addCoachModal .icon-box-lime {
        width: 52px !important;
        height: 52px !important;
        border-radius: 14px !important;
    }
    #addCoachModal .icon-box-lime i {
        font-size: 1.2rem !important;
    }
    #addCoachModal .modal-header h4 {
        font-size: 1.05rem !important;
    }
    #addCoachModal .modal-footer {
        padding: 14px 16px !important;
        position: sticky;
        bottom: 0;
        background: #fff;
        z-index: 1;
    }
    body.dark-mode #addCoachModal .modal-footer {
        background: #1e293b;
    }
}

/* ============================================================
   VERY SMALL PHONES (<= 480px) — extra tightening
   ============================================================ */
@media (max-width: 480px) {
    .display-5 { font-size: 1.45rem !important; }
    .display-4 { font-size: 1.6rem !important; }
    .display-3 { font-size: 1.75rem !important; }
    h1 { font-size: 1.4rem !important; }
    .hero-section {
        padding: 30px 14px !important;
        border-radius: 0 0 24px 24px !important;
    }
    .btn { font-size: 0.92rem; }
    .btn-lg {
        padding: 0.6rem 1.2rem !important;
        font-size: 0.95rem !important;
    }
    /* Even tighter spacing in the top navbar */
    .padel-sidebar { padding: 6px 8px !important; gap: 4px; }
    .padel-sidebar .logo { width: 34px !important; height: 34px !important; }
    .padel-sidebar .nav-link { padding: 6px 8px !important; }
    .padel-sidebar .nav-link i { font-size: 1rem !important; }
}
/* ===========================================================
   AUTH FORMS — login / register buttons
   =========================================================== */
.login-btn,
.auth-form .btn {
    min-height: 52px !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    cursor: pointer !important;
}
