/* Paddle Point dashboard/admin regression polish.
   Loaded after styles.css and responsive.css. This pass focuses on sticky
   navigation, compact-screen spacing, and dense operational rows. */

/* Keep the sticky admin section navigation below the sticky app header. */
.admin-section-nav {
    top: 91px;
    z-index: 40;
    max-width: 100%;
}

/* Dense rows should wrap cleanly instead of forcing neighboring controls out. */
.admin-event-meta,
.admin-booking-meta,
.admin-player-meta,
.audit-log-details,
.booking-slot-legend {
    flex-wrap: wrap;
}

.admin-screen-card,
.admin-stat-card,
.admin-quick-action,
.quick-action,
.home-upcoming-card,
.home-info-card,
.home-payment-card,
.history-stat-card,
.history-panel,
.event-card {
    min-width: 0;
}

.admin-screen-heading > div,
.admin-command-heading > div,
.admin-bookings-heading > div,
.dashboard-section-head > div,
.events-section-title,
.history-section-title {
    min-width: 0;
}

.admin-screen-heading h2,
.admin-command-heading h2,
.admin-bookings-heading h2,
.dashboard-section-head h2,
.events-section-title h2,
.history-section-title h2 {
    overflow-wrap: anywhere;
}

/* Avoid actions pushing labels or user data outside their cards. */
.admin-payment-actions,
.admin-event-actions,
.payment-history-actions {
    align-items: center;
}

.admin-payment-actions > button,
.admin-event-actions > button,
.payment-history-actions > button,
.payment-history-actions > a {
    max-width: 100%;
}

/* Keep navigation labels readable while preserving a compact desktop shell. */
.main-nav {
    scrollbar-width: none;
}
.main-nav::-webkit-scrollbar {
    display: none;
}

/* Tablet: the app header grows to two rows, so the admin sticky bar must move
   down with it instead of remaining at the desktop 91px offset. */
@media (max-width: 1000px) {
    .admin-section-nav {
        top: 126px;
    }

    .main-nav {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .main-nav .nav-item {
        flex: 0 0 auto;
        min-width: 82px;
    }

    .admin-screen-heading,
    .admin-command-heading,
    .admin-bookings-heading {
        min-width: 0;
    }
}

@media (max-width: 700px) {
    /* Mobile app header is ~118px tall. Keep a one-pixel visual gap so both
       sticky layers remain distinct while scrolling. */
    .admin-section-nav {
        top: 119px;
    }
}

@media (max-width: 650px) {
    /* Do not squeeze six navigation tabs into one row. The bar still spans the
       full viewport, but users can swipe horizontally without text collisions. */
    .main-nav {
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 4px;
        padding-bottom: 9px;
    }

    .main-nav .nav-item {
        flex: 0 0 auto;
        min-width: 76px;
        padding: 9px 10px;
        white-space: nowrap;
        line-height: 1.2;
    }

    .dashboard-actions {
        margin-right: 0;
    }

    .app-header .brand-lockup {
        max-width: calc(100vw - 82px);
    }

    .app-header .brand-name {
        max-width: min(48vw, 170px);
    }

    .admin-section-nav {
        margin-bottom: 18px;
    }

    .admin-screen-heading,
    .admin-command-heading,
    .admin-bookings-heading {
        gap: 10px;
    }

    .admin-screen-heading .admin-live-badge,
    .admin-screen-heading .admin-result-count,
    .admin-bookings-heading .admin-result-count {
        align-self: flex-start;
    }

    .admin-today-main strong,
    .admin-booking-topline strong,
    .admin-event-topline strong,
    .admin-player-main strong {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
    }

    .admin-event-meta,
    .admin-booking-meta,
    .admin-player-meta {
        row-gap: 4px;
    }

    .admin-payment-actions,
    .admin-event-actions,
    .payment-history-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .admin-payment-actions .payment-action-btn {
        flex: 1 1 120px;
    }

    .admin-quick-action,
    .quick-action {
        min-height: 118px;
    }
}

@media (max-width: 480px) {
    .admin-quick-actions,
    .quick-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .quick-action:last-child {
        grid-column: auto;
    }

    .admin-screen-card,
    .history-panel,
    .events-toolbar,
    .home-upcoming-card,
    .home-info-card,
    .home-payment-card {
        border-radius: 17px;
    }

    .admin-screen-heading h2,
    .admin-command-heading h2,
    .admin-bookings-heading h2 {
        font-size: 21px;
    }

    .admin-date-step {
        flex: 0 0 42px;
    }

    .admin-schedule-toolbar {
        min-width: 0;
    }

    .admin-date-field {
        min-width: 0;
    }

    .admin-payment-actions .payment-action-btn,
    .admin-event-actions > button,
    .payment-history-actions > button,
    .payment-history-actions > a {
        flex: 1 1 100%;
        width: 100%;
    }
}
