/* styles.css */

/* Global Reset & Base variables */
:root {
    --bg-app: #090a0f;
    --bg-sidebar: #0f111a;
    --bg-card: rgba(22, 25, 41, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus-primary: #4facfe;
    
    /* Text colors */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Accents & States */
    --accent-cyan: #00f2fe;
    --accent-cyan-glow: rgba(0, 242, 254, 0.15);
    
    --accent-purple: #a855f7;
    --accent-purple-glow: rgba(168, 85, 247, 0.15);
    
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.15);
    
    --accent-danger: #ef4444;
    
    --font-heading: 'Outfit', 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
    
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    width: 100%;
    -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
    z-index: 10;
    transition: var(--transition-smooth);
    overflow-y: auto;
}

/* Custom premium scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

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

.brand-logo-container {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.brand-logo-icon {
    width: 24px;
    height: 24px;
    color: white;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tagline {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
    text-align: left;
}

.nav-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    color: white;
    background: linear-gradient(90deg, rgba(0, 242, 254, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    border-left: 3px solid var(--accent-cyan);
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.nav-icon {
    width: 18px;
    height: 18px;
    transition: var(--transition-smooth);
}

.nav-btn.active .nav-icon {
    color: var(--accent-cyan);
    transform: scale(1.1);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.version-tag {
    font-size: 11px;
    color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Flag & Currency Selector Styles */
.currency-selector-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.country-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 6px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.country-ribbon.ribbon-cop {
    background: linear-gradient(135deg, rgba(252, 209, 22, 0.15) 0%, rgba(206, 17, 38, 0.15) 100%);
    border-color: #fcd116;
    color: #fcd116;
    box-shadow: 0 0 10px rgba(252, 209, 22, 0.3);
}

