@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;500&display=swap');

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

body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6fb;
    color: #232a7c;
    line-height: 1.6;
    /* padding: 20px; */
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #121866 0%, #1a237e 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
    transition: width 0.25s cubic-bezier(.4,2,.6,1), min-width 0.25s;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-logo i {
    font-size: 20px;
    color: #fff;
}

.brand-text h1 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: #fff;
}

.brand-text p {
    font-size: 0.75rem;
    margin: 0;
    opacity: 0.8;
    color: #fff;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

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

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.6);
}

.nav-links {
    display: flex;
    flex-direction: column;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    position: relative;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: #fff;
}

.nav-links a.active {
    background: rgba(255,255,255,0.15);
    border-left-color: #fff;
    font-weight: 600;
}

.nav-links a i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-links a .nav-text {
    flex: 1;
}

.nav-links a .badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar i {
    font-size: 16px;
    color: #fff;
}

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

.user-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
}
.sidebar nav a svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}
.sidebar nav a i {
    font-size: 20px;
    color: #fff;
}
.sidebar a.logout, .sidebar a.logout:visited, .sidebar a.logout:active, .sidebar a.logout:focus {
    margin-top: auto;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    background: #e53935 !important;
    color: #fff !important;
    border-radius: 8px !important;
    padding: 12px 0 !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    box-shadow: 0 2px 8px rgba(229,57,53,0.08) !important;
    transition: background 0.18s, color 0.18s !important;
    text-decoration: none !important;
    gap: 10px !important;
}
.sidebar a.logout:hover {
    background: #b71c1c !important;
    color: #fff !important;
    text-decoration: none !important;
}
.sidebar a.logout svg {
    fill: #fff !important;
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
}
.sidebar a.logout i {
    font-size: 22px !important;
    color: #fff !important;
    flex-shrink: 0 !important;
}
.sidebar a.logout .nav-text {
    color: #fff !important;
    font-size: 1rem !important;
    text-decoration: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.main-content {
    margin-left: 250px;
    margin-top: 0;
    width: calc(100% - 250px);
    padding: 32px 32px 24px 32px;
    transition: margin-left 0.25s cubic-bezier(.4,2,.6,1), width 0.25s cubic-bezier(.4,2,.6,1);
    box-sizing: border-box;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 70px !important;
    width: calc(100% - 70px) !important;
    transition: margin-left 0.25s cubic-bezier(.4,2,.6,1), width 0.25s cubic-bezier(.4,2,.6,1);
}

@media (max-width: 900px) {
    .main-content { 
        margin-left: 70px; 
        width: calc(100% - 70px); 
        padding: 18px 4vw; 
    }
    .sidebar.collapsed ~ .main-content {
        margin-left: 70px !important;
        width: calc(100% - 70px) !important;
    }
}

/* Login & Form Container */
.login-container,
.form-container {
    width: 100%;
    max-width: 440px;
    margin: 60px auto;
    padding: 36px 32px 32px 32px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(18,24,102,0.10);
}

h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #121866;
    font-size: 2rem;
    font-weight: 700;
}

/* Labels & Inputs */
form label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
    color: #121866;
}

form input,
form select {
    width: 100%;
    padding: 11px;
    border: 1.5px solid #cfd8dc;
    border-radius: 7px;
    font-size: 15px;
    margin-bottom: 4px;
    background: #f7f9fc;
    transition: border 0.2s;
}

form input:focus,
form select:focus {
    border-color: #121866;
    outline: none;
}

/* Buttons */
button {
    width: 100%;
    margin-top: 22px;
    padding: 12px;
    background-color: #121866;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(18,24,102,0.08);
    transition: background-color 0.2s, box-shadow 0.2s;
}

button:hover {
    background-color: #232a7c;
    box-shadow: 0 4px 16px rgba(18,24,102,0.13);
}

/* Error Messages */
.error {
    background-color: #f8d7da;
    color: #842029;
    padding: 10px;
    border-radius: 7px;
    margin-bottom: 15px;
    text-align: center;
    border: 1px solid #f5c2c7;
}

/* Success Messages */
.success {
    background-color: #d1e7dd;
    color: #0f5132;
    padding: 10px;
    border-radius: 7px;
    margin-bottom: 15px;
    text-align: center;
    border: 1px solid #badbcc;
}

