/* Staff tools panel (templates/events/components/admin_panel.html).
   A slim bar that folds open. Closed by default under 768px so the event
   itself is on the first screen; the last choice is kept per tab.
   Radius: 10px controls, 14px cards, 999px pills. Every fill sets its own
   color and -webkit-text-fill-color (custom.css paints spans gray). */
.staff-fold {
    display: block;
    margin: 0 0 12px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.staff-fold > summary {
    list-style: none;
}

.staff-fold > summary::-webkit-details-marker {
    display: none;
}

.staff-fold > summary::marker {
    content: "";
}

.staff-fold__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 72rem;
    min-height: 56px;
    margin: 0 auto;
    padding: 6px 12px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.staff-fold__bar:focus-visible {
    outline: 2px solid #be123c;
    outline-offset: -2px;
    border-radius: 10px;
}

.staff-fold__who {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 0 1 auto;
}

.staff-fold b {
    font-weight: inherit;
}

.staff-fold__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #ede9fe;
    color: #4c1d95;
    -webkit-text-fill-color: #4c1d95;
    font-size: 15px;
    line-height: 1;
}

.staff-fold__role {
    font-size: 11px;
    font-weight: 700 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    -webkit-text-fill-color: #64748b;
}

.staff-fold__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700 !important;
    color: #0f172a;
    -webkit-text-fill-color: #0f172a;
}

.staff-fold__chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.staff-fold__chips::-webkit-scrollbar {
    display: none;
}

.staff-fold__chip {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700 !important;
    white-space: nowrap;
}

.staff-fold__chip--date {
    background: #e0f2fe;
    color: #075985;
    -webkit-text-fill-color: #075985;
}

.staff-fold__chip--count {
    background: #ede9fe;
    color: #5b21b6;
    -webkit-text-fill-color: #5b21b6;
}

.staff-fold__chip--games {
    background: #dcfce7;
    color: #166534;
    -webkit-text-fill-color: #166534;
}

.staff-fold__toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    min-height: 44px;
    margin-left: auto;
    padding: 0 12px;
    border-radius: 999px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
    -webkit-text-fill-color: #9f1239;
    font-size: 13px;
    font-weight: 700 !important;
    white-space: nowrap;
    transition: background-color 0.18s ease-out, transform 0.12s ease-out;
}

.staff-fold__bar:hover .staff-fold__toggle {
    background: #ffe4e6;
}

.staff-fold__bar:active .staff-fold__toggle {
    transform: scale(0.97);
}

.staff-fold__chev {
    transition: transform 0.2s ease-out;
}

.staff-fold[open] .staff-fold__chev {
    transform: rotate(180deg);
}

.staff-fold__toggle-open {
    display: none;
}

.staff-fold[open] .staff-fold__toggle-open {
    display: inline;
}

.staff-fold[open] .staff-fold__toggle-closed {
    display: none;
}

.staff-fold__body {
    padding: 12px 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.staff-fold__body .space-y-6 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 16px;
}

.staff-fold__body h3 {
    margin-bottom: 8px !important;
    padding-bottom: 6px !important;
    font-size: 15px !important;
    line-height: 1.4;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a;
}

.staff-fold__body .text-sm.text-gray-600 {
    font-size: 12px;
    color: #475569 !important;
}

.admin-mgmt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.admin-mgmt-card {
    position: relative !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 112px;
    min-height: 112px;
    max-height: 112px;
    box-sizing: border-box;
    padding: 16px 12px 12px;
    overflow: visible !important;
    border-radius: 14px;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    -webkit-tap-highlight-color: transparent;
}

.admin-mgmt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    text-decoration: none !important;
}

.admin-mgmt-card:active {
    transform: scale(0.97);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.admin-mgmt-card:focus-visible {
    outline: 2px solid #be123c;
    outline-offset: 2px;
}

.admin-mgmt-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
}

.admin-mgmt-card-icon {
    font-size: 24px;
    line-height: 1;
}

.admin-mgmt-card-title {
    font-size: 15px;
    font-weight: 700;
    text-shadow: none;
}

.admin-mgmt-card-desc {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.6;
}

.admin-mgmt-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #047857;
    color: white;
    -webkit-text-fill-color: white;
    border: 1px solid #065f46;
}

/* English corner label */
.admin-mgmt-card .absolute {
    position: absolute !important;
    top: 0.5rem !important;
    left: 0.625rem !important;
    right: auto !important;
    bottom: auto !important;
    -webkit-font-smoothing: antialiased;
}

.admin-mgmt-card .text-\[9px\] {
    font-size: 11px !important;
    line-height: 1.3;
}

.admin-mgmt-card .text-\[10px\] {
    font-size: 12px !important;
    line-height: 1.3;
}

/* Phone: three small tiles per row, icon + Chinese title only */
@media (max-width: 639px) {
    .staff-fold__bar {
        padding: 6px 12px;
    }

    .staff-fold__role {
        display: none;
    }

    .staff-fold__name {
        max-width: 7.5em;
    }

    .staff-fold__body {
        padding: 10px 12px 14px;
    }

    .staff-fold__body .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .staff-fold__body h3 {
        font-size: 14px !important;
    }

    .staff-fold .admin-mgmt-card {
        height: 76px;
        min-height: 76px;
        max-height: 76px;
        padding: 8px 4px;
        border-width: 1px !important;
        border-radius: 14px;
    }

    .staff-fold .admin-mgmt-card .absolute,
    .staff-fold .admin-mgmt-card .text-\[10px\] {
        display: none !important;
    }

    .staff-fold .admin-mgmt-card > div {
        gap: 4px !important;
    }

    .staff-fold .admin-mgmt-card-icon {
        font-size: 22px !important;
    }

    .staff-fold .admin-mgmt-card-title {
        font-size: 13px !important;
        line-height: 1.25;
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-mgmt-card,
    .staff-fold__toggle,
    .staff-fold__chev {
        transition: none;
    }

    .admin-mgmt-card:hover,
    .admin-mgmt-card:active {
        transform: none;
    }
}
