:root {
    /* Color Palette - Premium Dark Mode */
    --bg-main: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Spacing & Borders */
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

#app {
    display: flex;
    height: 100vh;
}

/* Sidebar Styling - Premium Overhaul */
.sidebar {
    width: 280px;
    background-color: #0b1120; /* Very dark navy */
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 30px 15px;
    z-index: 20;
    overflow-y: auto;
}

.sidebar-logo-area {
    height: 100px;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-links li {
    background: linear-gradient(135deg, #2b3a8a 0%, #3f4fb3 100%);
    padding: 16px 20px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 1.3rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-links li:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.2);
    background: linear-gradient(135deg, #3f4fb3 0%, #5262c5 100%);
}

.nav-links li.active {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 1px solid #38bdf8;
}

.nav-links li .nav-arrow {
    background: white;
    color: #2b3a8a;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 900;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #94a3b8;
}

.status-indicator .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.settings-gear {
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.settings-gear:hover {
    transform: rotate(90deg);
    color: white;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-bar {
    height: 72px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
}

.top-bar h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-logout {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    filter: grayscale(1);
    transition: var(--transition);
}

.btn-logout:hover { filter: grayscale(0); transform: scale(1.1); }

.view-container {
    padding: 32px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* UI Elements */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--text-muted);
}

/* Dashboard Cards - Mockup Style */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    padding: 30px;
}

.dash-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%);
    padding: 40px 20px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 160px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dash-card:hover {
    transform: translateY(-5px);
    border-color: #38bdf8;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.dash-card h3 {
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

/* Recent Activity Section */
.recent-activity {
    padding: 0 30px 40px;
}

.recent-activity h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #94a3b8;
}

.table-container {
    background-color: rgba(17, 27, 51, 0.5);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

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

th {
    text-align: left;
    padding: 15px 20px;
    background-color: rgba(0, 0, 0, 0.2);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

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

.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    transition: var(--transition);
}

.btn-primary { background-color: var(--accent); color: #000; }
.btn-primary:hover { background-color: var(--accent-hover); }

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

.inventory-controls { margin-bottom: 24px; }

/* Sales Cards */
.product-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.sale-item-card {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.sale-item-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.sale-item-card strong {
    display: block;
    margin-top: 8px;
    color: var(--accent);
    font-size: 1.125rem;
}

.cashflow-setup, .cash-summary {
    max-width: 400px;
    margin: 40px auto;
    background-color: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.input-group {
    margin: 24px 0;
}

.input-group label { display: block; margin-bottom: 8px; color: var(--text-muted); }
.input-group input {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: white;
}

.big-value { font-size: 3rem; font-weight: 700; color: var(--success); margin: 24px 0; }

/* --- Premium Login Page Styles --- */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000428;
    background: radial-gradient(circle at center, #001f3f 0%, #000428 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 2000;
    font-family: 'Inter', sans-serif;
}

/* Background Tech Grid / Circuitry Simulation */
.login-bg-effects {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.login-bg-effects::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(50px); }
}

.circuit-lines {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40%;
    height: 300px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="300" viewBox="0 0 400 300"><path d="M0 150 L100 150 L130 120 L250 120 L280 150 L400 150 M0 170 L110 170 L140 200 L260 200 L290 170 L400 170" fill="none" stroke="rgba(56, 189, 248, 0.3)" stroke-width="2" /><circle cx="100" cy="150" r="3" fill="%2338bdf8" /><circle cx="280" cy="150" r="3" fill="%2338bdf8" /><circle cx="110" cy="170" r="3" fill="%2338bdf8" /><circle cx="290" cy="170" r="3" fill="%2338bdf8" /></svg>') no-repeat center right;
    background-size: contain;
    opacity: 0.6;
}

/* Main Login Box */
.login-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 90%;
    max-width: 1100px;
    z-index: 2;
}

/* Logo Section with Rotating Text */
.logo-animation-container {
    position: relative;
    width: 450px;
    height: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-logo-circle {
    position: relative;
    width: 200px;
    height: 200px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    transition: all 0.5s ease;
}

.main-logo-circle img {
    width: 140px;
    height: 140px;
    filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.4));
}

.orbit-text {
    position: absolute;
    width: 420px;
    height: 420px;
    animation: rotateOrbit 20s linear infinite;
}

@keyframes rotateOrbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.orbit-text svg {
    width: 100%;
    height: 100%;
}

.orbit-text text {
    fill: #38bdf8;
    font-weight: 900;
    font-size: 28px;
    font-style: italic;
    font-family: 'Inter', sans-serif;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
}

.glow-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(56, 189, 248, 0.1);
}

.ring-1 { width: 280px; height: 280px; border-style: dashed; animation: rotateOrbit -10s linear infinite reverse; }
.ring-2 { width: 380px; height: 380px; opacity: 0.2; }

/* Right side content */
.login-ui-side {
    flex: 1;
    padding-left: 80px;
}

.main-title-block {
    margin-bottom: 40px;
}

.main-title-block h1 {
    font-size: 5rem;
    font-style: italic;
    font-weight: 900;
    color: #0ea5e9; /* Match image blue */
    line-height: 0.85;
    text-transform: uppercase;
    margin: 0;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.main-title-block .subtitle {
    font-size: 2.2rem;
    font-weight: 300;
    color: white; /* CONTROL is white */
    text-transform: uppercase;
    letter-spacing: 12px;
    margin-top: 10px;
}

/* User Selection Buttons */
.user-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 380px;
}

.premium-user-btn {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #1e293b;
    padding: 18px 35px;
    border-radius: 20px;
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.premium-user-btn:hover {
    background: #1e293b;
    border-color: #0ea5e9;
    transform: translateX(10px);
}

.premium-user-btn .arrow {
    color: #0ea5e9;
    font-size: 1.2rem;
    font-weight: 900;
}

.orbit-text text {
    fill: white; /* Orbit text is white in image */
    font-weight: 800;
    font-size: 26px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.main-logo-circle img {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
    mix-blend-mode: screen; /* Makes black background disappear */
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.4));
}

/* Password Input Modal/Area */
.password-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #38bdf8;
    padding: 40px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.2);
    z-index: 100;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
}

