/* Bordes sentimentales para tabs de reportes */
.tabs .tab[data-sentimiento="ventas"] {
    border: 2.5px solid var(--secondary);
}
.tabs .tab[data-sentimiento="clientes"] {
    border: 2.5px solid var(--primary);
}
.tabs .tab[data-sentimiento="fiscal"] {
    border: 2.5px solid var(--warning);
}
.tabs .tab[data-sentimiento="cuadre"] {
    border: 2.5px solid var(--danger);
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

body {
    background: var(--gray-100);
    min-height: 100vh;
    overflow-x: hidden !important;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 700;
}

.auth-logo p {
    color: var(--gray-500);
     border: 1.5px solid var(--gray-200);
     border-radius: 0.7rem !important;
     box-shadow: 0 2px 8px 0 rgba(79,70,229,0.04);
}

.form-group {
    margin-bottom: 1.25rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.7rem !important;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 15px !important;
    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);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem !important;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 15px !important;
    cursor: pointer;
    transition: all 0.2s;
    gap: 0.5rem;
}

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

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

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

.btn-success:hover {
    background: #059669;
}

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

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.35rem 0.7rem !important;
    font-size: 14px !important;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--gray-500);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #ecfdf5;
    color: var(--secondary);
    border: 1px solid #a7f3d0;
}

.layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden !important;
}

/* ─── TOP BAR STYLES ─── */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    background: var(--gray-900);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    border-bottom: 2px solid var(--gray-700);
    box-shadow: 0 2px 0 rgba(255, 255, 255, 0.05);
    height: 70px;
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-bar-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    padding: 4px;
}

.top-bar-logo-placeholder {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
}

.top-bar-text h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.top-bar-text p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.panel-label {
    font-size: 0.9rem;
    color: var(--gray-300);
    font-weight: 500;
}

.nav-toggle-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    border-radius: 0.5rem;
}

.nav-toggle-btn:hover {
    background: var(--gray-800);
}

.nav-toggle-btn svg {
    width: 24px;
    height: 24px;
}

.user-menu {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* ─── NAV BAR STYLES ─── */
.nav-bar {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 1199;
    background: #1a1f2e;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    border-bottom: 1px solid var(--gray-800);
    height: 50px;
    flex-shrink: 0;
    overflow: hidden !important;
}

.nav-items-container {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex: 1;
    overflow: hidden !important;
    padding-right: 0.5rem;
    min-width: 0;
}

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    color: var(--gray-300);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.8rem;
    border-radius: 0.4rem;
    white-space: nowrap;
    flex-shrink: 1;
    font-weight: 500;
    min-width: 0;
}

.nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--gray-700);
    color: white;
}

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

.nav-label {
    display: inline;
}

.nav-separator {
    color: rgba(148, 163, 184, 0.4);
    font-size: 0.85rem;
    font-weight: 300;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 0.1rem;
}

.nav-more-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 0.4rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.nav-more-btn:hover {
    background: var(--gray-700);
}

.nav-more-btn svg {
    width: 20px;
    height: 20px;
}

.nav-dropdown {
    position: fixed;
    top: 72px;
    left: 1.5rem;
    right: auto;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1300;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    max-height: 70vh;
    overflow-y: auto;
    min-width: 280px;
}

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

.nav-dropdown .nav-item {
    display: flex;
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: 0;
    margin: 0;
    justify-content: flex-start;
}

.nav-dropdown .nav-item:hover {
    background: var(--gray-700);
}

.nav-dropdown .nav-item.active {
    background: var(--primary);
}