/* --- ESTILO GLOBAL PARA TODAS LAS TABLAS DEL SISTEMA --- */

/* Tabla base */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 2px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(18,24,102,0.10);
    font-size: 1rem;
}

th, td {
    padding: 14px 12px;
    border-bottom: 1px solid #e3e6f0;
    text-align: left;
    vertical-align: middle;
}

/* Encabezado azul corporativo */
.table thead th,
thead th {
    background: #121866 !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    letter-spacing: 0.5px;
}

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

/* Filas alternas y hover */
tbody tr:nth-child(even) {
    background: #f7f9fc;
}
tbody tr:hover {
    background: #e3e6fa;
    transition: background 0.18s;
}

/* Badges globales */
.badge {
    font-size: 0.95rem;
    border-radius: 8px;
    padding: 6px 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.badge.bg-secondary { background: #757575; color: #fff; }
.badge.bg-info { background: #00bcd4; color: #fff; }
.badge.bg-success { background: #43a047; color: #fff; }
.badge.bg-danger { background: #e53935; color: #fff; }
.badge.bg-warning { background: #ffc107; color: #232a7c; }

/* Miniaturas de imagen en tablas */
.table td.img-col img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    display: block;
    margin: 0 auto;
}
.table td.img-col span, .table td.barcode-col span {
    color: #bbb;
    font-size: 1.5rem;
    display: block;
    text-align: center;
}
.table td.barcode-col {
    font-size: 1.1rem;
    text-align: center;
}
.table th.img-col, .table td.img-col {
    width: 80px;
    min-width: 70px;
    max-width: 100px;
    text-align: center;
}
.table th.barcode-col, .table td.barcode-col {
    width: 120px;
    min-width: 90px;
    max-width: 140px;
    text-align: center;
}

/* --- Personalización por tabla: agrega una clase extra si necesitas algo especial --- */
/*
.table-movimientos th, .table-movimientos td { ... }
.table-productos th, .table-productos td { ... }
*/

.input-error {
    border: 1.5px solid #e53935 !important;
    background-color: #fff0f0;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
}

.nav-links a button {
    width: 100%;
    margin: 0;
}

@media (max-width: 700px) {
    .dashboard-cards {
        flex-direction: column;
    }
    .form-container, .login-container {
        max-width: 98vw;
        padding: 18px 6px;
    }
    table, th, td {
        font-size: 0.97rem;
    }
}

/* --- Dashboard custom styles --- */
.dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 36px;
}
.dashboard-header h2 {
    font-size: 2.3rem;
    color: #121866;
    font-weight: 800;
    margin-bottom: 0;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dashboard-header .dashboard-subtitle {
    color: #232a7c;
    font-size: 1.15rem;
    margin: 0;
    font-weight: 500;
}
.dashboard-header p {
    color: #232a7c;
    font-size: 1.1rem;
    margin: 0;
}

/* Tarjetas dashboard modernas */
.dashboard-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin: 0 0 28px 0;
    justify-content: center;
}
.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(18,24,102,0.10);
    border: none;
    padding: 36px 20px 28px 20px;
    min-width: 200px;
    min-height: 120px;
    margin-bottom: 0;
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
}
.card:hover {
    box-shadow: 0 8px 32px rgba(18,24,102,0.16);
    transform: translateY(-2px) scale(1.02);
}
.card .icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #388e3c;
}
.card:nth-child(1) .icon { color: #121866; }
.card:nth-child(2) .icon { color: #388e3c; }
.card:nth-child(3) .icon { color: #1976d2; }
.card:nth-child(4) .icon { color: #e53935; }
.card h3 {
    font-size: 1.1rem;
    color: #232a7c;
    font-weight: 700;
    margin-bottom: 10px;
}
.card p {
    font-size: 2.3rem;
    font-weight: 800;
    color: #121866;
    margin: 0;
}

.dashboard-extra {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 28px;
    justify-content: center;
}
.extra-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(18,24,102,0.07);
    padding: 18px 18px 14px 18px;
    min-width: 180px;
    margin-bottom: 0;
    border-left: 6px solid #121866;
    margin-right: 0;
    margin-top: 0;
    font-size: 1rem;
    font-weight: 500;
    transition: border-color 0.2s;
}
.extra-card h4 {
    color: #121866;
    font-size: 1.02rem;
    margin-bottom: 6px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.extra-card p {
    font-size: 1.08rem;
    color: #232a7c;
    margin: 0;
}
.alert-stock { border-left-color: #e53935; }
.alert-movido { border-left-color: #1976d2; }
.alert-ultimo { border-left-color: #43a047; }
.alert-categoria { border-left-color: #ffc107; }
.alert-proveedor { border-left-color: #00bcd4; }
.alert-hoy { border-left-color: #8e24aa; }
.alert-mayor { border-left-color: #388e3c; }

@media (max-width: 900px) {
    .main-content { margin-left: 70px; width: calc(100% - 70px); padding: 18px 4vw; }
    .header-empresa { padding: 0 4vw; height: 56px; min-height: 56px; margin-bottom: 18px; }
    .sidebar.collapsed ~ .main-content .header-empresa { height: 44px; min-height: 44px; }
    .logo-empresa { height: 32px; }
    .nombre-empresa { font-size: 1rem; }
    .header-logo-nombre { gap: 10px; }
    .dashboard-cards { flex-direction: column; gap: 14px; }
    .dashboard-header h2 { font-size: 1.5rem; }
    .dashboard-header .dashboard-subtitle { font-size: 1rem; }
    .dashboard-extra { flex-direction: column; gap: 10px; }
    .extra-card { min-width: 90vw; }
}

/* Dashboard estadísticas rápidas y usuario */
.header-hora .usuario {
    font-size: 1.1rem;
    color: #121866;
    font-weight: 600;
    margin-left: 18px;
}

.icon-btn svg {
    width: 22px;
    height: 22px;
}
.icon-btn i {
    font-size: 22px;
}
.icon-btn span {
    display: inline;
    margin-left: 4px;
    font-size: 1rem;
}

/* Sidebar hamburguesa y layout mejorado */
.sidebar-toggle-container {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 10px;
    padding-left: 10px;
    padding-top: 12px;
}
#toggleSidebar {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    transition: background 0.18s;
    font-size: 1.7rem;
}
#toggleSidebar:hover, #toggleSidebar:focus {
    background: rgba(255,255,255,0.13);
}
#toggleSidebar i {
    font-size: 1.7rem;
    color: #fff;
    transition: color 0.18s;
}
#toggleSidebar:hover i, #toggleSidebar:focus i {
    color: #ffc107;
}
.sidebar.collapsed {
    width: 70px !important;
    min-width: 70px !important;
    transition: width 0.25s cubic-bezier(.4,2,.6,1), min-width 0.25s;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .section-title,
.sidebar.collapsed .user-details {
    display: none !important;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center !important;
    margin-bottom: 10px !important;
}

.sidebar.collapsed .brand-logo {
    width: 32px !important;
    height: 32px !important;
}

.sidebar.collapsed .brand-logo i {
    font-size: 16px !important;
}

.sidebar.collapsed .nav-links a {
    padding: 12px 0 !important;
    justify-content: center !important;
    border-left: none !important;
    border-radius: 6px !important;
    margin: 0 8px 4px 8px !important;
}

.sidebar.collapsed .nav-links a:hover,
.sidebar.collapsed .nav-links a.active {
    background: rgba(255,255,255,0.2) !important;
    border-left: none !important;
}

.sidebar.collapsed .nav-links a i {
    font-size: 20px !important;
    width: auto !important;
}

.sidebar.collapsed .nav-section-header {
    padding: 0 8px 4px 8px !important;
    text-align: center !important;
}

.sidebar.collapsed .user-info {
    padding: 8px !important;
    justify-content: center !important;
}

.sidebar.collapsed .user-avatar {
    width: 24px !important;
    height: 24px !important;
}

.sidebar.collapsed .user-avatar i {
    font-size: 12px !important;
}

.sidebar.collapsed a.logout {
    padding: 8px 0 !important;
    width: 90% !important;
    margin: 0 auto 16px auto !important;
}

/* === Mejoras visuales para la tabla de productos === */
.table-productos .img-nombre-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}
.table-productos .img-nombre-wrap .img-col-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    background: #f7f9fc;
    display: block;
}
.table-productos .img-nombre-wrap .img-placeholder {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f0f0f0;
    color: #bbb;
    font-size: 2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}
.table-productos .nombre-producto {
    font-weight: 700;
    font-size: 1.08rem;
    color: #121866;
    margin-bottom: 2px;
}
.table-productos .sku-badge {
    font-size: 0.90em;
    margin-bottom: 2px;
    margin-top: 2px;
    background: #e3e6fa;
    color: #232a7c;
    font-weight: 500;
    border-radius: 6px;
    padding: 2px 10px;
    display: inline-block;
    cursor: help;
}
.table-productos .desc-producto {
    font-size: 0.93em;
    color: #888;
    margin-top: 2px;
    display: block;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 900px) {
    .table-productos .img-nombre-wrap { flex-direction: column; align-items: flex-start; gap: 6px; }
    .table-productos .img-nombre-wrap .img-col-img, .table-productos .img-nombre-wrap .img-placeholder { width: 44px; height: 44px; font-size: 1.3rem; }
    .table-productos .desc-producto { max-width: 120px; }
}

.header-empresa {
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 12px rgba(18,24,102,0.08);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 70px;
    min-height: 70px;
    margin-bottom: 32px;
    border-radius: 14px;
    z-index: 20;
    position: relative;
    transition: margin-left 0.25s cubic-bezier(.4,2,.6,1), width 0.25s cubic-bezier(.4,2,.6,1);
}
.sidebar.collapsed ~ .main-content .header-empresa {
    padding-left: 18px;
    height: 60px;
    min-height: 60px;
}
.header-logo-nombre {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 100%;
}
.logo-empresa {
    height: 48px;
    width: auto;
    display: block;
    object-fit: contain;
}
.nombre-empresa {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #121866;
    text-align: left;
    line-height: 1.1;
    margin-left: 0;
}
@media (max-width: 900px) {
    .header-empresa { padding: 0 4vw; height: 56px; min-height: 56px; margin-bottom: 18px; }
    .sidebar.collapsed ~ .main-content .header-empresa { height: 44px; min-height: 44px; }
    .logo-empresa { height: 32px; }
    .nombre-empresa { font-size: 1rem; }
    .header-logo-nombre { gap: 10px; }
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    margin-top: 8px;
}
.sidebar .logo-empresa {
    height: 48px;
    width: auto;
    display: block;
    margin-bottom: 8px;
}
.sidebar-nombre-empresa {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 0;
    letter-spacing: 0.2px;
}
@media (max-width: 900px) {
    .sidebar-brand { margin-bottom: 10px; }
    .sidebar .logo-empresa { height: 32px; }
    .sidebar-nombre-empresa { font-size: 0.85rem; }
}

.dashboard-graficas {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    margin-top: 48px;
    justify-content: center;
}
.grafica-card {
    flex: 1 1 380px;
    min-width: 320px;
    max-width: 480px;
    background: #fff;
    padding: 28px 18px 18px 18px;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(18,24,102,0.10);
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1.5px solid #e3e6f0;
}
.grafica-card h3 {
    color: #121866;
    font-size: 1.13rem;
    margin-bottom: 18px;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.grafica-card canvas {
    display: block;
    width: 340px !important;
    height: 340px !important;
    max-width: 100vw;
    max-height: 60vw;
    aspect-ratio: 1/1;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(18,24,102,0.07);
}
.grafica-card.barras {
    align-items: stretch;
    overflow-x: auto;
    padding: 18px 0 18px 0;
}
.grafica-card.barras canvas {
    width: 100% !important;
    height: 340px !important;
    max-width: 520px;
    min-width: 240px;
    max-height: 400px;
    display: block;
    margin: 0 auto;
}
@media (max-width: 900px) {
    .dashboard-graficas { flex-direction: column; gap: 18px; margin-top: 24px; }
    .grafica-card { max-width: 98vw; }
    .grafica-card canvas { width: 90vw !important; height: 90vw !important; max-width: 350px; max-height: 350px; }
    .grafica-card.barras canvas { width: 100% !important; height: 240px !important; max-width: 98vw; max-height: 300px; }
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 0 32px 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.header-empresa {
    margin-bottom: 0;
    border-radius: 18px 18px 0 0;
}

.header-hora {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: #fff;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 2px 8px rgba(18,24,102,0.07);
    padding: 12px 32px;
    margin-bottom: 18px;
    gap: 18px;
}

.dashboard-header {
    margin-bottom: 18px;
    padding: 0 8px;
}

.dashboard-cards {
    margin-bottom: 18px;
    gap: 32px;
}

.dashboard-extra {
    margin-bottom: 18px;
    gap: 18px;
}

.dashboard-graficas {
    margin-top: 32px;
    gap: 32px;
}

@media (max-width: 1300px) {
    .dashboard-container { max-width: 98vw; }
}
@media (max-width: 900px) {
    .dashboard-container { padding: 8px 0; gap: 18px; }
    .header-hora { padding: 8px 8vw; gap: 8px; }
}

/* --- Compact Sidebar Footer --- */
.compact-footer {
    padding: 10px 12px 12px 12px !important;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.07);
}
.compact-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
}
.compact-avatar {
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,0.10);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.compact-avatar i {
    font-size: 13px;
    color: #fff;
}
.compact-details {
    flex: 1;
    min-width: 0;
}
.compact-details .user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0;
}
.compact-details .user-role {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.7);
}
.compact-logout {
    margin-top: 0;
    margin-bottom: 0;
    padding: 7px 0 7px 0 !important;
    font-size: 0.95rem !important;
    border-radius: 6px !important;
    width: 100% !important;
    min-height: unset !important;
    background: #e53935 !important;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow: 0 1px 4px rgba(229,57,53,0.08) !important;
}
.compact-logout i {
    font-size: 16px !important;
}
.compact-logout .nav-text {
    font-size: 0.95rem !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* --- Compact Sidebar Header --- */
.sidebar-header-compact {
    padding: 10px 0 8px 0 !important;
    min-height: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand-compact {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px !important;
    margin-top: 0 !important;
}
.brand-logo-compact {
    width: 28px !important;
    height: 28px !important;
    background: rgba(255,255,255,0.10);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.brand-logo-compact i {
    font-size: 15px !important;
    color: #fff;
}
.brand-text-compact {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
}
.brand-text-compact h1 {
    font-size: 0.92rem !important;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
    color: #fff;
}
.brand-text-compact p {
    font-size: 0.68rem !important;
    margin: 0;
    opacity: 0.7;
    color: #fff;
    line-height: 1.1;
}

/* --- Ultra Compact Sidebar Footer --- */
.ultra-compact-footer {
    padding: 2px 4px 2px 4px !important;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: none;
}
.ultra-compact-user-row {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
    width: 100%;
}
.ultra-compact-avatar {
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
}
.ultra-compact-name {
    font-size: 0.75rem;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}
.ultra-compact-logout {
    margin-left: auto;
    color: #fff;
    background: none;
    border: none;
    padding: 2px 4px;
    border-radius: 50%;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.ultra-compact-logout:hover {
    background: #e53935;
    color: #fff;
}

/* --- Mid Compact Sidebar Footer (equilibrado) --- */
.mid-compact-footer {
    padding: 7px 10px 10px 10px !important;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.04);
}
.mid-compact-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    width: 100%;
}
.mid-compact-avatar {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
}
.mid-compact-name {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}
.mid-compact-logout {
    margin-left: auto;
    color: #fff;
    background: #e53935;
    border: none;
    padding: 5px 12px 5px 8px;
    border-radius: 7px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, color 0.15s;
    box-shadow: 0 1px 4px rgba(229,57,53,0.08);
    text-decoration: none;
}
.mid-compact-logout:hover {
    background: #b71c1c;
    color: #fff;
}
.mid-compact-logout i {
    font-size: 15px;
}
.mid-compact-logout .logout-text {
    font-size: 0.95rem;
    margin: 0;
    padding: 0;
    font-weight: 500;
}

.form-row-horizontal {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.form-row-horizontal label {
    min-width: 120px;
    margin-bottom: 0;
    font-weight: 600;
    color: #232a7c;
    flex-shrink: 0;
}
.form-row-horizontal input,
.form-row-horizontal small {
    flex: 1 1 0%;
}
.form-row-horizontal .input-group {
    flex: 1 1 0%;
}
.form-row-horizontal .form-control {
    margin-bottom: 0;
}

/* --- Mejora: Logout compacto en sidebar colapsado --- */
.sidebar.collapsed .mid-compact-logout .logout-text {
    display: none !important;
}
.sidebar.collapsed .mid-compact-logout {
    padding: 5px 8px !important;
    border-radius: 50% !important;
    min-width: 0 !important;
    width: 36px !important;
    justify-content: center !important;
    font-size: 1.2rem !important;
}
