/* --- MFR EXECUTIVE CONSOLE 2026: MASTER STYLESHEET --- */

:root { 
    --mfr-teal: #008080; 
    --mfr-bg: #f4f7f6; 
    --mfr-border: #e2e8f0; 
}

body { 
    font-family: 'Segoe UI', sans-serif; 
    background: var(--mfr-bg); 
    margin: 0; 
    padding: 0; 
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

/* --- LOGIN & SECURITY --- */
#master-gate {
    display: block;
}

#login-gate { 
    display: none;
    max-width: 400px; 
    margin: clamp(20px, 8vh, 100px) auto; 
    background: white; 
    padding: 40px; 
    border-radius: 15px; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.1); 
    text-align: center; 
}

.pass-wrapper { 
    position: relative; 
    width: 100%; 
    max-width: 320px; 
    margin: 0 auto 15px auto; 
}

.pass-wrapper input { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    box-sizing: border-box;
}

.pass-wrapper i { 
    position: absolute; 
    right: 15px; 
    top: 50%; 
    transform: translateY(-50%); 
    cursor: pointer; 
    color: var(--mfr-teal); 
    z-index: 10;
}

/* --- DASHBOARD LAYOUT --- */
#admin-dashboard { 
    display: none !important; 
    padding: 20px; 
    max-width: 1500px; 
    margin: auto; 
}

#admin-dashboard.unlocked {
    display: block !important;
}

.nav-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: white; 
    padding: 20px 30px; 
    border-radius: 12px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
    margin-bottom: 30px; 
    border-bottom: 4px solid var(--mfr-teal); 
}

