:root {
    --primary: #2563EB;
    /* Electric Tech Blue */
    --primary-dark: #1E40AF;
    --secondary: #10B981;
    /* Emerald Green for success */
    --dark: #0F172A;
    /* Deep Navy */
    --light: #F8FAFC;
    /* Very pale cool white */
    --gray: #94A3B8;
    --white: #ffffff;
    --shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.4);
    --glass: rgba(15, 23, 42, 0.85);
    /* Darker, navier glass */
    --glass-border: rgba(255, 255, 255, 0.1);
    --radius: 1.25rem;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --error: #ef4444;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
}

/* Premium Nav Tooltips (Borrowed from Fiscal) */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    pointer-events: none;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}


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

@keyframes glowPulse {
    0% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.2), inset 4px 0 0 var(--primary); }
    50% { box-shadow: 0 0 20px rgba(37, 99, 235, 0.4), inset 4px 0 0 var(--primary); }
    100% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.2), inset 4px 0 0 var(--primary); }
}

.new-wo-highlight {
    background: linear-gradient(90deg,
        rgba(37, 99, 235, 0.05) 0%,
        rgba(37, 99, 235, 0.15) 50%,
        rgba(37, 99, 235, 0.05) 100%) !important;
    background-size: 200% 100% !important;
    animation: shimmerNew 3s infinite linear, glowPulse 2s infinite ease-in-out !important;
    position: relative;
    z-index: 10;
}

.badge-new {
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
    display: inline-block;
    vertical-align: middle;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--light);
    background-image:
        radial-gradient(var(--gray) 0.5px, transparent 0.5px),
        radial-gradient(var(--gray) 0.5px, var(--light) 0.5px);
    background-size: 24px 24px;
    background-position: 0 0, 12px 12px;
    background-attachment: fixed;
    color: var(--dark);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    max-width: 100%;
}

/* Custom Global Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.1);
    border-radius: 10px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

.hover-row:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* Scrollbar styling for Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.1) transparent;
}

/* Table container to handle horizontal overflow only when strictly necessary */
.table-container {
    width: 100%;
    overflow-x: hidden;
    /* No scrollbar on desktop 1080p+ */
    overflow-y: visible;
    /* Ensure vertical absolute children are not clipped */
    margin-bottom: 1rem;
    padding: 0;
}

/* On desktop, allow full visibility for dropdowns */
@media (min-width: 1201px) {
    .table-container {
        overflow: visible !important;
    }
}


.table-container table {
    width: 100%;
    table-layout: auto;
    border-spacing: 0;
}

@media (max-width: 1200px) {
    .table-container {
        overflow-x: auto;
        /* Enable scroll for smaller screens */
        -webkit-overflow-scrolling: touch;
    }

    .table-container table {
        min-width: 900px;
        /* Force minimum comfort width only on smaller screens */
    }
}

/* Standalone PWA Tweaks */
@media (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        user-select: none;
        /* Prevent accidental selection on UI elements */
    }

    input,
    textarea {
        -webkit-user-select: text;
        user-select: text;
    }
}

/* Loader Overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    /* Higher z-index */
    transition: opacity 0.4s ease;
    pointer-events: all;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.loader-logo {
    width: 120px !important;
    max-width: 120px !important;
    height: auto;
    max-width: 120px !important;
    height: auto;
    animation: pulse 2s infinite ease-in-out;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.loader-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
    /* Added to ensure it doesn't stay in flow if fixed fails */
}


/* Background Decoration - Soft atmospheric glows */
.bg-blob {
    position: fixed;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: -1;
    border-radius: 50%;
    filter: blur(60px);
}

.blob-1 {
    top: -20%;
    right: -10%;
}

.blob-2 {
    bottom: -20%;
    left: -10%;
}

/* CSS specifically for the Auth wrapper is handled below in .auth-wrapper */

.auth-card-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-bottom: 6rem;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    background: #030712;
    /* Deeper dark background */
    background-image:
        radial-gradient(circle at 10% 10%, rgba(37, 99, 235, 0.1) 0, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(16, 185, 129, 0.05) 0, transparent 40%),
        url('custom_bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    gap: 0;
}

.auth-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 450px;
    padding: 3rem 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    color: var(--white);
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ELECTRON SPECIAL STYLE */
body.is-electron .auth-wrapper {
    background: #020617;
    /* Even darker */
    background-image:
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.15) 0, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(37, 99, 235, 0.1) 0, transparent 50%);
}

body.is-electron .auth-card {
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(37, 99, 235, 0.1);
    transform: scale(1.05);
    /* Slightly bigger on desktop */
}

body.is-electron .auth-mode-badge {
    background: #1e293b;
    border: 1px solid var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
}

/* Subtil glowing border effect for cards */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.5), transparent);
}

.brand {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand img {
    width: 70px;
    /* Matched to penguin logo in image */
    margin-bottom: 0.5rem;
}

.auth-mode-badge {
    text-align: center;
    margin: -1.5rem auto 2.5rem auto;
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.4rem;
    border-radius: 0.75rem;
    width: fit-content;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    text-transform: uppercase;
}

.auth-mode-badge.workshop-mode {
    background: var(--primary);
}

.brand h1 {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.025em;
}

.brand p {
    color: #cbd5e1;
    font-size: 0.875rem;
}

/* Staff Toggle Button */
.btn-staff-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--white);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    font-size: 1.1rem;
}

.btn-staff-toggle:hover {
    background: var(--primary);
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.4);
    border-color: var(--primary);
}

/* Inventory Selection Styles */
.inventory-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.inventory-checkbox:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.inventory-checkbox:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Tarjetas de Búsqueda de Inventario Premium */
.inventory-wide-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.inventory-wide-card:hover {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: var(--primary) !important;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4),
        0 0 15px -3px rgba(37, 99, 235, 0.2);
}

.inventory-wide-card:active {
    transform: translateY(-2px) scale(0.98);
}

.magnifier-btn {
    position: absolute;
    right: 12px;
    bottom: 8px;
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 50%;
    z-index: 100;
}

.magnifier-btn:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    transform: scale(1.1);
}

.inventory-selection-footer {
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#btn-inventory-select.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.3);
}

.bulk-action-bar {
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    bottom: 0.85rem;
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    line-height: 1;
    transition: var(--transition);
    user-select: none;
}

.password-toggle:hover {
    color: var(--white);
}

.form-group-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    border-radius: 0.75rem;
    transition: background 0.3s ease;
}

.form-group-checkbox:hover {
    background: rgba(255, 255, 255, 0.03);
}

.form-group-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.4rem;
    height: 1.4rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy transition */
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.form-group-checkbox input[type="checkbox"]:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.form-group-checkbox input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transform: scale(1.05);
}

