/* ========================================
   AUTH GATE — Pantalla de login bloqueante
   ======================================== */
.auth-gate {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1a2b3c 0%, #16a085 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}
.auth-gate.hidden { display: none; }
.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}
.auth-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.25rem;
    padding: 1.25rem;
    background: #1a2b3c;
    border-radius: 50%;
    display: block;
    box-shadow: 0 8px 24px rgba(26,43,60,0.25);
    object-fit: contain;
}
.auth-title { font-size: 1.5rem; color: #2c3e50; margin-bottom: 0.25rem; }
.auth-subtitle { font-size: 0.9rem; color: #7f8c8d; margin-bottom: 2rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.auth-form .input-group label { display: block; font-size: 0.8rem; color: #7f8c8d; margin-bottom: 0.35rem; font-weight: 500; }
.auth-form .input-group input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.auth-form .input-group input:focus { outline: none; border-color: #1abc9c; }
.auth-submit { margin-top: 0.5rem; padding: 0.85rem; font-size: 1rem; }
.auth-error {
    background: #fee;
    color: #c0392b;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
    margin: 0;
}
.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #c0392b;
    border-color: #f1c7c0;
}
.btn-logout:hover {
    background: #fdecea;
    color: #a93226;
}

:root {
    /* Contabilium Inspired Palette - Clean & Professional */
    --bg-app: #f4f7fa;
    /* Light gray background for contrast */
    --bg-sidebar: #1a2b3c;
    /* Solid deep navy/teal from the image */
    --bg-card: #ffffff;
    --bg-input: #ffffff;

    --white: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --text-dim: #95a5a6;
    --text-sidebar: #cbd5e0;

    --accent: #1abc9c;
    /* Contabilium Teal */
    --accent-dark: #16a085;
    --emerald: #27ae60;
    --red: #e74c3c;

    --border: #e1e8ed;
    --border-sidebar: rgba(255, 255, 255, 0.05);

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 4px;
    /* More rectangular/professional */
    --radius-lg: 8px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 4px 15px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-app);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    line-height: 1.5;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Hamburger Menu (Mobile Only) */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1100;
    background: var(--slate-800);
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--slate-700);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-sidebar);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    max-width: 140px;
    height: auto;
    display: block;
}

.sidebar-list {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.sidebar-item {
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-sidebar);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-sidebar);
    position: relative;
    border-left: 4px solid transparent;
    /* La barra vertical del proveedor */
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.sidebar-item.active {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--white) !important;
    border-left-width: 6px;
    /* Resaltar la barra al estar activo */
}

/* Flecha de conexión (opcional, Contabilium no la usa pero la mantengo si prefieres, 
   o la quito para limpieza total. La quitaré para limpieza total) */
.sidebar-item.active::after {
    display: none;
}

.count-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-sidebar);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    min-width: 20px;
    text-align: center;
}

.sidebar-item.active .count-badge {
    background: var(--accent);
    color: var(--white);
}

.supplier-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Delete Button: Ghost style to avoid "white patch" */
.btn-delete-item {
    background: transparent !important;
    border: none !important;
    padding: 6px !important;
    opacity: 0.3;
    color: var(--text-dim) !important;
    transition: var(--transition);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-item:hover .btn-delete-item {
    opacity: 1;
}

.btn-delete-item:hover {
    background: var(--red) !important;
    color: var(--white) !important;
    opacity: 1;
    transform: scale(1.1);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-app);
}