.country-ribbon.ribbon-mxn {
    background: linear-gradient(135deg, rgba(0, 104, 71, 0.2) 0%, rgba(206, 17, 38, 0.2) 100%);
    border-color: #10b981;
    color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.country-ribbon.ribbon-usd {
    background: linear-gradient(135deg, rgba(0, 36, 125, 0.25) 0%, rgba(207, 20, 43, 0.25) 100%);
    border-color: #3b82f6;
    color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* Document Type Switcher Buttons */
.doc-type-btn {
    transition: var(--transition-smooth);
}
.doc-type-btn.active {
    box-shadow: 0 0 14px rgba(0, 242, 254, 0.3);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: radial-gradient(circle at 80% 20%, rgba(30, 27, 75, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 10% 80%, rgba(8, 47, 73, 0.15) 0%, transparent 50%);
}

/* Top bar / Header */
.top-bar {
    height: 75px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    background-color: rgba(9, 10, 15, 0.5);
    flex-shrink: 0;
}

.store-badge-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-logo-preview {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.store-name-display {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
}

.store-branch-display {
    font-size: 11px;
    color: var(--text-secondary);
}

.scroll-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 32px;
}

/* Tab Navigation Logic */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out forwards;
}

.tab-content.active {
    display: block;
}

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

/* Cards & Containers */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(15px);
    margin-bottom: 24px;
}

.card-title-bar {
    margin-bottom: 24px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Form Design */
.grid-form {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-gap: 16px;
}

/* Generar columnas variables */
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.required {
    color: var(--accent-danger);
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="file"],
textarea {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
    color: white;
    font-family: var(--font-body);
    font-size: 14px;
    transition: var(--transition-smooth);
    width: 100%;
}

/* Desplegables Generales y Opciones de Menú (Modo Oscuro de Alto Contraste) */
select {
    background-color: #16182a !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px;
    padding: 10px 14px;
    color: #ffffff !important;
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition-smooth);
    width: 100%;
    cursor: pointer;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus-primary);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

select:focus {
    outline: none;
    border-color: var(--accent-cyan) !important;
    background-color: #1e2238 !important;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.25) !important;
}

/* Reglas universales para opciones dentro de menús desplegables (<option>) */
select option,
option {
    background-color: #121422 !important;
    color: #ffffff !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

select option:hover,
select option:focus,
select option:checked {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.input-helper {
    font-size: 11px;
    color: var(--text-muted);
}

.section-divider {
    grid-column: span 12;
    height: 1px;
    background-color: var(--border-color);
    margin: 12px 0;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.35);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-cyan {
    background-color: rgba(0, 242, 254, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.btn-cyan:hover {
    background-color: rgba(0, 242, 254, 0.18);
}

.btn-purple {
    background-color: rgba(168, 85, 247, 0.1);
    color: var(--accent-purple);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.btn-purple:hover {
    background-color: rgba(168, 85, 247, 0.18);
}

.btn-emerald {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-emerald:hover {
    background-color: rgba(16, 185, 129, 0.18);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    flex-shrink: 0;
}

.btn-icon-right {
    margin-left: auto;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

/* Dashboard / Resumen Styling */
.dashboard-header {
    margin-bottom: 28px;
}

.dashboard-header h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    grid-gap: 16px;
    margin-bottom: 24px;
}

/* Glow Cards */
.card-glow-cyan {
    border: 1px solid rgba(0, 242, 254, 0.25) !important;
    box-shadow: 0 8px 32px rgba(0, 242, 254, 0.05), var(--shadow-premium) !important;
}

.card-glow-purple {
    border: 1px solid rgba(168, 85, 247, 0.25) !important;
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.05), var(--shadow-premium) !important;
}

.card-glow-emerald {
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.05), var(--shadow-premium) !important;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon.cyan {
    background-color: rgba(0, 242, 254, 0.08);
    color: var(--accent-cyan);
}
.card-icon.purple {
    background-color: rgba(168, 85, 247, 0.08);
    color: var(--accent-purple);
}
.card-icon.emerald {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--accent-emerald);
}

.card-body .value {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
}

.card-body .subtext {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 16px 0;
}

.metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.metric .label {
    color: var(--text-muted);
}

.metric .value-small {
    font-weight: 600;
    color: var(--text-primary);
}

.highlight-cyan { color: var(--accent-cyan) !important; }
.highlight-purple { color: var(--accent-purple) !important; }
.highlight-emerald { color: var(--accent-emerald) !important; }
.highlight-white { color: white !important; }

.card-note {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Steps System */
.section-card h3 {
    font-family: var(--font-heading);
    margin-bottom: 20px;
    font-size: 16px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 20px;
}

.step-item {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 16px;
    position: relative;
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.step-item h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.step-item p {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Logo Uploader styling */
.logo-uploader {
    display: flex;
    gap: 16px;
    align-items: center;
}

.logo-preview-box {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.preview-placeholder {
    font-size: 11px;
    color: var(--text-muted);
}

.file-input {
    display: none;
}

.uploader-inputs {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

/* Grid Layout structure for tabs */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-gap: 24px;
    align-items: start;
}

.sidebar-cards {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Result rows / Summary panel */
.card-summary h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    margin-bottom: 16px;
    color: white;
}

.result-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.result-row span {
    color: var(--text-secondary);
}

.result-row.total {
    border-top: 1.5px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    font-size: 14px;
    padding-top: 14px;
    font-weight: 700;
}

.card-info-box {
    margin-top: 18px;
    background-color: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--border-focus-primary);
    padding: 12px;
    border-radius: 0 10px 10px 0;
}

.formula-text {
    font-family: monospace;
    font-size: 11px;
    color: var(--accent-cyan);
    margin: 4px 0 8px 0;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.formula-explanation {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* Cotizador breakdown */
.price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.breakdown-row span:first-child {
    color: var(--text-secondary);
}

.breakdown-row span:last-child {
    font-weight: 600;
    color: white;
}

.breakdown-row.total-cost {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.breakdown-row.final-price {
    border-top: 1.5px solid rgba(255, 255, 255, 0.1);
    padding-top: 14px;
    margin-top: 4px;
}

.breakdown-row.final-price span:first-child {
    font-family: var(--font-heading);
    font-weight: 700;
    color: white;
}

.breakdown-row.final-price span:last-child {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 20px;
    color: var(--accent-emerald);
}

/* Service Order Ticket styling */
.print-preview-card {
    background-color: rgba(18, 20, 32, 0.4);
    padding: 0;
    overflow: hidden;
}

.print-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.print-actions span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.ticket-container {
    width: 320px;
    margin: 24px auto;
    background-color: #ffffff;
    color: #000000;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    font-family: Arial, Helvetica, 'Segoe UI', sans-serif;
    font-size: 11.5px;
    line-height: 1.45;
    font-weight: 500;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.ticket-logo {
    display: block;
    max-width: 85px;
    max-height: 85px;
    margin: 0 auto 10px auto;
    filter: grayscale(1) contrast(150%);
}

.ticket-header {
    text-align: center;
    color: #000000;
}

.ticket-title {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 3px;
    color: #000000;
    letter-spacing: -0.2px;
}

.ticket-order-id {
    font-weight: 800;
    font-size: 13px;
    margin-top: 8px;
    color: #000000;
}

.ticket-divider {
    border-bottom: 2px solid #000000;
    margin: 10px 0;
}

.ticket-section h4 {
    font-weight: 800;
    margin-bottom: 4px;
    font-size: 12px;
    color: #000000;
    text-transform: uppercase;
}

.ticket-section p {
    margin: 3px 0;
    color: #000000;
    font-weight: 600;
}

.ticket-pricing .price-line {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: #000000;
}

.ticket-pricing .ticket-saldo {
    font-weight: 800;
    font-size: 12.5px;
    margin-top: 5px;
    border-top: 2px solid #000000;
    padding-top: 5px;
    color: #000000;
}

.ticket-terms {
    margin-top: 12px;
    font-size: 9.5px;
    line-height: 1.35;
    font-weight: 600;
    color: #000000;
}

.ticket-terms ol {
    padding-left: 14px;
    color: #000000;
}

.ticket-footer {
    text-align: center;
    margin-top: 15px;
    font-weight: 700;
    color: #000000;
}

.ticket-by {
    font-size: 9.5px;
    margin-top: 4px;
    color: #000000;
    font-weight: 600;
}

/* Estilos de previsualización en pantalla para Ticket Media Carta */
.ticket-container.preview-mediacarta {
    width: 100%;
    max-width: 650px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    border: 2px solid #000000;
    padding: 28px;
    border-radius: 0;
}

.ticket-container.preview-mediacarta * {
    font-size: inherit;
    color: #000000;
}

/* Estilos de previsualización en pantalla para Ticket de 58mm */
.ticket-container.preview-ticket58 {
    width: 240px;
    padding: 12px;
    font-size: 10.5px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 600;
}

.ticket-container.preview-ticket58 * {
    font-size: 10.5px;
    color: #000000;
}

.ticket-container.preview-ticket58 .ticket-title {
    font-size: 13px;
    font-weight: 800;
}

.ticket-container.preview-ticket58 .ticket-barcode {
    width: 100%;
}

.ticket-container.preview-ticket58 .ticket-logo {
    max-width: 60px;
}

.ticket-container.preview-ticket58 .photo-grid-print img {
    width: 100%;
}

#globalPrintContainer {
    display: none;
}

@media print {
    @page {
        margin: 0;
        size: auto;
    }

    html, body {
        background: #ffffff !important;
        background-color: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Ocultar absolutamente toda la interfaz de la aplicación en el cuerpo */
    body > *:not(#globalPrintContainer) {
        display: none !important;
    }

    /* Mostrar ÚNICAMENTE el contenedor de impresión clonado adjunto al body */
    body > #globalPrintContainer {
        display: block !important;
        visibility: visible !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 6px !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-sizing: border-box !important;
    }

    body > #globalPrintContainer * {
        visibility: visible !important;
        color: #000000 !important;
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
        filter: none !important;
        -webkit-font-smoothing: antialiased !important;
    }

    /* Impresión Estándar 80mm */
    body:not(.printing-mediacarta):not(.printing-ticket58) #globalPrintContainer .ticket-container {
        width: 80mm !important;
        max-width: 80mm !important;
        margin: 0 auto !important;
        padding: 4mm !important;
        font-family: Arial, Helvetica, sans-serif !important;
        font-size: 11px !important;
        line-height: 1.35 !important;
        font-weight: 700 !important;
        border: none !important;
        box-shadow: none !important;
        color: #000000 !important;
    }

    /* Impresión 58mm */
    body.printing-ticket58 #globalPrintContainer .ticket-container {
        width: 58mm !important;
        max-width: 58mm !important;
        margin: 0 auto !important;
        padding: 2mm !important;
        font-family: Arial, Helvetica, sans-serif !important;
        font-size: 10px !important;
        line-height: 1.3 !important;
        font-weight: 700 !important;
        border: none !important;
        box-shadow: none !important;
        color: #000000 !important;
    }

    /* Impresión Media Carta */
    body.printing-mediacarta #globalPrintContainer .ticket-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 16px !important;
        border: 2px solid #000000 !important;
        font-family: Arial, Helvetica, sans-serif !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        box-shadow: none !important;
        color: #000000 !important;
    }

    /* Impresión Tamaño Carta (Letter / A4) */
    body.printing-carta #globalPrintContainer .financial-summary-print-container,
    body.printing-carta #globalPrintContainer .ticket-container {
        width: 100% !important;
        max-width: 216mm !important;
        margin: 0 auto !important;
        padding: 18mm !important;
        border: 2px solid #000000 !important;
        font-family: Arial, Helvetica, sans-serif !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        box-shadow: none !important;
        color: #000000 !important;
    }
}

/* Responsiveness */
@media (max-width: 1024px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
    .grid-layout {
        grid-template-columns: 1fr;
    }
    .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-12 {
        grid-column: span 12 !important;
    }
    .steps-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 4px 8px;
    }
    .brand {
        margin-bottom: 3px;
    }
    .brand h1 {
        font-size: 14px;
    }
    .brand-tagline {
        display: none !important;
    }
    .sidebar-footer {
        display: none !important; /* Ocultar pie de lateral redundante en celulares para maximizar área de trabajo */
    }
    .header-vip-tag {
        display: none !important; /* Ocultar banner VIP de encabezado en celular */
    }
    .top-bar {
        padding: 4px 8px;
        margin-bottom: 6px;
        min-height: 40px;
    }
    .store-name-display {
        font-size: 12.5px;
    }
    .store-branch-display {
        font-size: 10px;
    }
    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 2px;
        gap: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .nav-btn {
        padding: 4px 8px;
        font-size: 11px;
        white-space: nowrap;
        width: auto;
    }
    .nav-btn.active {
        border-left: none;
        border-bottom: 3px solid var(--border-focus-primary);
        padding-left: 8px;
        padding-bottom: 3px;
    }
    .main-content {
        height: auto;
    }
    .scroll-container {
        padding: 6px 8px;
    }
    .dashboard-header {
        margin-bottom: 8px;
    }
    .dashboard-header h2 {
        font-size: 16px;
    }
    .card {
        padding: 10px;
        margin-bottom: 8px;
    }
    .grid-form {
        grid-gap: 6px;
    }
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

/* Checklist and Verification styles */
.checklist-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 12px;
    padding: 6px 0;
    margin-bottom: 8px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-cyan);
    margin: 0;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.check-item label {
    cursor: pointer;
    font-size: 13px;
    text-transform: none;
    color: var(--text-primary);
    font-weight: 500;
}

.ticket-checklist-display {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 3px 12px;
    font-size: 10px;
    font-family: 'Courier New', Courier, monospace;
}

.ticket-check-row {
    display: flex;
    justify-content: space-between;
}

/* Authentication Screen Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(6, 8, 14, 0.92);
    backdrop-filter: blur(25px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Cover everything */
    transition: var(--transition-smooth);
}

.auth-modal {
    width: 480px;
    max-width: 94%;
    max-height: 88vh;
    overflow-y: auto;
    background: rgba(22, 25, 41, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 30px 26px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Custom scrollbar for Auth Modal on smaller screens */
.auth-modal::-webkit-scrollbar {
    width: 6px;
}
.auth-modal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}
.auth-modal::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 10px;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.auth-modal h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    color: white;
    font-weight: 700;
    text-align: center;
}

.auth-subtitle {
    font-size: 13.5px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 6px;
    margin-bottom: 16px;
}

.auth-modal .form-group {
    margin-bottom: 14px;
}

.auth-modal label {
    font-size: 13.5px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 7px;
    display: block;
}

.auth-modal input[type="text"],
.auth-modal input[type="password"],
.auth-modal input[type="tel"] {
    height: 48px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 10px;
    background: rgba(15, 17, 26, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    color: white;
    letter-spacing: 0.5px;
    transition: var(--transition-smooth);
}

.auth-modal input[type="text"]:focus,
.auth-modal input[type="password"]:focus,
.auth-modal input[type="tel"]:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.25);
    background: rgba(15, 17, 26, 0.95);
}

.auth-modal .btn-block {
    height: 48px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    margin-top: 6px;
}

.auth-switch {
    font-size: 13.5px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 20px;
}

.auth-switch a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.auth-switch a:hover {
    color: var(--border-focus-primary);
    text-decoration: underline;
}

/* Admin Users Table Styles */
.admin-table {
    width: 100%;
    margin-top: 8px;
}

.admin-table th, 
.admin-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.admin-table tbody tr {
    transition: var(--transition-smooth);
}

.admin-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-approved {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-pending {
    background-color: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-blocked {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Photo Uploader Styles */
.photo-uploader-container {
    background: rgba(255, 255, 255, 0.01);
    border: 1.5px dashed var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: var(--transition-smooth);
}
.photo-uploader-container:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.01);
}
.photo-upload-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.3);
    color: var(--accent-cyan);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: var(--transition-smooth);
}
.photo-upload-btn:hover {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}
.photos-preview-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-top: 16px;
}
.photos-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-size: cover;
    background-position: center;
}
.photos-preview-item .delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.85);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    transition: var(--transition-smooth);
}
.photos-preview-item .delete-btn:hover {
    background: rgb(239, 68, 68);
    transform: scale(1.1);
}

/* Printing styles for ticket photos */
.ticket-photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 8px;
}
.ticket-photo-thumb {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 4px;
    filter: grayscale(1);
}

@media (max-width: 768px) {
    .photos-preview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Optimización Responsive Móvil para Modal de Autenticación y Registro */
@media (max-width: 600px) {
    .auth-modal {
        width: 95% !important;
        padding: 20px 14px !important;
        border-radius: 16px !important;
        max-height: 94vh !important;
    }

    .auth-modal .grid-form {
        gap: 10px !important;
    }

    .auth-modal .form-group {
        grid-column: span 12 !important; /* Forzar campos a ancho completo en celulares */
    }

    .auth-modal input[type="text"],
    .auth-modal input[type="password"],
    .auth-modal input[type="tel"],
    .auth-modal select {
        height: 46px !important;
        font-size: 14px !important;
        padding: 10px 14px !important;
    }

    .auth-modal .btn-block {
        height: 46px !important;
        font-size: 14.5px !important;
        margin-top: 8px !important;
    }
}