/* Checkmark built with CSS borders */
.form-group-checkbox input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg) scale(0);
    opacity: 0;
    transition: all 0.2s ease;
}

.form-group-checkbox input[type="checkbox"]:checked::after {
    transform: translate(-50%, -50%) rotate(45deg) scale(1);
    opacity: 1;
}

.form-group-checkbox label {
    font-size: 0.85rem;
    color: var(--gray);
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
    transition: color 0.2s;
}

.form-group-checkbox input[type="checkbox"]:checked+label {
    color: var(--white);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1.2rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--white);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input::placeholder {
    color: #64748b;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15), 0 0 20px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.btn {
    width: 100%;
    padding: 1rem;
    border: 1px solid transparent;
    border-radius: 0.875rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border-color: var(--glass-border);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.footer-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--gray);
}

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

/* Dashboards (Hidden by default) */
.dashboard {
    display: none;
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Standard Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 1.5rem;
}

/* 
   WORK ORDER LARGE MODAL - POPUP STYLE
   Restoring the large centered modal with overlay padding.
*/
.modal-overlay:not(.hidden):has(.full-modal) {
    padding: 1.5rem !important;
    /* Restore padding around the modal */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    backdrop-filter: blur(8px) !important;
    background: rgba(15, 23, 42, 0.85) !important;
    z-index: 100000 !important;
}

/* Custom Minimalist Scrollbar for Premium Feel */
.modal-overlay:has(.full-modal) ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.modal-overlay:has(.full-modal) ::-webkit-scrollbar-track {
    background: #020617;
}

.modal-overlay:has(.full-modal) ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.modal-overlay:has(.full-modal) ::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.modal-card {
    background: rgba(25, 25, 25, 0.95);
    backdrop-filter: blur(20px);
    width: 100%;
    max-width: 550px;
    border-radius: 2rem;
    padding: 2.5rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    color: var(--white);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

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

.close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--gray);
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.error-text {
    color: var(--error);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

input[readonly] {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--gray);
    cursor: not-allowed;
    border-style: dashed;
}

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

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

.stat-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    padding: 1.75rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, 0.4);
}

.stat-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--white);
    /* Cambiado a blanco para mejor visibilidad */
    margin-bottom: 1rem;
    font-weight: 700;
    opacity: 0.8;
}

.stat-card p {
    font-size: 2rem;
    font-weight: 800;
    color: var(--white);
}

.header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -1px;
}

.header p {
    color: var(--gray);
    font-weight: 500;
    font-size: 1rem;
}

/* Hidden States */
.hidden {
    display: none !important;
}

/* Main Layout for Employee Dashboard */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.content-area {
    padding: 2rem 3rem;
    flex: 1;
    width: 100%;
    transition: all 0.3s ease;
    background-color: #0f172a;
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}

/* Panorama Dashboard Overrides */
.view-section.dash-container {
    padding: 2.5rem 1.5rem;
    /* Reduced horizontal padding for panoramic feel */
}

@media (min-width: 1600px) {
    .view-section.dash-container {
        padding: 2.5rem 4rem;
        /* Balanced for ultra-wide */
    }
}

/* --- NEW TOP NAVBAR STYLES --- */
.workshop-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.6rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    height: 70px;
}

.workshop-nav-container {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex: 1;
    justify-content: center;
    background: transparent;
    padding: 0.35rem;
    border-radius: 1rem;
    max-width: fit-content;
    margin: 0 auto;
    border: none;
}

.workshop-nav-item {
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    white-space: nowrap;
    background: transparent;
    cursor: pointer;
}

.workshop-nav-item svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.workshop-nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.workshop-nav-item.active {
    background: rgba(37, 99, 235, 0.12);
    color: white;
    box-shadow: 0 8px 20px -6px rgba(37, 99, 235, 0.3);
}

.workshop-nav-item.active svg {
    color: var(--primary);
    stroke-width: 2.5;
    filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.5));
}

/* --- END TOP NAVBAR STYLES --- */

/* Brand Section */
.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.sidebar:hover .sidebar-brand {
    flex-direction: row;
    justify-content: flex-start;
    gap: 1rem;
    padding-left: 0.5rem;
    text-align: left;
}

.sidebar-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar:hover .sidebar-logo {
    width: 40px;
    height: 40px;
}

.brand-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
    transition: all 0.3s ease;
}

/* If you want the 'hide-until-hover' effect for other parts of the app, 
   keep it scoped. But for the sidebar-brand, we want it visible if it's in column mode. */
.sidebar .brand-text {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar:hover .brand-text {
    opacity: 1;
    max-height: 100px;
}

.sidebar nav {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    text-align: left;
    background: transparent;
    border: none;
    color: #94a3b8;
    /* Gris más claro para mejor contraste */
    padding: 1rem 0;
    border-radius: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 0.95rem;
    white-space: nowrap;
    justify-content: center;
}

.sidebar:hover .nav-item {
    justify-content: flex-start;
    padding: 1rem 1.2rem;
    gap: 1rem;
}

.nav-item .icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
}

.nav-item .label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.sidebar:hover .nav-item .label {
    max-width: 150px;
    opacity: 1;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    /* Fondo un poco más visible en hover */
    color: var(--white);
}

.nav-item.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.4);
}

@media (max-width: 768px) {
    .workshop-navbar {
        height: auto;
        padding: 0.5rem 1rem;
        flex-direction: row;
        gap: 0.5rem;
        position: fixed;
        bottom: 0;
        top: auto;
        width: 100%;
        border-bottom: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 1.5rem 1.5rem 0 0;
    }

    .workshop-nav-container {
        max-width: none;
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: none;
        background: transparent;
        border: none;
        padding: 0;
    }

    .workshop-nav-item {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.65rem;
        padding: 0.6rem 0.5rem;
        min-width: 70px;
    }

    .content-area {
        padding: 1.5rem 1rem 6rem 1rem;
        min-height: 100vh;
    }
}

.view-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.view-section.hidden {
    display: none !important;
}

.flex-1 {
    flex: 1;
}

@media (max-width: 1366px) {
    .content-area {
        padding: 2rem;
    }
}

