/* ===================================================
   ADMIN DASHBOARD - GLASSMORPHISM THEME
   Technoeconomia Panel de Control (Premium)
   =================================================== */

/* Variables CSS */
/* Variables CSS */
:root {
    /* Fondo Profundo (Deep Slate Blue) */
    --bg-dark: #0f172a;

    /* Glassmorphism Tokens (Higher Visibility) */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-bg-hover: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.15);
    /* --glass-blur: blur(20px); REMOVED */

    /* Accents */
    --accent-primary: #2660AA;
    --accent-secondary: #4d9eff;
    --accent-dark: #1e4a84;
    --accent-green: #2660AA;
    /* Keeping name for compatibility, changing to blue */
    --accent-cyan: #4d9eff;
    --accent-purple: #9d4edd;
    --accent-orange: #f97316;
    --accent-pink: #ec4899;
    --accent-yellow: #eab308;

    /* Text */
    --text-bright: #f8fafc;
    /* Slate 50 */
    --text-main: #e2e8f0;
    /* Slate 200 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    /* Misc */
    --border-color: var(--glass-border);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Reset y Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;
    background-color: var(--bg-dark);
    /* Fondo radial sutil (Blue Glow) */
    background-image:
        radial-gradient(circle at 10% 20%,
            rgba(38, 96, 170, 0.15) 0%,
            transparent 40%),
        radial-gradient(circle at 90% 80%,
            rgba(77, 158, 255, 0.15) 0%,
            transparent 40%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===================================================
   LOGIN PAGE STYLES
   =================================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    perspective: 1000px;
}

.login-box {
    background: rgba(15, 23, 42, 0.9);
    /* Solid fallback */
    /* backdrop-filter: blur(20px); */
    /* -webkit-backdrop-filter: blur(20px); */
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(38, 96, 170, 0.3));
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s;
}

.form-group input:focus+.input-icon,
.form-group input:focus~.input-icon {
    color: var(--accent-green);
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-bright);
    font-weight: 500;
}

.login-box .form-group input,
.login-box .input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    /* Left padding for icon */
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-bright);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.login-box .form-group input:focus,
.login-box .input-wrapper input:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(38, 96, 170, 0.1);
}

.login-box .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #2660AA, #4d9eff);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 10px;
    -webkit-appearance: none;
    appearance: none;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(38, 96, 170, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

.login-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: var(--accent-green);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* ===================================================
   LAYOUT STRUCTURE (SIDEBAR)
   =================================================== */

.dashboard-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: #0f172a;
    /* Solid background */
    /* backdrop-filter: blur(20px); */
    /* -webkit-backdrop-filter: blur(20px); */
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

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

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(38, 96, 170, 0.2);
}

.sidebar-brand h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-bright);
    margin: 0;
}

.sidebar-brand p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-left: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 4px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: left;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-bright);
}

.nav-item.active {
    background: rgba(38, 96, 170, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(38, 96, 170, 0.2);
}

.nav-icon {
    font-size: 1.2rem;
    min-width: 24px;
    display: flex;
    justify-content: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
}

.btn-logout-sidebar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    width: 100%;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: #fca5a5;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    justify-content: center;
}

.btn-logout-sidebar:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
    border-color: #ef4444;
}

/* Main Content Wrapper (Adjusted) */
.main-content-wrapper {
    flex: 1;
    margin-left: 260px;
    /* Width of sidebar */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 260px);
}

/* Header Tweaks for Sidebar Layout */
.dashboard-header {
    background: #0f172a;
    /* Solid background */
    /* backdrop-filter: blur(10px); */
    border-bottom: 1px solid var(--glass-border);
    padding: 16px 32px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid var(--glass-border);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-info-text {
    display: flex;
    flex-direction: column;
}

/* Mini Stat Cards */
.stat-card-mini {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-bright);
}

