/* ═══════════════════════════════════════════════════════════════════════════
   RESPALDAME PANEL - Design System
   Estilo: Google Calendar + Notion + Apple Design
   Minimalista, Elegante, Limpio, Innovador
   ═══════════════════════════════════════════════════════════════════════════ */

/* Fuente Premium - Plus Jakarta Sans */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════
   VARIABLES GLOBALES
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
    /* Colores principales - Respaldame Brand */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    
    /* Colores secundarios */
    --secondary: #8b5cf6;
    --secondary-dark: #7c3aed;
    --secondary-light: #a78bfa;
    
    /* Acentos */
    --accent-cyan: #22d3ee;
    --accent-teal: #14b8a6;
    
    /* Estados */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Escala de grises - Slate */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    
    /* Texto */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Fondos */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-elevated: #ffffff;
    
    /* Sidebar */
    --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --sidebar-text: rgba(255, 255, 255, 0.7);
    --sidebar-text-active: #ffffff;
    --sidebar-hover: rgba(99, 102, 241, 0.15);
    --sidebar-active: var(--primary);
    
    /* Bordes */
    --border-light: #f1f5f9;
    --border-default: #e2e8f0;
    --border-strong: #cbd5e1;
    
    /* Radios */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Sombras */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-primary: 0 4px 14px rgba(99, 102, 241, 0.25);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    
    /* Transiciones */
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 350ms;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --gradient-light: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET Y BASE
   ═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
    color: var(--primary-dark);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--primary-100);
    color: var(--primary-dark);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ═══════════════════════════════════════════════════════════════════════════ */
.page-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR - Elegante y Moderno
   ═══════════════════════════════════════════════════════════════════════════ */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: all var(--duration-normal) var(--ease-out);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1.75rem 1.5rem;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-primary);
}

.sidebar-brand-logo svg {
    width: 24px;
    height: 24px;
    color: white;
}

.sidebar-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--sidebar-text-active);
    letter-spacing: -0.02em;
}

.sidebar-brand-tagline {
    font-size: 0.7rem;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 1px;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 1.5rem 0.75rem;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--slate-500);
    padding: 0.5rem 1rem;
    margin-top: 1rem;
}

.nav-section-title:first-child {
    margin-top: 0;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-out);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.nav-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    box-shadow: var(--shadow-primary);
}

.nav-link .icon {
    width: 20px;
    height: 20px;
    opacity: 0.8;
    flex-shrink: 0;
}

.nav-link.active .icon,
.nav-link:hover .icon {
    opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
}

.sidebar-user-info {
    flex-grow: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sidebar-text-active);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT WRAPPER
   ═══════════════════════════════════════════════════════════════════════════ */
.main-content-wrapper {
    flex-grow: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--duration-normal) var(--ease-out);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 0.875rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle-btn {
    background: var(--slate-100);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-out);
    font-size: 1.25rem;
}

.sidebar-toggle-btn:hover {
    background: var(--slate-200);
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-search {
    position: relative;
}

.topbar-search input {
    width: 280px;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    background: var(--slate-50);
    transition: all var(--duration-fast) var(--ease-out);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px var(--primary-50);
}

.topbar-search .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.375rem 0.75rem 0.375rem 0.375rem;
    border-radius: var(--radius-full);
    background: var(--slate-100);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.user-profile:hover {
    background: var(--slate-200);
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.user-profile span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--duration-fast) var(--ease-out);
}

.logout-link:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.logout-link svg {
    width: 20px;
    height: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════════════════════════════════════════════ */
.content-area {
    padding: 2rem;
    flex-grow: 1;
    background: var(--bg-primary);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.content-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.content-header p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS - Estilo Apple/Notion
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-out);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-default);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--gradient-light);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.card-body {
    padding: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STATS CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--duration-normal) var(--ease-out);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-100);
}