/* Mobile: Bottom Nav or Full Drawer? 
   Let's keep simple responsive from before but adapted */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
        padding-bottom: 80px;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        padding: 0 0.5rem;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        z-index: 200;
        background: #000;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .sidebar::-webkit-scrollbar {
        display: none;
    }

    .sidebar-brand,
    .brand-text {
        display: none !important;
    }

    .sidebar nav {
        margin: 0;
        display: flex;
        flex-direction: row;
        width: auto;
        justify-content: flex-start;
        flex-shrink: 0;
    }

    /* Container of the logout button */
    .sidebar div[style*="margin-top: auto"] {
        margin-top: 0 !important;
        display: flex;
        flex-direction: row;
        flex-shrink: 0;
    }

    .nav-item {
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.2rem;
        font-size: 0.75rem;
        border-radius: 0.5rem;
        flex-shrink: 0;
        width: 75px;
        min-width: 75px;
        justify-content: center;
        align-items: center;
    }

    .nav-item .icon {
        font-size: 1.4rem;
    }

    .nav-item .label {
        opacity: 1;
        transform: none;
        display: block;
        font-size: 0.65rem;
    }

    .content-area {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
        padding-bottom: 6rem;
    }

    .header h1 {
        font-size: 1.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* CUSTOM WORKSHOP PANEL MOBILE IMPROVEMENTS */
    .view-header-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1.5rem !important;
    }

    .view-header-flex h3 {
        font-size: 1.5rem;
        text-align: center;
    }

    .center-controls-wrapper {
        width: 100%;
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: stretch !important;
    }

    .status-filter-bar {
        width: 100%;
        overflow-x: auto;
        padding: 0.5rem;
        white-space: nowrap;
        justify-content: flex-start !important;
        scrollbar-width: none;
        -ms-overflow-style: none;
        background: rgba(255, 255, 255, 0.02);
        border-radius: 12px;
    }

    .status-filter-bar::-webkit-scrollbar {
        display: none;
    }

    .search-container-circular {
        position: relative !important;
        width: 100% !important;
        right: auto !important;
        left: auto !important;
        transform: none !important;
        margin: 0 !important;
        max-width: 100% !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.05) !important;
    }

    .search-input-circular {
        width: 100% !important;
        opacity: 1 !important;
        padding: 0.8rem 1rem 0.8rem 3rem !important;
    }

    .btn-search-circular {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
    }

    #btn-dashboard-new-order {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
        border-radius: 12px !important;
    }

    /* Table to Card Layout */
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block !important;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 2rem !important;
        background: rgba(255, 255, 255, 0.03) !important;
        border: 1px solid var(--glass-border) !important;
        border-radius: 1.25rem !important;
        padding: 1rem !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    }

    td {
        border: none !important;
        position: relative;
        padding-left: 45% !important;
        text-align: right !important;
        margin-bottom: 0.75rem;
        min-height: 2.2rem;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        color: white !important;
    }

    td[data-label]::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 40%;
        text-align: left;
        font-weight: 700;
        color: var(--gray);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    td.action-cell {
        margin-top: 1rem;
        padding-top: 1rem !important;
        padding-left: 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
        justify-content: center !important;
        margin-bottom: 0;
    }

    td.action-cell div {
        width: 100%;
        justify-content: center;
    }

    /* Modal Adjustments */
    .modal-card {
        width: 95% !important;
        max-height: 90vh !important;
    }

    .full-modal {
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-section {
        padding: 1.2rem;
    }
}

/* Ultra-Aesthetic Configuration Design */

.settings-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    color: var(--gray);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

.settings-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.settings-tab-btn.active {
    background: rgba(37, 99, 235, 0.2);
    color: var(--primary);
    position: relative;
}

.settings-tab-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.settings-tab-btn span {
    font-size: 1.1rem;
}

.settings-pane.hidden {
    display: none !important;
}

.settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.02em;
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    border-color: var(--primary);
}

.settings-table-card {
    background: rgba(15, 15, 15, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.settings-table-header {
    display: grid;
    grid-template-columns: 1fr 180px 80px;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--gray);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.settings-row {
    display: grid;
    grid-template-columns: 1fr 180px 80px;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    align-items: center;
    transition: all 0.2s ease;
}

.settings-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.settings-row:last-child {
    border-bottom: none;
}

.col-name a,
.col-name span {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.col-name a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.col-value {
    color: var(--gray);
    font-size: 0.85rem;
    font-weight: 500;
}

.col-actions {
    display: flex;
    justify-content: flex-end;
}

.action-dots {
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    line-height: 1;
}

.action-dots:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.settings-footer {
    padding: 1.25rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.1);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Updated Sub-view (QR Screen) */
.settings-subview-header {
    margin-bottom: 2rem;
}

.btn-back {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    padding: 0.6rem 1.25rem;
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    transform: translateX(-3px);
}

.qr-centered-container {
    padding: 5rem 2rem;
    /* Más espacio */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(15, 15, 15, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 2rem;
}

.qr-centered-container h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--white);
    letter-spacing: -0.5px;
}

.qr-centered-container p {
    color: var(--gray);
    max-width: 480px;
    margin: 0 auto 3rem auto;
    font-size: 1rem;
    line-height: 1.6;
}

.qr-frame {
    background: white;
    padding: 3rem;
    border-radius: 2.5rem;
    width: fit-content;
    margin-bottom: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 10px rgba(255, 255, 255, 0.05);
}

/* Profile Modal Styles */
.profile-modal-card {
    max-width: 800px !important;
    width: 95% !important;
    background: #1a1a1a !important;
    border: 1px solid var(--glass-border);
    padding: 0 !important;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.profile-content {
    padding: 2rem;
}

.profile-header-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 10px 20px rgba(204, 51, 0, 0.2);
}

.profile-main-info h3 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    color: white;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gray);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    /* Columnas dinámicas */
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.profile-info-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.profile-info-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(204, 51, 0, 0.2);
}