.stat-sublabel {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.stat-values {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
}

.stat-value-group {
    text-align: center;
    flex: 1;
}

.value-number {
    font-size: 1.1rem;
    font-weight: 700;
}

.value-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.color-green {
    color: #2660AA;
    /* renaming visually */
}

.color-blue {
    color: #3b82f6;
}

.color-orange {
    color: #f59e0b;
}

.highlight-purple {
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.05);
}

.highlight-cyan {
    border-color: rgba(0, 247, 255, 0.3);
    background: rgba(0, 247, 255, 0.05);
}

/* Buttons */
.btn-action {
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.btn-action.primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.btn-action.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.btn-action.info {
    background: linear-gradient(135deg, #00f7ff, #00a8aa);
    color: #000;
}

.btn-icon-square {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    transition: all 0.2s;
}

.btn-icon-square.primary {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.5);
}

.btn-icon-square.warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.btn-icon-square.info {
    background: rgba(0, 247, 255, 0.1);
    border: 1px solid rgba(0, 247, 255, 0.5);
    color: #00f7ff;
}

.social-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.social-btn:hover {
    transform: translateY(-3px);
}

.social-btn.whatsapp {
    background: #25d366;
}

.social-btn.telegram {
    background: #0088cc;
}

.social-btn.twitter {
    background: #000;
    border: 1px solid #333;
}

.social-btn.copy {
    background: #8b5cf6;
}

/* Responsive Sidebar */
@media (max-width: 900px) {
    .sidebar {
        width: 280px;
        height: 100vh;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        background: #0f172a;
        z-index: 1050;
        border-right: 1px solid var(--glass-border);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Overlay for sidebar */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(3px);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .sidebar-header {
        justify-content: flex-start;
    }

    .main-content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .sidebar-nav {
        display: block;
        /* Always show nav items inside sidebar */
    }

    /* Mobile nav visible style if we want basics */
    .sidebar-nav.mobile-visible {
        display: block;
    }
}

/* Collapsed Sidebar State (Desktop) */
.sidebar.collapsed {
    width: 68px;
    /* Slightly narrower */
}

/* Hide text labels */
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-header p,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-section h3 {
    display: none;
}

/* Center items */
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
    margin: 4px 6px;
    width: auto;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 0;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar.collapsed .sidebar-logo {
    margin: 0;
    width: 32px;
    height: 32px;
}

.sidebar.collapsed .sidebar-nav {
    padding: 24px 8px;
    /* Reduce padding */
}

.sidebar.collapsed .btn-logout-sidebar {
    justify-content: center;
    padding: 12px;
    margin: 0 10px;
}

.main-content-wrapper.expanded {
    margin-left: 68px;
    width: calc(100% - 68px);
}

/* Chat Z-Index Fix - Force on top */
#adminChatForm {
    z-index: 99999 !important;
    /* Maximum priority */
    position: fixed !important;
    bottom: 0;
    right: 20px;
    box-shadow: 0 -5px 40px rgba(0, 0, 0, 0.5);
    /* Stronger shadow to separate from background */
}

/* Main Content */
.dashboard-main {
    flex: 1;
    padding: 32px 24px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.dashboard-welcome {
    text-align: center;
    margin-bottom: 40px;
}

.dashboard-welcome h2 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 8px;
    background: linear-gradient(to right, #fff, #bbb);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dashboard-welcome p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Generic Card Style (Glass) */
.glass-panel {
    background: var(--glass-bg);
    /* backdrop-filter: var(--glass-blur); */
    /* -webkit-backdrop-filter: var(--glass-blur); */
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 16px;
    gap: 16px;
    padding: 24px;
    background: rgba(30, 41, 59, 0.7);
    /* Solid fallback */
    /* backdrop-filter: var(--glass-blur); */
    /* -webkit-backdrop-filter: var(--glass-blur); */
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}



.tool-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    background: var(--glass-bg-hover);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    transition: transform 0.3s ease;
    /* Icon background is now more subtle */
    background: rgba(255, 255, 255, 0.05);
}

.tool-card:hover .tool-icon {
    transform: scale(1.1);
}



/* Icon Colors using variables */
.email-icon {
    color: var(--accent-green);
    box-shadow: 0 0 15px rgba(38, 96, 170, 0.1);
}

.video-icon {
    color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.1);
}

.link-icon {
    color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 247, 255, 0.1);
}

