/* ============================================
   SISTEMA WINSTAR - Estilos Principales
   Colores: Naranja, Negro, Amarillo, Blanco
   ============================================ */

/* --- CSS Variables --- */
:root {
    --primary: #FF8C00;
    --primary-dark: #E07B00;
    --primary-light: #FFA540;
    --secondary: #1A1A1A;
    --secondary-light: #2D2D2D;
    --accent: #FFB800;
    --accent-light: #FFD54F;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --success: #10B981;
    --success-bg: #D1FAE5;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --danger: #EF4444;
    --danger-bg: #FEE2E2;
    --info: #3B82F6;
    --info-bg: #DBEAFE;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.2s ease;
    --sidebar-width: 260px;
    --header-height: 60px;
    font-size: 14px;
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary) 0%, #2D2D2D 50%, var(--secondary) 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(255,140,0,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(255,184,0,0.05) 0%, transparent 50%);
    animation: loginBg 20s ease-in-out infinite alternate;
}

@keyframes loginBg {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(10deg); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-xl);
}

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

.login-logo h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -0.5px;
}

.login-logo h1 span {
    color: var(--primary);
}

.login-logo p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: 4px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--gray-800);
    transition: var(--transition);
    background: var(--white);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,140,0,0.15);
}

.form-control::placeholder {
    color: var(--gray-400);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

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

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.form-check label {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0;
}

.login-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #FECACA;
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    display: none;
}

.login-error.show {
    display: block;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-light);
}

.btn-accent {
    background: var(--accent);
    color: var(--secondary);
}
.btn-accent:hover:not(:disabled) {
    background: var(--accent-light);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-warning { background: var(--warning); color: var(--secondary); }
.btn-info { background: var(--info); color: var(--white); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; min-width: 36px; }

/* ============================================
   SELECTOR PAGE (Seleccionar empresa)
   ============================================ */
.selector-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--secondary) 0%, #2D2D2D 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.selector-header {
    text-align: center;
    margin-bottom: 40px;
}

.selector-header h1 {
    font-size: 2rem;
    color: var(--white);
    font-weight: 800;
}

.selector-header h1 span { color: var(--primary); }

.selector-header p {
    color: var(--gray-400);
    margin-top: 8px;
    font-size: 1rem;
}

.selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    max-width: 1000px;
    width: 100%;
}

.selector-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.selector-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.selector-card .card-icon {
    width: 120px;
    height: 100px;
    border-radius: 12px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: var(--white);
    font-weight: 700;
    border: 2px solid var(--gray-200);
    padding: 12px;
}

.selector-card h3 {
    font-size: 1.2rem;
    color: var(--secondary);
    margin-bottom: 8px;
}

.selector-card p {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.selector-card .card-role {
    display: inline-block;
    margin-top: 12px;
    padding: 4px 12px;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 600;
}

.selector-user-info {
    margin-top: 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--gray-400);
}

.selector-user-info .btn {
    font-size: 0.85rem;
}

/* ============================================
   LAYOUT: SIDEBAR + CONTENT
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-header small {
    display: block;
    color: var(--gray-400);
    font-size: 0.7rem;
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.nav-section {
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--gray-500);
    font-weight: 700;
    letter-spacing: 1px;
    padding: 8px 12px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--gray-400);/* Un color gris para lo que no está seleccionado */
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2px;
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: var(--white);
}

/* ESTADO ACTIVO: Solo este tendrá el fondo naranja */
.nav-item.active {
    background: rgba(255,140,0,0.15); /* El color naranja/amarillo */
    color: var(----primary);
    font-weight: bold;
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sub-item {
    padding-left: 40px !important; /* Desplaza el texto a la derecha */
    font-size: 0.9em;              /* Un poco más pequeño que el principal */
    opacity: 0.8;                  /* Color un poco más suave para jerarquía */
}

.sub-item:hover {
    opacity: 1;
    background-color: rgba(255, 255, 0, 0.1); /* Efecto amarillo al pasar el mouse */
}

/* submenús  ocultos solo se vean al pasar el mouse por Comercial */
.nav-submenu {
    display: none;
}
.nav-section:hover .nav-submenu {
    display: block;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: var(--white);
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-user:hover {
    background: rgba(255,255,255,0.06);
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

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

.sidebar-user-info .role {
    font-size: 0.7rem;
    color: var(--gray-400);
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* Top header */
.top-header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-header-left h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-800);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.breadcrumb a {
    color: var(--gray-500);
}
.breadcrumb a:hover {
    color: var(--primary);
}

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

.btn-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--gray-600);
    padding: 4px;
}

/* Page content */
.page-content {
    flex: 1;
    padding: 24px;
}

/* ============================================
   CARDS & PANELS
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-icon.orange { background: #FFF3E0; color: var(--primary); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.yellow { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.2;
}

.stat-info p {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: var(--gray-50);
    padding: 10px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
    color: var(--gray-700);
}

tbody tr:hover {
    background: var(--gray-50);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-success { background: var(--success-bg); color: #065F46; }
.badge-warning { background: var(--warning-bg); color: #92400E; }
.badge-danger { background: var(--danger-bg); color: #991B1B; }
.badge-info { background: var(--info-bg); color: #1E40AF; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-primary { background: #FFF3E0; color: #E65100; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    line-height: 1;
}
.modal-close:hover { color: var(--gray-700); }

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 400px;
    animation: toastIn 0.3s ease;
    border-left: 4px solid var(--gray-400);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    line-height: 1;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   ERROR PAGES (403 / 404)
   ============================================ */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    text-align: center;
    padding: 40px 20px;
}

.error-page .error-code {
    font-size: 8rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    opacity: 0.3;
}

.error-page h2 {
    font-size: 1.8rem;
    color: var(--gray-800);
    margin: 16px 0 8px;
}

.error-page p {
    color: var(--gray-500);
    margin-bottom: 24px;
    max-width: 400px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.d-flex { display: flex; }
.d-grid { display: grid; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.72rem; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Search bar */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 300px;
}

.search-bar .form-control {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-600);
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading spinner */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    color: var(--gray-500);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.empty-state h3 {
    color: var(--gray-600);
    margin-bottom: 4px;
}

/* Checkbox for empresa access */
.empresa-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 8px;
    border: 1px solid var(--gray-200);
}

.empresa-toggle.active {
    border-color: var(--primary);
    background: #FFF8F0;
}

.empresa-toggle label {
    font-weight: 600;
    font-size: 0.9rem;
}

.empresa-toggle select {
    margin-left: auto;
    padding: 4px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.8rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }

    .btn-menu-toggle {
        display: block;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .selector-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
    }

    .modal {
        max-width: 100%;
        margin: 10px;
    }

    .top-header {
        padding: 0 16px;
    }

    .page-content {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 24px;
    }

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

}