.info-icon {
    width: 40px;
    height: 40px;
    background: rgba(204, 51, 0, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.info-data label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 0.1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.info-data p {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    overflow-wrap: anywhere;
    line-height: 1.2;
}


.profile-section h3 {
    font-size: 1.1rem;
    color: white;
    margin-bottom: 1rem;
}

.parts-mini-list {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.part-mini-item {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.part-mini-item:last-child {
    border-bottom: none;
}

.part-mini-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.part-mini-info p {
    font-size: 0.75rem;
    color: var(--gray);
}


/* Full Screen "Workspace" View */
.full-modal {
    flex: 1 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: #0f172a !important;
    /* Solid dark background */
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.6) !important;
    overflow: hidden !important;
    margin: 0 !important;
    position: relative;
    z-index: 1;
}

.full-modal .modal-header {
    height: 60px !important;
    padding: 0 2rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(30, 41, 59, 0.5) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    width: 100% !important;
}

.full-modal .modal-header h2 {
    font-size: 1.25rem !important;
    letter-spacing: -0.01em !important;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.full-modal form {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    /* Context for absolute footer */
}

#wo-form-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    padding-bottom: 150px;
    /* Extra space to prevent footer overlap */
    display: flex;
    flex-direction: column;
    gap: 2rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
    background: transparent;
    /* Clean background for modal */
}

.wo-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

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

.form-section {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    padding: 3rem;
    margin-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-section:hover {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.form-section h3 {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    color: var(--white);
    font-size: 1.5rem;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.step-num {
    background: linear-gradient(135deg, var(--primary), #ef4444);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    transform: rotate(-5deg);
}


.form-actions-sticky {
    position: absolute;
    /* Force anchor to modal bottom */
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 1.25rem 1.5rem;
    /* Balanced, centered feeling */
    background: rgba(15, 23, 42, 0.95);
    /* High contrast */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center !important;
    align-items: center;
    gap: 1.5rem;
    z-index: 100;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 0 0 2rem 2rem;
}


.form-actions-sticky .btn {
    width: auto !important;
    min-width: 160px;
    /* Comfortable click area */
    max-width: 300px;
    padding: 0.6rem 2rem;
    font-size: 0.9rem;
    border-radius: 12px;
    letter-spacing: 0.02em;
    margin: 0;
    /* Remove any margins causing shifts */
}





/* Base style for all form controls */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #121212;
    color: var(--white);
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(204, 51, 0, 0.15);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

/* Custom Select Styling */
.form-group select {
    appearance: none;
    cursor: pointer;
    padding-right: 3rem;
    background-color: #1a1a1a !important;
    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 1.25rem center;
    background-size: 1.2rem;
    color-scheme: dark;
}

.form-group select option {
    background: #161616;
    color: white;
    padding: 1rem;
}

/* Datalist/Input brand tweak */
#order-brand {
    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='gray' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    background-size: 1rem;
}



/* Status Filter Bar */
.status-filter-bar {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.4rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 5;
}

.view-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1.5rem;
    position: relative;
    width: 100%;
}

.center-controls-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-height: 50px;
}

.filter-pill {
    background: transparent;
    border: none;
    color: var(--gray);
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.filter-pill.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(204, 51, 0, 0.2);
}

/* Drag & Drop Zone */
.drop-zone {
    height: 150px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
}

.drop-zone:hover,
.drop-zone--over {
    border-color: var(--primary);
    background: rgba(204, 51, 0, 0.05);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.drop-icon {
    font-size: 2rem;
}

.drop-zone-content p {
    font-size: 0.9rem;
    color: var(--white);
    margin: 0;
}

.drop-zone-content p span {
    color: var(--primary);
    font-weight: 600;
}

#logo-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111;
    padding: 0.5rem;
}

/* Action Dropdown Menu */
.action-cell {
    position: relative;
    text-align: right;
    display: flex;
    justify-content: flex-end;
}

.btn-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.btn-action-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.btn-action-icon svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.btn-action-icon.primary {
    background: rgba(204, 51, 0, 0.1);
    border-color: rgba(204, 51, 0, 0.2);
    color: var(--primary);
}

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

.btn-action-icon.whatsapp {
    background: rgba(37, 211, 102, 0.1);
    border-color: rgba(37, 211, 102, 0.2);
    color: #25D366;
}

.btn-action-icon.whatsapp:hover {
    background: #25D366;
    color: white;
}

.btn-action-icon.menu {
    border: none;
    background: transparent;
}

.action-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    background: rgba(26, 26, 26, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 0.5rem;
    min-width: 210px;
    z-index: 5000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    display: none;
    flex-direction: column;
    gap: 0.1rem;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: opacity 0.2s, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for the dropdown specifically */
.action-dropdown::-webkit-scrollbar {
    width: 4px;
}

.action-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}


.action-dropdown.active {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Removed arrow triangles to prevent scrolling glitches */

/* Open upwards variation */
.action-dropdown.open-up {
    top: auto;
    bottom: calc(100% + 5px);
    transform: translateY(10px) scale(0.95);
}

.action-dropdown.open-up.active {
    transform: translateY(0) scale(1);
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

.action-item:hover {
    background: rgba(204, 51, 0, 0.15);
    color: var(--primary);
    transform: translateX(-4px);
}

.action-item.danger {
    color: #ff4d4d;
    opacity: 0.8;
}

.action-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ff4d4d;
    opacity: 1;
}

.action-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 0.25rem 0.5rem;
}

/* Search Container Styles */
.search-container-circular {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 0.25rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 42px;
    overflow: hidden;
    position: absolute;
    right: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.search-container-circular.active {
    width: 100%;
    max-width: 500px;
    background: #0f172a;
    /* Fondo más sólido para cubrir bien */
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 20;
}

.search-input-circular {
    border: none;
    background: transparent;
    color: white;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    width: 0;
    opacity: 0;
    transition: all 0.3s ease;
    flex: 1;
}

.search-container-circular.active .search-input-circular {
    width: 100%;
    opacity: 1;
}

.btn-search-circular {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-container-circular.active .btn-search-circular {
    color: var(--primary);
}

.btn-search-circular:hover {
    color: white;
    transform: scale(1.1);
}

/* Interactive PDF Designer Styles */
.preview-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #888;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-toggle.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

#pdf-visual-canvas .design-element {
    position: absolute;
    border: 1px dashed transparent;
    user-select: none;
    cursor: move;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: box-shadow 0.2s;
}

#pdf-visual-canvas .design-element.active {
    border: 1px dashed var(--primary);
    background: rgba(204, 51, 0, 0.05);
    z-index: 50;
}

/* Resizing handles */
.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
}

/* POS Thermal Ticket Styling */
    @media print {
        body {
            background: white !important;
            margin: 0;
            padding: 0;
        }

        #view-side-nav,
        #mobile-nav,
        header,
        aside,
        section,
        nav,
        .modal-overlay {
            display: none !important;
            visibility: hidden !important;
        }

        #printable-ticket-container,
        #printable-ticket-container * {
            visibility: visible !important;
            display: block !important;
        }

        #printable-ticket-container {
            position: absolute;
            left: 0;
            top: 0;
            width: 80mm;
            background: white !important;
            color: black !important;
            padding: 0;
            margin: 0;
        }
    }

    .thermal-ticket {
        width: 80mm;
        padding: 0;
        margin: 0;
        background: white !important;
        color: black !important;
        font-family: 'Courier New', Courier, monospace;
        font-size: 13px;
        line-height: 1.2;
        text-align: center;
        box-shadow: none !important;
        /* IMPORTANTE: Las sombras causan tickets negros */
    }

    .thermal-ticket * {
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .thermal-ticket h1 {
        font-size: 20px;
        margin-bottom: 5px;
        text-transform: uppercase;
        font-weight: bold;
    }

    .thermal-ticket .meta {
        font-size: 11px;
        margin-bottom: 15px;
        border-bottom: 1px dashed black;
        padding-bottom: 10px;
    }

    .thermal-ticket table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 15px;
    }

    .thermal-ticket th {
        border-bottom: 1px dashed black;
        text-align: left;
        padding: 5px 0;
        font-size: 11px;
    }

    .thermal-ticket td {
        text-align: left;
        padding: 5px 0;
        vertical-align: top;
    }

    .thermal-ticket .total-row {
        border-top: 2px solid black;
        font-weight: bold;
        font-size: 18px;
        padding-top: 10px;
        margin-top: 5px;
    }

    .thermal-ticket .footer {
        border-top: 1px dashed black;
        margin-top: 20px;
        padding-top: 10px;
        font-size: 11px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
}

/* POS Thermal Ticket Styling */
@media print {
    body {
        background: white !important;
        margin: 0;
        padding: 0;
    }

    #view-side-nav,
    #mobile-nav,
    header,
    aside,
    section,
    nav,
    .modal-overlay {
        display: none !important;
        visibility: hidden !important;
    }

    #printable-ticket-container,
    #printable-ticket-container * {
        visibility: visible !important;
        display: block !important;
    }

    #printable-ticket-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        background: white !important;
        color: black !important;
        padding: 0;
        margin: 0;
    }
}