.nav-user-section {
    padding: 1rem;
    border-top: 1px solid var(--gray-700);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-info-full {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-large {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.user-details {
    flex: 1;
}

.user-details h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

.user-details span {
    font-size: 0.75rem;
    color: var(--gray-400);
    display: block;
}

/* ─── RESPONSIVE ADJUSTMENTS ─── */
@media (max-width: 1440px) {
    .nav-item {
        padding: 0.4rem 0.65rem;
        font-size: 0.75rem;
    }
    
    .nav-item svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 1200px) {
    .nav-label {
        display: none;
    }
    
    .nav-item {
        padding: 0.4rem 0.5rem;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 0.5rem 1rem;
        height: 60px;
    }
    
    .panel-label {
        display: none;
    }
    
    .nav-bar {
        padding: 0 1rem;
        height: 45px;
    }
    
    .nav-items-container {
        gap: 0.1rem;
    }
    
    .nav-item {
        padding: 0.35rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .nav-more-btn {
        padding: 0.4rem;
    }
}

/* Fallback sidebar (hiden by default now) */
.sidebar {
    display: none;
}

.sidebar-header {
    padding: 0;
    border-bottom: none;
    border-right: 2px solid var(--gray-700);
    border-bottom: 2px solid var(--gray-700);
    padding-right: 1.5rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.sidebar-header h2 {
    color: var(--primary);
    font-size: 0.95rem;
    margin: 0;
    white-space: nowrap;
}

.sidebar-header p {
    color: var(--gray-400);
    font-size: 0.7rem;
    margin: 0;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 0;
    display: flex;
    gap: 0.25rem;
    align-items: center;
    overflow-x: auto;
    flex-wrap: wrap;
}

.nav-section-title {
    padding: 0.4rem 0.75rem;
    color: var(--gray-500);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-left: 1px solid var(--gray-700);
    white-space: nowrap;
}

.sidebar-footer {
    padding: 0;
    border-top: none;
    border-left: 1px solid var(--gray-800);
    padding-left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-content {
    flex: 1;
    margin-left: 0;
    margin-top: 120px;
    padding: 2rem;
    overflow-y: auto;
}

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: var(--gray-900);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    padding: 10px;
    gap: 5px;
    z-index: 1001;
    transition: background 0.2s;
}

.hamburger-btn:hover {
    background: var(--gray-800);
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header h1 {
    color: var(--gray-900);
    font-size: 1.75rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    color: var(--gray-900);
    font-size: 1.5rem;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    color: var(--gray-900);
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.stat-card .change.positive {
    color: var(--secondary);
}

.stat-card .change.negative {
    color: var(--danger);
}

.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: var(--gray-900);
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 0.45rem 0.7rem !important;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
    font-size: 15px !important;
    line-height: 1.15 !important;
}

th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover {
    background: var(--gray-50);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #ecfdf5;
    color: var(--secondary);
}

.badge-warning {
    background: #fffbeb;
    color: var(--warning);
}

.badge-danger {
    background: #fef2f2;
    color: var(--danger);
}

.badge-info {
    background: #eff6ff;
    color: #3b82f6;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.2s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--gray-400);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

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

.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.85rem 2rem;
    background: none;
    border: none;
    color: var(--gray-500);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
    border-radius: 8px 8px 0 0;
}

.tab:hover {
    color: var(--gray-700);
    background: var(--gray-50);
}

.tab.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    background: rgba(102, 126, 234, 0.08);
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

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

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

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

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

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

@media (max-width: 1024px) {
    .hamburger-btn {
        display: flex;
    }
    
    /* .sidebar y .sidebar.open eliminadas por estar vacías */
    
    .sidebar-overlay {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 1rem;
    }
    
    .page-header {
        position: sticky;
        top: 0;
        z-index: 50;
        background: var(--gray-100);
        padding: 0.75rem 0;
        margin-bottom: 1rem;
    }
    
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
    margin: 0;
}

.spinner-inline {
    display: inline-block;
    margin-right: 0.5rem;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.loading-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    color: var(--gray-500);
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }
.skeleton-text.full { width: 100%; }

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
    margin-bottom: 1rem;
}

.form-group input.invalid,
.form-group select.invalid,
.form-group textarea.invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input.valid,
.form-group select.valid,
.form-group textarea.valid {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.field-error {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.field-error::before {
    content: '!';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
}

.validation-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
    padding-right: 2.5rem;
}

.input-icon-left {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.input-wrapper input,
.input-wrapper select {
    padding-left: 2.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-500);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: var(--gray-400);
}

.empty-state h4 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state .btn {
    margin-top: 0.5rem;
}

.empty-state.empty-sm {
    padding: 2rem 1rem;
}

.empty-state.empty-sm svg {
    width: 48px;
    height: 48px;
}

.empty-state.empty-sm h4 {
    font-size: 1rem;
}

.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 380px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.18), 0 8px 16px -4px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    max-width: 380px;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0,0,0,0.05);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.toast-success { 
    background: linear-gradient(135deg, #fff 0%, #f0fdf4 100%);
    border-left: 4px solid #10b981;
}
.toast.toast-success .toast-icon { color: #10b981; }

.toast.toast-error { 
    background: linear-gradient(135deg, #fff 0%, #fef2f2 100%);
    border-left: 4px solid #ef4444;
}
.toast.toast-error .toast-icon { color: #ef4444; }

.toast.toast-warning { 
    background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
    border-left: 4px solid #f59e0b;
}
.toast.toast-warning .toast-icon { color: #f59e0b; }

.toast.toast-info { 
    background: linear-gradient(135deg, #fff 0%, #eff6ff 100%);
    border-left: 4px solid #3b82f6;
}
.toast.toast-info .toast-icon { color: #3b82f6; }

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #111827;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    padding: 0;
}
.toast-close:hover {
    background: rgba(0,0,0,0.05);
    color: #4b5563;
}

/* Eliminar bloque huérfano y regla suelta */
.toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--gray-600);
}

.progress-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

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

.card-hover {
    transition: box-shadow 0.2s, transform 0.2s;
}

.card-hover:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.input-group {
    display: flex;
}

.input-group input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* ================================
   ESTILOS RESPONSIVOS PARA MÓVILES
   ================================ */

/* Tablets pequeños */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .header-actions .btn {
        flex: 1 1 auto;
        min-width: 120px;
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
    
    .tabla-simple {
        font-size: 0.8rem;
    }
    
    .tabla-simple th,
    .tabla-simple td {
        padding: 0.5rem;
    }
    
    .modal {
        max-width: 95% !important;
        margin: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Móviles */
@media (max-width: 480px) {
    /* Texto base más pequeño */
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
    
    /* Page header */
    .page-header {
        padding: 1rem;
    }
    
    .page-header h2 {
        font-size: 1.2rem;
    }
    
    /* Header actions - botones más compactos */
    .header-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }
    
    .header-actions .btn {
        flex: 1 1 45%;
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }
    
    /* Tablas */
    .tabla-simple {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
    }
    
    .tabla-simple th,
    .tabla-simple td {
        padding: 0.4rem;
        white-space: nowrap;
    }
    
    /* Cards */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .resumen-card {
        padding: 1rem;
    }
    
    /* Formularios */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Evita zoom en iOS */
        padding: 0.6rem;
    }
    
    /* Modal */
    .modal {
        max-width: 98% !important;
        margin: 0.5rem;
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Botones */
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    /* Sidebar toggle para móviles */
    .sidebar-toggle {
        display: flex !important;
    }
    
    /* POS */
    .pos-container {
        grid-template-columns: 1fr !important;
    }
    
    .servicios-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .servicio-card {
        padding: 0.75rem;
    }
    
    /* Citas */
    .citas-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .fecha-rango {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .estado-filtro {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .estado-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .cita-card {
        padding: 0.75rem;
    }
    
    .cita-acciones {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .cita-acciones .btn {
        flex: 1 1 auto;
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
    }
    
    /* Carrito POS */
    .carrito {
        max-height: 50vh;
    }
    
    .carrito-item {
        padding: 0.5rem;
    }
    
    /* Reportes */
    .cuadre-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .cuadre-item {
        padding: 0.75rem;
    }
    
    /* Inputs con ancho completo en móviles */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        width: 100%;
    }
    
    /* Badges */
    .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Móviles muy pequeños */
@media (max-width: 360px) {
    .header-actions .btn {
        flex: 1 1 100%;
    }
    
    .estado-filtro .estado-btn {
        flex: 1 1 45%;
    }
    
    .tabla-simple {
        font-size: 0.7rem;
    }
}

/* Orientación landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
        max-height: 95vh;
        overflow-y: auto;
    }
}

/* --- UNIFICACIÓN DE FUENTE Y ESPACIADO GLOBAL --- */

html, body, * {
    font-size: 12px !important;
}


th, td {
    padding: 0.45rem 0.7rem !important;
    line-height: 1.15 !important;
    font-size: 12px !important;
}


.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.5rem 0.7rem !important;
    font-size: 12px !important;
}

.btn {
  padding: 0.55rem 1.1rem !important;
  font-size: 15px !important;
}

.btn-sm {
  padding: 0.35rem 0.7rem !important;
  font-size: 14px !important;
}

.page-header h1 {
  font-size: 1.15rem !important;
}

.card-header h3 {
  font-size: 1rem !important;
}

/* --- TABLA DE VENTAS POS NOTABLE (más compacta) --- */
.tabla-datos-notable {
  font-size: 11.5px !important;
  border-radius: 10px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,0.07);
  overflow: hidden;
}
.tabla-datos-notable thead th {
  background: #f3f4f6;
  color: #374151;
  border-bottom: 2px solid #d1d5db;
  font-size: 0.92em;
  padding: 0.45rem 0.5rem;
}
.tabla-datos-notable tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.12s;
}
.tabla-datos-notable tbody tr:nth-child(even) {
  background: #f9fafb;
}
.tabla-datos-notable td {
  padding: 0.28rem 0.38rem;
  font-size: 0.92em;
  vertical-align: middle;
}
.tabla-datos-notable .td-monto {
  font-weight: 700;
  color: #10b981;
}
.tabla-datos-notable .td-accion {
  text-align: center;
}
.tabla-datos-notable .btn-ver {
  background: #f3f4f6;
  border: none;
  border-radius: 6px;
  padding: 0.18rem 0.5rem;
  font-size: 0.85em;
  color: #2563eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3em;
  transition: background 0.15s;
}
.tabla-datos-notable .btn-ver:hover {
  background: #e0e7ef;
}
.tabla-datos-notable .venta-pos-row td {
  border-left: 3px solid #10b981;
}

/* --- Tarjetas resumen inventario --- */
.card-resumen {
  flex: 1 1 160px;
  min-width: 140px;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(16,185,129,0.07);
  padding: 1.1rem 1.2rem 0.8rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.3rem;
  transition: box-shadow 0.18s, border 0.18s;
  border: 2px solid transparent;
}
.card-resumen .resumen-label {
  font-size: 0.92em;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 0.2em;
}
.card-resumen .resumen-valor {
  font-size: 1.45em;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.card-resumen.card-neutral {
  border-color: #d1d5db;
  background: #f9fafb;
}
.card-resumen.card-info {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1e40af;
}
.card-resumen.card-success {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
}
.card-resumen.card-alert {
  border-color: #ef4444;
  background: #fef2f2;
  color: #b91c1c;
  position: relative;
}
.card-resumen.card-alert.pulse {
  animation: pulse-alert 1.2s infinite;
}
@keyframes pulse-alert {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.18); }
  70% { box-shadow: 0 0 0 8px rgba(239,68,68,0.08); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.18); }
}