.password-box.active {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

.password-box h3 {
    margin-bottom: 25px;
    color: #38bdf8;
    font-size: 1.5rem;
}

.password-box input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(56, 189, 248, 0.5);
    padding: 15px;
    width: 100%;
    color: white;
    font-size: 1.25rem;
    border-radius: 10px;
    text-align: center;
    letter-spacing: 5px;
    margin-bottom: 20px;
    outline: none;
}

.password-box input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.password-box .btn-row {
    display: flex;
    gap: 10px;
}

.password-box .btn {
    flex: 1;
}

/* Responsive Fixes */
@media (max-width: 900px) {
    .login-container {
        overflow-y: auto;
        align-items: flex-start;
        padding: 40px 0;
    }
    .login-content {
        flex-direction: column;
        text-align: center;
    }
    .login-ui-side {
        padding-left: 0;
        margin-top: -50px;
    }
    .logo-animation-container {
        width: 300px;
        height: 300px;
    }
    .main-logo-circle { width: 120px; height: 120px; }
    .orbit-text { width: 220px; height: 220px; }
    .main-title-block h1 { font-size: 2.5rem; }
    .main-title-block .subtitle { font-size: 1.5rem; }
}

/* Override existing dashboard styles if needed */
.login-mode .sidebar, .login-mode .top-bar { display: none !important; }