.thermal-ticket {
    width: 80mm;
    padding: 0;
    margin: 0;
    background: white !important;
    color: black !important;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
    box-shadow: none !important;
    /* IMPORTANTE: Las sombras causan tickets negros */
}

.thermal-ticket * {
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.thermal-ticket h1 {
    font-size: 20px;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: bold;
}

.thermal-ticket .meta {
    font-size: 11px;
    margin-bottom: 15px;
    border-bottom: 1px dashed black;
    padding-bottom: 10px;
}

.thermal-ticket table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.thermal-ticket th {
    border-bottom: 1px dashed black;
    text-align: left;
    padding: 5px 0;
    font-size: 11px;
}

.thermal-ticket td {
    text-align: left;
    padding: 5px 0;
    vertical-align: top;
}

.thermal-ticket .total-row {
    border-top: 2px solid black;
    font-weight: bold;
    font-size: 18px;
    padding-top: 10px;
    margin-top: 5px;
}

/* MODO BAJO RENDIMIENTO (ECO) */
body.low-performance * {
    backdrop-filter: none !important;
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body.low-performance .bg-blob {
    display: none !important;
}

body.low-performance .stat-card,
body.low-performance .modal-content,
body.low-performance .chart-bento-box {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

/* Visualization Content Styles */
.canvas-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.canvas-text-header {
    font-weight: bold;
    color: var(--primary);
    line-height: 1.1;
}

.canvas-box {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    background: #fcfcfc;
}

.canvas-table-proxy {
    border-top: 2px solid var(--primary);
}

.canvas-table-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
    font-size: 7px;
}

.canvas-footer-area {
    border-top: 1px solid #eee;
    font-size: 6px;
    color: #999;
    text-align: center;
    overflow: hidden;
}


/* Fix for color inputs in designer */
#view-settings-pdf input[type="color"] {
    height: 35px;
    padding: 2px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

/* Tooltip Styles */
.help-tooltip:hover .tooltip-content {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0);
}

.tooltip-content {
    position: absolute;
    top: 40px;
    right: 0;
    width: 250px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.25rem;
    color: #cbd5e1;
    z-index: 1000;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.tooltip-content h4 {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.tooltip-content ul {
    padding-left: 1.2rem;
    margin: 0.5rem 0;
}

.tooltip-content li {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

/* Premium Nav Tooltips */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    pointer-events: none;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: -6px;
    right: 15px;
    width: 12px;
    height: 12px;
    background: #1e293b;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    border-radius: 2px 0 0 0;
}

.full-modal {
    display: flex;
    flex-direction: column;
}

.full-modal form {
    flex: 1;
    overflow-y: auto;
    padding-right: 1rem;
}

/* Multi-Select Styles */
.multi-select-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 0.5rem 1rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    position: relative;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-chip {
    background: rgba(204, 51, 0, 0.2);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tag-remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.7;
}

.tag-remove:hover {
    opacity: 1;
}

.placeholder {
    color: #64748b;
    font-size: 0.9rem;
}

.ms-arrow {
    font-size: 0.8rem;
    color: var(--gray);
}

.ms-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    margin-top: 4px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    padding: 0.5rem;
}

.ms-search {
    width: 100%;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.3rem;
    color: white;
    margin-bottom: 0.5rem;
}

.ms-options {
    max-height: 200px;
    overflow-y: auto;
}

.ms-option {
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.3rem;
    transition: background 0.2s;
    color: #ccc;
    font-size: 0.9rem;
}

.ms-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.ms-option.selected {
    background: rgba(204, 51, 0, 0.1);
    color: var(--primary);
}

/* --- CLIENTS GRID VIEW --- */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding-bottom: 80px;
}

.client-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.client-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

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

.client-avatar {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #ff6b3d);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(204, 51, 0, 0.3);
}

.client-info {
    flex: 1;
    min-width: 0;
}

.client-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin: 0 0 0.2rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-app {
    background: rgba(0, 255, 150, 0.15);
    color: #00ff96;
    border: 1px solid rgba(0, 255, 150, 0.3);
}

.badge-guest {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gray);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.client-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.8rem;
    border-radius: 0.8rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-row span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.client-btn {
    flex: 1;
    padding: 0.6rem;
    border-radius: 0.6rem;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

.client-btn.primary {
    background: rgba(204, 51, 0, 0.15);
    border-color: rgba(204, 51, 0, 0.4);
    color: var(--primary-light);
}

.client-btn.primary:hover {
    background: rgba(204, 51, 0, 0.3);
}

/* --- NEW CLIENT DASHBOARD STYLES --- */
body,
.client-view {
    /* Fondo base más vivo: Azul medianoche a Púrpura oscuro */
    background: linear-gradient(135deg, #1e293b 0%, #312e81 100%) !important;
    background-attachment: fixed !important;
    color: white !important;
    min-height: 100vh;
    position: relative;
    z-index: 0;
}

/* Patrón sutil */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Mismo patrón pero con opacity ajustada */
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

.client-view {
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
}

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

.user-welcome {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #00C6FF, #0072FF);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.3);
}

.subtitle {
    color: var(--gray);
    font-size: 0.9rem;
    margin: 0;
}

.icon-btn-ghost {
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.icon-btn-ghost:hover {
    color: white;
}

/* PWA Install Banner (Client) - Compact Version */
.pwa-install-banner {
    margin: 1rem 1.5rem 2rem 1.5rem;
    padding: 0.8rem 1rem;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pwa-install-banner:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: var(--primary);
}

.pwa-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}

.pwa-icon-box {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-icon-box svg {
    width: 18px;
    height: 18px;
}

.pwa-text {
    flex: 1;
}

.pwa-text h4 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--white);
    margin-bottom: 0.1rem;
}

.pwa-text p {
    margin: 0;
    font-size: 0.72rem;
    color: var(--gray);
    line-height: 1.2;
}

.pwa-action-icon {
    color: var(--gray);
    opacity: 0.5;
}

@keyframes install-pulse-anim {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Active Repair Hero */
.repair-status-card {
    background: rgba(30, 41, 59, 0.7);
    /* Más transparente y ligero */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    /* Borde más brillante */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.repair-status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #ff6b3d);
}

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

.status-badge {
    background: rgba(204, 51, 0, 0.2);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.pulse {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(204, 51, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(204, 51, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(204, 51, 0, 0);
    }
}

.repair-date {
    font-size: 0.8rem;
    color: var(--gray);
}

.status-steps {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.step {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.step.completed {
    background: var(--primary);
}

.step.active {
    background: var(--primary);
    opacity: 0.5;
}

.status-text {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Actions Grid */
.client-actions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.25rem;
    border-radius: 1.25rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.action-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.action-card.primary {
    background: linear-gradient(135deg, rgba(204, 51, 0, 0.1), rgba(204, 51, 0, 0.05));
    border-color: rgba(204, 51, 0, 0.2);
}

.action-icon {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-info h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: white;
}

.action-info p {
    font-size: 0.8rem;
    color: var(--gray);
    margin: 0;
}

/* History Section */
.history-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--gray);
}

.empty-state-card {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 1rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    color: var(--gray);
    font-size: 0.9rem;
}

/* Tutorial Section Styles */
.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.tutorial-card {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tutorial-icon-wrapper {
    width: 50px;
    height: 50px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.tutorial-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--white);
}

.tutorial-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.tutorial-list li {
    font-size: 0.9rem;
    color: var(--gray);
    position: relative;
    padding-left: 1.2rem;
    line-height: 1.4;
}

.tutorial-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.tutorial-list li strong {
    color: #e2e8f0;
}

.tutorial-list li a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.tutorial-list li a:hover {
    text-decoration: underline;
}

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

/* Error Blog Styles */
.error-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.error-post-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: var(--transition);
    position: relative;
    backdrop-filter: blur(10px);
}

.error-post-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.post-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.post-category {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-model {
    color: var(--gray);
    font-size: 0.85rem;
    font-weight: 500;
}

.error-post-card h3 {
    font-size: 1.25rem;
    color: white;
    line-height: 1.3;
}

.error-post-card p {
    font-size: 0.95rem;
    color: var(--gray);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.btn-read-more {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.btn-read-more:hover {
    color: var(--white);
    transform: translateX(5px);
}

.post-date {
    font-size: 0.8rem;
    color: #475569;
}

/* Modern Search Bar */
.search-bar-modern {
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar-modern input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    color: white;
    font-size: 1rem;
    transition: var(--transition);
}

.search-bar-modern input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.2);
}

.search-bar-modern .search-icon {
    position: absolute;
    left: 1.5rem;
    font-size: 1.2rem;
    opacity: 0.5;
}

@media (max-width: 600px) {
    .error-blog-grid {
        grid-template-columns: 1fr;
    }
}

/* Breadcrumbs for Error Navigation */
.error-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--gray);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1.25rem;
    border-radius: 2rem;
    width: fit-content;
    border: 1px solid var(--glass-border);
}

.breadcrumb-item {
    cursor: pointer;
    transition: var(--transition);
}

.breadcrumb-item:hover {
    color: var(--white);
}

.breadcrumb-item.active {
    color: var(--primary);
    font-weight: 700;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "/";
    margin-right: 0.5rem;
    color: rgba(255, 255, 255, 0.1);
}

/* Category Cards (Brands/Models) */
.category-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.category-image-wrapper {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: var(--transition);
}

.category-card:hover .category-image-wrapper img {
    transform: scale(1.1);
}

.category-icon-fallback {
    font-size: 3rem;
    filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.3));
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.3));
}