/* --- STATS & CARDS --- */
.stats-grid { 
    display: flex;
    flex-wrap: nowrap;
    gap: 6px; 
    margin-bottom: 12px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.stat-card { 
    background: white; 
    padding: 10px 8px; 
    border-radius: 10px; 
    text-align: center; 
    border-bottom: 4px solid var(--mfr-teal); 
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    flex: 1 1 0;
    min-width: 110px;
    max-width: 180px;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

/* --- STAT CARD COLOR CODING --- */
.exec-perf-card .stat-card:nth-child(1) { border-bottom-color: #008080; }
.exec-perf-card .stat-card:nth-child(1) h2 { color: #008080; }

.exec-perf-card .stat-card:nth-child(2) { border-bottom-color: #3b82f6; }
.exec-perf-card .stat-card:nth-child(2) h2 { color: #3b82f6; }

.exec-perf-card .stat-card:nth-child(3) { border-bottom-color: #e11d48; }
.exec-perf-card .stat-card:nth-child(3) h2 { color: #e11d48; }

.exec-perf-card .stat-card:nth-child(4) { border-bottom-color: #d97706; }
.exec-perf-card .stat-card:nth-child(4) h2 { color: #d97706; }

.exec-perf-card .stat-card:nth-child(5) { border-bottom-color: #16a34a; }
.exec-perf-card .stat-card:nth-child(5) h2 { color: #16a34a; }

.exec-perf-card .stat-card:nth-child(6) { border-bottom-color: #ef4444; }
.exec-perf-card .stat-card:nth-child(6) h2 { color: #ef4444; }

.exec-perf-card .stat-card:nth-child(7) { border-bottom-color: #0ea5e9; }
.exec-perf-card .stat-card:nth-child(7) h2 { color: #0ea5e9; }

.exec-perf-card .stat-card:nth-child(8) { border-bottom-color: #25d366; }
.exec-perf-card .stat-card:nth-child(8) h2 { color: #25d366; }

.stat-card h4 {
    margin: 0 0 5px 0;
    font-size: 11px;
    text-transform: uppercase;
    color: #1e293b;
    letter-spacing: 0.5px;
    font-weight: 800;
}

.stat-card h2 { 
    margin: 0;
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--mfr-teal);
    letter-spacing: 0.3px;
}

.card { 
    background: white; 
    padding: 30px; 
    border-radius: 15px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.05); 
    margin-bottom: 40px; 
    border: 1px solid var(--mfr-border); 
}

h3 { 
    color: var(--mfr-teal); 
    margin-top: 0; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

/* --- INPUTS & BUTTONS --- */
.input-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 15px; 
}

input, select, textarea { 
    width: 100%; 
    padding: 14px; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    box-sizing: border-box; 
}

.btn-pub { 
    background: var(--mfr-teal); 
    color: white; 
    border: none; 
    padding: 18px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: bold; 
    width: 100%; 
    margin-top: 10px; 
}

.btn-del { 
    background: #fee2e2; 
    color: #ef4444; 
    border: none; 
    padding: 8px 12px; 
    border-radius: 6px; 
    cursor: pointer; 
}

/* --- TABLE MANAGEMENT --- */
.table-container { 
    width: 100%;
    overflow-x: auto !important;
    max-height: 480px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
    display: block;
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    min-width: 1100px; 
}

th { 
    text-align: left; 
    background: #f8fafc; 
    padding: 18px; 
    color: #64748b; 
    font-size: 12px; 
    text-transform: uppercase; 
    border-bottom: 2px solid #edf2f7; 
}

td { 
    padding: 18px; 
    border-bottom: 1px solid #edf2f7; 
    font-size: 14px; 
}

/* --- BADGES & TAGS --- */
.status-badge { 
    padding: 6px 14px; 
    border-radius: 6px; 
    font-size: 11px; 
    font-weight: bold; 
    cursor: pointer; 
    border: none; 
    background: #e2e8f0; 
}

.status-badge.active { 
    background: #22c55e !important; 
    color: white !important; 
}

.status-badge.pending {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
    cursor: pointer;
}

.status-badge.pending:hover {
    background: #ffe4e6;
}

.detail-tag { 
    display: inline-block; 
    background: #f0f4f8; 
    padding: 2px 8px; 
    border-radius: 4px; 
    font-size: 10px; 
    margin: 2px; 
    color: #4a5568; 
    border: 1px solid #e2e8f0; 
}

#registry-search {
    border: 2px solid var(--mfr-teal);
    transition: all 0.3s ease;
}

#registry-search:focus {
    box-shadow: 0 0 10px rgba(0, 128, 128, 0.15);
}

/* --- REGISTRY TABLE --- */
#master-registry-table {
    min-width: 1900px;
    border-collapse: collapse;
    width: 100%;
}

#master-registry-table thead th {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #008080, #006666);
    color: #ffffff;
    z-index: 5;
    border-bottom: 3px solid #004d4d;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 12px 15px;
    text-transform: uppercase;
}

#master-registry-table td {
    white-space: nowrap;
    padding: 10px 12px;
    border-bottom: 1px solid #e8f4f4;
    font-size: 12px;
    vertical-align: middle;
}

/* Courses column — allow wrapping */
#master-registry-table td:nth-child(6) {
    white-space: normal;
    min-width: 160px;
}

/* Dispatch column — wider to fit 3 buttons side by side */
#master-registry-table td:nth-child(9) {
    min-width: 220px;
}

#master-registry-table tbody tr:nth-child(even) {
    background-color: #f0fafa;
}

#master-registry-table tbody tr:hover {
    background-color: #e6f4f1 !important;
    transition: background 0.2s;
}

/* ===== DISPATCH CELL — 3 buttons in one row ===== */
.dispatch-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

/* EMAIL send/resend button */
.dispatch-email-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    color: #334155;
    border: 1.5px solid #cbd5e1;
    padding: 6px 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    font-family: 'Segoe UI', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dispatch-email-btn:hover {
    background: #008080;
    color: #ffffff;
    border-color: #008080;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,128,128,0.3);
}

.dispatch-email-btn.sent {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.dispatch-email-btn.sent:hover {
    background: #008080;
    color: #ffffff;
    border-color: #008080;
}

/* WA CHAT button — opens direct chat, solid green */
.dispatch-wa-chat-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #25d366;
    color: #ffffff;
    border: none;
    padding: 6px 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(37,211,102,0.35);
    font-family: 'Segoe UI', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dispatch-wa-chat-btn:hover {
    background: #128c7e;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(18,140,126,0.4);
}

/* WA RECEIPT button — sends full formatted receipt, outlined green */
.dispatch-wa-receipt-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0fdf4;
    color: #166534;
    border: 1.5px solid #86efac;
    padding: 6px 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    font-family: 'Segoe UI', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dispatch-wa-receipt-btn:hover {
    background: #25d366;
    color: #ffffff;
    border-color: #25d366;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37,211,102,0.35);
}

/* Disabled WA state — no number on file */
.dispatch-wa-disabled {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: not-allowed;
    font-family: 'Segoe UI', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* --- COURSE DISTRIBUTION MANAGER --- */
#courses-table {
    min-width: 2000px;
    border-collapse: collapse;
    width: 100%;
}

#courses-table thead th {
    position: sticky;
    top: 0;
    background-color: #f8fafc;
    z-index: 5;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

#courses-table td {
    white-space: nowrap;
    padding: 12px 15px;
    vertical-align: middle;
}

#courses-table td:nth-child(2) {
    white-space: normal;
    min-width: 180px;
}

#courses-table td:last-child {
    white-space: nowrap;
    min-width: 220px;
}

/* --- COURSE BANK TABLE --- */
#course-bank-table {
    min-width: 900px;
    border-collapse: collapse;
    width: 100%;
}

#course-bank-table thead th {
    position: sticky;
    top: 0;
    background-color: #f8fafc;
    z-index: 5;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

#course-bank-table td {
    white-space: nowrap;
    padding: 12px 15px;
    vertical-align: middle;
}

/* --- STATUS TOGGLE BADGES --- */
.status-badge.open-badge {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-badge.open-badge:hover { background: #bbf7d0; }

.status-badge.closed-badge {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.status-badge.closed-badge:hover { background: #ffe4e6; }

/* --- CANCEL EDIT BUTTON --- */
#cancel-edit-btn {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;
    padding: 18px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
}

#cancel-edit-btn:hover { background: #fecaca; }

/* --- TOOLTIPS --- */
[title] { position: relative; }

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

[title]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
    z-index: 9999;
    pointer-events: none;
}

/* --- ACTIVITY MONITOR --- */
#admin-log-table {
    min-width: 900px;
    border-collapse: collapse;
    width: 100%;
}

#admin-log-table thead th {
    position: sticky;
    top: 0;
    background-color: #1e293b;
    color: #ffffff;
    z-index: 5;
    border-bottom: 2px solid #334155;
    white-space: nowrap;
    font-size: 11px;
    padding: 12px 15px;
}

#admin-log-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    vertical-align: middle;
}

#log-prev:disabled,
#log-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- EXECUTIVE PERFORMANCE CARD --- */
.exec-perf-card {
    margin-top: 25px !important;
    border-left: 8px solid var(--mfr-teal) !important;
    padding: 14px 16px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f0fafa 100%) !important;
}

.exec-perf-title {
    color: var(--mfr-teal);
    margin-bottom: 12px;
    margin-top: 0;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.exec-perf-card .stats-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
}

/* --- REGISTRY SUMMARY STATS BAR --- */
.registry-stats {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    margin-bottom: 24px;
    margin-top: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    width: 100%;
}

.reg-stat-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-bottom: 4px solid var(--mfr-teal);
    border-radius: 10px;
    padding: 12px 10px;
    flex: 1 1 0;
    min-width: 115px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

.reg-stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.1);
}