.card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.card-icon.primary { background: var(--gradient-primary); box-shadow: var(--shadow-primary); }
.card-icon.success { background: linear-gradient(135deg, #10b981 0%, #34d399 100%); }
.card-icon.danger { background: linear-gradient(135deg, #ef4444 0%, #f87171 100%); }
.card-icon.warning { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }
.card-icon.info { background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%); }

.card-info {
    flex-grow: 1;
}

.card-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTONES - Minimalistas y Elegantes
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    white-space: nowrap;
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background: var(--slate-100);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover {
    background: var(--slate-200);
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--slate-50);
    border-color: var(--slate-300);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABLAS - Limpias y Modernas
   ═══════════════════════════════════════════════════════════════════════════ */
.table-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-responsive {
    overflow-x: auto;
}

table, .user-table {
    width: 100%;
    border-collapse: collapse;
}

table thead th,
.user-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 1rem 1.25rem;
    background: var(--slate-50);
    border-bottom: 1px solid var(--border-default);
}

table tbody td,
.user-table td {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

table tbody tr:last-child td,
.user-table tr:last-child td {
    border-bottom: none;
}

table tbody tr:hover,
.user-table tr:hover {
    background: var(--slate-50);
}

table td strong,
.user-table td strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════════ */
.badge, .status-badge, .type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    letter-spacing: 0.01em;
}

.badge-success, .status-active {
    background: var(--success-light);
    color: #047857;
}

.badge-danger, .status-inactive {
    background: var(--danger-light);
    color: #b91c1c;
}

.badge-warning {
    background: var(--warning-light);
    color: #b45309;
}

.badge-info {
    background: var(--info-light);
    color: #1d4ed8;
}

.badge-muted {
    background: var(--slate-100);
    color: var(--slate-600);
}

.badge-primary {
    background: var(--primary-50);
    color: var(--primary-dark);
}

/* Type badges específicos */
.type-admin {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
}

.type-reseller {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
}

.type-user {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMULARIOS
   ═══════════════════════════════════════════════════════════════════════════ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label,
.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea,
.input-group input,
.input-group select,
.input-group textarea,
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--duration-fast) var(--ease-out);
}

.form-group input:hover,
.form-group select:hover,
.input-group input:hover,
.input-group select:hover,
.form-control:hover {
    border-color: var(--slate-300);
}

.form-group input:focus,
.form-group select:focus,
.input-group input:focus,
.input-group select:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.form-group input::placeholder,
.input-group input::placeholder,
.form-control::placeholder {
    color: var(--text-muted);
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    align-items: end;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALES - Glassmorphism
   ═══════════════════════════════════════════════════════════════════════════ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal.open,
.modal[style*="block"] {
    display: flex;
}

.modal-content,
.modal-dialog {
    width: 100%;
    max-width: 520px;
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    animation: modalSlideIn 0.3s var(--ease-out);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gradient-light);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: var(--slate-100);
    border: 1px solid var(--border-default);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: all var(--duration-fast) var(--ease-out);
}

.close-btn:hover {
    background: var(--slate-200);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--slate-50);
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTAS
   ═══════════════════════════════════════════════════════════════════════════ */
.alert, .flash-message {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    border: 1px solid transparent;
}

.alert-success, .flash-message.success {
    background: var(--success-light);
    color: #047857;
    border-color: #a7f3d0;
}

.alert-danger, .alert-error, .flash-message.error {
    background: var(--danger-light);
    color: #b91c1c;
    border-color: #fecaca;
}

.alert-warning {
    background: var(--warning-light);
    color: #b45309;
    border-color: #fde68a;
}

.alert-info {
    background: var(--info-light);
    color: #1d4ed8;
    border-color: #bfdbfe;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCIONES DE TABLA
   ═══════════════════════════════════════════════════════════════════════════ */
.actions-cell, .table-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.action-btn {
    background: var(--slate-100);
    border: 1px solid var(--border-light);
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast) var(--ease-out);
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.action-btn:hover {
    background: var(--slate-200);
    color: var(--text-primary);
}

.action-btn.edit:hover {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-100);
}

.action-btn.activate:hover,
.action-btn.toggle[style*="success"]:hover {
    background: var(--success-light);
    color: var(--success);
    border-color: #a7f3d0;
}

.action-btn.deactivate:hover,
.action-btn.toggle:hover {
    background: var(--warning-light);
    color: var(--warning);
    border-color: #fde68a;
}

.action-btn.delete:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: #fecaca;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGINACIÓN
   ═══════════════════════════════════════════════════════════════════════════ */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    gap: 0.375rem;
}

