/* ============================================
   SISTEMA DE CONTROL DE FLOTAS - ESTILOS CSS
   ============================================ */

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 28px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    color: #666;
}

/* ============================================
   MODERN LOGIN PAGE STYLES
   ============================================ */

.login-page-modern {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -1;
}

.login-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    bottom: -150px;
    right: -150px;
    animation-delay: 7s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.login-container-modern {
    width: 100%;
    max-width: 480px;
    z-index: 10;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 50px 45px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 
                0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card.animate-in {
    transform: translateY(0);
    opacity: 1;
}

.login-card-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    margin-bottom: 20px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
    }
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
    margin-bottom: 8px;
}

.login-subtitle {
    color: #666;
    font-size: 15px;
    font-weight: 400;
    margin-top: 10px;
}

.alert-error-modern,
.alert-success-modern {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error-modern {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-error-modern i {
    font-size: 18px;
}

.alert-success-modern {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.alert-success-modern i {
    font-size: 18px;
}

.login-form-modern {
    margin-top: 30px;
}

.form-group-modern {
    margin-bottom: 24px;
}

.form-group-modern label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.form-group-modern label i {
    color: #667eea;
    font-size: 16px;
}

.form-group-modern input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group-modern input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 8px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #667eea;
}

.btn-login-modern {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-login-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.btn-login-modern:active {
    transform: translateY(0);
}

.btn-login-modern i {
    transition: transform 0.3s ease;
}

.btn-login-modern:hover i {
    transform: translateX(4px);
}

.login-footer-modern {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
}

.demo-credentials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 10px;
}

.demo-credentials i {
    color: #667eea;
    font-size: 16px;
}

.demo-credentials strong {
    color: #333;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 576px) {
    .login-card {
        padding: 40px 30px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .logo-icon {
        width: 70px;
        height: 70px;
        font-size: 32px;
    }
    
    .shape {
        filter: blur(40px);
    }
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 3px solid #e94560;
    position: relative;
}

.navbar-brand a {
    color: white;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    line-height: 1.2;
    white-space: nowrap;
}

.navbar-brand a:hover {
    color: #e94560;
    transform: scale(1.02);
}

/* Hamburger Toggle Button */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1000;
}

.navbar-toggle span {
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.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-collapse {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.navbar-menu li a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s;
    display: block;
    font-size: 15px;
    font-weight: 500;
    border: 2px solid transparent;
    white-space: nowrap;
}

.navbar-menu li a:hover {
    background: rgba(233, 69, 96, 0.2);
    border-color: #e94560;
    transform: translateY(-2px);
}

.navbar-menu li a.active {
    background: #e94560;
    border-color: #e94560;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-name {
    font-weight: bold;
    font-size: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.user-role {
    font-size: 13px;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
}

/* Responsive Navbar */
@media (max-width: 992px) {
    .navbar {
        padding: 12px 15px;
    }
    
    .navbar-brand a {
        font-size: 18px;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 80px 20px 20px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 999;
    }
    
    .navbar-collapse.show {
        right: 0;
    }
    
    .navbar-menu {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .navbar-menu li {
        width: 100%;
    }
    
    .navbar-menu li a {
        width: 100%;
        text-align: left;
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .navbar-user {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .user-name, .user-role {
        text-align: center;
    }
    
    .navbar-user .btn {
        width: 100%;
        text-align: center;
    }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    overflow-x: hidden;
    width: 100%;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h1 {
    color: white;
    font-size: 32px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.card h3 {
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.filters-form {
    padding: 0;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.5);
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    max-width: 100%;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    word-wrap: break-word;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table td.actions {
    white-space: nowrap;
}

.data-table td.actions form {
    display: inline-block;
    margin: 0 2px;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.badge-primary {
    background: #667eea;
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #333;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.stat-card.stat-success {
    border-left-color: #28a745;
}

.stat-card.stat-danger {
    border-left-color: #dc3545;
}

.stat-card.stat-warning {
    border-left-color: #ffc107;
}

.stat-card.stat-info {
    border-left-color: #17a2b8;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-footer {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.charts-grid .card {
    height: 400px;
}

.charts-grid canvas {
    max-height: 300px;
}

/* Responsive Design - Mobile First */
@media (max-width: 1200px) {
    .container {
        padding: 20px 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
        overflow-x: hidden; /* Prevenir scroll horizontal en body */
    }
    
    .container {
        padding: 15px 10px;
        width: 100%;
        max-width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .page-header .btn {
        width: 100%;
    }
    
    /* Cards más compactas */
    .card {
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 8px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .card h2, .card h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    /* Forms */
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        min-width: 100%;
        width: 100%;
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        box-sizing: border-box;
    }
    
    .filters-container {
        flex-direction: column;
        width: 100%;
    }
        flex-direction: column;
    }
    
    .filters-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .filters-form .form-group {
        width: 100%;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    /* Charts */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .charts-grid .card {
        height: auto;
        min-height: 280px;
        padding: 12px;
    }
    
    /* Tables - SOLUCIÓN MÓVIL sin deformar desktop */
    .table-container {
        overflow-x: auto !important;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        margin: 10px 0;
        padding: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 6px;
        background: white;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        display: block;
    }
    
    .data-table {
        font-size: 10px;
        min-width: 600px !important;
        margin: 0;
        width: auto !important;
        max-width: none !important;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 4px;
        font-size: 10px;
        white-space: nowrap;
        vertical-align: middle;
    }
    
    .data-table th {
        font-size: 9px;
        text-transform: uppercase;
        font-weight: 700;
        background: #f8f9fa !important;
        position: sticky;
        top: 0;
        z-index: 2;
    }
    
    /* Primera columna sticky removida para evitar problemas */
    .data-table th:first-child,
    .data-table td:first-child {
        position: static;
        box-shadow: none;
        padding-left: 6px;
    }
    
    .data-table th:last-child,
    .data-table td:last-child {
        padding-right: 6px;
    }
    
    .data-table .actions {
        min-width: 85px;
        white-space: nowrap;
    }
    
    .data-table .actions .btn {
        padding: 4px 6px;
        font-size: 9px;
        margin: 1px;
        display: inline-block;
    }
    
    .data-table .actions form {
        display: inline-block;
        margin: 0;
    }
    
    /* Números y montos */
    .data-table td {
        text-align: left;
    }
    
    .data-table td:nth-child(3),
    .data-table td:nth-child(4),
    .data-table td:nth-child(5) {
        text-align: right;
    }
    
    /* Badges más pequeñas */
    .badge {
        font-size: 9px;
        padding: 2px 5px;
        white-space: nowrap;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 5px 8px;
        font-size: 10px;
    }
    
    .btn-block {
        width: 100%;
        display: block;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px 3px;
    }
    
    .page-header h1 {
        font-size: 16px;
    }
    
    .card {
        padding: 8px;
        border-radius: 6px;
        margin: 0 0 8px 0;
    }
    
    .card h2, .card h3 {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .stat-icon {
        font-size: 20px;
    }
    
    /* Tablas ultra compactas para pantallas muy pequeñas */
    .table-container {
        margin: 0 -8px;
        padding: 0;
        width: calc(100% + 16px);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        font-size: 9px;
        min-width: 100%;
        width: 100%;
    }
    
    .data-table th,
    .data-table td {
        padding: 5px 3px;
        font-size: 9px;
    }
    
    .data-table th {
        font-size: 8px;
        font-weight: 700;
    }
    
    .data-table th:first-child,
    .data-table td:first-child {
        padding-left: 6px;
    }
    
    .data-table .actions {
        min-width: 80px;
        padding-right: 6px;
    }
    
    .data-table .actions .btn {
        padding: 3px 5px;
        font-size: 8px;
    }
    
    .badge {
        font-size: 8px;
        padding: 2px 4px;
    }
    
    .btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .btn-sm {
        font-size: 9px;
        padding: 4px 7px;
    }
    
    /* Form inputs más pequeños */
    .form-group {
        margin-bottom: 8px;
    }
    
    .form-group label {
        font-size: 11px;
        margin-bottom: 3px;
    }
    
    /* Login responsive */
    .login-box {
        padding: 18px;
    }
    
    .login-header h1 {
        font-size: 18px;
    }
    
    /* Alerts más compactas */
    .alert {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    /* Charts más pequeños */
    .charts-grid .card {
        min-height: 220px;
        padding: 8px;
    }
}

/* Utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .navbar,
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .page-header h1 {
        color: #333;
        text-shadow: none;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    position: relative;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content.modal-sm {
    max-width: 400px;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1a1a2e;
    font-size: 24px;
}

.modal-content .close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #999;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
}

.modal-content .close:hover,
.modal-content .close:focus {
    color: #e94560;
    transform: rotate(90deg);
}

.modal-content .form-group {
    margin-bottom: 20px;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.modal-content .form-group input,
.modal-content .form-group select,
.modal-content .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.modal-content .form-group input:focus,
.modal-content .form-group select:focus,
.modal-content .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-content .form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

.modal-content .form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-content .text-danger {
    color: #dc3545;
    font-weight: 500;
    margin: 15px 0;
}

/* Subtitle */
.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin-top: 5px;
    font-weight: 400;
}

/* Action Buttons in Table */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    white-space: nowrap;
}

/* Form Row for 2-column layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Help Text */
.help-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
    font-style: italic;
}

/* Text Utilities */
.text-center {
    text-align: center;
}

/* Elegant Filter Card */
.filter-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e0e0e0;
    margin-bottom: 25px;
}

.filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.filter-form-elegant {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-input,
.filter-select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-input::placeholder {
    color: #999;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

@media (max-width: 1024px) {
    .filter-form-elegant {
        grid-template-columns: 1fr 1fr;
    }
    
    .filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .filter-form-elegant {
        grid-template-columns: 1fr;
    }
}

/* Elegant Table Card */
.table-card {
    overflow: hidden;
}

.table-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.elegant-table {
    width: 100%;
}

.elegant-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    padding: 15px 12px;
}

.elegant-table tbody tr {
    transition: all 0.3s ease;
}

.elegant-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: translateX(5px);
    box-shadow: -5px 0 0 0 #667eea;
}

.elegant-table tbody td {
    padding: 15px 12px;
    vertical-align: middle;
}

/* Enhanced Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.badge-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

/* Enhanced Action Buttons */
.action-buttons .btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-buttons .btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border: none;
}

.action-buttons .btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.action-buttons .btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
}

.action-buttons .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* ============================================
   MEJORAS ADICIONALES PARA MÓVILES
   ============================================ */

/* Prevenir overflow horizontal global */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Mejor touch en móviles */
* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Box-sizing para todos los elementos */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Inputs más grandes para móvil */
@media (max-width: 768px) {
    /* Prevenir zoom en inputs iOS */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important; /* Evita zoom en iOS */
        min-height: 44px; /* Tamaño mínimo de touch */
    }
    
    .btn {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Formularios en tarjetas más compactos */
    .card form .form-group {
        margin-bottom: 12px;
    }
    
    .card form label {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    /* Ocultar columnas menos importantes en móvil */
    .hide-mobile {
        display: none !important;
    }
    
    /* Texto más legible */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Asegurar que las imágenes no se salgan */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Prevenir overflow en pre y code */
    pre, code {
        overflow-x: auto;
        max-width: 100%;
    }
}

/* Mejoras para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Overlay para menú móvil */
.navbar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.navbar-overlay.show {
    display: block;
    opacity: 1;
}

/* Mejoras para scroll horizontal en tablas */
@media (max-width: 768px) {
    .table-container {
        position: relative;
        border-radius: 0;
        background: white;
        box-shadow: none;
    }
    
    /* Indicador de scroll - más discreto */
    .table-container::after {
        content: '';
        display: none;
    }
    
    /* NO hacer sticky la primera columna en móvil */
    .data-table th:first-child,
    .data-table td:first-child {
        position: static;
        background: inherit;
        box-shadow: none;
    }
}

/* Utility classes para responsive */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

@media (max-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
}

@media (max-width: 576px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
}

/* Text utilities responsive */
@media (max-width: 768px) {
    .text-sm-center { text-align: center !important; }
    .text-sm-left { text-align: left !important; }
}

/* Spacing adjustments para móvil */
@media (max-width: 768px) {
    .mb-mobile-2 { margin-bottom: 1rem !important; }
    .mt-mobile-2 { margin-top: 1rem !important; }
    .p-mobile-0 { padding: 0 !important; }
}
