/* ================================================================
   MOTOWASH POS — Clean Core CSS & Print Engine
   Visual Identity: Montserrat Bold · #FFC107 Gold Accent · Carbon Matte
   Dual Theme (Dark Carbon / Light Clean) · Responsive Sidebar Engine
   ================================================================ */

* {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

/* ── Resilient Media & Icon Defaults ───────────────────────────── */
html, body {
    background-color: #0f172a !important;
    color: #f8fafc;
    color-scheme: dark;
}

html:not(.dark), html:not(.dark) body {
    background-color: #f8fafc !important;
    color: #1e293b;
    color-scheme: light;
}

/* ── Venta Rápida Mostrador Engine ────────────────────────────── */
.vr-payment-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.5rem !important;
    width: 100% !important;
}

.vr-payment-btn {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    padding: 0.625rem 0.25rem !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    border-radius: 0.75rem !important;
    font-weight: 800 !important;
    font-size: 0.8125rem !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    text-align: center !important;
}

@media (max-width: 480px) {
    .vr-payment-btn {
        flex-direction: column !important;
        padding: 0.5rem 0.2rem !important;
        font-size: 0.75rem !important;
        gap: 0.2rem !important;
    }
}

.vr-products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 0.625rem !important;
}

@media (max-width: 640px) {
    .vr-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)) !important;
        gap: 0.5rem !important;
    }
}

img {
    max-width: 100%;
    height: auto;
}

svg.lucide {
    stroke: currentColor;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── Login View Dedicated Resilient Engine ─────────────────────── */
.login-body {
    background-color: #121212 !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    margin: 0;
}

.login-logo-img {
    max-width: 320px !important;
    width: 100% !important;
    height: auto !important;
    max-height: 190px !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    display: block !important;
}

.login-card {
    background-color: #1A1A1A !important;
    border: 1px solid #2B2B2B !important;
    border-radius: 1.5rem !important;
    padding: 2rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.login-input {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.75rem 1rem !important;
    background-color: #141414 !important;
    border: 1px solid #333333 !important;
    border-radius: 0.75rem !important;
    color: #ffffff !important;
    font-size: 0.875rem !important;
    font-family: inherit !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}

.login-input:focus {
    border-color: #FFC107 !important;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.4) !important;
}

.login-btn {
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 0.5rem !important;
    padding: 0.875rem !important;
    background-color: #FFC107 !important;
    color: #020617 !important;
    border: none !important;
    border-radius: 0.75rem !important;
    font-weight: 900 !important;
    font-size: 0.875rem !important;
    font-family: inherit !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    box-shadow: 0 10px 25px -5px rgba(255, 193, 7, 0.2) !important;
    transition: all 0.2s ease !important;
}

.login-btn:hover {
    background-color: #FFD54F !important;
}

.login-btn:active {
    background-color: #FFA000 !important;
}

/* ── Sidebar Layout & Collapsing Engine ────────────────────────── */
#sidebar {
    width: 16rem !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 50 !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#main-content {
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar-overlay {
    display: none;
}

@media (min-width: 1024px) {
    html:not(.sidebar-collapsed) #sidebar,
    body:not(.sidebar-collapsed) #sidebar {
        transform: translateX(0) !important;
    }
    html.sidebar-collapsed #sidebar,
    body.sidebar-collapsed #sidebar {
        transform: translateX(-100%) !important;
    }
    html:not(.sidebar-collapsed) #main-content,
    body:not(.sidebar-collapsed) #main-content {
        margin-left: 16rem !important;
    }
    html.sidebar-collapsed #main-content,
    body.sidebar-collapsed #main-content {
        margin-left: 0 !important;
    }
}

@media (max-width: 1023px) {
    #sidebar {
        transform: translateX(-100%) !important;
    }
    html.sidebar-mobile-open #sidebar,
    body.sidebar-mobile-open #sidebar {
        transform: translateX(0) !important;
    }
    #main-content {
        margin-left: 0 !important;
    }
    html.sidebar-mobile-open .sidebar-overlay,
    body.sidebar-mobile-open .sidebar-overlay {
        display: block !important;
    }
}

/* ── Custom Scrollbars ────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(18, 20, 23, 0.6);
}
::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.5);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #FFC107;
}

.custom-scroll::-webkit-scrollbar {
    width: 4px;
}
.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, 0.4);
    border-radius: 4px;
}

/* ── Universal Motorcycle License Plate Badge ─────────────────── */
.placa-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #121417 !important;
    color: #FFC107 !important;
    border: 1.5px solid #FFC107 !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    font-weight: 900 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

