/* ===========================================
   MultiWisp - Enhanced Professional Styles
   Optimized for visual comfort and usability
   =========================================== */

:root {
    /* Colores base - más suaves y profesionales */
    --bg: #f8fafc;
    --panel: #ffffff;
    --panel-2: #f1f5f9;
    --panel-hover: #f8fafc;
    
    /* Textos - mejor contraste pero sin ser agresivo */
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Primarios - azul más suave y profesional */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --primary-lighter: #dbeafe;
    
    /* Colores de estado - tonos más suaves */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #0ea5e9;
    --info-light: #e0f2fe;
    
    /* Bordes y sombras - más sutiles */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
    
    /* Radios - más suaves */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Sidebar - azul clarito elegante */
    --sidebar-bg: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
    --sidebar-text: #334155;
    --sidebar-hover: rgba(59, 130, 246, 0.08);
    --sidebar-active-bg: rgba(59, 130, 246, 0.15);
    --sidebar-active-text: var(--primary);
    --sidebar-border: #bae6fd;
    
    /* Topbar */
    --topbar-bg: #ffffff;
    --topbar-border: #e2e8f0;
    
    /* Transiciones suaves */
    --transition-fast: all 0.15s ease;
    --transition-base: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* ===========================================
   RESET Y BASE
   =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===========================================
   SIDEBAR - Mejorado
   =========================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 12px rgba(59, 130, 246, 0.08);
}

/* Logo mejorado */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.logo .logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.logo .logo-icon i {
    color: white;
    font-size: 20px;
}

.logo-text h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.logo-text p {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
    font-weight: 500;
}

/* Menu mejorado */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.menu {
    list-style: none;
}

.menu > li {
    margin-bottom: 2px;
}

.menu > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    position: relative;
}

.menu > li > a:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.menu > li > a.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.menu > li > a i {
    width: 18px;
    font-size: 16px;
    text-align: center;
}

/* Submenus mejorados */
.has-submenu > a {
    position: relative;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 11px !important;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.has-submenu.active .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(186, 230, 253, 0.2);
    border-radius: var(--radius-md);
    margin: 4px 0;
}

.has-submenu.active .submenu {
    max-height: 500px;
}

.submenu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 42px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    margin: 2px 0;
}

.submenu li a:hover {
    color: var(--text);
    background: var(--sidebar-hover);
}

.submenu li a.active {
    color: var(--primary);
    font-weight: 600;
}

.submenu li a i {
    font-size: 11px;
    width: 14px;
    opacity: 0.7;
}

/* Badge mejorado */
.menu-badge {
    margin-left: auto;
    background: var(--primary-lighter);
    color: var(--primary);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1.4;
}

.menu-badge.danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* Footer del sidebar */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(186, 230, 253, 0.3);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--success);
    margin-bottom: 6px;
    font-weight: 500;
}

.connection-status i {
    font-size: 7px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.connection-status.disconnected {
    color: var(--danger);
}

.connection-status.disconnected i {
    animation: none;
}

.version-info {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===========================================
   TOPBAR - Mejorado
   =========================================== */
.topbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 64px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--panel-2);
    color: var(--primary);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.breadcrumb i {
    color: var(--primary);
    font-size: 18px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Search bar mejorado */
.search-bar {
    position: relative;
    width: 320px;
}

.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--panel-2);
    color: var(--text);
    transition: var(--transition-fast);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--panel);
    box-shadow: 0 0 0 3px var(--primary-lighter);
}

.search-bar input:focus + i {
    color: var(--primary);
}

/* Notification icon mejorado */
.notification-icon {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.notification-icon:hover {
    background: var(--panel-2);
}

.notification-icon i {
    font-size: 20px;
    color: var(--text-secondary);
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* ISP Selector mejorado */
.isp-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition-fast);
}

.isp-selector:hover {
    background: var(--panel);
    border-color: var(--primary);
}

.isp-selector i {
    color: var(--primary);
    font-size: 16px;
}

/* User menu mejorado */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.user-avatar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.user-avatar i {
    color: white;
    font-size: 18px;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition-base);
    z-index: 1000;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.user-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.user-info span {
    font-size: 12px;
    color: var(--text-secondary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition-fast);
}

.user-dropdown a:hover {
    background: var(--panel-2);
    color: var(--primary);
}

.user-dropdown a i {
    width: 18px;
    font-size: 15px;
    color: var(--text-secondary);
}

.user-dropdown a:hover i {
    color: var(--primary);
}

.logout-link:hover {
    color: var(--danger) !important;
}

.logout-link:hover i {
    color: var(--danger) !important;
}

/* ===========================================
   MAIN CONTENT - Mejorado
   =========================================== */
.container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    margin-top: 64px;
    padding: 24px;
    min-height: calc(100vh - 64px);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Page Header mejorado */