/* Dashboard Fixes */
.quick-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.btn-action {.input-row {
    display: flex;
    gap: 12px;
}
.input-row .input-group { flex: 1; margin: 12px 0; }
    flex: 1;
    min-width: 200px;
    padding: 20px;
    font-size: 1rem;
    background-color: var(--accent);
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-action.secondary {
    background-color: var(--bg-hover);
    color: white;
    border: 1px solid var(--border);
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge.EFECTIVO { background-color: #10b981; color: white; }
.badge.TRANSFERENCIA { background-color: #3b82f6; color: white; }
.badge.TARJETA, .badge.DÉBITO, .badge.CRÉDITO { background-color: #8b5cf6; color: white; }

/* Reports & Dashboard */
.report-card {
    background-color: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 32px;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.report-item {
    text-align: center;
    padding: 16px;
    border-radius: var(--radius-md);
    background-color: var(--bg-main);
}

.report-item h4 { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; }
.report-item p { font-size: 1.25rem; font-weight: 700; }
.report-item.profit p { color: var(--success); }

.report-section { margin-top: 40px; }
.report-section h3 { margin-bottom: 20px; font-size: 1.125rem; }

/* Modal Cashier Close */
.cash-check {
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 24px;
    padding-top: 24px;
}

.diff-positive { color: var(--success); }
.diff-negative { color: var(--danger); }

/* --- Cashflow Redesign Styles --- */
.cashflow-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 20px 0;
}

.cashflow-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(30, 41, 59, 0.5);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.cashflow-col h3 {
    font-size: 1.25rem;
    color: var(--accent);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.stat-item {
    background: rgba(15, 23, 42, 0.4);
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid var(--border);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateX(5px);
    background: rgba(15, 23, 42, 0.6);
}

.stat-item.cash { border-left-color: var(--success); }
.stat-item.mp { border-left-color: #009ee3; }
.stat-item.expense { border-left-color: var(--danger); }

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
}

.actions-col {
    justify-content: center;
    gap: 25px;
}

.btn-big {
    padding: 25px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 18px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

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

.btn-big.month {
    background: var(--warning);
    color: black;
}

@media (max-width: 1100px) {
    .cashflow-grid {
        grid-template-columns: 1fr;
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    justify-content: center;
    align-items: flex-start; /* Permite scroll desde arriba */
    padding: 20px 0;
    overflow-y: auto; /* Scroll para el fondo si el modal es gigante */
}

.modal-content {
    background-color: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-height: calc(100vh - 40px); /* Evita que se salga de la pantalla */
    overflow-y: auto; /* Scroll interno si es necesario */
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease-out;
}

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

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

/* Modal Form Grid (Responsive-Adaptive) */
.modal-form-grid {
    display: grid;
    gap: 25px;
    margin-top: 10px;
}

/* Specific 4-column repair grid */
.repair-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

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

@media (max-width: 1300px) {
    .repair-grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .modal-form-grid, .repair-grid-4 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.125rem;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--bg-hover);
}

select {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: white;
}

/* --- Premium System Alert --- */
.system-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.system-alert-box {
    background: #0b1120;
    border: 2px solid #38bdf8;
    padding: 40px;
    border-radius: 24px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 50px rgba(56, 189, 248, 0.4);
    animation: alertEntry 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes alertEntry {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.system-alert-title {
    color: #38bdf8;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.system-alert-message {
    color: white;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.system-alert-btn {
    background: #38bdf8;
    color: #0b1120;
    border: none;
    padding: 12px 30px;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.mobile-only {
    display: none;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }

    body, #app {
        overflow: auto;
        height: auto;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 280px;
        transition: left 0.3s ease;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }

    #app.sidebar-active .sidebar {
        left: 0;
    }

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

    #sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.6);
        backdrop-filter: blur(5px);
        z-index: 15;
    }

    .main-content {
        width: 100%;
        padding: 10px !important;
    }

    .top-bar {
        padding: 10px 15px;
        gap: 10px;
        position: sticky;
        top: 0;
        background: #0b1120;
        z-index: 10;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

   /* --- Print Styles --- */
@media print {
    body * {
        visibility: hidden;
    }
    #print-area, #print-area * {
        visibility: visible;
    }
    #print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white !important;
        color: black !important;
        padding: 0;
        margin: 0;
    }
    .main-content, .sidebar, .top-bar, .modal, .show-system-alert {
        display: none !important;
    }
    
    .voucher-page {
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
        font-family: Arial, sans-serif;
        color: #000;
    }
    
    .voucher-header {
        display: grid;
        grid-template-columns: 1fr 2fr 1fr;
        align-items: center;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }
    
    .voucher-logo { text-align: left; }
    .voucher-shop-info { text-align: center; }
    .voucher-qr { text-align: right; }
    
    .voucher-section {
        margin-bottom: 15px;
        position: relative;
    }
    
    .section-title {
        background: white;
        padding: 0 5px;
        position: absolute;
        top: -10px;
        left: 20px;
        font-size: 12px;
        font-weight: bold;
    }
    
    .box {
        border: 1.5px solid #000;
        border-radius: 5px;
        padding: 15px 10px 10px 10px;
    }
    
    .box-content p {
        margin: 3px 0;
        font-size: 13px;
    }
    
    .box-content.grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }
    
    .warranty-box {
        border-top: 1px solid #000;
        border-bottom: 1px solid #000;
        padding: 10px 0;
        margin-top: 20px;
    }
    
    .voucher-footer {
        margin-top: 50px;
        display: flex;
        justify-content: space-around;
        text-align: center;
    }
    
    .signature-line {
        width: 40%;
    }
    
    .signature-line .line {
        border-top: 1.5px solid #000;
        margin-bottom: 5px;
    }
    
    .signature-line p {
        font-size: 11px;
        font-weight: bold;
    }
}

/* Fix for print area display in-app (non-print) */
.print-only {
    display: none;
}

    #menu-toggle {
        background: none;
        border: none;
        color: white;
        font-size: 1.8rem;
        cursor: pointer;
        padding: 5px;
    }

    #page-title {
        font-size: 1.2rem;
    }

    .user-profile .date {
        display: none; /* Ocultar fecha completa en móviles para ahorrar espacio */
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .dash-card {
        padding: 25px 20px;
        height: auto;
        min-height: 100px;
    }

    .dash-card h3 {
        font-size: 1.1rem;
    }

    .recent-activity h2 {
        font-size: 1.3rem;
        margin-top: 20px;
    }

    .table-container {
        overflow-x: auto;
        border-radius: 10px;
    }

    table {
        min-width: 500px; /* Asegura que la tabla tenga scroll horizontal en móviles */
    }

    /* Ajustes de Login para móvil */
    .login-container {
        padding: 20px;
    }

    .brand-logo h1 {
        font-size: 2rem;
    }

    .brand-logo h1 span {
        font-size: 1rem;
    }

    .orbit-text {
        transform: scale(0.6) !important;
    }

    .user-cards {
        grid-template-columns: 1fr;
    }
}

/* --- Inventory Modal Redesign --- */
.inventory-modal-grid {
    display: grid;
    grid-template-columns: 250px 1fr 280px;
    gap: 30px;
    align-items: flex-start;
}

.category-selector-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.category-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 12px 15px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    text-align: left;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-btn:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.category-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.photo-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}

.photo-preview-container {
    width: 220px;
    height: 220px;
    border-radius: var(--radius-md);
    background: var(--bg-main);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
}

.photo-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    font-size: 3rem;
    color: var(--text-muted);
    opacity: 0.3;
}

.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.upload-btn-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

@media (max-width: 1100px) {
    .inventory-modal-grid {
        grid-template-columns: 1fr 1fr;
    }
    .photo-column {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .inventory-modal-grid {
        grid-template-columns: 1fr;
    }
    .photo-column {
        grid-column: auto;
    }
}

/* --- Inventory Catalog Design --- */
.category-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
}

.category-filter-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 30px;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    font-weight: 600;
}

.category-filter-btn:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--accent);
}

