/* ============================================
   MAIN.CSS - Design system del panel
   Variables, layout, navbar, componentes globales.
   Las páginas del panel cargan main + responsive;
   los módulos añaden su CSS específico (products, caja, etc.).
   ============================================ */

/* Variables CSS - Base del panel */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    /* Aliases para módulos que usan nombres distintos */
    --color-primario: #2563eb;
    --color-primario-oscuro: #1e40af;
    --primary-color-dark: #1e40af;
    --bg-secondary: #f1f5f9;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px 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);
}

/* Modo oscuro: se activa con data-theme="dark" en <html> */
html[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --bg-secondary: #1e293b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px 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);
    /* Colores de estado se mantienen; primario/secundario los define la empresa o el default */
}

/* 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-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow: visible;
    position: relative;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

/* Menú Hamburguesa */
.menu-toggle {
    display: none; /* Se mostrará automáticamente cuando los links no quepan */
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    flex-shrink: 0;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

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

/* Menú Lateral Móvil */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    background: var(--card-bg);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.mobile-menu-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu-user-info strong {
    font-size: 1rem;
    color: var(--text-color);
}

.menu-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.menu-close:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.mobile-menu-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    position: relative;
}

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

.mobile-menu-link.active {
    background: rgba(37, 99, 235, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.mobile-notifications-badge {
    margin-left: auto;
    background: var(--error-color);
    color: white;
    border-radius: 12px;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0 0.5rem;
}

.mobile-menu-link.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.menu-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.menu-badge {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    background: var(--text-muted);
    color: white;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.mobile-menu-footer {
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

/* Botón de tema en menú móvil: mismo aspecto que un link */
button.theme-toggle-btn-mobile {
    width: 100%;
    border: none;
    background: none;
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.mobile-menu-link.logout {
    color: var(--error-color);
}

.mobile-menu-link.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--error-color);
    color: var(--error-color);
}

/* Submenús móviles */
.mobile-menu-group {
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-toggle {
    cursor: pointer;
    user-select: none;
}

.menu-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.mobile-menu-group.active .menu-arrow {
    transform: rotate(90deg);
}

.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--bg-color);
}

.mobile-menu-group.active .mobile-submenu {
    max-height: 500px;
}

.mobile-submenu-link {
    padding-left: 3rem;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
}

.mobile-submenu-link.active {
    background: rgba(37, 99, 235, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

.breadcrumbs-current {
    color: var(--text-color);
    font-weight: 500;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    justify-content: space-between;
    overflow: visible;
    position: relative;
    min-width: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    flex-wrap: nowrap;
    overflow: visible;
    flex: 1;
    min-width: 0;
    position: relative;
}

.nav-links::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Brand link dentro del nav-links */
.nav-brand-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.35rem 0.6rem;
    margin-right: 0.5rem;
    border-right: 1px solid var(--border-color);
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
    line-height: 1.2;
}

.nav-brand-logo {
    height: 28px;
    max-width: 100px;
    object-fit: contain;
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    line-height: 1.1;
}

.nav-brand-text > span:first-child {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.nav-brand-sucursal {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.nav-brand-link:hover {
    color: var(--primary-dark);
    background-color: rgba(37, 99, 235, 0.05);
    border-radius: 6px;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

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

.nav-link-active {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-link-active:hover {
    background-color: rgba(37, 99, 235, 0.15);
}

/* Dropdown Desktop */
.nav-dropdown {
    position: relative;
    z-index: 1001;
    overflow: visible;
}

.nav-link-dropdown {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.dropdown-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s;
    cursor: pointer;
    user-select: none;
    opacity: 0.7;
}

.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu - Estilos base (igual que el dropdown del usuario) */
.nav-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1002;
    padding: 0.5rem 0;
    overflow: hidden;
}

/* Dropdown abierto por JavaScript (clase .open) - igual que el dropdown del usuario */
.nav-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: var(--bg-color);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.dropdown-item.active {
    background: rgba(37, 99, 235, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

.nav-link-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* User Dropdown */
.nav-user-dropdown {
    position: relative;
    flex-shrink: 0;
    margin-left: 0.25rem;
}

.nav-user-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
}

.nav-user-toggle:hover {
    opacity: 0.8;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.nav-user-toggle:hover .nav-user-info {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.nav-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
}

.nav-user-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: nowrap;
}

.nav-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.2;
    white-space: nowrap;
}

.nav-user-arrow {
    font-size: 0.625rem;
    color: var(--text-muted);
    transition: transform 0.2s;
    margin-left: 0.25rem;
}

.nav-user-dropdown.active .nav-user-arrow {
    transform: rotate(180deg);
}

.nav-user-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 240px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.nav-user-dropdown.active .nav-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-user-menu-header {
    padding: 1rem;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.nav-user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    overflow: hidden;
}

.nav-user-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-user-menu-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.nav-user-menu-info strong {
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-user-menu-info .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    align-self: flex-start;
}

.nav-user-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.nav-user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
}

.nav-user-menu-item:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-user-menu-item-danger {
    color: var(--error-color);
}

.nav-user-menu-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.nav-user-menu-group {
    position: relative;
}

.nav-user-menu-toggle {
    cursor: pointer;
}

.nav-user-submenu {
    background: var(--bg-color);
    padding-left: 2rem;
}

.nav-user-submenu-item {
    padding-left: 2.5rem;
    font-size: 0.875rem;
}

.nav-user-submenu-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.nav-user-menu-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 70px);
}

/* Auth: contenedor base (detalle en auth.css) */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

.btn-danger:hover {
    filter: brightness(0.9);
}

/* Alerts */
.flash-messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #065f46;
    border: 1px solid var(--success-color);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.15);
    color: #991b1b;
    border: 1px solid var(--error-color);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: #92400e;
    border: 1px solid var(--warning-color);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.15);
    color: #1e40af;
    border: 1px solid var(--info-color);
}

