/*
   Admin Team page — single-school Emergency Response Team management.
   Distinct from the slate-only Schools/Users tables: this page leans on
   the Project ADAM burgundy and uses an asymmetric hero header so the
   status reads instantly.
*/

.admin-team {
    color: #0f172a;
    font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
}

/* ═══════════════════════════════════════════════════════
   Header — back-link, asymmetric title + status hero
   ═══════════════════════════════════════════════════════ */
.admin-team-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem 0.25rem 0;
    transition: color 0.12s ease;
}
.admin-team-back-btn:hover {
    color: #0f172a;
}
.admin-team-back-btn .mud-icon-root {
    font-size: 1.125rem !important;
}

.admin-team-header {
    margin-bottom: 1.75rem;
}

.admin-team-titlewrap {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem 2.5rem;
    align-items: end;
    margin-top: 0.5rem;
}

.admin-team-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9F2241;
    margin-bottom: 0.5rem;
}
.admin-team-eyebrow .mud-icon-root {
    font-size: 0.875rem !important;
}

.admin-team-title {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0;
    color: #0f172a;
}

.admin-team-subtitle {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: #475569;
}
.admin-team-subtitle-sep {
    margin: 0 0.5rem;
    color: #cbd5e1;
}

/* ─── Status hero (right column of header) ──────────── */
.admin-team-status {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem 0.75rem 0.75rem;
    border-radius: 9999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    min-width: 0;
}

.admin-team-status-ring {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-team-status-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.25;
}
.admin-team-status-ring::after {
    content: '';
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    background: currentColor;
}

.admin-team-status-text {
    line-height: 1.15;
}
.admin-team-status-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}
.admin-team-status-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.125rem;
}

