/* ========== ADMIN PANEL STYLES v4.0 ========== */

.admin-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.admin-panel-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #00ff88;
    border-radius: 10px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 255, 136, 0.3);
    display: flex;
    flex-direction: column;
}

.admin-panel-header {
    background: #0f3460;
    padding: 15px 20px;
    border-bottom: 2px solid #00ff88;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-panel-header h2 {
    color: #00ff88;
    margin: 0;
    font-size: 22px;
}

.close-btn {
    background: #ff4444;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
}

.close-btn:hover {
    background: #cc0000;
}

.admin-panel-content {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

/* ========== TABS ========== */

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #00ff88;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.admin-tab {
    background: #16213e;
    color: #aaa;
    border: 1px solid #333;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px 5px 0 0;
    transition: all 0.3s;
}

.admin-tab:hover {
    background: #1f2a48;
    color: #00ff88;
}

.admin-tab.active {
    background: #00ff88;
    color: #1a1a2e;
    font-weight: bold;
    border-color: #00ff88;
}

.tab-content {
    min-height: 400px;
}

/* ========== USERS TAB ========== */

.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.users-header h3 {
    color: #00ff88;
    margin: 0;
}

.users-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#userSearch {
    flex: 1;
    padding: 10px;
    background: #16213e;
    border: 1px solid #00ff88;
    color: #00ff88;
    border-radius: 5px;
    font-size: 14px;
}

#roleFilter {
    padding: 10px;
    background: #16213e;
    border: 1px solid #00ff88;
    color: #00ff88;
    border-radius: 5px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: #16213e;
    border-radius: 5px;
    overflow: hidden;
}

.users-table thead {
    background: #0f3460;
}

.users-table th {
    padding: 12px;
    color: #00ff88;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #00ff88;
}

.users-table td {
    padding: 10px 12px;
    color: #ddd;
    border-bottom: 1px solid #333;
}

.users-table tbody tr:hover {
    background: #1f2a48;
}

.users-table .actions {
    display: flex;
    gap: 5px;
}

/* ========== BUTTONS ========== */

.btn-primary, .btn-success, .btn-danger, .btn-secondary, .btn-sm {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #00ff88;
    color: #1a1a2e;
    font-weight: bold;
}

.btn-primary:hover {
    background: #00cc6e;
}

.btn-success {
    background: #00ff88;
    color: #1a1a2e;
}

.btn-success:hover {
    background: #00cc6e;
}

.btn-danger {
    background: #ff4444;
    color: white;
}

.btn-danger:hover {
    background: #cc0000;
}

.btn-secondary {
    background: #666;
    color: white;
}

.btn-secondary:hover {
    background: #444;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    background: #0f3460;
    color: #00ff88;
    border: 1px solid #00ff88;
}

.btn-sm:hover {
    background: #00ff88;
    color: #1a1a2e;
}

/* ========== PENDING TAB ========== */

.pending-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pending-card {
    background: #16213e;
    border: 1px solid #00ff88;
    border-radius: 5px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pending-info h4 {
    color: #00ff88;
    margin: 0 0 10px 0;
}

.pending-info p {
    color: #aaa;
    margin: 3px 0;
    font-size: 14px;
}

.pending-actions {
    display: flex;
    gap: 10px;
}

/* ========== STATS TAB ========== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: #16213e;
    border: 1px solid #00ff88;
    border-radius: 5px;
    padding: 20px;
    text-align: center;
}

.stat-card h4 {
    color: #aaa;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.stat-number {
    color: #00ff88;
    font-size: 36px;
    font-weight: bold;
    margin: 0;
}

.stats-section {
    background: #16213e;
    border: 1px solid #00ff88;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.stats-section h4 {
    color: #00ff88;
    margin: 0 0 15px 0;
}

.stats-section p {
    color: #ddd;
    margin: 5px 0;
}

.role-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.role-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #0f3460;
    border-radius: 3px;
}

.role-name {
    color: #aaa;
}

.role-count {
    color: #00ff88;
    font-weight: bold;
}

/* ========== SYSTEM TAB ========== */

.system-section {
    background: #16213e;
    border: 1px solid #00ff88;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.system-section h4 {
    color: #00ff88;
    margin: 0 0 15px 0;
}

.system-section p {
    color: #ddd;
    margin: 10px 0;
}

#shardInput {
    padding: 8px;
    background: #0f3460;
    border: 1px solid #00ff88;
    color: #00ff88;
    border-radius: 5px;
    margin-right: 10px;
}

/* ========== AUDIT TAB ========== */

.audit-table {
    width: 100%;
    border-collapse: collapse;
    background: #16213e;
    border-radius: 5px;
    overflow: hidden;
}

.audit-table thead {
    background: #0f3460;
}

.audit-table th {
    padding: 12px;
    color: #00ff88;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #00ff88;
}

.audit-table td {
    padding: 8px 12px;
    color: #ddd;
    border-bottom: 1px solid #333;
    font-size: 13px;
}

.audit-table tbody tr:hover {
    background: #1f2a48;
}

.action-badge {
    background: #0f3460;
    color: #00ff88;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

/* ========== DIALOGS ========== */

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog {
    background: #16213e;
    border: 2px solid #00ff88;
    border-radius: 10px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
}

.dialog h3 {
    color: #00ff88;
    margin: 0 0 15px 0;
}

.dialog p {
    color: #ddd;
    margin: 10px 0;
}

.dialog-select, .dialog-textarea {
    width: 100%;
    padding: 10px;
    background: #0f3460;
    border: 1px solid #00ff88;
    color: #00ff88;
    border-radius: 5px;
    margin: 10px 0;
    font-family: inherit;
    font-size: 14px;
}

.dialog-textarea {
    min-height: 80px;
    resize: vertical;
}

.dialog-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ========== ERROR MESSAGES ========== */

.error {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .admin-panel-modal {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .admin-tabs {
        flex-wrap: wrap;
    }

    .admin-tab {
        flex: 1;
        min-width: 100px;
        font-size: 12px;
        padding: 8px 10px;
    }

    .users-table {
        font-size: 12px;
    }

    .users-table td, .users-table th {
        padding: 8px 5px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}
