/* ==========================================================================
   ZURA - PANEL UNIFICADO ADMIN & SOPORTE (NetOrbe Guard v1.1 Theme)
   ========================================================================== */

:root {
    --bg-dark: #080914;
    --card-bg: rgba(18, 22, 38, 0.85);
    --card-border: rgba(255, 255, 255, 0.12);
    --brand-primary: #6366f1;
    --brand-hover: #4f46e5;
    --brand-glow: rgba(99, 102, 241, 0.35);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;
    --purple: #8b5cf6;
    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.glass-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-brand {
    background: var(--brand-primary);
    color: #000;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 15px var(--brand-glow);
}

.btn-brand:hover {
    background: var(--brand-hover);
    box-shadow: 0 6px 20px rgba(192, 241, 28, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
}

/* Layout */
.app-layout {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* Sidebar */
.panel-sidebar {
    width: var(--sidebar-width);
    background: rgba(12, 12, 16, 0.95);
    border-right: 1px solid var(--card-border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 20px;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
}

.badge-tag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.badge-admin {
    background: rgba(192, 241, 28, 0.15);
    color: var(--brand-primary);
    border: 1px solid rgba(192, 241, 28, 0.3);
}

.badge-support {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-guard {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.mode-switcher-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 6px;
}

.mode-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.mode-btn.active {
    background: var(--brand-primary);
    color: #000;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.nav-link.active {
    background: rgba(192, 241, 28, 0.12);
    color: var(--brand-primary);
    border-left: 3px solid var(--brand-primary);
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
    margin-top: auto;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #27272a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--brand-primary);
    overflow: hidden;
}

.user-details {
    flex: 1;
    overflow: hidden;
}

.user-details .name {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-details .role {
    font-size: 0.725rem;
    color: var(--text-muted);
}

/* Main Content */
.panel-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
    width: calc(100vw - var(--sidebar-width));
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-title h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Support Contact Top Strip */
.support-strip {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    padding: 16px 24px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.support-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.support-contact-item i {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
}

/* Grid & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card .title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
}

.stat-card .value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.1rem;
    font-weight: 800;
    margin: 10px 0;
    color: #fff;
}

.stat-card .subtext {
    font-size: 0.775rem;
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
    width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(192, 241, 28, 0.15);
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--card-border);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.custom-table th {
    background: rgba(255, 255, 255, 0.04);
    padding: 14px 18px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--card-border);
}

.custom-table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
}

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

/* Status Badges */
.status-pill {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-suspended {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.status-in_progress {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

/* Auth Modal Overlay */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 10, 0.95);
    backdrop-filter: blur(25px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    max-width: 440px;
    width: 100%;
    padding: 36px;
    text-align: center;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--brand-primary);
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px var(--brand-glow);
}

.auth-logo img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
}

/* Responsiveness for Phone Users */
@media (max-width: 900px) {
    .panel-sidebar {
        transform: translateX(-100%);
    }

    .panel-sidebar.mobile-open {
        transform: translateX(0);
    }

    .panel-main {
        margin-left: 0;
        width: 100vw;
        padding: 20px 16px;
    }

    .mobile-nav-toggle {
        display: block;
    }

    .header-title h1 {
        font-size: 1.5rem;
    }

    .support-strip {
        flex-direction: column;
        align-items: flex-start;
    }
}