.calc-icon {
    color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.1);
}

.contact-icon {
    color: var(--accent-pink);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.1);
}

.tutorial-icon {
    color: var(--accent-green);
}

.webinar-icon {
    color: var(--accent-yellow);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.1);
}

.meeting-icon {
    color: var(--accent-cyan);
}

.gallery-icon {
    color: var(--accent-purple);
}

.admin-icon {
    color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

/* Uni2 Ecosystem Icons */
.uni2-icon {
    color: var(--accent-green);
}

.exchange-icon {
    color: #22c55e;
}

.blockchain-icon {
    color: #3b82f6;
}

.view-icon {
    color: #8b5cf6;
}

.nodes-icon {
    color: #0ea5e9;
}

.qr-icon {
    color: #14b8a6;
}

.vip-icon {
    color: var(--accent-yellow);
}

.presentation-icon {
    color: var(--accent-orange);
}

/* AI Icons */
.ai-gemini {
    color: #4285f4;
}

.ai-chatgpt {
    color: #10a37f;
}

.ai-notebook {
    color: #fbbc04;
}

.ai-studio {
    color: #ea4335;
}

.ai-deepseek {
    color: #6366f1;
}

.ai-abacus {
    color: var(--accent-pink);
}

.tool-content {
    flex: 1;
    min-width: 0;
}

.tool-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 4px;
}

.tool-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.tool-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    opacity: 0.5;
}

.tool-card:hover .tool-arrow {
    color: var(--accent-green);
    opacity: 1;
    transform: translateX(4px);
}

/* Section Title */
.section-title {
    margin-top: 48px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.section-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-bright);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dashboard Section (e.g. quick links) */
.dashboard-section {
    margin-top: 32px;
}

.dashboard-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 16px;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