/* Dashboard */
.dashboard-container {
    padding: 1rem 0;
}

.dashboard-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    flex: 1;
}

.dashboard-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.header-right {
    display: flex;
    align-items: center;
}

.date-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.date-icon {
    font-size: 1.25rem;
}

.date-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Secciones del dashboard */
.dashboard-section {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

/* Estadísticas/Indicadores */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
    border-left: 4px solid;
}

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

.stat-card.stat-primary {
    border-left-color: var(--primary-color);
}

.stat-card.stat-success {
    border-left-color: var(--success-color);
}

.stat-card.stat-warning {
    border-left-color: var(--warning-color);
}

.stat-card.stat-info {
    border-left-color: var(--info-color);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 10px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0; /* Permite que el contenido se ajuste correctamente */
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.stat-subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.25rem;
}

.stat-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    vertical-align: middle;
}

.alert-badge {
    background: var(--warning-color);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Acciones rápidas */
.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.dashboard-action-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
    border: 2px solid transparent;
    position: relative;
}

.dashboard-action-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.dashboard-action-card.action-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.dashboard-action-card.action-disabled::after {
    content: 'Próximamente';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--text-muted);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.action-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 10px;
    flex-shrink: 0;
}

.action-content {
    flex: 1;
}

.action-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
    font-weight: 600;
}

.action-content p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.action-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: all 0.2s;
    flex-shrink: 0;
}