.category-filter-btn.active {
    background: var(--accent);
    color: #0b1120;
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.product-card-premium {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card-premium:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.card-img-area {
    width: 100%;
    height: 110px;
    background: var(--bg-main);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.card-img-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-no-img {
    font-size: 3rem;
    opacity: 0.2;
}

.card-content {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 700;
}

.card-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: white;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-price {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--success);
}

.card-stock-badge {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.card-stock-badge.low {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: var(--transition);
}

.product-card-premium:hover .card-actions {
    opacity: 1;
}

.action-dot {
    width: 32px;
    height: 32px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 1px solid var(--border);
}

.action-dot:hover {
    background: var(--danger);
    color: white;
}

/* --- ESTILOS DE CENTRO FINANCIERO --- */
.finance-card {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    cursor: default;
}

.finance-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.report-col {
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.05);
}

.report-col:hover {
    background: rgba(255,255,255,0.06) !important;
    border-color: var(--accent) !important;
    transform: translateY(-3px);
}

.stat-line {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.stat-line:last-child {
    border-bottom: none;
}

#finance-modal .modal-content {
    background: #0f172a;
    border: 1px solid var(--accent);
    box-shadow: 0 0 50px rgba(56,189,248,0.2);
}

canvas#yearlyChart {
    width: 100% !important;
    height: 100% !important;
}

.badge.MERCADO.PAGO {
    background: rgba(0, 158, 227, 0.1);
    color: #009ee3;
    border: 1px solid rgba(0, 158, 227, 0.2);
}

.badge.EFECTIVO {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* --- ANIMACIONES DE ENERGÍA MUNDO PANTALLA --- */
.energy-svg-overlay {
    pointer-events: none;
    overflow: visible !important;
}

#energy-line-path {
    stroke-dasharray: 8 8;
    animation: energy-flow 2s linear infinite;
}

@keyframes energy-flow {
    from { stroke-dashoffset: 100; }
    to { stroke-dashoffset: 0; }
}

#bolt-path-Admin.animate-bolt,
#bolt-path-Vendedor.animate-bolt,
#bolt-path-Tecnico.animate-bolt {
    display: block !important;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: bolt-lightning 0.5s ease-in forwards;
}