.page-header {
    margin-bottom: 24px;
}

.header-info h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.header-info p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===========================================
   CARDS - Mejorados
   =========================================== */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

/* ===========================================
   FORMS - Mejorados
   =========================================== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.2px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--panel);
    transition: var(--transition-fast);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:hover {
    border-color: var(--text-muted);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--panel);
    box-shadow: 0 0 0 3px var(--primary-lighter);
}

.form-control:disabled {
    background: var(--panel-2);
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--border-light);
}

.form-control:read-only {
    background: var(--panel-2);
    cursor: default;
}

/* ===========================================
   BUTTONS - Mejorados
   =========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--panel-2);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning);
    color: white;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* ===========================================
   STATS CARDS - Mejorados
   =========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .stat-icon i {
    font-size: 22px;
    color: white;
}

.stat-card .stat-icon.blue { 
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.stat-card .stat-icon.green { 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.stat-card .stat-icon.orange { 
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.stat-card .stat-icon.purple { 
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.stat-card .stat-icon.red { 
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.stat-info h3 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    line-height: 1.2;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===========================================
   TABLES - Mejoradas
   =========================================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

table thead {
    background: var(--panel-2);
}

table th {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
}

table td {
    font-size: 14px;
    color: var(--text);
}

table tbody tr {
    transition: var(--transition-fast);
}

table tbody tr:hover {
    background: var(--panel-hover);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* ===========================================
   BADGES - Mejorados
   =========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-primary {
    background: var(--primary-lighter);
    color: var(--primary);
}

/* ===========================================
   MODALS - Mejorados
   =========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 400;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--panel-2);
    color: var(--text);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--panel-hover);
}

/* ===========================================
   NOTIFICATIONS PANEL - Mejorado
   =========================================== */
.notification-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--panel);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    z-index: 300;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-panel.active {
    right: 0;
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.notification-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-action-btn {
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.notification-action-btn:hover {
    background: var(--panel);
    border-color: var(--primary);
    color: var(--primary);
}

.close-panel {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.close-panel:hover {
    background: var(--panel-2);
    color: var(--text);
}

.notification-content {
    padding: 16px;
    overflow-y: auto;
    height: calc(100vh - 80px);
}

.notification-content::-webkit-scrollbar {
    width: 6px;
}

.notification-content::-webkit-scrollbar-track {
    background: transparent;
}

.notification-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--panel);
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.notification-item.unread {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.notification-item:hover {
    transform: translateX(-4px);
    box-shadow: var(--shadow-sm);
}

.notification-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.notification-item-icon.success {
    background: var(--success);
}

.notification-item-icon.warning {
    background: var(--warning);
}

.notification-item-icon.error {
    background: var(--danger);
}

.notification-item-icon.info {
    background: var(--info);
}

.notification-text {
    flex: 1;
    min-width: 0;
}

.notification-text strong {
    display: block;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.notification-text p {
    margin: 0 0 6px 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.notification-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===========================================
   LOADING & ERROR STATES - Mejorados
   =========================================== */
.loading-screen,
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.error-icon {
    width: 72px;
    height: 72px;
    background: var(--danger-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.error-icon i {
    font-size: 32px;
    color: var(--danger);
}

.error-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.error-state p {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 14px;
}

.error-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 8px;
    font-weight: 600;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===========================================
   ALERTS Y TOASTS - Mejorados
   =========================================== */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    font-weight: 500;
    border-left: 4px solid;
}

.alert i {
    font-size: 18px;
    margin-top: 2px;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border-left-color: var(--success);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
    border-left-color: var(--warning);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
    border-left-color: var(--danger);
}

.alert-info {
    background: var(--info-light);
    color: var(--info);
    border-left-color: var(--info);
}

/* ===========================================
   INPUTS ESPECIALES
   =========================================== */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Date inputs */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    background: var(--panel);
    color: var(--text);
}

/* Textarea */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

/* ===========================================
   RESPONSIVE - Optimizado
   =========================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .topbar {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .search-bar {
        width: 200px;
    }

    .isp-selector span {
        display: none;
    }

    .topbar {
        padding: 0 16px;
        height: 60px;
    }

    .main-content {
        padding: 16px;
        margin-top: 60px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .notification-panel {
        width: 100%;
        right: -100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .breadcrumb {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .search-bar {
        display: none;
    }

    .topbar-right {
        gap: 8px;
    }

    .card {
        padding: 16px;
    }

    .page-header .header-info h2 {
        font-size: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ===========================================
   UTILIDADES
   =========================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* Smooth scrollbars para toda la aplicación */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===========================================
   PRINT STYLES
   =========================================== */
@media print {
    .sidebar,
    .topbar,
    .notification-panel,
    .btn,
    .form-actions {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}