/* =================================================================
   Admin dashboard panels (rendered inside #page-harvest by admin.js).
   Extracted from dashboard.css so the dashboard CSS can be replaced
   independently without breaking admin views. Selectors live outside
   #page-dashboard so dashboard tokens don't apply; pin colors directly.
   ================================================================= */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 900px) {
    .admin-grid { grid-template-columns: 1fr; }
}
.admin-card {
    background: #161b22;
    border: 1px solid #2a313b;
    border-radius: 10px;
    padding: 20px;
}
.admin-card h3 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #b0bec5;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.admin-help {
    font-size: 0.82rem;
    color: #b0bec5;
    margin: 0 0 12px;
    line-height: 1.5;
}
.admin-log-card {
    margin: 0 16px 16px;
    max-width: 1068px;
    margin-left: auto;
    margin-right: auto;
}
.admin-log {
    background: #0a0e14;
    border: 1px solid #2a2f36;
    border-radius: 6px;
    padding: 12px;
    height: 300px;
    overflow-y: auto;
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    color: #8b949e;
}
.log-line {
    white-space: pre-wrap;
    word-break: break-word;
}
.admin-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
}
.admin-stat-row span:first-child { color: #b0bec5; }
.admin-stat-row span:last-child { color: #e6edf3; font-weight: 500; }

.admin-section {
    margin: 0 16px 16px;
    max-width: 1068px;
    margin-left: auto;
    margin-right: auto;
}
.admin-section-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.admin-section-controls input[type="search"],
.admin-section-controls select {
    padding: 6px 10px;
    background: #15181d;
    border: 1px solid #2a313b;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.85rem;
}
.admin-section-controls input[type="search"] {
    flex: 1 1 260px;
    min-width: 180px;
}
.admin-section-controls input[type="search"]:focus {
    outline: none;
    border-color: #4fc3f7;
}

/* Login wall toggle (off / A/B / on) */
.admin-section-hint {
    font-size: 0.82rem;
    color: #b0bec5;
    margin: 0 0 12px;
    line-height: 1.5;
}
.admin-login-gate-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.admin-login-gate-buttons {
    display: inline-flex;
    border: 1px solid #2a313b;
    border-radius: 8px;
    overflow: hidden;
    align-self: flex-start;
}
.admin-login-gate-btn {
    background: #15181d;
    color: #b0bec5;
    border: 0;
    padding: 8px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    border-right: 1px solid #2a313b;
    transition: background 0.15s, color 0.15s;
}
.admin-login-gate-btn:last-child { border-right: 0; }
.admin-login-gate-btn:hover { background: #1d2229; color: #e0e0e0; }
.admin-login-gate-btn.is-active {
    background: linear-gradient(180deg, #1a4d8f 0%, #143d70 100%);
    color: #fff;
}
.admin-login-gate-status {
    margin: 0;
    font-size: 0.8rem;
    color: #78909c;
}
.admin-section-empty {
    color: #b0bec5;
    font-size: 0.88rem;
    font-style: italic;
    padding: 10px 0;
    margin: 0;
}

.admin-users-summary {
    display: flex;
    gap: 18px;
    align-items: center;
    font-size: 0.82rem;
    color: #b0bec5;
    margin-bottom: 10px;
}
.admin-users-summary-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.admin-users-summary-item strong { color: #e0e0e0; font-weight: 600; }
.admin-online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #66bb6a;
    box-shadow: 0 0 6px rgba(102, 187, 106, 0.7);
}

/* The container div scrolls the wide table on phones — without this the
   whole page gains a horizontal scrollbar at 375px (responsive contract). */
#admin-users-table { overflow-x: auto; }
.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.admin-users-table thead th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #2a313b;
    color: #b0bec5;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-users-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}
.admin-user-row {
    cursor: pointer;
    transition: background 0.12s;
}
.admin-user-row:hover { background: rgba(79, 195, 247, 0.06); }
.admin-users-th-avatar { width: 40px; }
.admin-user-cell-avatar { width: 40px; position: relative; }
.admin-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-block;
    background: #15181d;
    vertical-align: middle;
    object-fit: cover;
}
.admin-user-avatar-placeholder {
    text-align: center;
    line-height: 28px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #b0bec5;
    border: 1px solid #2a313b;
}
.admin-user-cell-avatar .admin-online-dot {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
}
.admin-user-name { color: #e0e0e0; font-weight: 500; }
.admin-user-email { font-size: 0.75rem; color: #7a8490; }
.admin-user-cell-badges { width: 110px; }
.admin-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-right: 4px;
}
.admin-badge-admin {
    background: rgba(239, 83, 80, 0.18);
    color: #ef5350;
    border: 1px solid rgba(239, 83, 80, 0.5);
}
.admin-badge-premium {
    background: rgba(255, 213, 98, 0.15);
    color: #ffd562;
    border: 1px solid rgba(255, 213, 98, 0.5);
}
.admin-badge-mod {
    background: rgba(102, 187, 106, 0.18);
    color: #66bb6a;
    border: 1px solid rgba(102, 187, 106, 0.5);
}
.admin-user-cell-actions { width: 110px; text-align: right; }
.admin-mod-btn {
    background: rgba(102, 187, 106, 0.12);
    color: #66bb6a;
    border: 1px solid rgba(102, 187, 106, 0.5);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.admin-mod-btn:hover:not(:disabled) {
    background: rgba(102, 187, 106, 0.25);
}
.admin-mod-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.admin-mod-btn-revoke {
    background: rgba(255, 152, 0, 0.10);
    color: #ffa726;
    border-color: rgba(255, 152, 0, 0.5);
}
.admin-mod-btn-revoke:hover:not(:disabled) {
    background: rgba(255, 152, 0, 0.22);
}
.admin-user-cell-count { text-align: center; width: 80px; }
.admin-count-badge {
    display: inline-block;
    min-width: 24px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: #e0e0e0;
    font-size: 0.78rem;
    font-weight: 500;
    text-align: center;
}
.admin-count-zero { color: #7a8490; background: transparent; }
.admin-count-bugs {
    background: rgba(255, 183, 77, 0.18);
    color: #ffb74d;
    border: 1px solid rgba(255, 183, 77, 0.45);
}
.admin-user-cell-time {
    color: #b0bec5;
    font-size: 0.78rem;
    white-space: nowrap;
}
.admin-growth-chart-wrap {
    position: relative;
    width: 100%;
    height: 280px;
}
.admin-user-bugs-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.admin-user-bugs-head h3 { margin: 0; }

/* ============================================================================
   Tournament Test Lab (admin-tournament-sim.js)
   ============================================================================ */
.tsim-create-form .tsim-check {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-direction: row;
}
.tsim-create-form .tsim-check input[type="checkbox"] { width: auto; }
.tsim-sim {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #2a2f36;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}
.tsim-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.tsim-name { color: #e0e0e0; }
.tsim-meta { color: #7a8490; font-size: 0.78rem; }
.tsim-links { margin-left: auto; font-size: 0.82rem; }
.tsim-links a { color: #4fc3f7; text-decoration: none; }
.tsim-links a:hover { text-decoration: underline; }
.tsim-state {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tsim-state-open { background: rgba(79, 195, 247, 0.15); color: #4fc3f7; }
.tsim-state-live { background: rgba(102, 187, 106, 0.15); color: #66bb6a; }
.tsim-state-done { background: rgba(255, 255, 255, 0.07); color: #b0bec5; }
.tsim-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0 6px;
}
.tsim-btn { font-size: 0.8rem; padding: 5px 10px; }
.tsim-bots { color: #7a8490; font-size: 0.78rem; margin-bottom: 8px; }
.tsim-match-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.tsim-match-table th {
    text-align: left;
    color: #7a8490;
    font-weight: 500;
    padding: 4px 8px;
    border-bottom: 1px solid #2a2f36;
}
.tsim-match-table td {
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #cfd8dc;
}
.tsim-row-done td { color: #78909c; }
.tsim-vs { color: #546e7a; font-size: 0.74rem; }
.tsim-tag {
    display: inline-block;
    padding: 0 5px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #90a4ae;
    font-size: 0.66rem;
    font-weight: 600;
    vertical-align: 1px;
}
.tsim-tag-you { background: rgba(79, 195, 247, 0.2); color: #4fc3f7; }
.tsim-actions-cell { white-space: nowrap; }
.tsim-mini {
    margin: 1px 2px;
    padding: 2px 8px;
    border: 1px solid #37424d;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: #cfd8dc;
    font-size: 0.74rem;
    cursor: pointer;
}
.tsim-mini:hover:not(:disabled) { background: rgba(79, 195, 247, 0.12); }
.tsim-mini:disabled { opacity: 0.5; cursor: default; }
.tsim-mini-link { text-decoration: none; display: inline-block; }
.tsim-log {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    max-height: 160px;
    overflow-y: auto;
    font-size: 0.76rem;
}
.tsim-log-line { color: #b0bec5; padding: 1px 0; }
.tsim-log-time { color: #546e7a; margin-right: 6px; }

@media (max-width: 767px) {
    .tsim-links { margin-left: 0; flex-basis: 100%; }
    .tsim-match-table { display: block; overflow-x: auto; }
}
.tsim-your-turn { color: #ffb74d; }
