/* Variables CSS - Tema Claro */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --success-color: #10b981;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --text-color: #111827;
    --text-muted: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f3f4f6;
    --bg-sidebar: #ffffff;
    --sidebar-text: #111827;
    --sidebar-hover: #f3f4f6;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --transition: all 0.3s ease;
}

/* Variables CSS - Tema Oscuro */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #60a5fa;
    --success-color: #10b981;
    --dark-color: #0f172a;
    --light-color: #1e293b;
    --border-color: #334155;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --bg-sidebar: #1e293b;
    --sidebar-text: #f1f5f9;
    --sidebar-hover: #334155;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Login Page - Diseño Moderno */
.login-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: 0;
}

.login-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>'),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z" fill="%23ffffff" fill-opacity="0.1"></path></svg>');
    background-size: cover, cover;
    background-position: bottom, top;
    background-repeat: no-repeat;
    opacity: 0.3;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 1;
}

.login-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation-delay: 5s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

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

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: slideUp 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.login-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
    animation: pulse 2s infinite;
}

.login-icon i {
    font-size: 36px;
    color: white;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
}

.login-alert {
    margin-bottom: 25px;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

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

.login-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
}

.login-form-group label i {
    color: var(--primary-color);
    font-size: 14px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    font-size: 16px;
    z-index: 1;
    pointer-events: none;
}

.login-form input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    transition: var(--transition);
    background: var(--bg-color);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.login-form input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.password-toggle {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
    z-index: 1;
}

.password-toggle:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.login-submit {
    margin-top: 30px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    border: none;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
    position: relative;
    overflow: hidden;
}

.login-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.login-submit:hover::before {
    width: 300px;
    height: 300px;
}

.login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.4);
}

.login-submit:active {
    transform: translateY(0);
}

.login-submit i {
    transition: var(--transition);
}

.login-submit:hover i {
    transform: translateX(5px);
}

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

.login-footer p {
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-footer i {
    color: var(--success-color);
}

/* Responsive */
@media (max-width: 480px) {
    .login-box {
        padding: 35px 25px;
        border-radius: 15px;
    }
    
    .login-icon {
        width: 70px;
        height: 70px;
    }
    
    .login-icon i {
        font-size: 30px;
    }
    
    .login-header h1 {
        font-size: 26px;
    }
}

/* Topbar */
.topbar {
    background: var(--bg-color);
    box-shadow: var(--shadow);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
    transition: left 0.3s ease, background-color 0.3s ease;
}

body.sidebar-open .topbar {
    left: 280px;
}

@media (max-width: 768px) {
    body.sidebar-open .topbar {
        left: 0;
    }
}

.topbar-brand {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-brand .brand-link {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.global-search-container {
    position: relative;
    flex: 1;
    max-width: 600px;
    margin-left: 10px;
}

.global-search-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.global-search-group .input-group-text {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    color: var(--text-muted);
    font-size: 14px;
}

.global-search-input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-left: none;
    border-right: none;
    background: var(--bg-color);
    color: var(--text-color);
    padding: 8px 12px;
    font-size: 14px;
    transition: var(--transition);
}

.global-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.global-search-group:focus-within .input-group-text {
    border-color: var(--primary-color);
}

.global-search-clear {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-left: none;
    background: var(--bg-secondary);
    color: var(--text-color);
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-search-clear:hover {
    background: var(--sidebar-hover);
    color: var(--primary-color);
}

.global-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-color);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    padding: 10px;
    min-width: 100%;
}

.global-search-results.active {
    display: block;
}

.global-search-results .result-item {
    padding: 12px;
    margin-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 4px;
}

.global-search-results .result-item:hover {
    background: var(--sidebar-hover);
}

.global-search-results .result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.global-search-results .result-section {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
}

.global-search-results .result-title {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 15px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-search-results .result-icon {
    font-size: 14px;
}

.global-search-results .result-snippet {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.global-search-results .result-url {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-style: italic;
}

.global-search-results .no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

.global-search-results mark {
    background: rgba(255, 193, 7, 0.3);
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .global-search-container {
        max-width: 100%;
        margin-left: 5px;
    }
    
    .global-search-group {
        position: relative;
    }
    
    .global-search-group .input-group-text {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1;
        background: transparent;
        border: none;
        border-right: none;
        padding: 8px 12px;
        pointer-events: none;
    }
    
    .global-search-input {
        font-size: 13px;
        padding: 6px 10px 6px 40px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        width: 100%;
    }
    
    .global-search-clear {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        border: none;
        border-left: 1px solid var(--border-color);
        background: transparent;
        padding: 6px 12px;
    }
    
    .global-search-group:focus-within .input-group-text {
        border: none;
    }
    
    .topbar-brand .brand-link span {
        display: none;
    }
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botón toggle sidebar */
.sidebar-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    color: var(--text-color);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--sidebar-hover);
    color: var(--primary-color);
}

/* Botón cambio de tema */
.theme-toggle {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-color);
    font-size: 18px;
    transition: var(--transition);
    margin-left: 10px;
}

.theme-toggle:hover {
    background: var(--sidebar-hover);
    transform: scale(1.1);
}

.theme-toggle i {
    transition: transform 0.3s ease;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 280px;
    height: calc(100vh - 70px);
    background: var(--bg-sidebar);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease, background-color 0.3s ease;
    transform: translateX(-100%);
}

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

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        top: 70px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
}