.pagination a, .pagination span {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-out);
}

.pagination a:hover {
    background: var(--slate-100);
    border-color: var(--slate-300);
}

.pagination .active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SOPORTE CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.support-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-out);
}

.support-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-default);
}

.support-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gradient-light);
}

.support-card-header .icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.support-card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.support-card-body {
    padding: 1.5rem;
}

.support-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.support-item {
    margin: 0;
}

.support-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    background: var(--slate-50);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--duration-fast) var(--ease-out);
}

.support-link:hover {
    background: var(--primary-50);
    border-color: var(--primary-100);
    color: var(--primary-dark);
    transform: translateX(4px);
}

.support-link .icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color var(--duration-fast) var(--ease-out);
}

.support-link:hover .icon {
    color: var(--primary);
}

/* Changelog */
.changelog-entry {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px dashed var(--border-default);
}

.changelog-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.changelog-entry h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.375rem;
}

.changelog-entry .version {
    background: var(--gradient-primary);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.changelog-entry .date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.changelog-entry ul {
    list-style: disc;
    padding-left: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.changelog-entry ul li {
    margin-bottom: 0.25rem;
}

/* Download Button */
.download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-primary);
    transition: all var(--duration-fast) var(--ease-out);
    border: none;
    width: 100%;
    text-decoration: none;
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    color: white;
}

.download-button .icon {
    width: 20px;
    height: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR TOGGLE STATES
   ═══════════════════════════════════════════════════════════════════════════ */
.sidebar-toggled .sidebar {
    transform: translateX(-260px);
}

.sidebar-toggled .main-content-wrapper {
    margin-left: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-260px);
    }
    
    .main-content-wrapper {
        margin-left: 0;
    }
    
    body:not(.sidebar-toggled) .sidebar {
        transform: translateX(0);
    }
    
    .content-area {
        padding: 1.5rem;
    }
    
    .topbar {
        padding: 0.75rem 1.5rem;
    }
    
    .topbar-search {
        display: none;
    }
}

@media (max-width: 768px) {
    .content-area {
        padding: 1rem;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .support-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-form {
        grid-template-columns: 1fr;
    }
    
    .modal-content,
    .modal-dialog {
        max-width: 100%;
        margin: 1rem;
        border-radius: var(--radius-xl);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMACIONES
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .stat-card, .support-card {
    animation: fadeInUp 0.4s var(--ease-out);
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0ms; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 50ms; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 100ms; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 150ms; }

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN/REGISTER PAGES - Centrado
   ═══════════════════════════════════════════════════════════════════════════ */
body.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    background: var(--bg-primary);
}

.form-wrapper {
    width: 100%;
    max-width: 440px;
}

.form-container {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    text-align: center;
}

.logo-container {
    margin-bottom: 2rem;
}

.logo-wrapper {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: var(--radius-xl);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-primary);
}

.logo-wrapper svg {
    width: 40px;
    height: 40px;
    color: white;
}

.logo {
    max-width: 72px;
    height: auto;
}

.form-container h1 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.form-container > p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

.form-footer {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--primary);
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* User Dashboard Grid */
.user-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .user-dashboard-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
}

.license-info-card, .support-card-user {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.license-info-card h3, .support-card-user h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.license-info-card h3 .icon, .support-card-user h3 .icon {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.license-details p {
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.license-details strong {
    color: var(--text-primary);
    font-weight: 500;
    min-width: 80px;
    display: inline-block;
}

.license-details .license-key {
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: var(--slate-100);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.support-list-user {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.support-list-user .support-item {
    margin: 0;
}

.no-license-message {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
}

/* Section Title */
.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

/* Recent Activity */
.recent-activity-container {
    margin-top: 2rem;
}

.activity-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.activity-card .card-header {
    background: var(--gradient-light);
}

.activity-list {
    padding: 0;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--duration-fast) var(--ease-out);
}

.activity-item:hover {
    background: var(--slate-50);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-info {
    display: flex;
    flex-direction: column;
}

.activity-info .customer-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.activity-info .email {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.activity-meta {
    text-align: right;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.activity-meta .creator {
    display: block;
    color: var(--text-secondary);
}

.activity-item-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}