.admin-team-status.heart-safe { color: #10893e; }
.admin-team-status.heart-safe { border-color: rgba(16, 137, 62, 0.25); }
.admin-team-status.warning    { color: #b45309; border-color: rgba(180, 83, 9, 0.28); }
.admin-team-status.lapsed     { color: #b91c1c; border-color: rgba(185, 28, 28, 0.28); }

@keyframes admin-team-pulse {
    0%, 100% { transform: scale(1); opacity: 0.25; }
    50% { transform: scale(1.15); opacity: 0.45; }
}
.admin-team-status.lapsed .admin-team-status-ring::before {
    animation: admin-team-pulse 1.8s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════
   Issues banner
   ═══════════════════════════════════════════════════════ */
.admin-team-issues {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.875rem 1.125rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}
.admin-team-issues.warning {
    background: #fffaf2;
    border-color: #fde9c8;
}
.admin-team-issues.lapsed {
    background: #fef2f2;
    border-color: #fecaca;
}
.admin-team-issues-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}
.admin-team-issues.warning .admin-team-issues-icon { color: #b45309 !important; }
.admin-team-issues.lapsed .admin-team-issues-icon { color: #b91c1c !important; }
.admin-team-issues ul {
    margin: 0;
    padding-left: 1rem;
    font-size: 0.875rem;
    color: #334155;
}
.admin-team-issues li + li {
    margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════════════════
   Quick facts row
   ═══════════════════════════════════════════════════════ */
.admin-team-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.admin-team-fact {
    padding: 1rem 1.125rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.admin-team-fact-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}
.admin-team-fact-value {
    margin-top: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-variant-numeric: tabular-nums;
}
.admin-team-fact-sub {
    font-size: 0.75rem;
    font-weight: 400;
    color: #94a3b8;
}
.admin-team-fact-empty {
    color: #94a3b8;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   Section header
   ═══════════════════════════════════════════════════════ */
.admin-team-section {
    margin-top: 1.5rem;
}

.admin-team-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-team-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.005em;
}

.admin-team-section-sub {
    margin: 0.125rem 0 0;
    font-size: 0.8125rem;
    color: #64748b;
}

.admin-team-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-team-primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: #9F2241;
    color: #fff;
    border: none;
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.admin-team-primary-btn:hover {
    background: #6E1730;
}
.admin-team-primary-btn:active {
    transform: scale(0.98);
}
.admin-team-primary-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}
.admin-team-primary-btn .mud-icon-root {
    font-size: 1rem !important;
}

/* ═══════════════════════════════════════════════════════
   Member roster — card grid
   ═══════════════════════════════════════════════════════ */
.admin-team-roster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.625rem;
}

.admin-team-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.875rem;
    align-items: center;
    padding: 0.875rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.admin-team-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.admin-team-card.is-leader {
    background: linear-gradient(180deg, #fdf2f5 0%, #fff 60%);
    border-color: #f3c5d1;
}

.admin-team-card-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.admin-team-card.is-leader .admin-team-card-avatar {
    background: #9F2241;
    color: #fff;
}

.admin-team-card-body {
    min-width: 0;
}

.admin-team-card-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    line-height: 1.2;
}

.admin-team-leader-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    background: rgba(159, 34, 65, 0.08);
    color: #9F2241;
    border-radius: 9999px;
    padding: 0.125rem 0.5rem 0.125rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-team-leader-pill .mud-icon-root {
    font-size: 0.75rem !important;
}

.admin-team-invite-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-team-invite-pill.active {
    background: #ecfdf5;
    color: #047857;
}
.admin-team-invite-pill.pending {
    background: #fffbeb;
    color: #b45309;
}

.admin-team-card-role {
    font-size: 0.8125rem;
    color: #475569;
    margin-top: 0.125rem;
}

.admin-team-card-meta {
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.admin-team-card-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.admin-team-icon-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.admin-team-icon-btn:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}
.admin-team-icon-btn.danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}
.admin-team-icon-btn .mud-icon-root {
    font-size: 1rem !important;
}

/* ═══════════════════════════════════════════════════════
   Empty state for missing team
   ═══════════════════════════════════════════════════════ */
.admin-team-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 2rem;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
}
.admin-team-empty-icon {
    width: 3rem;
    height: 3rem;
    color: #cbd5e1 !important;
    font-size: 3rem !important;
    margin-bottom: 0.75rem;
}
.admin-team-empty-state h3 {
    margin: 0 0 0.375rem;
    font-size: 1.125rem;
    color: #0f172a;
    font-weight: 600;
}
.admin-team-empty-state p {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: #64748b;
    max-width: 28rem;
}

/* ═══════════════════════════════════════════════════════
   Past-members collapsible
   ═══════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════
   Deactivated members — removed from the team, one + to bring back
   ═══════════════════════════════════════════════════════ */
.admin-team-deactivated {
    margin-top: 1.25rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.admin-team-deactivated-title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #334155;
}

.admin-team-deactivated-sub {
    margin: 0.25rem 0 0;
    max-width: 34rem;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #64748b;
}

.admin-team-deactivated-list {
    margin: 0.875rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 0.5rem;
}

.admin-team-deactivated-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

/* Muted, not struck through: these are people, and the row is an offer to bring
   them back rather than a record of a deletion. */
.admin-team-deactivated-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 0.6875rem;
    font-weight: 700;
}

.admin-team-deactivated-body {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
    min-width: 0;
    flex: 1;
}

.admin-team-deactivated-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-team-deactivated-meta {
    font-size: 0.6875rem;
    color: #94a3b8;
}

.admin-team-reactivate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.admin-team-reactivate-btn:hover:not(:disabled) {
    background: #ecfdf5;
    border-color: #10b981;
    color: #047857;
}

.admin-team-reactivate-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.admin-team-deactivated-note {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    color: #b45309;
}

/* ═══════════════════════════════════════════════════════
   Modal hint text
   ═══════════════════════════════════════════════════════ */
.admin-team-modal-hint {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0.5rem 0 0;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════
   Secondary button + section actions
   ═══════════════════════════════════════════════════════ */
.admin-team-section-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-team-secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: #fff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.admin-team-secondary-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}
.admin-team-secondary-btn .mud-icon-root {
    font-size: 1rem !important;
}

/* ═══════════════════════════════════════════════════════
   Drills — two-column layout (cert | internal)
   ═══════════════════════════════════════════════════════ */
.admin-team-drills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.admin-team-drill-col {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.admin-team-drill-col-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.admin-team-drill-col-title .mud-icon-root {
    color: #94a3b8 !important;
    font-size: 0.875rem !important;
}

.admin-team-drill-count {
    margin-left: auto;
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0;
}

.admin-team-drill-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.8125rem;
    color: #94a3b8;
}

/* Cards, not hairline-separated rows. Each entry carries a verdict, a date, a
   handful of chips and sometimes a paragraph of notes; separated only by a 1px
   rule those runs of text bleed into each other and the list reads as one block
   of prose rather than a drill history. */
.admin-team-drill-list {
    margin: 0;
    padding: 0 1rem 1rem;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-team-drill-item {
    padding: 0.875rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    position: relative;
}

.admin-team-drill-item:hover { border-color: #cbd5e1; }

/* A tinted background rather than an accent stripe: the verdict is already
   spelled out in the status text, so this only has to separate a failed drill
   from a passed one at a glance. */
.admin-team-drill-item.drill-failed {
    background: #fffbfa;
    border-color: #fecaca;
}

.admin-team-drill-row-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}
.admin-team-drill-status {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0f172a;
}
.admin-team-drill-item.drill-passed .admin-team-drill-status { color: #10893e; }
.admin-team-drill-item.drill-failed .admin-team-drill-status { color: #b91c1c; }

.admin-team-drill-date {
    font-size: 0.75rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.admin-team-drill-row-bottom {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.375rem;
}

.admin-team-drill-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    background: #f1f5f9;
    color: #334155;
    border-radius: 6px;
    padding: 0.125rem 0.5rem 0.125rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.admin-team-drill-chip .mud-icon-root {
    font-size: 0.75rem !important;
}

.admin-team-drill-cert {
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-left: auto;
}

.admin-team-drill-notes {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: #475569;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════
   Drill modal form grid
   ═══════════════════════════════════════════════════════ */
.admin-team-drill-modal {
    max-width: 36rem;
}
.admin-team-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.admin-team-form-grid .admin-field.col-span-2 {
    grid-column: span 2;
}

.admin-team-checks {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding: 0.375rem 0;
}
.admin-team-check {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #334155;
    cursor: pointer;
    user-select: none;
}

/* ═══════════════════════════════════════════════════════
   Cardiac arrest event list
   ═══════════════════════════════════════════════════════ */
.admin-team-events-empty {
    padding: 1.5rem 1.25rem;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
}

.admin-team-events {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.admin-team-event {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: 1rem;
    padding: 1rem 1.125rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    position: relative;
}

.admin-team-event-date {
    text-align: center;
    border-right: 1px solid #f1f5f9;
    padding-right: 1rem;
    line-height: 1.1;
}
.admin-team-event-date-month {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
}
.admin-team-event-date-day {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0f172a;
    margin-top: 0.125rem;
    font-variant-numeric: tabular-nums;
}
.admin-team-event-date-year {
    font-size: 0.6875rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.admin-team-event-headline {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0f172a;
}
.admin-team-event-age {
    font-weight: 400;
    color: #64748b;
    margin-left: 0.25rem;
}

.admin-team-event-location {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: #475569;
    margin-top: 0.25rem;
}
.admin-team-event-location .mud-icon-root {
    color: #94a3b8 !important;
    font-size: 0.875rem !important;
}

.admin-team-event-desc {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: #334155;
    line-height: 1.5;
}

.admin-team-event-chips {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-top: 0.625rem;
    align-items: center;
}

.admin-team-event-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 0.125rem 0.5rem;
}

.admin-team-event-outcome {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    padding: 0.125rem 0.625rem;
}
.admin-team-event-outcome.outcome-survived { background: #ecfdf5; color: #047857; }
.admin-team-event-outcome.outcome-deceased { background: #fef2f2; color: #b91c1c; }
.admin-team-event-outcome.outcome-unknown  { background: #f1f5f9; color: #475569; }

/* ─── Debrief request pill (FF-2317) ─────────────────────────────────────
   Warm while the request is open, green once it is done — the same reading
   the compliance colours give elsewhere in the app, so a coordinator does not
   learn a second palette. */
.admin-team-event-outcome.debrief {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.admin-team-event-outcome.debrief-requested    { background: #fffbeb; color: #b45309; }
.admin-team-event-outcome.debrief-acknowledged { background: #fff7ed; color: #c2410c; }
.admin-team-event-outcome.debrief-scheduled    { background: #eff6ff; color: #1d4ed8; }
.admin-team-event-outcome.debrief-completed    { background: #ecfdf5; color: #047857; }

.admin-team-event-reporter {
    margin-top: 0.5rem;
    font-size: 0.6875rem;
    color: #94a3b8;
}

/* ─── Debrief queue block (coordinators) ─────────────────────────────── */
.admin-events-debrief {
    margin-top: 0.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: #fffdf5;
}
.admin-events-debrief-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.admin-events-debrief-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #92400e;
}
.admin-events-debrief-done {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #047857;
}

/* The trail. Numbered by <ol> semantics but not by marker — the timestamps
   already order it, and "1." beside a date reads as a rank. */
.admin-events-debrief-trail {
    list-style: none;
    margin: 0.625rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.admin-events-debrief-trail li {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
    padding-left: 0.75rem;
    border-left: 2px solid #fde68a;
}
.admin-events-debrief-trail-stage {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f172a;
}
.admin-events-debrief-trail-meta {
    font-size: 0.6875rem;
    color: #94a3b8;
}
.admin-events-debrief-trail-note {
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: #475569;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════
   Events page (statewide) — stats row + filter pills
   ═══════════════════════════════════════════════════════ */
/* ─── Narrowed to one school (FF-2317) ───────────────────────────────── */
.admin-events-scope-banner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 0.8125rem;
    flex-wrap: wrap;
}

.admin-events-scope-banner span { flex: 1; }

.admin-events-scope-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid #bfdbfe;
    background: #fff;
    color: #1e40af;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    cursor: pointer;
}

.admin-events-scope-clear:hover { border-color: #1d4ed8; }

/* auto-fit, not a fixed count: the debriefs tile is coordinator-only, so this
   row is five tiles wide for a district admin and six for a coordinator, and
   hard-coding either leaves the other with a gap or an overflow. */
.admin-events-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.625rem;
    margin-bottom: 1.5rem;
}
.admin-events-stat {
    padding: 0.875rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.admin-events-stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}
.admin-events-stat-value {
    margin-top: 0.25rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}
.admin-events-stat-sub {
    font-size: 0.75rem;
    font-weight: 400;
    color: #94a3b8;
}
.admin-events-stat.outcome-survived .admin-events-stat-value { color: #047857; }
.admin-events-stat.outcome-deceased .admin-events-stat-value { color: #b91c1c; }
/* Amber, not red: an open debrief is work waiting, not a failure. */
.admin-events-stat.debrief-open .admin-events-stat-value { color: #b45309; }

.admin-events-toolbar {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.admin-events-filters {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #f1f5f9;
    border-radius: 9999px;
}

.admin-events-filter {
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.admin-events-filter:hover { background: rgba(255, 255, 255, 0.6); }
.admin-events-filter.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.admin-events-filter.outcome-survived.active { color: #047857; }
.admin-events-filter.outcome-deceased.active { color: #b91c1c; }

/* The debrief toggle is an independent filter, not a fifth outcome, so a rule
   separates it from the group it does not belong to. */
.admin-events-filter-divider {
    width: 1px;
    align-self: stretch;
    margin: 0.25rem 0.375rem;
    background: #cbd5e1;
}
.admin-events-filter.debrief {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.admin-events-filter.debrief.active { color: #b45309; }
.admin-events-filter-count {
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    background: rgba(180, 83, 9, 0.12);
    color: #b45309;
    font-variant-numeric: tabular-nums;
}

.admin-events-search {
    flex: 1;
    min-width: 240px;
}

.admin-events-school-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}
.admin-events-school-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: transparent;
    border: none;
    color: #9F2241;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.admin-events-school-btn:hover { text-decoration: underline; }
.admin-events-school-btn .mud-icon-root { font-size: 0.875rem !important; }

/* A community report's site name: same slot, but nowhere to navigate to. */
.admin-events-school-btn.is-static {
    color: #16202c;
    cursor: default;
}
.admin-events-school-btn.is-static:hover { text-decoration: none; }

.admin-events-community-tag {
    padding: 0.0625rem 0.375rem;
    border-radius: 9999px;
    background: #eef1f5;
    color: #64748b;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-events-district {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ═══════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .admin-team-titlewrap {
        grid-template-columns: 1fr;
    }
    .admin-team-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 1100px) {
    .admin-events-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .admin-team-drills {
        grid-template-columns: 1fr;
    }
    .admin-team-form-grid {
        grid-template-columns: 1fr;
    }
    .admin-team-form-grid .admin-field.col-span-2 {
        grid-column: span 1;
    }
    .admin-events-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 540px) {
    .admin-team-facts {
        grid-template-columns: 1fr;
    }
    .admin-team-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}