.sidebar-menu-area {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: calc(100vh - 70px);
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand a {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu-item {
    margin: 0;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-size: 14px;
}

.sidebar-menu-link:hover {
    background: var(--sidebar-hover);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.sidebar-menu-link.active {
    background: var(--sidebar-hover);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-menu-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-menu-divider {
    margin: 15px 0 10px 0;
    padding: 10px 20px 5px 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-menu-divider span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 5px;
}

.sidebar-user {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-sidebar);
    margin-top: auto;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--sidebar-text);
    font-size: 14px;
}

.sidebar-user-info i {
    color: var(--primary-color);
}

.sidebar-logout {
    width: 100%;
    padding: 10px;
    background: var(--danger-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-logout:hover {
    background: #dc2626;
}

/* Navbar (mantener para compatibilidad) */
.navbar {
    background: var(--bg-color);
    box-shadow: var(--shadow);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 70px;
    flex-wrap: wrap;
}

/* Botón hamburguesa */
.navbar-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 30px;
    justify-content: space-around;
    z-index: 1001;
    position: relative;
}

.navbar-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: var(--transition);
    transform-origin: center;
}

.navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.navbar-toggle:hover span {
    background: var(--primary-dark);
}

.navbar-brand {
    flex: 1;
}

.navbar-brand a {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-text {
    white-space: nowrap;
}

.navbar-menu {
    display: flex;
    gap: 5px;
    flex: 1;
    margin: 0 30px;
    transition: var(--transition);
}

.nav-link {
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.nav-link:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    font-size: 14px;
}

.badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-admin {
    background: var(--primary-color);
    color: white;
}

.badge-info {
    background: var(--info-color);
    color: white;
}

.btn-logout {
    padding: 8px 15px;
    background: var(--danger-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #dc2626;
}

/* Main Content */
.main-content {
    padding: 30px 20px;
    min-height: calc(100vh - 70px);
    margin-top: 70px;
    transition: margin-left 0.3s ease;
}

body.sidebar-open .main-content {
    margin-left: 280px;
}

@media (max-width: 768px) {
    body.sidebar-open .main-content {
        margin-left: 0;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    color: var(--text-color);
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 16px;
}

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

.stat-card {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 40px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--light-color);
}

.stat-primary .stat-icon {
    background: #dbeafe;
    color: var(--primary-color);
}

.stat-success .stat-icon {
    background: #d1fae5;
    color: var(--success-color);
}

.stat-danger .stat-icon {
    background: #fee2e2;
    color: var(--danger-color);
}

.stat-warning .stat-icon {
    background: #fef3c7;
    color: var(--warning-color);
}

.stat-info .stat-icon {
    background: #dbeafe;
    color: var(--info-color);
}

.stat-content h3 {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}

.stat-content p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Cards */
.card {
    background: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: background-color 0.3s ease;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 18px;
    color: var(--text-color);
    margin: 0;
}

.card-header .d-flex {
    width: 100%;
}

.card-header .d-flex h3 {
    flex: 0 0 auto;
}

.card-header .d-flex .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.card-header .d-flex .ms-auto,
.card-header .d-flex > div:last-child {
    margin-left: auto !important;
}

/* Alineación específica para botones en vista detallada de vehículo */
.card-header .d-flex.justify-content-between > div:last-child {
    margin-left: auto !important;
    flex-shrink: 0;
}

/* Estilos específicos para header de vista detallada de vehículo */
.vehicle-detail-header {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
}

.vehicle-detail-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.vehicle-detail-title h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: var(--text-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.vehicle-detail-title p {
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
}

.vehicle-detail-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex: 0 0 auto;
    flex-shrink: 0;
    white-space: nowrap;
    align-items: center;
}

.vehicle-detail-actions .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .vehicle-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .vehicle-detail-title {
        width: 100%;
    }
    
    .vehicle-detail-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .vehicle-detail-actions .btn {
        flex: 1;
        min-width: 0;
    }
}

.gap-2 {
    gap: 0.5rem;
}

.card-body {
    padding: 20px;
}

/* Grid System */
.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.col-md-6 {
    grid-column: span 1;
}

.col-12 {
    grid-column: 1 / -1;
}

/* Summary Items */
.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .label {
    color: var(--text-muted);
    font-weight: 500;
}

.summary-item .value {
    font-size: 18px;
    font-weight: bold;
}

/* Tablas pequeñas */
.table-sm {
    font-size: 14px;
}

.table-sm th,
.table-sm td {
    padding: 8px;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Botones extra pequeños */
.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.2;
    border-radius: 3px;
}

.btn-xs i {
    font-size: 11px;
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-muted {
    color: var(--text-muted);
}

/* Notification List */
.notification-list {
    list-style: none;
}

.notification-item {
    padding: 15px;
    background: var(--light-color);
    border-radius: var(--radius);
    margin-bottom: 10px;
    border-left: 4px solid var(--warning-color);
}

.notification-item strong {
    color: var(--text-color);
    display: block;
    margin-bottom: 5px;
}

.notification-item small {
    color: var(--text-muted);
    font-size: 13px;
}

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: var(--light-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

.quick-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.quick-link .icon {
    font-size: 32px;
    margin-bottom: 10px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-secondary {
    background: var(--text-muted);
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-color);
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select.form-control {
    cursor: pointer;
}

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

/* Tables */
.table-container {
    overflow-x: auto;
    background: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

thead {
    background: var(--light-color);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: white !important;
    border-bottom: 2px solid var(--border-color);
}

table th,
thead th {
    color: white !important;
}

.sortable-header {
    color: white !important;
    text-decoration: none;
}

.sortable-header:link,
.sortable-header:visited,
.sortable-header:hover,
.sortable-header:active,
.sortable-header.active,
.sortable-header.active:link,
.sortable-header.active:visited,
.sortable-header.active:hover,
.sortable-header.active:active {
    color: white !important;
    text-decoration: none;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background: var(--light-color);
}

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

tbody tr.table-warning {
    background: #fef3c7;
}

[data-theme="dark"] tbody tr.table-warning {
    background: #78350f;
    color: #fef3c7;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--info-color);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

[data-theme="dark"] .alert-error {
    background: #7f1d1d;
    color: #fecaca;
}

[data-theme="dark"] .alert-success {
    background: #064e3b;
    color: #a7f3d0;
}

[data-theme="dark"] .alert-info {
    background: #1e3a8a;
    color: #bfdbfe;
}

[data-theme="dark"] .alert-warning {
    background: #78350f;
    color: #fde68a;
}

/* Footer */
.footer {
    background: var(--bg-color);
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

/* Utilities */
.mt-4 {
    margin-top: 30px;
}

.mb-4 {
    margin-bottom: 30px;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-2 {
    gap: 10px;
}

/* Responsive - Mobile First Approach */

/* Extra Small devices (phones, 480px and down) */
@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
        border-radius: 15px;
    }
    
    .login-icon {
        width: 60px;
        height: 60px;
    }
    
    .login-icon i {
        font-size: 28px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .login-header p {
        font-size: 13px;
    }
    
    .login-form input {
        padding: 12px 12px 12px 40px;
        font-size: 14px;
    }
    
    .login-submit {
        padding: 14px;
        font-size: 15px;
    }
    
    .container {
        padding: 10px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .card-header {
        padding: 15px;
        font-size: 16px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 12px;
        min-width: 600px;
    }
    
    table th,
    table td {
        padding: 8px 6px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control {
        padding: 10px;
        font-size: 14px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .col-md-6,
    .col-md-4,
    .col-md-3 {
        grid-column: 1 / -1;
    }
}

/* Small devices (landscape phones, 481px to 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .login-box {
        padding: 40px 30px;
    }
    
    .container {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .col-md-6 {
        grid-column: span 1;
    }
    
    .col-md-4 {
        grid-column: span 2;
    }
    
    .col-md-3 {
        grid-column: span 2;
    }
    
    table {
        font-size: 13px;
    }
    
    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 15px;
    }
    
    .navbar-menu {
        order: 3;
        width: 100%;
        margin-top: 10px;
        flex-wrap: wrap;
    }
    
    .navbar-user {
        margin-left: auto;
    }
}

/* Medium devices (tablets, 769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .col-md-6 {
        grid-column: span 1;
    }
    
    .col-md-4 {
        grid-column: span 1;
    }
    
    .col-md-3 {
        grid-column: span 1;
    }
    
    .container {
        padding: 20px;
    }
}

/* Large devices (desktops, 1025px and up) */
@media (min-width: 1025px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .row {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Responsive Navbar */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        padding: 10px 15px;
        height: auto;
        min-height: 70px;
    }

    .navbar-brand {
        order: 1;
        flex: 1;
    }

    .navbar-toggle {
        display: flex !important;
        order: 2;
        margin-left: 10px;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative;
        z-index: 1002;
    }
    
    .navbar-brand .brand-text {
        display: none;
    }

    .navbar-user {
        order: 3;
        width: 100%;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--border-color);
        justify-content: space-between;
        display: none !important;
    }

    .navbar-menu {
        order: 4;
        flex-direction: column;
        width: 100%;
        margin: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, visibility 0.3s ease;
        padding: 0;
        display: flex !important;
    }

    .navbar-menu.active {
        max-height: 1000px !important;
        opacity: 1 !important;
        visibility: visible !important;
        padding: 15px 0 !important;
        margin-top: 15px !important;
        border-top: 1px solid var(--border-color);
        overflow: visible !important;
    }

    .nav-link {
        padding: 12px 15px;
        font-size: 15px;
        width: 100%;
        border-radius: var(--radius);
        margin-bottom: 5px;
        justify-content: flex-start;
    }

    .nav-link:hover {
        background: var(--light-color);
    }

    .navbar-user.active {
        display: flex;
    }

    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 8px 10px;
    }

    .navbar-brand a {
        font-size: 16px;
    }

    .navbar-toggle {
        width: 28px;
        height: 28px;
    }

    .navbar-toggle span {
        width: 22px;
        height: 2.5px;
    }

    .nav-link {
        padding: 10px 12px;
        font-size: 14px;
    }

    .user-name {
        font-size: 13px;
    }

    .btn-logout {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Responsive Tables */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    table {
        min-width: 800px;
    }
    
    /* No ocultar columnas - usar scroll horizontal o vista de tarjetas */
    /* Las tablas mantendrán todas las columnas visibles con scroll horizontal */
}

/* Responsive Forms */
@media (max-width: 768px) {
    .form-group label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .form-control,
    select.form-control {
        font-size: 16px; /* Evita zoom en iOS */
        padding: 12px;
    }
    
    textarea.form-control {
        min-height: 100px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group .form-control {
        margin-bottom: 10px;
    }
}

/* Responsive Cards */
@media (max-width: 768px) {
    .card {
        margin-bottom: 15px;
    }
    
    .card-header {
        padding: 15px;
        font-size: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .card-footer {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .card-footer .btn {
        width: 100%;
    }
}

/* Responsive Buttons */
@media (max-width: 768px) {
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .d-flex.gap-2 {
        flex-direction: column;
    }
    
    .d-flex.gap-2 .btn {
        width: 100%;
    }
}

/* Responsive Modals (si se usan) */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        margin: 10px;
        padding: 15px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }
}

/* Responsive Stats Grid */
@media (max-width: 480px) {
    .stats-grid {
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card .stat-value {
        font-size: 24px;
    }
    
    .stat-card .stat-label {
        font-size: 12px;
    }
}

/* Responsive Login Shapes */
@media (max-width: 768px) {
    .shape-1,
    .shape-2,
    .shape-3 {
        display: none; /* Ocultar formas decorativas en móvil para mejor rendimiento */
    }
}

/* Touch-friendly elements */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .card {
        min-height: 44px; /* Tamaño mínimo recomendado para touch */
    }
    
    input,
    select,
    textarea {
        min-height: 44px;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .login-box {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .navbar {
        height: auto;
    }
}

/* Estilos mejorados para botones de subida de archivos */
.file-upload-wrapper {
    position: relative;
    margin-bottom: 15px;
    display: inline-block;
    width: auto;
}

.file-upload-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    overflow: hidden;
    text-align: center;
    white-space: nowrap;
    width: auto;
    min-width: auto;
}

.file-upload-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.file-upload-button:hover::before {
    width: 300px;
    height: 300px;
}

.file-upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    border-color: var(--primary-dark);
}

.file-upload-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.file-upload-button i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.file-upload-button:hover i {
    transform: scale(1.1);
}

.file-upload-button-camera {
    background: linear-gradient(135deg, var(--success-color), #059669);
    border-color: var(--success-color);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.file-upload-button-camera:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    border-color: #059669;
}

.file-upload-button-camera::before {
    background: rgba(255, 255, 255, 0.2);
}

.file-upload-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.file-upload-info {
    margin-top: 10px;
    padding: 10px 15px;
    background: var(--light-color);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary-color);
    font-size: 14px;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.file-upload-info.has-file {
    background: #d1fae5;
    border-left-color: var(--success-color);
    color: #065f46;
}

[data-theme="dark"] .file-upload-info.has-file {
    background: #064e3b;
    color: #a7f3d0;
}

.file-upload-info i {
    margin-right: 8px;
    color: var(--primary-color);
}

.file-upload-info.has-file i {
    color: var(--success-color);
}

.file-upload-hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.file-upload-hint i {
    font-size: 12px;
}

/* Responsive para botones de subida */
@media (max-width: 768px) {
    .file-upload-button {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .file-upload-button i {
        font-size: 13px;
    }
    
    .file-upload-info {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Estilos para selector de columnas (Componente reutilizable) */
.table-controls {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-end;
}

.column-selector-container {
    position: relative;
}

.column-selector-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 200px;
    max-width: 250px;
    margin-top: 5px;
    overflow: hidden;
}

.column-selector-dropdown.show {
    display: block;
}

.column-selector-header {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-selector-actions {
    display: flex;
    gap: 10px;
}

.column-selector-actions .btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.9em;
    padding: 0;
    text-decoration: underline;
}

.column-selector-actions .btn-link:hover {
    color: var(--primary-dark);
}

.column-selector-body {
    padding: 10px 15px;
    overflow: hidden;
    max-height: none;
}

.column-selector-body label {
    display: block;
    padding: 8px 0;
    cursor: pointer;
    user-select: none;
}

.column-selector-body input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Sin barras de desplazamiento en el desplegable */
.column-selector-dropdown {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

.column-selector-body {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

.column-selector-dropdown::-webkit-scrollbar,
.column-selector-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.column-selector-dropdown,
.column-selector-body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Responsive para selector de columnas */
@media (max-width: 768px) {
    .table-controls {
        margin-bottom: 10px;
    }
    
    .column-selector-dropdown {
        right: 0;
        left: auto;
    }
}