.reg-stat-label {
    display: block !important;
    font-size: 10px;
    text-transform: uppercase;
    color: #1e293b;
    font-weight: 800;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
}

.reg-stat-val {
    display: block !important;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--mfr-teal);
    margin-top: 0;
    letter-spacing: 0.3px;
}

/* --- TOGGLE BUTTONS (attendance, qualified) --- */
.reg-toggle-btn {
    padding: 7px 14px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    transition: all 0.25s ease;
    width: 100%;
    text-align: center;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    font-family: 'Segoe UI', sans-serif;
}

.reg-toggle-btn.approved {
    background: linear-gradient(135deg, #34d399, #059669);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(5,150,105,0.35);
}

.reg-toggle-btn.pending {
    background: linear-gradient(135deg, #f87171, #dc2626);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}

.reg-toggle-btn.present {
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.reg-toggle-btn.absent {
    background: linear-gradient(135deg, #fb923c, #ea580c);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(234,88,12,0.3);
}

.reg-toggle-btn.qualified {
    background: linear-gradient(135deg, #c084fc, #9333ea);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(147,51,234,0.3);
}

.reg-toggle-btn.not-qualified {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #475569;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.reg-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    filter: brightness(1.08);
}

.reg-toggle-btn:active {
    transform: translateY(0);
    filter: brightness(0.96);
}

/* --- STATUS TOGGLE BUTTONS (approved / pending) --- */
.status-toggle {
    padding: 7px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 0.3px;
}

.approved-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(22,163,74,0.35);
}

.approved-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22,163,74,0.4);
}

.pending-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.pending-btn:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

/* --- INPUT GRID REFINEMENTS --- */
.input-grid input,
.input-grid select,
.input-grid textarea {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: #1e293b;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Segoe UI', sans-serif;
}

.input-grid input:focus,
.input-grid select:focus,
.input-grid textarea:focus {
    border-color: #008080;
    box-shadow: 0 0 0 3px rgba(0,128,128,0.1);
    background: #ffffff;
    outline: none;
}

.input-grid input::placeholder,
.input-grid textarea::placeholder {
    color: #94a3b8;
    font-size: 12px;
}

/* --- COURSE COUNT BADGE --- */
.course-count-badge {
    background: #1e293b;
    color: #ffffff;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* ================================================================
   ADMIN RESPONSIVE RULES
   Breakpoints: 768px (tablet), 480px (large phone), 360px (small phone)
   Goal: usable on phone when you're locked up in town
   ================================================================ */

/* --- TABLET (≤768px) --- */
@media (max-width: 768px) {
    #admin-dashboard { padding: 10px; }

    /* Nav bar — stack brand + actions vertically */
    .nav-bar {
        flex-direction: column;
        gap: 12px;
        padding: 14px;
        border-radius: 10px;
    }

    .nav-bar .brand img { width: 140px; }
    .nav-bar .brand span { font-size: 0.95rem; }

    /* Nav actions — wrap buttons */
    .nav-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
        width: 100%;
    }

    .nav-actions button {
        flex: 1 1 auto;
        min-width: 100px;
        font-size: 10px;
        padding: 8px 10px;
        white-space: nowrap;
    }

    /* Login / master gate */
    #master-gate, #login-gate {
        margin: 40px auto;
        padding: 25px 20px;
    }

    #master-gate img { width: 200px !important; }

    /* Stats scroll row */
    .exec-perf-card .stats-grid {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
    }

    .exec-perf-card .stat-card {
        flex: 0 0 120px !important;
        min-width: 120px !important;
    }

    /* Registry stats — 2 per row */
    .registry-stats { flex-wrap: wrap; }
    .reg-stat-box { flex: 1 1 calc(50% - 8px); }

    /* Input grid — 2 columns */
    .input-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

    /* Filter bar — wrap */
    #registry-search { max-width: 100%; }

    /* Dispatch cell — wrap on tablet */
    .dispatch-cell { flex-wrap: wrap; }

    /* Card padding */
    .card { padding: 18px; }
}

/* --- LARGE PHONE (≤480px) --- */
@media (max-width: 480px) {
    #admin-dashboard { padding: 8px; }

    /* Nav bar */
    .nav-bar { padding: 12px 10px; gap: 10px; }
    .nav-bar .brand img { width: 110px !important; }
    .nav-bar .brand span { font-size: 0.82rem; margin-left: 6px; }

    /* Nav action buttons — icon only on very small */
    .nav-actions {
        gap: 5px;
        justify-content: center;
    }

    .nav-actions button {
        flex: 0 0 auto;
        padding: 9px 10px;
        font-size: 0;        /* hide text label */
        min-width: unset;
    }

    /* Show only icon — font-size:0 hides text, icon inherits from fa */
    .nav-actions button i {
        font-size: 15px;
    }

    /* Login gate */
    #master-gate, #login-gate {
        margin: 20px 12px;
        padding: 20px 16px;
        border-radius: 10px;
    }

    #master-gate img { width: 160px !important; }

    .pass-wrapper { max-width: 100%; }

    /* Stat cards — smaller on phone */
    .exec-perf-card .stat-card {
        flex: 0 0 100px !important;
        min-width: 100px !important;
        padding: 8px 5px;
    }

    .stat-card h4 { font-size: 9px; }
    .stat-card h2 { font-size: 0.95rem; }

    /* Registry stats — 2 per row */
    .registry-stats { gap: 8px; }
    .reg-stat-box { flex: 1 1 calc(50% - 6px); padding: 10px 8px; }
    .reg-stat-label { font-size: 9px; }
    .reg-stat-val { font-size: 1.1rem; }

    /* Input grid — single column */
    .input-grid { grid-template-columns: 1fr; gap: 8px; }

    /* Card */
    .card { padding: 14px 12px; margin-bottom: 20px; }
    h3 { font-size: 0.95rem; }

    /* Filters — stack */
    #registry-card > div[style*="display:flex"] {
        flex-direction: column !important;
    }

    #registry-search,
    #filter-status,
    #filter-course { min-width: unset !important; width: 100% !important; }

    /* Inputs — prevent iOS zoom */
    input, select, textarea { font-size: 16px !important; }

    /* Prevent iOS auto-zoom in input grid */
    .input-grid input,
    .input-grid select,
    .input-grid textarea { font-size: 16px !important; }

    /* Bulk approve button — full width */
    .nav-actions .status-badge.active { flex: 1 1 100%; }

    /* Table — already scrolls horizontally, ensure touch works */
    .table-container { -webkit-overflow-scrolling: touch; }

    /* Dispatch cell — stack buttons */
    .dispatch-cell {
        flex-direction: column;
        gap: 4px;
        align-items: stretch;
    }

    .dispatch-email-btn,
    .dispatch-wa-chat-btn,
    .dispatch-wa-receipt-btn,
    .dispatch-wa-disabled {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* Action buttons in table — compact */
    .btn-del { padding: 6px 8px; font-size: 11px; }
    .status-badge { padding: 5px 8px; font-size: 10px; }

    /* Pagination */
    #log-prev, #log-next { padding: 8px 12px; }

    /* Save button */
    .btn-pub { padding: 14px; font-size: 0.9rem; }

    /* Cancel edit */
    #cancel-edit-btn { padding: 14px 16px; font-size: 0.9rem; }
}

/* --- SMALL PHONE (≤360px) --- */
@media (max-width: 360px) {
    #admin-dashboard { padding: 6px; }

    .nav-bar { padding: 10px 8px; }
    .nav-bar .brand img { width: 90px !important; }
    .nav-bar .brand span { display: none; } /* hide text on tiny screens */

    /* Gate */
    #master-gate, #login-gate { margin: 15px 8px; padding: 16px 12px; }
    #master-gate img { width: 130px !important; }

    /* Stat cards */
    .exec-perf-card .stat-card {
        flex: 0 0 88px !important;
        min-width: 88px !important;
        padding: 6px 4px;
    }

    .stat-card h4 { font-size: 8px; letter-spacing: 0; }
    .stat-card h2 { font-size: 0.85rem; }

    /* Registry stats — 2 per row, smaller */
    .reg-stat-box { flex: 1 1 calc(50% - 5px); padding: 8px 6px; }
    .reg-stat-label { font-size: 8px; }
    .reg-stat-val { font-size: 1rem; }

    .card { padding: 10px 8px; }
    h3 { font-size: 0.88rem; gap: 6px; }

    /* Input grid */
    .input-grid { gap: 6px; }

    /* Filters */
    #registry-search { font-size: 14px !important; }
}