.dashboard-action-card:hover .action-arrow {
    color: var(--primary-color);
    transform: translateX(4px);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.card-body {
    padding: 1.25rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.card-body p {
    margin-bottom: 0.75rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.card-body p:last-child {
    margin-bottom: 0;
}

/* Resumen del día */
.resumen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.resumen-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.resumen-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.resumen-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .resumen-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .resumen-item {
        padding: 0.875rem;
    }
    
    .resumen-value {
        font-size: 1.25rem;
    }
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background-color: rgba(37, 99, 235, 0.15);
    color: var(--primary-dark);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #065f46;
}

.badge-info {
    background-color: rgba(59, 130, 246, 0.15);
    color: #0c4a6e;
}

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

.hidden {
    display: none !important;
}

/* Tarjeta de alerta de stock bajo */
.alert-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border-left: 4px solid var(--warning-color);
}

.alert-warning-card {
    border-left-color: var(--warning-color);
}

.alert-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-icon {
    font-size: 1.5rem;
}

.alert-header h3 {
    flex: 1;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.alert-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.alert-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.alert-products {
    padding: 1rem 1.25rem;
}

.alert-product-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.product-code {
    font-weight: 600;
    color: var(--text-color);
    min-width: 80px;
    font-size: 0.9rem;
}

.product-name {
    flex: 1;
    color: var(--text-color);
    font-size: 0.95rem;
}

.product-stock {
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.stock-low {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

/* Footer */
.main-footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    margin-top: 3rem;
    text-align: center;
}

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

.footer-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.footer-text strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Responsive - General */
@media (max-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .dashboard-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive: layout, navbar y dashboard - Tablets */
@media (max-width: 1200px) and (min-width: 769px) {
    .nav-container {
        padding: 0.45rem 0.875rem;
    }
    
    .nav-brand-link {
        font-size: 0.85rem;
        padding: 0.3rem 0.5rem;
        margin-right: 0.4rem;
    }
    
    .nav-brand-text > span:first-child {
        max-width: 120px;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
    }
    
    .nav-user-info {
        padding: 0.3rem 0.5rem;
    }
    
    .nav-user-name {
        font-size: 0.75rem;
    }
    
    .nav-user-role {
        font-size: 0.65rem;
    }
    
    .nav-notifications-toggle {
        padding: 0.3rem;
    }
    
    .nav-notifications-icon {
        font-size: 1.1rem;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .nav-links {
        gap: 0.1rem;
        overflow-x: auto;
        overflow-y: visible;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-links::-webkit-scrollbar {
        display: none;
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.45rem;
        white-space: nowrap;
    }
    
    .nav-brand-text > span:first-child {
        max-width: 100px;
        font-size: 0.8rem;
    }
    
    .nav-brand-sucursal {
        font-size: 0.65rem;
        max-width: 100px;
    }
    
    .nav-user-details {
        display: none; /* Ocultar nombre y rol en tablets pequeñas */
    }
    
    .nav-user-arrow {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .nav-container {
        padding: 0.5rem 0.75rem;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }
    
    /* En móvil siempre mostrar hamburguesa */
    .menu-toggle {
        display: flex !important;
        flex-shrink: 0;
    }
    
    .nav-menu {
        display: none !important;
    }
    
    .nav-brand-link {
        display: none;
    }
    
    /* Mostrar solo iconos en móvil */
    .nav-notifications-toggle {
        padding: 0.4rem;
        min-width: 40px;
        min-height: 40px;
    }
    
    .nav-notifications-icon {
        font-size: 1.2rem;
    }
    
    .nav-user-info {
        padding: 0.3rem 0.5rem;
        gap: 0.4rem;
    }
    
    .nav-user-avatar {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .nav-user-name {
        font-size: 0.75rem;
    }
    
    .nav-user-role {
        font-size: 0.65rem;
    }
    
    .nav-user-details {
        display: none; /* Ocultar nombre y rol en móvil muy pequeño */
    }
}
    
    .breadcrumbs {
        font-size: 0.8125rem;
        padding: 0.5rem 0;
        margin-bottom: 1rem;
    }
    
    .dashboard-container {
        padding: 0.5rem 0;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem;
        font-weight: 700;
        margin-bottom: 0.25rem;
    }
    
    .subtitle {
        font-size: 0.875rem;
    }
    
    .header-right {
        width: 100%;
        justify-content: flex-start;
    }
    
    .date-badge {
        width: 100%;
        justify-content: center;
        padding: 0.625rem 1rem;
    }
    
    .date-icon {
        font-size: 1.1rem;
    }
    
    .date-text {
        font-size: 0.875rem;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.875rem;
        margin-bottom: 1.5rem;
    }
    
    .stat-card {
        padding: 1rem;
        gap: 0.75rem;
        flex-direction: row;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.75rem;
    }
    
    .stat-content {
        min-width: 0;
    }
    
    .stat-label {
        font-size: 0.8125rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
        margin-left: 0.25rem;
    }
    
    .dashboard-section {
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    
    .dashboard-actions {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-action-card {
        padding: 1.25rem;
    }
    
    .action-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .action-content h3 {
        font-size: 1.125rem;
    }
    
    .action-content p {
        font-size: 0.8125rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .alert-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .alert-header h3 {
        font-size: 1rem;
    }
    
    .alert-link {
        font-size: 0.8125rem;
    }
    
    .alert-products {
        padding: 0.75rem 1rem;
    }
    
    .alert-product-item {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.625rem 0;
    }
    
    .product-code {
        min-width: auto;
        font-size: 0.8125rem;
    }
    
    .product-name {
        font-size: 0.875rem;
        flex: 1 1 100%;
    }
    
    .product-stock {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
    
    .main-footer {
        padding: 1rem;
        margin-top: 2rem;
    }
    
    .footer-text {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.5rem 0.625rem;
        gap: 0.375rem;
    }
    
    .nav-brand a {
        font-size: 1rem;
    }
    
    .menu-toggle {
        width: 24px;
        height: 24px;
    }
    
    .menu-toggle span {
        height: 2px;
    }
    
    /* Ocultar detalles del usuario en móvil muy pequeño */
    .nav-user-details {
        display: none;
    }
    
    .nav-user-arrow {
        display: none;
    }
    
    .nav-user-info {
        padding: 0.25rem 0.35rem;
        gap: 0.25rem;
    }
    
    .nav-user-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.375rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.875rem;
        flex-direction: row;
    }
    
    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
        flex-shrink: 0;
    }
    
    .stat-value {
        font-size: 1.375rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .resumen-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .resumen-item {
        padding: 0.75rem;
    }
    
    .resumen-value {
        font-size: 1.125rem;
    }
    
    .resumen-label {
        font-size: 0.75rem;
    }
    
    .dashboard-action-card {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .action-icon {
        width: 44px;
        height: 44px;
        font-size: 1.75rem;
    }
    
    .action-content h3 {
        font-size: 1rem;
    }
    
    .action-content p {
        font-size: 0.75rem;
    }
    
    .action-arrow {
        font-size: 1.25rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-header h3 {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    .card-body p {
        margin-bottom: 0.5rem;
        font-size: 0.875rem;
    }
    
    .alert-header {
        padding: 0.875rem;
    }
    
    .alert-header h3 {
        font-size: 0.9375rem;
    }
    
    .alert-products {
        padding: 0.625rem 0.875rem;
    }
    
    .alert-product-item {
        padding: 0.5rem 0;
    }
}

@media (max-width: 360px) {
    .main-content {
        padding: 0.75rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.25rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .dashboard-action-card {
        padding: 0.875rem;
    }
    
    .action-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

/* Estilos para selector de sucursal */
.nav-sucursal-selector {
    display: flex;
    align-items: center;
}

.nav-sucursal-select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--card-bg);
    color: var(--text-color);
    min-width: 140px;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Estilo para items activos en el menú del usuario */
.nav-user-menu-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-user-menu-item.active:hover {
    background: rgba(37, 99, 235, 0.15);
}

/* Estilos para selector de sucursal en menú de usuario */
.nav-user-menu-selector {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.nav-user-menu-selector-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-user-menu-selector-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-sucursal-select-user {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.8125rem;
    background: var(--card-bg);
    color: var(--text-color);
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-sucursal-select-user:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

/* Estilos para selector de sucursal en menú móvil */
.mobile-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.75rem 1rem;
}

.mobile-menu-sucursal-selector {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 0.5rem 0;
    background: var(--bg-color);
}

.mobile-menu-sucursal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.mobile-menu-sucursal-label {
    font-weight: 500;
    font-size: 0.875rem;
}

.footer-text-small {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
}

.mobile-sucursal-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Notificaciones en Navbar */
.nav-notifications {
    position: relative;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.nav-notifications-toggle {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-notifications-toggle:hover {
    background: var(--bg-color);
}

.nav-notifications-icon {
    font-size: 1.25rem;
    color: var(--text-color);
    transition: transform 0.2s;
}

.nav-notifications-toggle:hover .nav-notifications-icon {
    transform: scale(1.1);
}

.nav-notifications-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--error-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border: 2px solid var(--card-bg);
    animation: pulse-scale 2s infinite;
}

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

.nav-notifications-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 400px;
    max-width: 90vw;
    max-height: 600px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nav-notifications-panel.hidden {
    display: none !important;
}

.notifications-panel-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-panel-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.notifications-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notifications-panel-actions span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.btn-mark-all-read {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.notifications-panel-body {
    flex: 1;
    overflow-y: auto;
    max-height: 450px;
}

.notifications-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notification-item {
    padding: 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.notification-item-link {
    padding: 1rem;
    flex: 1;
    min-width: 0;
}

.notification-item-link:hover {
    background: var(--bg-color);
}

.notification-mark-read-btn {
    align-self: flex-start;
    margin: 0 1rem 0.75rem 1rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
}

.notification-mark-read-btn:hover {
    background: rgba(37, 99, 235, 0.1);
}

.notification-item.unread {
    border-left: 3px solid var(--primary-color);
}

.notification-item.unread .notification-item-link {
    background: rgba(37, 99, 235, 0.08);
}

.notification-item.read {
    opacity: 0.7;
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-icon.stock-bajo,
.notification-icon.vencimiento-proximo {
    color: var(--warning-color);
}

.notification-icon.vencido,
.notification-icon.caja-limite {
    color: var(--error-color);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notification-action {
    margin-top: 0.5rem;
}

.notification-action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.notifications-panel-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    text-align: center;
}

.notifications-view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.notifications-view-all:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.notifications-loading {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.notifications-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    display: none;
}

.notifications-empty.show {
    display: block;
}

/* Responsive para notificaciones */
@media (max-width: 768px) {
    .nav-notifications-panel {
        width: 90vw;
        right: 5vw;
        max-height: 70vh;
    }
    
    .nav-notifications-toggle {
        display: flex !important;
    }
}

@media (max-width: 480px) {
    .nav-notifications-panel {
        width: 95vw;
        right: 2.5vw;
        max-height: 80vh;
    }
    
    .notifications-panel-header {
        padding: 0.875rem;
    }
    
    .notifications-panel-header h3 {
        font-size: 1rem;
    }
    
    .notifications-panel-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-end;
    }
    
    .btn-mark-all-read {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .notifications-panel-body {
        max-height: 50vh;
    }
}

/* ============================================
   ESTILOS RESPONSIVE GLOBALES PARA MODALES
   ============================================ */

/* Modales con estilos inline - Convertir a clases */
.modal-inline {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    overflow-y: auto;
}

.modal-inline.show {
    display: flex !important;
}

.modal-inline-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-inline-content-lg {
    max-width: 800px;
}

.modal-inline-content-xl {
    max-width: 900px;
}

.modal-inline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-inline-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.modal-inline-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-inline-close:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

/* Responsive para modales inline */
@media (max-width: 768px) {
    .modal-inline {
        padding: 0.5rem;
        align-items: flex-start;
    }
    
    .modal-inline-content {
        width: 95%;
        max-width: 100%;
        padding: 1.5rem;
        margin: 1rem 0;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-inline-content-lg,
    .modal-inline-content-xl {
        max-width: 100%;
    }
    
    .modal-inline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .modal-inline-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-inline-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 480px) {
    .modal-inline-content {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .modal-inline-header h2 {
        font-size: 1.125rem;
    }
}

/* ============================================
   RESPONSIVE PARA FORMULARIOS
   ============================================ */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Utilidades para formularios y modales (evitar inline) */
.form-group-full { grid-column: 1 / -1; }
.form-group-section {
    grid-column: 1 / -1;
    border-top: 2px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 1rem;
}
.subsection-title { margin-bottom: 1rem; font-size: 1.125rem; }
.form-hint-block {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}
.label-inline { display: flex; align-items: center; gap: 0.5rem; }
.label-inline.cursor-pointer { cursor: pointer; }
.checkbox-inline { width: auto; cursor: pointer; }
.modal-actions { margin-top: 1.5rem; display: flex; gap: 1rem; justify-content: flex-end; }
.modal-header-sub { margin: 0.5rem 0 0 0; color: var(--text-muted); font-size: 0.9rem; }
.modal-toolbar { margin-bottom: 1.5rem; }
.modal-title-clean { margin: 0; }
.modal-body-text { margin-bottom: 1rem; color: var(--text-muted); }
.form-group-mb { margin-bottom: 1.5rem; }
.form-group-mt { margin-top: 1.5rem; }
.info-text-small { margin-top: 0.5rem; font-size: 0.875rem; color: var(--text-muted); }
.label-block { display: block; margin-bottom: 0.75rem; font-weight: 600; }
.mt { margin-top: 0.5rem; }
.mb { margin-bottom: 0.5rem; }
.cai-hint { color: var(--warning-color, #92400e); }
.btn-ml { margin-left: 0.5rem; }
.flex-col { display: flex; flex-direction: column; }
.pedido-total-label { font-size: 1.25rem; color: var(--primary-color); }
.text-error { color: var(--error-color); }
.pedido-resumen-box { max-width: 400px; margin-left: auto; }
.observaciones-pedido { color: var(--text-color); line-height: 1.6; }
.detalle-item-full { grid-column: 1 / -1; }
.info-block { display: block; margin-top: 0.5rem; color: var(--text-muted); font-size: 0.8125rem; }
.modal-select-actions { display: flex; gap: 1rem; justify-content: flex-end; }
.input-file-hidden { display: none; }
.display-none { display: none; }
.text-right { text-align: right; }
.form-actions-right { margin-top: 1.5rem; text-align: right; }
.form-actions-end { margin-top: 2rem; display: flex; gap: 1rem; justify-content: flex-end; }
.perfil-section-center { text-align: center; }
.perfil-name { margin: 1rem 0 0.5rem 0; font-size: 1.5rem; font-weight: 600; color: var(--text-color); }
.badge-rol { display: inline-block; padding: 0.375rem 0.75rem; border-radius: 12px; font-size: 0.875rem; font-weight: 500; }
.input-readonly-bg { background: var(--bg-secondary); cursor: not-allowed; }
.password-section-title { margin: 2rem 0 1rem 0; padding-top: 2rem; border-top: 2px solid var(--border-color); font-size: 1.25rem; font-weight: 600; color: var(--text-color); }
.form-hint-muted { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.875rem; }
.info-item-full { grid-column: 1 / -1; }
.info-item-full-border { grid-column: 1 / -1; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-color); }
.modal-content-w800 { max-width: 800px; }
.flex-row-center { display: flex; gap: 1rem; align-items: center; }
.flex-row-gap { display: flex; gap: 1rem; }
.flex-1 { flex: 1; }
.flex-row-inline { display: flex; gap: 0.5rem; }
.btn-validar-mt { margin-top: 0.5rem; }
.btn-horarios-gray { background: var(--text-muted, #6b7280); color: white; }
.logo-upload-emoji { font-size: 3rem; margin-bottom: 0.5rem; }
.config-hint-mb { margin-bottom: 1rem; }
.config-box-info {
    background: var(--bg-secondary);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.config-box-info + .config-box-info { margin-bottom: 0; }
.config-box-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; margin-bottom: 0.75rem; cursor: pointer; }
.config-box-label-mt { margin-top: 1rem; }
.config-box-label input[type="checkbox"] { width: auto; cursor: pointer; }
.config-box-nested { margin-left: 1.75rem; font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }
.config-box-nested .nested-item { margin-bottom: 0.75rem; padding: 0.5rem; background: var(--card-bg); border-radius: 4px; }
.config-box-nested .nested-item:last-child { margin-bottom: 0; }
.config-box-nested strong.text-success { color: var(--success-color); }
.config-box-nested strong.text-danger { color: var(--error-color); }
.metodos-pago-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.btn-primary-padding { padding: 0.75rem 2rem; }
.form-hint-ml { margin-left: 1.75rem; }
.form-hint-ml.mb { margin-bottom: 0.5rem; }
.form-hint-ml.mt { margin-top: 0.5rem; }
.cai-box-warning {
    background: var(--bg-secondary);
    border: 2px solid var(--warning-color, #f59e0b);
    border-radius: 8px;
    padding: 1rem;
}
.cai-box-title { margin: 0 0 1rem 0; font-size: 1rem; color: var(--warning-color, #d97706); }
.form-grid-inline { margin-top: 1rem; }

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* ============================================
   RESPONSIVE PARA PÁGINA DE VENTAS NUEVA
   ============================================ */

@media (max-width: 1024px) {
    .venta-container {
        grid-template-columns: 1fr;
    }
    
    .venta-right {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .venta-container {
        gap: 1rem;
    }
    
    .venta-right {
        padding: 1rem;
    }
    
    .search-box-large {
        flex-direction: column;
    }
    
    .search-box-large button {
        width: 100%;
    }
}

/* ============================================
   RESPONSIVE PARA PÁGINA DE CAJA
   (Los estilos completos están en caja.css)
   ============================================ */

/* ============================================
   RESPONSIVE PARA MODALES ESTÁNDAR
   ============================================ */

@media (max-width: 768px) {
    .modal {
        padding: 0.5rem;
        align-items: flex-start;
    }
    
    .modal-content {
        width: 95%;
        max-width: 100%;
        margin: 1rem 0;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-sm,
    .modal-md,
    .modal-lg,
    .modal-xl {
        max-width: 100%;
    }
    
    .modal-header {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .modal-header h2 {
        font-size: 1.125rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 0;
        border-radius: 8px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.875rem;
    }
}

/* ============================================
   RESPONSIVE PARA BOTONES Y ACCIONES
   ============================================ */

@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .header-actions .btn {
        width: 100%;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

/* ============================================
   RESPONSIVE PARA NAVBAR
   ============================================ */

@media (max-width: 768px) {
    .nav-notifications {
        margin-right: 0.5rem;
    }
    
    .nav-notifications-toggle {
        padding: 0.375rem;
        min-width: 40px;
        min-height: 40px;
    }
    
    .nav-notifications-icon {
        font-size: 1.2rem;
    }
    
    .nav-user-dropdown {
        margin-left: 0.25rem;
    }
    
    .nav-user-info {
        padding: 0.3rem 0.5rem;
        gap: 0.4rem;
    }
    
    .nav-user-avatar {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .nav-user-name {
        font-size: 0.75rem;
    }
    
    .nav-user-role {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.5rem 0.625rem;
        gap: 0.375rem;
    }
    
    .nav-notifications,
    .nav-user-dropdown {
        margin-left: 0.2rem;
        margin-right: 0.2rem;
    }
    
    .nav-notifications-toggle {
        padding: 0.3rem;
        min-width: 36px;
        min-height: 36px;
    }
    
    .nav-notifications-icon {
        font-size: 1rem;
    }
    
    .nav-user-info {
        padding: 0.25rem 0.35rem;
        gap: 0.25rem;
    }
    
    .nav-user-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
    
    .nav-user-details {
        display: none; /* Ocultar nombre y rol en móvil muy pequeño */
    }
    
    .nav-user-arrow {
        display: none; /* Ocultar flecha en móvil muy pequeño */
    }
    
    .nav-notifications-badge {
        width: 18px;
        height: 18px;
        font-size: 0.6875rem;
        top: -2px;
        right: -2px;
    }
}

@media (max-width: 360px) {
    .nav-notifications-toggle {
        padding: 0.25rem;
        min-width: 36px;
        min-height: 36px;
    }
    
    .nav-notifications-icon {
        font-size: 1rem;
    }
    
    .nav-notifications-badge {
        width: 16px;
        height: 16px;
        font-size: 0.625rem;
    }
    
    .mobile-notifications-badge {
        min-width: 20px;
        height: 20px;
        font-size: 0.6875rem;
    }
}