html.dark .placa-badge {
    background-color: #181A1E !important;
    color: #FFC107 !important;
    border-color: #FFC107 !important;
    box-shadow: 0 1px 3px rgba(255, 193, 7, 0.15);
}

/* ── Lucide Icon Color Inheritance ────────────────────────────── */
svg.lucide {
    stroke: currentColor;
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.88;
        transform: scale(1.01);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── Kanban Board & Card Hover ────────────────────────────────── */
.kanban-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.2);
}

/* ================================================================
   🌙 PURE NEUTRAL CARBON DARK MODE (ZERO BLUE TINT)
   Palette: Matte Carbon #121212 · Card #181818 · Accent #FFC107
   ================================================================ */
html.dark {
    color-scheme: dark;
}

html.dark body {
    background-color: #121212 !important;
    color: #F3F4F6 !important;
}

/* Neutral Carbon Containers & Cards (Replaces all blue-slate tones) */
html.dark .bg-slate-950,
html.dark .bg-slate-950\/80,
html.dark .bg-slate-950\/90,
html.dark .bg-slate-900,
html.dark .bg-slate-900\/40,
html.dark .bg-slate-900\/50,
html.dark .bg-slate-900\/60,
html.dark .bg-slate-900\/70,
html.dark .bg-slate-900\/80,
html.dark .bg-slate-900\/90,
html.dark .bg-slate-900\/95,
html.dark [class*="dark:bg-slate-950"],
html.dark [class*="dark:bg-slate-900"] {
    background-color: #181818 !important;
    border-color: #262626 !important;
}

/* Neutral Carbon Sub-wells and inner elements */
html.dark .bg-slate-800,
html.dark .bg-slate-800\/20,
html.dark .bg-slate-800\/30,
html.dark .bg-slate-800\/40,
html.dark .bg-slate-800\/50,
html.dark .bg-slate-800\/60,
html.dark .bg-slate-800\/70,
html.dark .bg-slate-800\/80,
html.dark .bg-slate-800\/90,
html.dark [class*="dark:bg-slate-800"] {
    background-color: #222222 !important;
    border-color: #2C2C2C !important;
}

/* Neutral Carbon Borders */
html.dark [class*="dark:border-slate-800"],
html.dark [class*="dark:border-slate-700"] {
    border-color: #2A2A2A !important;
}

/* Header in Dark Mode */
html.dark header {
    background-color: rgba(18, 18, 18, 0.95) !important;
    border-color: #262626 !important;
}

/* Inputs in Dark Mode */
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html.dark select,
html.dark textarea {
    background-color: #1A1A1A !important;
    color: #F8FAFC !important;
    border-color: #333333 !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
    color: #737373 !important;
}

html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
    border-color: #FFC107 !important;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2) !important;
    outline: none !important;
}

/* ================================================================
   ☀️ Light Mode — Modern Clean Surfaces & Typography
   ================================================================ */
html:not(.dark) {
    color-scheme: light;
}

html:not(.dark) body {
    background-color: #f8fafc;
    color: #0f172a;
}

/* ================================================================
   🎨 SIDEBAR DUAL THEME ENGINE (Light & Dark)
   ================================================================ */

/* ── Light Mode Sidebar ────────────────────────────────────────── */
html:not(.dark) #sidebar {
    background-color: #FFFFFF !important;
    color: #0F172A !important;
    border-right: 1px solid #E2E8F0 !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.04) !important;
}

html:not(.dark) #sidebar .sidebar-header {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid #E2E8F0 !important;
}

html:not(.dark) #sidebar .sidebar-brand-text {
    color: #0F172A !important;
    font-weight: 900 !important;
}

html:not(.dark) #sidebar .sidebar-subtext {
    color: #64748B !important;
    font-weight: 700 !important;
}

html:not(.dark) #sidebar .sidebar-section-title {
    color: #D97706 !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
}

html:not(.dark) #sidebar .nav-link-inactive {
    color: #334155 !important;
    background-color: transparent !important;
    font-weight: 700 !important;
}

html:not(.dark) #sidebar .nav-link-inactive p {
    color: #334155 !important;
    font-weight: 700 !important;
}

html:not(.dark) #sidebar .nav-link-inactive i,
html:not(.dark) #sidebar .nav-link-inactive svg {
    color: #64748B !important;
}

html:not(.dark) #sidebar .nav-link-inactive:hover {
    color: #0F172A !important;
    background-color: #F1F5F9 !important;
}

html:not(.dark) #sidebar .nav-link-inactive:hover p {
    color: #0F172A !important;
}

html:not(.dark) #sidebar .nav-link-inactive:hover i,
html:not(.dark) #sidebar .nav-link-inactive:hover svg {
    color: #D97706 !important;
}