.category-card h3 {
    font-size: 1.25rem;
    color: var(--white);
    margin: 0;
}

.category-card span {
    font-size: 0.85rem;
    color: var(--gray);
}

/* --- ADMIN DASHBOARD LAYOUT (Specific to Admin Panel) --- */
.admin-dashboard-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: #0f172a;
    /* Deep dark background */
    color: white;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

/* Admin Sidebar Styling */
.admin-sidebar {
    width: 280px;
    background: rgba(30, 41, 59, 0.5);
    /* Semi-transparent list */
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-wrapper h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    /* Push footer down */
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--gray);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-icon {
    font-size: 1.25rem;
}

.nav-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

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

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray);
}

.btn-logout {
    width: 100%;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 40%);
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: white;
}

.content-header p {
    color: var(--gray);
}

/* Admin Specific Views */
.admin-full-view {
    height: 100%;
}

.admin-full-view.hidden {
    display: none;
}

/* Tab Switching for Inner Content */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
}

.admin-tabs .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: transparent;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    color: var(--gray);
}

.admin-tabs .btn-sm.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 1rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        height: auto;
    }

    .nav-links {
        flex-direction: row;
        flex: unset;
    }

    .sidebar-footer {
        display: none;
        /* Hide footer on mobile for cleaner look */
    }

    .nav-text {
        display: none;
    }
}

/* Password Strength Indicator */
.strength-bar {
    height: 4px;
    width: 0%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
    margin-top: 0.5rem;
}

.strength-weak {
    width: 33% !important;
    background-color: var(--error) !important;
}

.strength-medium {
    width: 66% !important;
    background-color: #f59e0b !important;
}

.strength-strong {
    width: 100% !important;
    background-color: var(--secondary) !important;
}

/* --- PREMIUM LANDING PAGE STYLES --- */
.landing-navbar {
    width: 100%;
    padding: 1.5rem 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.nav-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-btn-link {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.nav-btn-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.6rem;
    border-radius: 0.8rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.nav-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    filter: brightness(1.1);
}

.landing-hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10rem 2rem 6rem 2rem;
    text-align: center;
    width: 100%;
}

.hero-content {
    max-width: 900px;
    z-index: 2;
    animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-badge {
    background: rgba(37, 99, 235, 0.15);
    color: #60a5fa;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid rgba(37, 99, 235, 0.3);
    display: inline-block;
    margin-bottom: 2.5rem;
    backdrop-filter: blur(4px);
}

.landing-hero h1 {
    font-size: 4.8rem;
    font-weight: 900;
    color: white;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 1.8rem;
}

.text-gradient {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(37, 99, 235, 0.3));
}

