/* =============================================
   ESTILOS BASE - Sistema POS
   Solo variables de color y estilos base
   Cada página tiene sus propios estilos inline
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #1e3a5f;
    --primary-light: #2d5a8e;
    --primary-dark: #0f2440;
    --primary-subtle: #e8eef6;
    --accent: #0d9488;
    --accent-light: #14b8a6;
    --accent-dark: #0f766e;
    --accent-subtle: #ccfbf1;
    --electric: #2563eb;
    --electric-light: #3b82f6;
    --electric-dark: #1d4ed8;
    --electric-subtle: #dbeafe;
    --success: #0d9488;
    --success-dark: #0f766e;
    --success-subtle: #ccfbf1;
    --warning: #d97706;
    --warning-dark: #b45309;
    --warning-subtle: #fef3c7;
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --danger-subtle: #fee2e2;
    --info: #2563eb;
    --info-subtle: #dbeafe;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-subtle: #f8fafc;
    --gradient-primary: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
    --gradient-accent: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    --gradient-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    --gradient-info: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    --gradient-warning: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    --gradient-sidebar: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --gradient-header: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
    --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
    --shadow-glow-accent: 0 4px 14px rgba(13, 148, 136, 0.35);
    --shadow-glow-blue: 0 4px 14px rgba(37, 99, 235, 0.35);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================
   ESTILOS COMPARTIDOS ENTRE PÁGINAS
   (Sidebar, header, nav, etc. - comunes)
   ============================================= */

.hamburger-btn {
    display: flex;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    padding: 8px;
    margin-right: 15px;
    cursor: pointer;
    transition: all var(--transition);
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar {
    width: 260px;
    background: var(--gradient-sidebar);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

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

.sidebar-overlay.active {
    display: block;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    position: relative;
}

.close-sidebar-btn {
    display: flex;
    position: absolute;
    right: 15px;
    top: 15px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
}

.close-sidebar-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-logo {
    font-size: 24px;
    color: var(--accent-light);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 15px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
}

.sidebar-nav .nav-link.active {
    background: rgba(13, 148, 136, 0.2);
    color: #fff;
    font-weight: 600;
}

.sidebar-nav .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.offline-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

.offline-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.header {
    background: var(--gradient-header);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.header h1 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin: 0;
    margin-left: 10px;
}

@media (max-width: 600px) {
    .header p {
        display: none;
    }
}

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

/* =============================================
   UTILIDADES COMPARTIDAS
   ============================================= */

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

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-body {
    padding: 22px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-800);
    background: var(--bg-card);
    transition: all var(--transition);
    outline: none;
}

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

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--gradient-accent);
    color: #fff;
}

.btn-success:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--gradient-danger);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* =============================================
   MODAL COMPARTIDO
   ============================================= */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large {
    max-width: 600px;
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-body {
    padding: 22px 24px;
}

.modal-footer {
    padding: 16px 24px 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* =============================================
   TOAST
   ============================================= */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    max-width: 360px;
}

.toast.success { background: var(--accent); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--electric); }

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

/* =============================================
   RESPONSIVE COMPARTIDO
   ============================================= */

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
}