.main-header {
    padding: 2.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.supplier-info h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.status-group {
    display: flex;
    gap: 0.75rem;
}

.badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    /* Prolijo */
    font-weight: 700;
    background: #e1e8ed;
    color: var(--text-muted);
    border: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-connected {
    background: rgba(255, 255, 255, 0.8);
    color: var(--accent);
    border: 1px solid rgba(26, 188, 156, 0.2);
    padding-left: 1.75rem;
    position: relative;
    box-shadow: 0 2px 8px rgba(26, 188, 156, 0.1);
    backdrop-filter: blur(4px);
}

.badge-connected::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(26, 188, 156, 0.4);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% {
        box-shadow: 0 0 0 0 rgba(26, 188, 156, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(26, 188, 156, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(26, 188, 156, 0);
    }
}

.sync-indicator {
    font-size: 0.7rem;
    color: var(--slate-500);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sync-indicator.show {
    opacity: 1;
}

.sync-indicator.saved {
    color: var(--accent);
}

.header-actions {
    display: flex;
    gap: 1.25rem;
    /* Separación generosa */
}

/* Buttons */
/* Botones Elegantes & Premium */
button {
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.8rem 1.75rem;
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
    border: none;
    box-shadow: 0 2px 4px rgba(26, 188, 156, 0.2);
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(26, 188, 156, 0.3);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--text-muted);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--red);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-icon:hover {
    background: rgba(26, 188, 156, 0.1);
    color: var(--accent);
    border-color: rgba(26, 188, 156, 0.2);
    transform: translateY(-2px);
}

/* Workspace Panels */
.workspace {
    flex: 1;
    padding: 0 3rem 3rem 3rem;
    overflow-y: auto;
}

.input-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    box-shadow: none;
    /* Plano y limpio */
}

.quick-input-form {
    display: flex;
    gap: 1.25rem;
    align-items: flex-end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.input-group.grow {
    flex: 2;
    /* Toma la mayor parte del espacio */
}

.input-group:not(.grow) {
    flex: 0 0 auto;
}

/* Anchos específicos para que el nombre destaque */
.input-group:has(#p-qty) {
    width: 80px;
}

.input-group:has(#p-sku) {
    width: 140px;
}

.input-group label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

input {
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.85rem 1rem;
    /* Padding cómodo pero no excesivo */
    border-radius: 8px;
    outline: none;
    width: 100%;
    transition: all 0.2s ease;
    font-weight: 400;
    box-shadow: none;
    /* Asegurar plano */
}

input:focus {
    background: var(--white);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.1);
    /* Glow sutil */
    transform: none;
    /* Sin movimiento */
}

input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Toolbar & Search */
.table-toolbar {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.search-container {
    position: relative;
    width: 300px;
}

.search-container svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-500);
    pointer-events: none;
}

#product-search {
    padding-left: 2.5rem;
    background: var(--white);
    border-radius: var(--radius);
}

/* Empty State */
.empty-state {
    padding: 5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-dim);
}

.icon-large {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.empty-state h3 {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Editable Cells */
.editable-cell {
    cursor: text;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.editable-cell:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.editable-cell:focus {
    background: var(--bg-input);
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.table-container {
    background: transparent;
    border-radius: 0;
    border: none;
    overflow-x: auto;
}

.products-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    /* Espacio entre filas */
}

.products-table th {
    padding: 0.75rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: none;
    /* Menos agresivo que uppercase */
    background: #f1f4f7;
    border-bottom: 2px solid var(--border);
}

.products-table th:first-child {
    border-top-left-radius: var(--radius);
}

.products-table th:last-child {
    border-top-right-radius: var(--radius);
}

.products-table td {
    padding: 0.85rem 1.25rem;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.9rem;
}

.products-table tr td:first-child {
    border-left: 1px solid var(--border);
}

.products-table tr td:last-child {
    border-right: 1px solid var(--border);
}

.products-table tr:hover td {
    background: #fdfdfd;
    border-color: var(--border-hover);
}

/* Table Column Widths */
.w-qty {
    width: 80px;
    text-align: center;
}

.w-sku {
    width: 150px;
}

.w-actions {
    width: 60px;
    text-align: right;
}

.tr-new {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.icon-small {
    width: 18px;
    height: 18px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.hidden {
    display: none;
}

.modal {
    background: var(--white);
    width: 750px;
    padding: 3.5rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-premium);
    box-shadow: var(--shadow-premium);
    max-width: 95vw;
}

.modal.glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-body {
    display: flex;
    flex-direction: column;
    max-height: 550px;
    /* Más espacio vertical */
    overflow-y: auto;
    padding-right: 1rem;
}

/* History Item Styling */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    gap: 1.5rem;
    /* Espacio entre texto y botón */
}

.history-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--border);
    transition: background 0.2s;
}

.history-item:hover {
    background: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(26, 188, 156, 0.3);
}

.history-item:hover::before {
    background: var(--accent);
}

.history-info {
    flex: 1;
    /* Ocupar el espacio disponible */
    min-width: 0;
    /* Permitir truncate si es necesario */
}

.history-event {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    /* Gris oscuro legible */
    display: block;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-dim);
    display: block;
    margin-bottom: 0.5rem;
}