html:not(.dark) #sidebar .nav-link-active {
    background-color: #FFC107 !important;
    color: #121212 !important;
    font-weight: 900 !important;
    box-shadow: 0 4px 14px rgba(255, 193, 7, 0.35) !important;
}

html:not(.dark) #sidebar .nav-link-active p,
html:not(.dark) #sidebar .nav-link-active span,
html:not(.dark) #sidebar .nav-link-active i,
html:not(.dark) #sidebar .nav-link-active svg {
    color: #121212 !important;
    font-weight: 900 !important;
}

html:not(.dark) #sidebar .sidebar-footer {
    background-color: #F8FAFC !important;
    border-top: 1px solid #E2E8F0 !important;
}

html:not(.dark) #sidebar .sidebar-user-card {
    background-color: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

html:not(.dark) #sidebar .sidebar-user-card:hover {
    background-color: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
}

html:not(.dark) #sidebar .sidebar-user-name {
    color: #0F172A !important;
    font-weight: 800 !important;
}

html:not(.dark) #sidebar .sidebar-user-role {
    color: #D97706 !important;
    font-weight: 800 !important;
}

/* ── Dark Mode Sidebar ─────────────────────────────────────────── */
html.dark #sidebar {
    background-color: #121417 !important;
    color: #F1F5F9 !important;
    border-right: 1px solid #23272F !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4) !important;
}

html.dark #sidebar .sidebar-header {
    background-color: #121417 !important;
    border-bottom: 1px solid #23272F !important;
}

html.dark #sidebar .sidebar-brand-text {
    color: #FFFFFF !important;
    font-weight: 900 !important;
}

html.dark #sidebar .sidebar-subtext {
    color: #94A3B8 !important;
    font-weight: 700 !important;
}

html.dark #sidebar .sidebar-section-title {
    color: #FFC107 !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
}

html.dark #sidebar .nav-link-inactive {
    color: #CBD5E1 !important;
    background-color: transparent !important;
    font-weight: 600 !important;
}

html.dark #sidebar .nav-link-inactive p {
    color: #CBD5E1 !important;
    font-weight: 600 !important;
}

html.dark #sidebar .nav-link-inactive i,
html.dark #sidebar .nav-link-inactive svg {
    color: #94A3B8 !important;
}

html.dark #sidebar .nav-link-inactive:hover {
    color: #FFFFFF !important;
    background-color: #1E2228 !important;
}

html.dark #sidebar .nav-link-inactive:hover p {
    color: #FFFFFF !important;
}

html.dark #sidebar .nav-link-inactive:hover i,
html.dark #sidebar .nav-link-inactive:hover svg {
    color: #FFC107 !important;
}

html.dark #sidebar .nav-link-active {
    background-color: #FFC107 !important;
    color: #121212 !important;
    font-weight: 900 !important;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3) !important;
}

html.dark #sidebar .nav-link-active p,
html.dark #sidebar .nav-link-active span,
html.dark #sidebar .nav-link-active i,
html.dark #sidebar .nav-link-active svg {
    color: #121212 !important;
    font-weight: 900 !important;
}

html.dark #sidebar .sidebar-footer {
    background-color: #0E1013 !important;
    border-top: 1px solid #23272F !important;
}

html.dark #sidebar .sidebar-user-card {
    background-color: #1A1D21 !important;
    border: 1px solid #2D323B !important;
}

html.dark #sidebar .sidebar-user-card:hover {
    background-color: #22262C !important;
    border-color: #FFC107 !important;
}

html.dark #sidebar .sidebar-user-name {
    color: #FFFFFF !important;
    font-weight: 700 !important;
}

html.dark #sidebar .sidebar-user-role {
    color: #FFC107 !important;
    font-weight: 700 !important;
}

/* ── Comprehensive Light Surfaces (Main Content only, never Sidebar) ── */
html:not(.dark) #main-content .bg-slate-950,
html:not(.dark) #main-content .bg-slate-950\/80,
html:not(.dark) #main-content .bg-slate-950\/90,
html:not(.dark) #main-content .bg-slate-900,
html:not(.dark) #main-content .bg-slate-900\/40,
html:not(.dark) #main-content .bg-slate-900\/50,
html:not(.dark) #main-content .bg-slate-900\/60,
html:not(.dark) #main-content .bg-slate-900\/70,
html:not(.dark) #main-content .bg-slate-900\/80,
html:not(.dark) #main-content .bg-slate-900\/90,
html:not(.dark) #main-content .bg-slate-900\/95 {
    background-color: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
}