@keyframes bolt-lightning {
    0% { stroke-dashoffset: 1000; opacity: 1; }
    90% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 0; }
}

.logo-energized {
    transform: scale(1.15) !important;
    filter: drop-shadow(0 0 40px #fff) drop-shadow(0 0 80px var(--accent)) !important;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.energy-rays-container {
    position: absolute;
    top: 50%;
    left: 25%; /* Ajustado a la posición del logo en el login */
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 5;
}

.energy-ray {
    position: absolute;
    width: 3px;
    height: 200px;
    background: linear-gradient(to top, transparent, #fff, var(--accent));
    left: 50%;
    bottom: 50%;
    transform-origin: bottom center;
    opacity: 0;
    animation: ray-surge-anim 0.6s ease-out forwards;
}

@keyframes ray-surge-anim {
    0% { height: 0; opacity: 1; transform: rotate(var(--rot)) scaleY(0); }
    100% { height: 1000px; opacity: 0; transform: rotate(var(--rot)) scaleY(1.5); }
}

.premium-user-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.premium-user-btn:active {
    transform: scale(0.95) translateX(5px);
    background: rgba(56, 189, 248, 0.2) !important;
}

/* --- NUEVA VISTA DE VENTAS FLASH CHECKOUT V2 (LISTA & XL) --- */
.sales-view-container.v2 {
    animation: fadeIn 0.4s ease-out;
}

.custom-dropdown select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    transition: all 0.3s ease;
}

.custom-dropdown select:hover {
    border-color: #fff;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.product-list-row:hover {
    background: rgba(56, 189, 248, 0.08) !important;
    border-color: var(--accent) !important;
    transform: translateX(8px);
    box-shadow: -5px 0 20px rgba(56, 189, 248, 0.2);
}

.product-list-row:active {
    transform: scale(0.98);
}

.add-btn-v2 {
    transition: all 0.2s ease;
}

.product-list-row:hover .add-btn-v2 {
    transform: scale(1.1) rotate(90deg);
}

.cart-item-card-xl {
    transition: all 0.2s ease;
}

.cart-item-card-xl:hover {
    background: rgba(56, 189, 248, 0.08) !important;
    transform: translateY(-2px);
}

.pay-method-btn-xl {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pay-method-btn-xl:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255,255,255,0.08) !important;
}

.pay-method-btn-xl.active {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.4);
}

.btn-checkout-ultra:hover:not(:disabled) {
    background: #fff !important;
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(56, 189, 248, 0.6);
}

.btn-checkout-ultra:active:not(:disabled) {
    transform: scale(0.95);
}

/* Custom Scrollbar para el Carrito XL */
.cart-items-scroll::-webkit-scrollbar {
    width: 8px;
}
.cart-items-scroll::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.2);
    border-radius: 10px;
}
.cart-items-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* --- MODAL PAGO Y CIERRE O.T. V2 --- */
.payment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 26, 0.82);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.recent-repairs-container {
    margin-top: 15px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 8px;
    border-radius: 12px;
}

