/*
 * ============================================================
 * Admin & Governance Module — Tables, Forms, Modal
 * ============================================================
 *
 * Purpose:
 *   Styles for the admin panel: action modal overlay, data tables
 *   (with responsive mobile layout), admin form groups, and
 *   tab/sidebar navigation.
 *
 * Extracted from style.css to reduce monolith size.
 *
 * How to undo:
 *   Move these styles back into style.css and remove the
 *   <link> in index.html.
 */

/* --- Admin Action Modal (replaces drawer pattern) --- */
.admin-action-modal {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.admin-action-modal.show {
    display: flex;
    opacity: 1;
}

.admin-action-modal-content {
    width: 600px;
    max-width: 95vw;
    max-height: 90vh;
    background: var(--bg-elevated);
    border: 1px solid var(--line-stark);
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-action-modal-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--line-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-action-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.admin-action-modal-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--line-subtle);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    background: rgba(0, 0, 0, 0.1);
}

/* --- Admin Panel Icon --- */
.admin-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

/* --- Data Tables --- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    text-align: left;
    padding: var(--space-sm);
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--line-active);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.admin-table td {
    padding: var(--space-sm);
    border-bottom: 1px solid var(--line-subtle);
    color: var(--text-body);
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Responsive Table: Wrap rows on mobile */
@media (max-width: 768px) {

    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tr {
        margin-bottom: var(--space-md);
        border: 1px solid var(--line-subtle);
        background: var(--bg-surface);
        border-radius: var(--radius-sm);
        padding: var(--space-xs);
    }

    .admin-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: var(--space-xs) var(--space-sm);
        border-bottom: 1px solid var(--line-subtle);
    }

    .admin-table td:last-child {
        border-bottom: none;
    }

    .admin-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--text-muted);
        text-transform: uppercase;
        margin-right: auto;
    }
}

/* --- Admin Form Groups --- */
.admin-form-group {
    margin-bottom: 24px;
}

.admin-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-form-group select,
.admin-form-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line-subtle);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.admin-form-group select:focus,
.admin-form-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}