.landing-hero p {
    font-size: 1.35rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    max-width: 650px;
    margin: 0 auto 3.5rem auto;
    font-weight: 400;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-btns .btn {
    width: auto !important;
    padding: 1rem 2.5rem !important;
    font-size: 1.05rem !important;
}

/* Auth Modal Overrides for Landing Page */
.modal-overlay {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(15, 23, 42, 0.75);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* --- MOBILE COMPATIBILITY FIXES --- */
/* Fixes auth screen zooming out and footer alignment on phones */
@media (max-width: 640px) {
    body {
        overflow-x: hidden;
        /* Prevent horizontal scroll */
    }

    .auth-wrapper {
        padding: 1.5rem 1rem;
        background-attachment: scroll;
        /* Smoother scrolling on mobile */
    }

    .auth-card {
        padding: 2rem 1.5rem;
        max-width: 100%;
        margin-bottom: 2rem;
    }

    /* Landing Mobile Fixes */
    .landing-hero h1 {
        font-size: 2.5rem;
        letter-spacing: -1px;
    }

    .landing-hero p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .nav-logo span {
        display: none;
    }

    .landing-navbar {
        padding: 0.8rem 1.5rem;
    }

    .nav-actions {
        gap: 1rem;
    }

    .auth-footer {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
        max-width: 100%;
        padding: 3rem 1rem;
    }

    .auth-footer a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0.5rem;
        /* Better touch target */
    }

    /* Modal Mobile Fixes */
    .modal-card {
        width: 95% !important;
        max-width: 95% !important;
        padding: 1.5rem;
        border-radius: 1.5rem;
        max-height: 85vh;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }
}

/* --- EMAIL CHOICE MODAL PREMIUM --- */
.email-options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.email-option-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.email-option-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.email-option-card .icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.email-option-card.smtp {
    border-left: 4px solid var(--success);
}

.email-option-card.gmail {
    border-left: 4px solid #EA4335;
}

.email-option-card.outlook {
    border-left: 4px solid #0078D4;
}

.email-option-card .info h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--white);
    font-weight: 600;
}

.email-option-card .info p {
    margin: 0.2rem 0 0 0;
    font-size: 0.75rem;
    color: var(--gray);
}

.email-option-card .badge-ready {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 0.65rem;
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: bold;
    opacity: 0.9;
}

/* End of Styles */
/* POS Thermal Ticket Styling */
@media print {
    body {
        background: white !important;
        margin: 0;
        padding: 0;
    }

    #view-side-nav,
    #mobile-nav,
    header,
    aside,
    section,
    nav,
    .modal-overlay:not(.printing-active) {
        display: none !important;
        visibility: hidden !important;
    }

    /* Better print isolation */
    #printable-ticket-container {
        display: block !important;
        visibility: visible !important;
        position: relative !important;
        width: 80mm !important;
        max-width: 100% !important;
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
        left: 0 !important;
        top: 0 !important;
    }

    #printable-ticket-container * {
        visibility: visible !important;
    }

    #printable-ticket-container div[style*="position: absolute"] {
        display: block !important;
        position: absolute !important;
    }
}

.thermal-ticket {
    width: 260px; /* Ancho seguro para 80mm y 58mm escalado */
    max-width: 100%;
    padding: 10px;
    margin: 0;
    background: white !important;
    color: black !important;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px;
    line-height: 1.2;
    text-align: left;
    box-sizing: border-box;
    box-shadow: none !important;
    opacity: 1 !important;
    filter: none !important;
}

.thermal-ticket * {
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
    opacity: 1 !important;
    filter: none !important;
}

.thermal-ticket h1 {
    font-size: 20px;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: bold;
}

.thermal-ticket .meta {
    font-size: 11px;
    margin-bottom: 15px;
    border-bottom: 1px dashed black;
    padding-bottom: 10px;
}

.thermal-ticket table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.thermal-ticket th {
    border-bottom: 1px dashed black;
    text-align: left;
    padding: 5px 0;
    font-size: 11px;
}

.thermal-ticket td {
    text-align: left;
    padding: 5px 0;
    vertical-align: top;
}

.thermal-ticket .total-row {
    border-top: 2px solid black;
    font-weight: bold;
    font-size: 18px;
    padding-top: 10px;
    margin-top: 5px;
}

.thermal-ticket .footer {
    border-top: 1px dashed black;
    margin-top: 15px;
    padding-top: 10px;
    font-size: 10px;
    font-style: italic;
    text-align: center;
}

/* THE GENERIC FIX: Avoid blank space at the end of tickets on generic drivers */
@media print {
    /* Hide the entire app UI during print */
    body > *:not(#printable-ticket-container):not(.modal-overlay) {
        display: none !important;
    }

    /* Force visibility and reset position for the actual ticket/label */
    #printable-ticket-container {
        display: none !important;
    }

    body.is-printing-tpv #printable-ticket-container {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        visibility: visible !important;
    }

    body.is-printing-tpv #printable-ticket-container * {
        visibility: visible !important;
    }

    /* Print logic for Labels (inside modal) */
    .modal-overlay:not(.printing-label) {
        display: none !important;
    }

    .modal-overlay.printing-label {
        display: flex !important;
        background: white !important;
        position: fixed !important;
        inset: 0 !important;
        z-index: 9999999 !important;
        padding: 0 !important;
    }

    .modal-overlay.printing-label .modal-card {
        background: white !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .modal-overlay.printing-label #label-preview {
        display: block !important;
        visibility: visible !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        border: none !important;
        background: white !important;
    }

    .modal-overlay.printing-label #label-preview * {
        visibility: visible !important;
    }

    /* Remove operating system margins/headers/footers */
    @page {
        margin: 0 !important;
        size: auto !important;
    }
}
/* --- PREMIUM WORK ORDER REDESIGN --- */

#work-order-modal .modal-card {
    background: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(40px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.7) !important;
    overflow: hidden !important;
}

#work-order-modal .modal-header {
    background: rgba(30, 41, 59, 0.5);
    padding: 2.5rem 3rem;
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#work-order-modal .modal-header h2 {
    font-size: 1.75rem;
    font-weight: 950;
    letter-spacing: -0.05em;
    background: linear-gradient(to right, #fff, var(--gray));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#wo-form-scroll {
    padding: 4rem 3rem 10rem 3rem !important;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 40%);
}

.form-section {
    background: rgba(30, 41, 59, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 2.5rem !important;
    border-radius: 2.5rem !important;
    transition: all 0.5s var(--transition) !important;
}

.form-section:hover {
    border-color: rgba(37, 99, 235, 0.3) !important;
    background: rgba(30, 41, 59, 0.4) !important;
}

.form-section h3 {
    font-size: 1.25rem !important;
    letter-spacing: -0.02em !important;
    margin-bottom: 2.5rem !important;
    text-transform: none !important;
}

.form-group label {
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    color: var(--gray) !important;
    font-weight: 800 !important;
    margin-bottom: 0.8rem !important;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 1.25rem !important;
    padding: 1rem 1.25rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-weight: 600 !important;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    background: rgba(37, 99, 235, 0.05) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.15) !important;
    transform: translateY(-2px) !important;
}

.step-num {
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    background: var(--primary) !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 800 !important;
}