/* Fix for dropdown option visibility (White text on White bg issue) */
select option {
    background-color: var(--bg-dark, #0f172a);
    color: var(--text-bright, #f8fafc);
}

.quick-link:hover {
    background: rgba(0, 255, 133, 0.1);
    border-color: rgba(0, 255, 133, 0.3);
    color: var(--accent-green);
}

/* Footer */
.dashboard-footer {
    padding: 20px 24px;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    background: var(--glass-bg);
}

.dashboard-footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Scrollbar Modern */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 768px) {
    .login-box {
        padding: 32px 24px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
        padding-top: calc(12px + var(--safe-area-top));
    }

    .header-left {
        justify-content: center;
        width: 100%;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
        border-top: 1px solid var(--glass-border);
        padding-top: 12px;
    }

    .user-info {
        align-items: flex-start;
    }

    .dashboard-main {
        padding: 20px 16px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tool-card {
        padding: 20px;
    }

    .header-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .user-info {
        align-items: center;
        order: -1;
        width: 100%;
        text-align: center;
    }

    .btn-logout {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    /* Main content */
    .dashboard-main {
        padding: 20px 16px;
        padding-bottom: calc(20px + var(--safe-area-bottom));
    }

    .dashboard-welcome h2 {
        font-size: 1.5rem;
    }

    /* Tools grid - single column */
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tool-card {
        padding: 16px;
    }

    /* Section headers */
    .section-title {
        margin-top: 32px;
    }

    /* Quick links */
    .quick-links {
        flex-direction: column;
    }

    .quick-link {
        width: 100%;
        justify-content: center;
    }

    /* Footer */
    .dashboard-footer {
        padding: 16px;
        padding-bottom: calc(16px + var(--safe-area-bottom));
    }
}

/* === MOBILE (480px and below) === */
@media (max-width: 480px) {

    /* Login adjustments */
    .login-page {
        padding: 16px;
    }

    .login-box {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .login-logo {
        width: 64px;
        height: 64px;
    }

    .login-header h1 {
        font-size: 1.25rem;
    }

    .form-group input {
        padding: 12px 12px 12px 44px;
        font-size: 16px;
        /* Prevent iOS zoom */
    }

    .btn-login {
        padding: 14px;
        font-size: 0.95rem;
    }

    /* Header compact mode */
    .dashboard-header {
        padding: 10px 12px;
    }

    .header-logo {
        width: 36px;
        height: 36px;
    }

    .header-info h1 {
        font-size: 1rem;
    }

    .header-subtitle {
        font-size: 0.75rem;
    }

    .session-time {
        font-size: 0.7rem;
    }

    /* Compact logout button */
    .btn-logout {
        padding: 8px 10px;
        font-size: 0.8rem;
        gap: 4px;
    }

    .btn-logout svg {
        width: 16px;
        height: 16px;
    }

    /* Main content tighter */
    .dashboard-main {
        padding: 16px 12px;
    }

    .dashboard-welcome {
        margin-bottom: 24px;
    }

    .dashboard-welcome h2 {
        font-size: 1.25rem;
    }

    .dashboard-welcome p {
        font-size: 0.9rem;
    }

    /* Tool cards compact */
    .tool-card {
        padding: 14px;
        gap: 12px;
    }

    .tool-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    .tool-content h3 {
        font-size: 0.95rem;
    }

    .tool-content p {
        font-size: 0.8rem;
    }

    .tool-arrow {
        font-size: 1.2rem;
    }

    /* Section titles */
    .section-title {
        margin-top: 24px;
        margin-bottom: 16px;
    }

    .section-title h3 {
        font-size: 1.1rem;
    }
}

/* === VERY SMALL SCREENS (360px and below) === */
@media (max-width: 360px) {
    .login-box {
        padding: 20px 16px;
    }

    .dashboard-main {
        padding: 12px 8px;
    }

    .tool-card {
        padding: 12px;
        gap: 10px;
    }

    .tool-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .tool-content h3 {
        font-size: 0.9rem;
    }

    .header-info h1 {
        font-size: 0.95rem;
    }
}

/* === LANDSCAPE PHONE ORIENTATION === */
@media (max-height: 500px) and (orientation: landscape) {
    .login-page {
        padding: 10px;
    }

    .login-box {
        padding: 20px;
    }

    .login-logo {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }

    .login-header {
        margin-bottom: 16px;
    }

    .dashboard-header {
        flex-direction: row;
        padding: 8px 16px;
    }

    .header-right {
        width: auto;
    }
}

/* Animaciones */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* === PRINT STYLES === */
@media print {

    .dashboard-header,
    .dashboard-footer,
    .btn-logout {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .tool-card {
        break-inside: avoid;
        border: 1px solid #ddd;
    }
}

/* ===================================================
   STATS GRID LAYOUT
   =================================================== */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    width: 100%;
}

/* Make stat cards smaller/compact for the single row */
.stat-card-mini {
    padding: 16px 12px;
    min-height: 110px;
}

.stat-label {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.value-number {
    font-size: 1rem;
}

/* Responsive: Wrap if too small, stack on mobile */
@media (max-width: 1400px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================================
   CHAT LAYOUT FIXES
   =================================================== */

.chat-layout-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
    /* Adjust based on header height */
    min-height: 500px;
    width: 100%;
    overflow: hidden;
}

.chat-list-panel {
    width: 300px;
    min-width: 300px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--glass-border);
}

.chat-main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--glass-border);
    min-width: 0;
    /* Prevents flex items from overflowing */
}

/* Enhanced Sidebar Hover Effects */
.nav-item {
    position: relative;
    overflow: hidden;
}

.nav-item:hover .nav-icon {
    transform: scale(1.2);
    text-shadow: 0 0 8px currentColor;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item:hover {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0%,
            transparent 100%);
    box-shadow: inset 2px 0 0 var(--accent-green);
    padding-left: 20px;
    /* Slight nudge right */
}

/* Active State Enhancement */
.nav-item.active {
    background: linear-gradient(90deg,
            rgba(38, 96, 170, 0.15) 0%,
            transparent 100%);
    box-shadow:
        inset 4px 0 0 var(--accent-green),
        0 0 20px rgba(38, 96, 170, 0.1);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px var(--accent-green));
}

/* Mobile Responsive Chat */
@media (max-width: 768px) {
    .chat-layout-container {
        flex-direction: column;
        height: auto;
    }

    .chat-list-panel {
        width: 100%;
        min-width: 0;
        height: 200px;
    }

    .chat-main-panel {
        height: 500px;
    }
}

/* ===================================================
   STATISTICS & TABLES STYLES (Unified)
   =================================================== */

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

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition:
        transform 0.2s,
        border-color 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(38, 96, 170, 0.3);
    background: var(--glass-bg-hover);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .val {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-green);
    text-shadow: 0 0 20px rgba(38, 96, 170, 0.2);
}