/* Light Sub-wells and inner containers */
html:not(.dark) #main-content .bg-slate-800,
html:not(.dark) #main-content .bg-slate-800\/20,
html:not(.dark) #main-content .bg-slate-800\/30,
html:not(.dark) #main-content .bg-slate-800\/40,
html:not(.dark) #main-content .bg-slate-800\/50,
html:not(.dark) #main-content .bg-slate-800\/60,
html:not(.dark) #main-content .bg-slate-800\/70,
html:not(.dark) #main-content .bg-slate-800\/80,
html:not(.dark) #main-content .bg-slate-800\/90 {
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

/* ── Typography & Headings in Light Mode ────────────────────────── */
html:not(.dark) h1:not(.text-white):not([class*="bg-clip-text"]):not(.ticket-header h2),
html:not(.dark) h2:not(.text-white):not([class*="bg-clip-text"]):not(.ticket-header h2),
html:not(.dark) h3:not(.text-white):not([class*="bg-clip-text"]),
html:not(.dark) h4:not(.text-white):not([class*="bg-clip-text"]),
html:not(.dark) h5:not(.text-white):not([class*="bg-clip-text"]) {
    color: #0f172a;
}

/* ── Form Inputs, Selects & Textareas in Light Mode ─────────────── */
html:not(.dark) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html:not(.dark) select,
html:not(.dark) textarea {
    background-color: #ffffff;
    color: #0f172a;
    border: 1.5px solid #cbd5e1;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder {
    color: #94a3b8;
}

html:not(.dark) input:focus,
html:not(.dark) select:focus,
html:not(.dark) textarea:focus {
    border-color: #FFC107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.25);
    outline: none;
}

/* ════════════════════════════════════════════════════════════════
   🖨️ THERMAL RECEIPT PRINT ENGINE (Helvetica Neue / Clean Typography)
   ════════════════════════════════════════════════════════════════ */
@media screen {
    .ticket-print {
        display: none !important;
    }
}

@media print {
    /* Hide everything on the page except the receipt */
    body * {
        visibility: hidden !important;
    }
    
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
        font-size: 11px !important;
        line-height: 1.35 !important;
    }

    .ticket-print,
    .ticket-print * {
        visibility: visible !important;
    }

    .ticket-print {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 78mm !important;
        margin: 0 auto !important;
        padding: 2mm 3mm !important;
        box-sizing: border-box !important;
        background: #ffffff !important;
        color: #000000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

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

/* Thermal Ticket Layout Styling */
.ticket-content {
    font-family: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #000000;
    width: 100%;
}

.ticket-header {
    text-align: center;
    border-bottom: 1.5px dashed #000000;
    padding-bottom: 7px;
    margin-bottom: 8px;
}

.ticket-header h2 {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.5px;
    margin: 0 0 2px 0;
    text-transform: uppercase;
}

.ticket-header p {
    font-size: 10px;
    margin: 1px 0;
    color: #222222;
}

.ticket-badge {
    display: inline-block;
    border: 1px solid #000000;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 800;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ticket-info {
    font-size: 10.5px;
    margin-bottom: 6px;
}

.ticket-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5px 0;
}

.ticket-info-row span {
    color: #333333;
}

.ticket-info-row strong {
    font-weight: 800;
    color: #000000;
}

.ticket-divider {
    border-top: 1px dashed #000000;
    margin: 5px 0;
}

.ticket-items {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0;
    font-size: 10.5px;
}

.ticket-items th {
    text-align: left;
    border-bottom: 1px solid #000000;
    padding: 3px 0;
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
}

.ticket-items td {
    padding: 3px 0;
    vertical-align: top;
}

.ticket-items .item-name {
    font-weight: 600;
}

.ticket-items .item-price {
    text-align: right;
    font-weight: 800;
    white-space: nowrap;
}

.ticket-total-box {
    border-top: 1.5px dashed #000000;
    border-bottom: 1.5px dashed #000000;
    padding: 6px 0;
    margin: 6px 0;
}

.ticket-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 900;
}

.ticket-subtotal-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #333333;
    margin-bottom: 2px;
}

.ticket-signatures {
    margin-top: 18px;
    padding-top: 6px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.ticket-sign-line {
    flex: 1;
    border-top: 1px solid #000000;
    text-align: center;
    padding-top: 3px;
    font-size: 8.5px;
    font-weight: 600;
}

.ticket-footer {
    text-align: center;
    margin-top: 10px;
    font-size: 9px;
    color: #444444;
}

.ticket-footer .gratitude {
    font-size: 10.5px;
    font-weight: 800;
    margin-bottom: 2px;
    color: #000000;
}