.recent-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.recent-order-item:hover {
    background: rgba(56, 189, 248, 0.08);
    border-color: var(--accent);
    transform: translateX(6px);
    box-shadow: -5px 0 15px rgba(56, 189, 248, 0.1);
}

.recent-order-item:active {
    transform: scale(0.98);
}

.recent-order-item .order-id {
    font-weight: 900;
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.recent-order-item .client-name {
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
    margin: 2px 0;
}

.recent-order-item .device-info {
    font-size: 0.75rem;
    color: var(--secondary);
    font-weight: 500;
}

.recent-order-item .price-tag {
    font-weight: 951;
    color: var(--success);
    font-size: 1.15rem;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* Scrollbar Custom para la Lista Relámpago */
.recent-repairs-container::-webkit-scrollbar {
    width: 6px;
}
.recent-repairs-container::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.15);
    border-radius: 10px;
}
.recent-repairs-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* --- BUSCADOR ULTRA-RÁPIDO V2 --- */
.search-wrap {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-wrap:focus-within {
    transform: scale(1.01);
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.15);
}

.search-wrap:focus-within input {
    border-color: var(--accent) !important;
    background: rgba(56, 189, 248, 0.05) !important;
}

mark.search-highlight {
    background: rgba(56, 189, 248, 0.25);
    color: var(--accent);
    padding: 0 2px;
    border-radius: 4px;
    font-weight: 900;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.product-list-row {
    animation: fadeInSlideUp 0.3s ease-out backwards;
}

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

/* --- SISTEMA DE IMPRESIÓN PREMIUM V6.0 (MULTI-WINDOW) --- */
/* En esta versión, la impresión se maneja en una ventana independiente */
/* Por lo tanto, no es necesario ocultar nada en el dashboard principal */

@media print {
    /* Mantenemos una regla mínima por si acaso se dispara el print accidentalmente */
    #print-zone { display: block !important; }
}

/* --- MODO TALLER (TABLET) V1.0 --- */
body.fullscreen-mode .sidebar { display: none !important; }
body.fullscreen-mode .top-bar { display: none !important; }
body.fullscreen-mode #view-container { 
    margin-left: 0 !important;
    padding-top: 0 !important;
    height: 100vh !important;
    overflow: hidden !important; 
}

.taller-container {
    display: flex; /* Cambiado a flex para ocupar 100% */
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    height: 100vh;
    background: var(--bg-main);
    box-sizing: border-box;
    overflow: hidden;
}

.taller-col {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.taller-col-header {
    padding: 20px;
    background: rgba(0,0,0,0.5);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.taller-col-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.taller-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 120px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.taller-scroll-area.pendientes-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tech-card {
    background: #0f172a;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-left: 5px solid var(--accent);
}

.tech-card.reparado { border-left-color: var(--success); }
.tech-card.entregado { border-left-color: #38bdf8; opacity: 0.7; }
.tech-card.rechazado { border-left-color: #ef4444; }

.tech-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tech-order-num {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--accent);
}

.tech-date {
    font-size: 0.8rem;
    color: var(--secondary);
    font-weight: 600;
}

.tech-device-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 5px;
}

.tech-problem {
    font-size: 1.1rem;
    color: #f87171; /* red-400 indicates the issue */
    font-weight: 700;
    background: rgba(2ef, 68, 68, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
}

.tech-customer {
    font-size: 1rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.tech-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.tech-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.tech-btn.btn-ready {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}
.tech-btn.btn-ready:active { background: var(--success); color: #000; }

.tech-btn.btn-reject {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid #ef4444;
}
.tech-btn.btn-reject:active { background: #ef4444; color: #fff; }

.btn-exit-talller {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid #ef4444;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-exit-talller:active { background: #ef4444; color: #fff; }

@media (max-width: 1024px) {
    .taller-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
        overflow-y: auto;
    }
    .taller-scroll-area { height: 400px; }
}

/* Oculto en pantalla normal */
#print-zone {
    display: none;
}