/* Data Tables Container */
.data-table-container {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 30px;
}

.data-table-container h3 {
    margin-bottom: 20px;
    color: var(--accent-green);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Base Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.02);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(38, 96, 170, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(38, 96, 170, 0.2);
}

.table-scroll {
    max-height: 450px;
    overflow-y: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.table-scroll::-webkit-scrollbar {
    width: 6px;
}

.table-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.table-scroll::-webkit-scrollbar-thumb {
    background: rgba(38, 96, 170, 0.2);
    border-radius: 10px;
}

/* Grid for tables area */
.row-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 1200px) {
    .row-grid {
        grid-template-columns: 1.2fr 1fr;
        gap: 25px;
    }
}

/* ===================================================
   HEADER LAYOUT & STATUS STYLES 
   (Ported from Dashboard inline to Global)
   =================================================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    /* Push to right just in case */
}

/* Ensure mobile responsiveness isn't broken */
@media (max-width: 900px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;

        /* Responsive Fixes for Mobile (Added by Antigravity) */
        @media (max-width: 768px) {

            /* Search Form Stacking */
            .search-form {
                flex-wrap: wrap;
                gap: 10px;
            }

            .search-form .search-input {
                width: 100% !important;
                min-width: 0 !important;
                border-radius: 12px !important;
            }

            .search-form .search-btn {
                width: 100% !important;
                border-radius: 12px !important;
                justify-content: center;
            }

            /* Prevent Chart Overflow */
            .data-table-container canvas {
                max-width: 100% !important;
                height: auto !important;
            }

            .data-table-container {
                padding-left: 10px !important;
                padding-right: 10px !important;
                overflow-x: hidden;
                /* Prevent horizontal scroll on container */
            }

            /* Ensure charts respect container width */
            .data-table-container>div {
                width: 100%;
                max-width: 100%;
            }
        }

        margin-left: 0;
    }
}

#statusSelect {
    appearance: none;
    -webkit-appearance: none;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    text-align: center;
}

#statusSelect:hover,
#statusSelect:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #2660AA;
}

#statusSelect option {
    background-color: #0d1a0d;
    color: #fff;
}

/* ===================================================
   ADMIN STATS LAYOUT FIXES
   =================================================== */

/* Grid for top stats (3 columns) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

/* Grid for 50/50 split rows */
.row-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

/* Responsive breakpoint for row-grid */
@media (min-width: 1024px) {
    .row-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Enhanced Sidebar Toggle Button */
.btn-sidebar-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 15px;
}

.btn-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-green);
    border-color: var(--accent-green);
    box-shadow: 0 0 10px rgba(38, 96, 170, 0.2);
    transform: scale(1.05);
}

@media (max-width: 768px) {

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