.history-count {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.04);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

.btn-restore {
    background: var(--white);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    font-weight: 600;
    white-space: nowrap;
    /* No romper línea */
    flex-shrink: 0;
    /* No encoger */
    box-shadow: var(--shadow-sm);
}

.btn-restore:hover {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
    box-shadow: 0 4px 6px rgba(26, 188, 156, 0.2);
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-input);
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

input[type="color"] {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    background: none;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Big Alert Notification */
.big-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.big-alert-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.big-alert-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    max-width: 450px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border);
}

.big-alert-overlay.show .big-alert-card {
    transform: scale(1);
}

.big-alert-icon {
    width: 64px;
    height: 64px;
    background: rgba(26, 188, 156, 0.1);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.big-alert-icon svg {
    width: 32px;
    height: 32px;
}

.big-alert-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.big-alert-message {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1050;
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(260px);
    }

    .menu-toggle {
        display: flex;
    }

    .main-header {
        padding: 6rem 1.5rem 1.5rem;
        flex-direction: column;
        gap: 1.5rem;
    }

    .header-actions {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .workspace {
        padding: 0 1.5rem 1.5rem;
    }

    .quick-input-form {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group:not(.grow),
    .input-group:has(#p-qty),
    .input-group:has(#p-sku) {
        width: 100%;
    }
}

#color-hex-preview {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.close-modal {
    background: none;
    color: var(--text-dim);
    font-size: 1.5rem;
}

.close-modal:hover {
    color: var(--text-main);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Premium Trash Cards */
.trash-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 2rem;
}

.trash-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.trash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-color: var(--accent);
}

.trash-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--item-color, var(--accent));
}

.trash-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.trash-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 500;
}

.trash-supplier {
    font-weight: 800;
    color: var(--text-main);
    font-size: 1.1rem;
}

.trash-summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #f8fafc;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid var(--border);
}

.trash-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}

.toast {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease forwards;
    min-width: 300px;
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.toast.success {
    border-left-color: var(--emerald);
}

.toast.error {
    border-left-color: var(--red);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsiveness */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        bottom: 0;
        z-index: 1050;
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(300px);
    }

    .menu-toggle {
        display: flex;
    }

    .main-header {
        padding-top: 5rem;
        flex-direction: column;
        gap: 1.5rem;
    }

    .header-actions {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
}

@media (max-width: 768px) {
    .workspace {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }

    .quick-input-form {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group.grow {
        flex: none;
    }

    .modal {
        padding: 2rem;
        border-radius: 20px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .main-header h2 {
        font-size: 1.4rem;
    }

    .products-table th,
    .products-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .w-sku {
        display: none;
    }

    /* Hide SKU on very small screens if needed */
}

/* Date Navigation - Premium Redesign */
.date-navigation-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.date-navigation-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    opacity: 0.8;
}

.date-display-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

#label-current-date {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    text-transform: uppercase;
    transition: var(--transition);
}

.badge-today {
    background: rgba(26, 188, 156, 0.15);
    color: var(--accent-dark);
    border: 1px solid rgba(26, 188, 156, 0.3);
    box-shadow: 0 2px 4px rgba(26, 188, 156, 0.1);
}

.badge-neutral {
    background: #f1f5f9;
    color: var(--slate-500);
    border: 1px solid var(--border);
}

.date-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    min-width: 200px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.btn-nav {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-nav:hover {
    background: var(--bg-app);
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.date-picker-wrapper {
    position: relative;
    width: 32px;
    height: 32px;
}

#date-picker-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.btn-icon-tiny {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.date-picker-wrapper:hover .btn-icon-tiny {
    background: rgba(26, 188, 156, 0.1);
    color: var(--accent);
}

@media (max-width: 768px) {
    .date-navigation-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .date-display-group {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .btn-nav {
        width: 100%;
        height: 44px;
        /* Larger touch target */
        border-radius: 8px;
    }

    /* Move nav buttons to bottom or sides? 
       Let's keep text in middle and buttons distinct 
    */
    .date-navigation-container {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }

    .date-display-group {
        grid-column: 1 / -1;
        order: -1;
        margin-bottom: 0.5rem;
    }

    #prev-day {
        grid-column: 1;
    }

    #next-day {
        grid-column: 3;
    }
}