/* Custom button styles in WO */
.btn-primary {
    background: var(--primary) !important;
    border: none !important;
    border-radius: 1rem !important;
    font-weight: 700 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2) !important;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.5) !important;
}

/* Photos upload UI */
#btn-add-photo {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 2px dashed rgba(255, 255, 255, 0.15) !important;
    border-radius: 2rem !important;
    transition: all 0.3s !important;
}

#btn-add-photo:hover {
    border-color: var(--primary) !important;
    background: rgba(37, 99, 235, 0.05) !important;
    color: var(--primary) !important;
}

/* Budget section premium feel */
.budget-itemizer {
    background: rgba(0, 0, 0, 0.15) !important;
    padding: 2rem !important;
    border-radius: 2rem !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.budget-table thead tr th {
    background: rgba(15, 23, 42, 0.5) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    font-weight: 800 !important;
}

.budget-total-bar {
    background: linear-gradient(to right, rgba(0,0,0,0.3), rgba(37, 99, 235, 0.1)) !important;
    border: 1px solid rgba(37, 99, 235, 0.2) !important;
    padding: 1.5rem 2.5rem !important;
}


/* --- RADICAL WORK ORDER MODAL REDESIGN --- */

.radical-wo-modal {
    max-width: 1400px !important;
    width: 95vw !important;
    height: 90vh !important;
    display: flex !important;
    flex-direction: row !important;
    padding: 0 !important;
    background: #0b1121 !important;
    border-radius: 2.5rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    overflow: hidden !important;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.8) !important;
    box-sizing: border-box !important;
}

.wo-sidebar {
    width: 280px;
    background: #0f172a;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.5rem;
    flex-shrink: 0;
}

.wo-sidebar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 4rem;
}

.wo-app-logo {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.wo-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.wo-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: 1.25rem;
    color: var(--gray);
    font-weight: 700;
    font-size: 0.9rem;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
}

.wo-nav-item svg {
    opacity: 0.6;
    transition: all 0.3s ease;
}

.wo-nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: white;
}

.wo-nav-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.wo-nav-item.active svg {
    opacity: 1;
    color: var(--primary);
}

.wo-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-cancel-radical {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
    padding: 0.8rem;
    border-radius: 1rem;
    font-weight: 700;
}

.btn-save-radical {
    background: var(--primary);
    border: none;
    color: white;
    padding: 1.25rem;
    border-radius: 1rem;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
}

.btn-save-radical:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.wo-content-area {
    flex: 1;
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.03), transparent 30%);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.wo-form-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 3rem 4rem;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.wo-content-header {
    margin-bottom: 4rem;
}

.wo-content-header h1 {
    font-size: 2.5rem;
    font-weight: 950;
    letter-spacing: -0.06em;
    color: white;
    margin-bottom: 0.5rem;
}

.wo-content-header p {
    color: var(--gray);
    font-size: 1.1rem;
    font-weight: 500;
}

.wo-modular-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    width: 100%;
    box-sizing: border-box;
}

.wo-modular-grid > div {
    min-width: 0; /* Important to prevent overflow in flex/grid */
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Final cleanup of conflicting grid styles */
@media (max-width: 1200px) {
    .radical-wo-modal {
        flex-direction: column !important;
        height: 98vh !important;
    }
    .wo-sidebar, .wo-summary-bar {
        width: 100% !important;
        border: none !important;
        padding: 1.5rem !important;
    }
    .wo-nav {
        flex-direction: row !important;
        overflow-x: auto !important;
    }
}

/* Redefine form-section for the new modal */
.radical-wo-modal .form-section {
    background: #111a2e !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2) !important;
    border-radius: 2rem !important;
}

.radical-wo-modal .form-section:hover {
    transform: none !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.radical-wo-modal .step-num {
    background: #1e293b !important;
    color: var(--gray) !important;
    box-shadow: none !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}


.wo-summary-bar {
    width: 320px;
    background: #0f172a;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 3rem 2rem;
    flex-shrink: 0;
}

.summary-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- ULTIMATE PREMIUM REDESIGN: WORK ORDER 3.0 --- */
.wo-modern-modal {
    background: #0f172a !important; /* Rich Dark Slate */
    background-image: 
        radial-gradient(at 0% 0%, rgba(30, 41, 59, 0.4) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(15, 23, 42, 0.4) 0px, transparent 50%) !important;
}

.wo-glass-card {
    background: #1e293b !important; /* Solid Slate 800 */
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 1.5rem !important; /* Less rounded, more pro */
    padding: 2.5rem !important;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 
        0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s ease !important;
    position: relative;
    display: flex;
    flex-direction: column;
}

.wo-glass-card:hover {
    border-color: rgba(37, 99, 235, 0.4) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.wo-modern-label {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #cbd5e1 !important; /* Slate 300 */
    text-transform: uppercase !important;
    letter-spacing: 0.025em !important;
    margin-bottom: 0.6rem !important;
    display: block !important;
}

.wo-modern-input {
    background: #0f172a !important; /* Slate 900 */
    border: 1px solid #334155 !important;
    border-radius: 0.75rem !important;
    color: #f1f5f9 !important;
    padding: 0.85rem 1.25rem !important;
    font-size: 0.95rem !important;
    transition: all 0.2s ease !important;
}

.wo-modern-input:focus {
    border-color: #3b82f6 !important;
    background: #0f172a !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2) !important;
    outline: none;
}

/* HIDE NUMBER SPINNERS FOR WO-MODERN-INPUT */
.wo-modern-input::-webkit-outer-spin-button,
.wo-modern-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
.wo-modern-input[type=number] {
    -moz-appearance: textfield;
}

.wo-step-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    color: white;
    margin-right: 1.5rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.wo-step-badge::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(255,255,255,0.2), transparent);
}

.wo-header-pill {
    background: rgba(37, 99, 235, 0.12);
    color: #60a5fa;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    border: 1px solid rgba(37, 99, 235, 0.3);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    animation: statusPulse 3s infinite ease-in-out;
}

.wo-header-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #60a5fa;
    border-radius: 50%;
    box-shadow: 0 0 10px #60a5fa;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
}

.wo-btn-save {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: white !important;
    padding: 1.25rem 3.5rem !important;
    border-radius: 1.75rem !important;
    font-weight: 800 !important;
    font-size: 1.1rem !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.4) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    letter-spacing: -0.01em !important;
}

.wo-btn-save:hover {
    transform: scale(1.05) translateY(-3px) !important;
    box-shadow: 0 30px 60px -12px rgba(37, 99, 235, 0.5) !important;
    filter: brightness(1.1);
}

.wo-footer-actions {
    background: rgba(2, 6, 23, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 2.5rem 5rem !important;
    z-index: 1000 !important;
}

/* Subtle row animation */
#budget-items-tbody tr {
    animation: fadeInSlide 0.4s ease forwards;
    opacity: 0;
}

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

