/**
 * LaserFlow ERP - Customer Panel Theme
 * Light + Dark theme support
 */

/* ==========================================================================
   CSS Custom Properties - Brand Colors
   ========================================================================== */

:root {
    /* Primary Blue */
    --lf-primary-50: #eff6ff;
    --lf-primary-100: #dbeafe;
    --lf-primary-200: #bfdbfe;
    --lf-primary-300: #93c5fd;
    --lf-primary-400: #60a5fa;
    --lf-primary-500: #3b82f6;
    --lf-primary-600: #2563eb;
    --lf-primary-700: #1d4ed8;
    --lf-primary-800: #1e40af;
    --lf-primary-900: #1e3a8a;

    /* Slate Gray */
    --lf-slate-50: #f8fafc;
    --lf-slate-100: #f1f5f9;
    --lf-slate-200: #e2e8f0;
    --lf-slate-300: #cbd5e1;
    --lf-slate-400: #94a3b8;
    --lf-slate-500: #64748b;
    --lf-slate-600: #475569;
    --lf-slate-700: #334155;
    --lf-slate-800: #1e293b;
    --lf-slate-900: #0f172a;

    /* Semantic colors */
    --lf-success: #22c55e;
    --lf-danger: #ef4444;
    --lf-warning: #f59e0b;

    /* Theme tokens - Light defaults */
    --lf-bg: #f8fafc;
    --lf-bg-card: #ffffff;
    --lf-bg-card-hover: #f8fafc;
    --lf-bg-muted: #f1f5f9;
    --lf-bg-inset: #f8fafc;
    --lf-border: #e2e8f0;
    --lf-border-light: #f1f5f9;
    --lf-text: #0f172a;
    --lf-text-secondary: #475569;
    --lf-text-muted: #64748b;
    --lf-text-faint: #94a3b8;
    --lf-accent: #2563eb;
    --lf-bg-active: #eff6ff;
    --lf-bg-preview: #f8fafc;
}

.dark {
    --lf-bg: #0f172a;
    --lf-bg-card: #1e293b;
    --lf-bg-card-hover: #334155;
    --lf-bg-muted: #334155;
    --lf-bg-inset: #0f172a;
    --lf-border: #334155;
    --lf-border-light: #1e293b;
    --lf-text: #f1f5f9;
    --lf-text-secondary: #cbd5e1;
    --lf-text-muted: #94a3b8;
    --lf-text-faint: #64748b;
    --lf-accent: #38bdf8;
    --lf-bg-active: #1e3a5f;
    --lf-bg-preview: #f8fafc;

    --lf-slate-50: #0f172a;
    --lf-slate-100: #1e293b;
    --lf-slate-200: #334155;
    --lf-slate-300: #475569;
    --lf-slate-400: #64748b;
    --lf-slate-500: #94a3b8;
    --lf-slate-600: #cbd5e1;
    --lf-slate-700: #e2e8f0;
    --lf-slate-800: #f1f5f9;
    --lf-slate-900: #f8fafc;

    --lf-primary-50: #172554;
    --lf-primary-100: #1e3a8a;
    --lf-primary-200: #1e40af;
}

/* ==========================================================================
   Page Headers - Unified Style
   ========================================================================== */

.lf-page-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.lf-page-header-inline {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.lf-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--lf-slate-900);
    margin: 0;
    line-height: 1.2;
}

.lf-page-subtitle {
    font-size: 0.875rem;
    color: var(--lf-slate-500);
    font-weight: 400;
}

/* Override Filament's gray scale for light mode */
.fi-body:not(.dark) {
    --gray-50: 248 250 252;
    --gray-100: 241 245 249;
    --gray-200: 226 232 240;
    --gray-300: 203 213 225;
    --gray-400: 148 163 184;
    --gray-500: 100 116 139;
    --gray-600: 71 85 105;
    --gray-700: 51 65 85;
    --gray-800: 30 41 59;
    --gray-900: 15 23 42;
    --gray-950: 2 6 23;
}

/* ==========================================================================
   Base Layout
   ========================================================================== */

.fi-body {
    background-color: var(--lf-bg) !important;
}

.fi-main {
    background-color: var(--lf-bg) !important;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.fi-sidebar {
    background: var(--lf-bg-card) !important;
    border-right: 1px solid var(--lf-border) !important;
}

.fi-sidebar-header {
    background: var(--lf-bg-card) !important;
    border-bottom: 1px solid var(--lf-border) !important;
    padding: 1rem !important;
}

/* Brand name in sidebar */
.fi-sidebar-header-title {
    color: var(--lf-slate-900) !important;
    font-weight: 700 !important;
}

/* Sidebar navigation */
.fi-sidebar-nav {
    padding: 0.5rem !important;
}

.fi-sidebar-item-button {
    color: var(--lf-slate-600) !important;
    border-radius: 0.5rem !important;
    transition: all 0.2s ease !important;
    margin: 0.125rem 0 !important;
}

.fi-sidebar-item-button:hover {
    background-color: var(--lf-slate-100) !important;
    color: var(--lf-slate-900) !important;
}

.fi-sidebar-item-active .fi-sidebar-item-button {
    background-color: var(--lf-primary-100) !important;
    color: var(--lf-primary-700) !important;
}

.fi-sidebar-item-active .fi-sidebar-item-button .fi-sidebar-item-icon {
    color: var(--lf-primary-600) !important;
}

.fi-sidebar-item-icon {
    color: var(--lf-slate-400) !important;
}

.fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    color: var(--lf-slate-600) !important;
}

/* ==========================================================================
   Topbar
   ========================================================================== */

.fi-topbar {
    background-color: var(--lf-bg-card) !important;
    border-bottom: 1px solid var(--lf-border) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}

.fi-topbar-nav-btn {
    color: var(--lf-slate-600) !important;
}

.fi-topbar-nav-btn:hover {
    background-color: var(--lf-slate-100) !important;
}

/* User menu */
.fi-user-menu {
    flex-shrink: 0;
}

.fi-user-menu-trigger {
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    padding: 0.1875rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: all 0.15s ease;
    cursor: pointer;
}

.fi-user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(96, 165, 250, 0.45);
}

.fi-user-menu-trigger .fi-avatar,
.fi-user-menu-trigger .fi-user-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 9999px !important;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   Page Header
   ========================================================================== */

.fi-header {
    margin-bottom: 1.5rem !important;
}

.fi-header-heading {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--lf-slate-900) !important;
}

.fi-header-subheading {
    color: var(--lf-slate-500) !important;
}

/* Breadcrumbs */
.fi-breadcrumbs-item {
    color: var(--lf-slate-500) !important;
}

.fi-breadcrumbs-item-separator {
    color: var(--lf-slate-300) !important;
}

/* ==========================================================================
   Cards & Sections
   ========================================================================== */

.fi-section {
    background-color: var(--lf-bg-card) !important;
    border: 1px solid var(--lf-border) !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}

.fi-section-header {
    background-color: var(--lf-bg-muted) !important;
    border-bottom: 1px solid var(--lf-border) !important;
    padding: 1rem 1.25rem !important;
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

.fi-section-header-heading {
    color: var(--lf-slate-900) !important;
    font-weight: 600 !important;
}

.fi-section-content {
    padding: 1.25rem !important;
}

/* Widget cards */
.fi-wi-stats-overview-stat {
    background-color: var(--lf-bg-card) !important;
    border: 1px solid var(--lf-border) !important;
    border-radius: 0.75rem !important;
}

.fi-wi-stats-overview-stat-value {
    color: var(--lf-slate-900) !important;
}

.fi-wi-stats-overview-stat-label {
    color: var(--lf-slate-500) !important;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

/* Primary button */
.fi-btn-primary,
button.fi-btn[data-color="primary"] {
    background-color: var(--lf-primary-600) !important;
    color: white !important;
    border-radius: 0.5rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    border: none !important;
}

.fi-btn-primary:hover,
button.fi-btn[data-color="primary"]:hover {
    background-color: var(--lf-primary-700) !important;
}

/* Success button */
.fi-btn-success,
button.fi-btn[data-color="success"] {
    background-color: var(--lf-success) !important;
    color: white !important;
}

/* Danger button */
.fi-btn-danger,
button.fi-btn[data-color="danger"] {
    background-color: var(--lf-danger) !important;
    color: white !important;
}

/* Secondary/Gray button */
.fi-btn-gray,
button.fi-btn[data-color="gray"] {
    background-color: var(--lf-bg-card) !important;
    border: 1px solid var(--lf-border) !important;
    color: var(--lf-slate-700) !important;
}

.fi-btn-gray:hover,
button.fi-btn[data-color="gray"]:hover {
    background-color: var(--lf-slate-50) !important;
}

/* Icon buttons */
.fi-icon-btn {
    color: var(--lf-slate-500) !important;
    transition: all 0.15s ease !important;
}

.fi-icon-btn:hover {
    background-color: var(--lf-slate-100) !important;
    color: var(--lf-slate-700) !important;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

/* Text inputs */
.fi-input,
.fi-select-input,
.fi-textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
    background-color: var(--lf-bg-card) !important;
    border: 1px solid var(--lf-border) !important;
    border-radius: 0.5rem !important;
    color: var(--lf-slate-900) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.fi-input:focus,
.fi-select-input:focus,
.fi-textarea:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--lf-primary-500) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    outline: none !important;
}

.fi-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--lf-slate-400) !important;
}

/* Labels */
.fi-fo-field-wrp-label,
.fi-input-wrapper-label,
label {
    color: var(--lf-slate-700) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
}

/* Helper text */
.fi-fo-field-wrp-helper-text {
    color: var(--lf-slate-500) !important;
}

/* Checkboxes & Radios */
.fi-checkbox-input:checked,
input[type="checkbox"]:checked {
    background-color: var(--lf-primary-600) !important;
    border-color: var(--lf-primary-600) !important;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.fi-ta-table {
    background-color: var(--lf-bg-card) !important;
    border-radius: 0.75rem !important;
    overflow: hidden !important;
}

.fi-ta-header {
    background-color: var(--lf-bg-muted) !important;
}

.fi-ta-header-cell {
    background-color: var(--lf-bg-muted) !important;
    color: var(--lf-slate-600) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.05em !important;
    border-bottom: 1px solid var(--lf-border) !important;
}

.fi-ta-row {
    border-bottom: 1px solid var(--lf-slate-100) !important;
    transition: background-color 0.15s ease !important;
}

.fi-ta-row:hover {
    background-color: var(--lf-slate-50) !important;
}

.fi-ta-cell {
    color: var(--lf-slate-700) !important;
}

/* Empty state */
.fi-ta-empty-state {
    background-color: var(--lf-bg-card) !important;
}

.fi-ta-empty-state-heading {
    color: var(--lf-slate-900) !important;
}

.fi-ta-empty-state-description {
    color: var(--lf-slate-500) !important;
}

/* ==========================================================================
   Modals & Dialogs
   ========================================================================== */

.fi-modal-window {
    background-color: var(--lf-bg-card) !important;
    border-radius: 1rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.fi-modal-header {
    border-bottom: 1px solid var(--lf-border) !important;
    padding: 1.25rem !important;
}

.fi-modal-heading {
    color: var(--lf-slate-900) !important;
    font-weight: 600 !important;
}

.fi-modal-content {
    padding: 1.25rem !important;
}

.fi-modal-footer {
    border-top: 1px solid var(--lf-border) !important;
    background-color: var(--lf-bg-muted) !important;
    padding: 1rem 1.25rem !important;
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.fi-notification {
    background-color: var(--lf-bg-card) !important;
    border: 1px solid var(--lf-border) !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

.fi-notification-title {
    color: var(--lf-slate-900) !important;
}

.fi-notification-body {
    color: var(--lf-slate-600) !important;
}

/* Notification variants */
.fi-notification[data-type="success"] {
    border-left: 4px solid var(--lf-success) !important;
}

.fi-notification[data-type="danger"] {
    border-left: 4px solid var(--lf-danger) !important;
}

.fi-notification[data-type="warning"] {
    border-left: 4px solid var(--lf-warning) !important;
}

.fi-notification[data-type="info"] {
    border-left: 4px solid var(--lf-primary-500) !important;
}

/* ==========================================================================
   Badges & Tags
   ========================================================================== */

.fi-badge {
    border-radius: 9999px !important;
    font-weight: 500 !important;
    font-size: 0.75rem !important;
}

.fi-badge-primary,
.fi-badge[data-color="primary"] {
    background-color: var(--lf-primary-100) !important;
    color: var(--lf-primary-700) !important;
}

.fi-badge-success,
.fi-badge[data-color="success"] {
    background-color: #dcfce7 !important;
    color: #15803d !important;
}

.fi-badge-danger,
.fi-badge[data-color="danger"] {
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
}

.fi-badge-warning,
.fi-badge[data-color="warning"] {
    background-color: #fef3c7 !important;
    color: #b45309 !important;
}

.fi-badge-gray,
.fi-badge[data-color="gray"] {
    background-color: var(--lf-slate-100) !important;
    color: var(--lf-slate-600) !important;
}

/* ==========================================================================
   Tabs
   ========================================================================== */

.fi-tabs {
    background-color: var(--lf-slate-100) !important;
    border-radius: 0.5rem !important;
    padding: 0.25rem !important;
}

.fi-tabs-item-button {
    color: var(--lf-slate-600) !important;
    border-radius: 0.375rem !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
}

.fi-tabs-item-button:hover {
    color: var(--lf-slate-900) !important;
}

.fi-tabs-item-active .fi-tabs-item-button {
    background-color: var(--lf-bg-card) !important;
    color: var(--lf-primary-600) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.fi-pagination-item-button {
    color: var(--lf-slate-600) !important;
    border-radius: 0.375rem !important;
    transition: all 0.15s ease !important;
}

.fi-pagination-item-button:hover {
    background-color: var(--lf-slate-100) !important;
}

.fi-pagination-item-active .fi-pagination-item-button {
    background-color: var(--lf-primary-600) !important;
    color: white !important;
}

/* ==========================================================================
   Dropdown Menus
   ========================================================================== */

.fi-dropdown-panel {
    background-color: var(--lf-bg-card) !important;
    border: 1px solid var(--lf-border) !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

.fi-dropdown-list-item-button {
    color: var(--lf-slate-700) !important;
}

.fi-dropdown-list-item-button:hover {
    background-color: var(--lf-slate-50) !important;
}

/* ==========================================================================
   InfoList (for detail pages)
   ========================================================================== */

.fi-in-entry-wrp {
    border-bottom: 1px solid var(--lf-slate-100) !important;
}

.fi-in-entry-wrp-label {
    color: var(--lf-slate-500) !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.fi-in-text-item {
    color: var(--lf-slate-900) !important;
}

/* ==========================================================================
   Actions
   ========================================================================== */

.fi-ac-btn-action {
    color: var(--lf-slate-600) !important;
}

.fi-ac-btn-action:hover {
    color: var(--lf-primary-600) !important;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.fi-loading-indicator {
    color: var(--lf-primary-600) !important;
}

/* ==========================================================================
   Scrollbar (Light Theme)
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--lf-slate-100);
}

::-webkit-scrollbar-thumb {
    background: var(--lf-slate-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--lf-slate-400);
}

/* ==========================================================================
   Scrollbar (Dark Mode)
   ========================================================================== */

.dark ::-webkit-scrollbar-track {
    background: var(--lf-slate-100);
}

.dark ::-webkit-scrollbar-thumb {
    background: var(--lf-slate-300);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: var(--lf-slate-400);
}

/* ==========================================================================
   Generator Page Styles
   ========================================================================== */

.lf-gen-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
}

@media (max-width: 1024px) {
    .lf-gen-grid {
        grid-template-columns: 1fr;
    }
}

.lf-gen-card {
    background: var(--lf-bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--lf-border);
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    min-width: 0;
    width: 100%;
}

.lf-gen-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--lf-slate-900);
    margin: 0 0 1rem 0;
}

.lf-gen-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--lf-slate-900);
    margin: 0 0 0.75rem 0;
}

.lf-gen-shapes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.lf-gen-shape-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px solid var(--lf-border);
    background: var(--lf-bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 1rem;
    color: var(--lf-slate-700);
}

.lf-gen-shape-btn:hover {
    border-color: var(--lf-slate-400);
}

.lf-gen-shape-btn.active {
    border-color: var(--lf-primary-500);
    background: var(--lf-primary-50);
    color: var(--lf-primary-700);
}

.dark .lf-gen-shape-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: #60a5fa;
    color: #bfdbfe;
}

.lf-gen-shape-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.lf-gen-shape-btn span {
    font-weight: 500;
}

.lf-gen-divider {
    border-top: 1px solid var(--lf-border);
    padding-top: 1.5rem;
    margin-top: 0.5rem;
}

.lf-gen-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--lf-slate-700);
    margin-bottom: 0.5rem;
}

.lf-gen-label-hint {
    font-weight: 400;
    color: var(--lf-slate-400);
    font-size: 0.8rem;
}

.lf-gen-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--lf-border);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--lf-slate-900);
    background: var(--lf-bg-card);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.lf-gen-input:focus {
    border-color: var(--lf-primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.lf-gen-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--lf-border);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--lf-slate-900);
    background: var(--lf-bg-card);
    outline: none;
    cursor: pointer;
}

.lf-gen-select:focus {
    border-color: var(--lf-primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.lf-gen-field {
    margin-bottom: 1rem;
}

.lf-gen-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.lf-gen-checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    cursor: pointer;
}

.lf-gen-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--lf-primary-600);
}

.lf-gen-checkbox-label {
    font-weight: 500;
    color: var(--lf-slate-700);
}

.lf-gen-sub-fields {
    margin-top: 0.75rem;
    padding-left: 2rem;
}

.lf-gen-sub-fields .lf-gen-label {
    font-size: 0.75rem;
    color: var(--lf-slate-600);
}

.lf-gen-stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1rem 0;
}

.lf-gen-stat {
    background: var(--lf-slate-50);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.lf-gen-stat-label {
    font-size: 0.75rem;
    color: var(--lf-slate-500);
    display: block;
    margin-bottom: 0.25rem;
}

.lf-gen-stat-value {
    font-weight: 600;
    color: var(--lf-slate-900);
}

.lf-gen-stat-primary {
    background: var(--lf-primary-50);
}

.lf-gen-stat-primary .lf-gen-stat-label {
    color: var(--lf-primary-600);
}

.lf-gen-stat-primary .lf-gen-stat-value {
    color: var(--lf-primary-900);
}

.dark .lf-gen-stat {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--lf-border);
}

.dark .lf-gen-stat-primary {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.dark .lf-gen-stat-primary .lf-gen-stat-label {
    color: #93c5fd;
}

.dark .lf-gen-stat-primary .lf-gen-stat-value {
    color: #bfdbfe;
}

.lf-gen-preview {
    aspect-ratio: 1;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid var(--lf-border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #1e40af;
}

.dark .lf-gen-preview {
    background: #f8fafc;
    color: #1e40af;
}

.lf-gen-preview svg {
    max-width: 100%;
    max-height: 100%;
}

.lf-gen-btn {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--lf-primary-600);
    color: white;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
    font-family: inherit;
}

.lf-gen-btn:hover {
    background: var(--lf-primary-700);
}

.lf-gen-btn:disabled {
    background: var(--lf-primary-300);
    cursor: not-allowed;
}

.lf-gen-btn svg {
    width: 20px;
    height: 20px;
}

.lf-gen-scroll {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.lf-gen-page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--lf-slate-900);
    margin: 0 0 0.5rem 0;
}

.lf-gen-page-subtitle {
    color: var(--lf-slate-600);
    margin: 0 0 2rem 0;
}

/* ==========================================================================
   Import Page Styles
   ========================================================================== */

.lf-import-container {
    max-width: 100%;
    margin: 0 auto;
}

.lf-import-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--lf-slate-900);
    margin: 0 0 0.5rem 0;
}

.lf-import-subtitle {
    color: var(--lf-slate-600);
    margin: 0 0 2rem 0;
}

.lf-import-dropzone {
    background: var(--lf-bg-card);
    border: 2px dashed var(--lf-border);
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

.lf-import-dropzone:hover {
    border-color: var(--lf-primary-400);
    background: var(--lf-primary-50);
}

.lf-import-dropzone.dragging {
    border-color: var(--lf-primary-500);
    background: var(--lf-primary-50);
}

.lf-import-dropzone-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--lf-slate-400);
}

.lf-import-dropzone-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--lf-slate-900);
    margin: 0 0 0.5rem 0;
}

.lf-import-dropzone-text {
    color: var(--lf-slate-500);
    margin: 0 0 1.5rem 0;
}

.lf-import-dropzone-hint {
    font-size: 0.75rem;
    color: var(--lf-slate-400);
    margin: 1rem 0 0 0;
}

.lf-import-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--lf-primary-600);
    color: white;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
    font-family: inherit;
}

.lf-import-btn:hover {
    background: var(--lf-primary-700);
}

.lf-import-btn svg {
    width: 20px;
    height: 20px;
}

.lf-import-card {
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.lf-import-card-header {
    background: var(--lf-bg-muted);
    border-bottom: 1px solid var(--lf-border);
    padding: 0.875rem 1.25rem;
}

.lf-import-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--lf-slate-900);
    margin: 0;
}

.lf-import-card-body {
    padding: 1.25rem;
}

.lf-import-empty {
    text-align: center;
    padding: 2rem;
    color: var(--lf-slate-500);
}

.lf-import-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    color: var(--lf-slate-300);
}

.lf-import-info {
    background: var(--lf-primary-50);
    border: 1px solid var(--lf-primary-200);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.lf-import-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--lf-primary-900);
    margin: 0 0 0.75rem 0;
}

.lf-import-info ol {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--lf-primary-800);
    font-size: 0.875rem;
}

.lf-import-info li {
    margin-bottom: 0.375rem;
}

.lf-import-info li:last-child {
    margin-bottom: 0;
}

.dark .lf-import-info {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.dark .lf-import-info h4 {
    color: #93c5fd;
}

.dark .lf-import-info ol {
    color: #bfdbfe;
}

/* Import settings grid */
.lf-import-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

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

.lf-import-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 0.5rem;
    color: #b45309;
    font-size: 0.875rem;
}

.lf-import-warning svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.lf-import-dropzone.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.lf-import-btn.disabled {
    background: var(--lf-slate-300);
    cursor: not-allowed;
    pointer-events: none;
}

/* File list for uploaded files */
.lf-import-files {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lf-import-file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--lf-slate-100);
}

.lf-import-file:last-child {
    border-bottom: none;
}

.lf-import-file-icon {
    width: 40px;
    height: 40px;
    background: var(--lf-slate-100);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lf-slate-500);
}

.lf-import-file-icon svg {
    width: 20px;
    height: 20px;
}

.lf-import-file-info {
    flex: 1;
}

.lf-import-file-name {
    font-weight: 500;
    color: var(--lf-slate-900);
    margin: 0 0 0.125rem 0;
}

.lf-import-file-size {
    font-size: 0.75rem;
    color: var(--lf-slate-500);
    margin: 0;
}

.lf-import-file-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
}

.lf-import-file-status.pending {
    background: var(--lf-slate-100);
    color: var(--lf-slate-600);
}

.lf-import-file-status.processing {
    background: #fef3c7;
    color: #b45309;
}

.lf-import-file-status.success {
    background: #dcfce7;
    color: #15803d;
}

.lf-import-file-status.error {
    background: #fef2f2;
    color: #dc2626;
}

/* ==========================================================================
   Products Page Styles
   ========================================================================== */

.lf-products-container {
    width: 100%;
}

.lf-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.lf-products-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--lf-slate-900);
    margin: 0 0 0.25rem 0;
}

.lf-products-subtitle {
    color: var(--lf-slate-600);
    margin: 0;
}

.lf-products-actions {
    display: flex;
    gap: 0.5rem;
}

.lf-products-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--lf-primary-600);
    color: white;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background 0.2s;
    font-family: inherit;
}

.lf-products-btn:hover {
    background: var(--lf-primary-700);
    color: white;
}

.lf-products-btn svg {
    width: 16px;
    height: 16px;
}

.lf-products-filters {
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.lf-products-search {
    flex: 1;
    min-width: 200px;
}

.lf-products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

@media (max-width: 1400px) {
    .lf-products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .lf-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 800px) {
    .lf-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .lf-products-grid {
        grid-template-columns: 1fr;
    }
}

.lf-product-card {
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.lf-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

a.lf-product-image {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.lf-product-image {
    aspect-ratio: 1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lf-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lf-product-image-placeholder {
    color: var(--lf-slate-300);
}

.lf-product-image-placeholder svg {
    width: 64px;
    height: 64px;
}

.lf-product-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.02em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lf-product-badge.draft {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.lf-product-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.lf-product-badge.auto_priced {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.lf-product-badge.calculated {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.lf-product-badge.approved {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.lf-product-badge.submitted {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.lf-product-badge.ordered {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.lf-product-badge.in_production {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.lf-product-badge.completed {
    background: rgba(22, 163, 74, 0.15);
    color: #4ade80;
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.lf-product-badge.cancelled {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.lf-product-info {
    padding: 0.875rem;
}

/* Row layout for product card */
.lf-product-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.lf-product-row:last-of-type {
    margin-bottom: 0;
}

/* Row 1: Model ID + Revision */
.lf-product-model-id {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--lf-slate-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

a.lf-product-link {
    text-decoration: none;
    color: var(--lf-slate-900);
    transition: color 0.15s ease;
}

a.lf-product-link:hover {
    color: var(--lf-primary-600);
}

/* Quantity row in product card */
.lf-product-qty-row {
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--lf-slate-100);
}

.lf-product-qty-label {
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: var(--lf-slate-500) !important;
    flex-shrink: 0;
}

.lf-product-qty-control {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.lf-product-qty-unit {
    font-size: 0.75rem;
    color: var(--lf-slate-500);
    margin-left: 0.125rem;
}

.lf-product-revision {
    font-size: 0.75rem;
    color: var(--lf-slate-500);
    background: var(--lf-slate-100);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

/* Row 2: Name + Weight */
.lf-product-name {
    font-size: 0.8rem;
    color: var(--lf-slate-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.lf-product-weight {
    font-size: 0.75rem;
    color: var(--lf-slate-500);
    flex-shrink: 0;
}

/* Row 3: Material + Thickness */
.lf-product-material {
    font-size: 0.75rem;
    color: var(--lf-slate-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.lf-product-thickness {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--lf-slate-700);
    flex-shrink: 0;
}

/* Legacy - kept for compatibility */
.lf-product-model {
    font-size: 0.875rem;
    color: var(--lf-slate-500);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lf-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.lf-product-thickness {
    color: var(--lf-slate-500);
}

.lf-product-price {
    font-weight: 600;
    color: var(--lf-slate-900);
}

.lf-product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--lf-slate-100);
}

.lf-product-action-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.lf-product-action-btn.secondary {
    background: var(--lf-slate-100);
    color: var(--lf-slate-600);
}

.lf-product-action-btn.secondary:hover {
    background: var(--lf-slate-200);
}

.lf-product-action-btn.primary {
    background: var(--lf-primary-50);
    color: var(--lf-primary-600);
}

.lf-product-action-btn.primary:hover {
    background: var(--lf-primary-100);
}

.lf-product-action-btn.lf-btn-request,
.lf-product-action-btn.lf-btn-order {
    position: relative;
}

.lf-btn-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.lf-btn-cart-badge-request {
    background: #f59e0b;
}

.lf-btn-cart-badge-order {
    background: #22c55e;
}

.lf-product-action-btn.lf-btn-request {
    background: #fef3c7;
    color: #b45309;
}

.lf-product-action-btn.lf-btn-request:hover {
    background: #fde68a;
    color: #92400e;
}

.lf-product-action-btn.lf-btn-order {
    background: #dcfce7;
    color: #15803d;
}

.lf-product-action-btn.lf-btn-order:hover {
    background: #bbf7d0;
    color: #166534;
}

.lf-product-action-btn.lf-btn-pdf {
    background: #fee2e2;
    color: #b91c1c;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.lf-product-action-btn.lf-btn-pdf:hover {
    background: #fecaca;
    color: #991b1b;
}

.lf-products-empty {
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    padding: 3rem;
    text-align: center;
}

.lf-products-empty-icon {
    width: 48px;
    height: 48px;
    color: var(--lf-slate-300);
    margin: 0 auto 1rem;
}

.lf-products-empty h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--lf-slate-900);
    margin: 0 0 0.5rem 0;
}

.lf-products-empty p {
    color: var(--lf-slate-500);
    margin: 0 0 1rem 0;
}

.lf-products-pagination {
    margin-top: 1.5rem;
}

.lf-products-pagination nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.lf-products-pagination nav svg {
    width: 20px;
    height: 20px;
}

.lf-products-pagination nav a,
.lf-products-pagination nav span,
.lf-products-pagination nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
    color: var(--lf-slate-600);
    text-decoration: none;
    transition: all 0.15s;
}

.lf-products-pagination nav a:hover {
    background: var(--lf-slate-100);
    color: var(--lf-slate-900);
}

.lf-products-pagination nav span[aria-current="page"] span,
.lf-products-pagination nav .fi-pagination-item-active {
    background: var(--lf-primary-600);
    color: white;
    font-weight: 600;
}

.lf-products-pagination nav span[aria-disabled="true"],
.lf-products-pagination nav .fi-pagination-item-disabled {
    opacity: 0.4;
    cursor: default;
}

.lf-products-pagination p {
    font-size: 0.8rem;
    color: var(--lf-slate-500);
    text-align: center;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Add Product Page Styles
   ========================================================================== */

.lf-add-product-container {
    max-width: 800px;
    margin: 0 auto;
}

.lf-add-product-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.lf-add-product-card {
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    overflow: hidden;
}

.lf-add-product-card-header {
    background: var(--lf-bg-muted);
    border-bottom: 1px solid var(--lf-border);
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lf-add-product-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--lf-slate-900);
    margin: 0;
}

.lf-add-product-card-hint {
    font-size: 0.75rem;
    color: var(--lf-slate-500);
}

.lf-add-product-card-body {
    padding: 1.25rem;
}

.lf-add-product-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.lf-add-product-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .lf-add-product-row,
    .lf-add-product-row-3 {
        grid-template-columns: 1fr;
    }
}

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

.lf-input-error {
    border-color: var(--lf-danger) !important;
}

.lf-field-error {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--lf-danger);
}

.lf-gen-textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--lf-border);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--lf-slate-900);
    background: var(--lf-bg-card);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    resize: vertical;
    font-family: inherit;
    min-height: 80px;
}

.lf-gen-textarea:focus {
    border-color: var(--lf-primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Dropzone */
.lf-add-product-dropzone {
    background: var(--lf-bg-muted);
    border: 2px dashed var(--lf-border);
    border-radius: 0.5rem;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lf-add-product-dropzone:hover {
    border-color: var(--lf-primary-400);
    background: var(--lf-primary-50);
}

.lf-add-product-dropzone.dragging {
    border-color: var(--lf-primary-500);
    background: var(--lf-primary-50);
}

.lf-add-product-dropzone-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.75rem;
    color: var(--lf-slate-400);
}

.lf-add-product-dropzone-text {
    color: var(--lf-slate-600);
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
}

.lf-add-product-dropzone-hint {
    font-size: 0.75rem;
    color: var(--lf-slate-400);
    margin: 0.75rem 0 0 0;
}

.lf-add-product-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--lf-primary-600);
    color: white;
    font-weight: 500;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s;
    font-family: inherit;
}

.lf-add-product-upload-btn:hover {
    background: var(--lf-primary-700);
}

.lf-add-product-upload-btn svg {
    width: 16px;
    height: 16px;
}

/* Selected files */
.lf-add-product-files {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--lf-border);
}

.lf-add-product-files h4 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--lf-slate-700);
    margin: 0 0 0.75rem 0;
}

.lf-add-product-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lf-add-product-file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem;
    background: var(--lf-slate-50);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.lf-add-product-file-item:last-child {
    margin-bottom: 0;
}

.lf-add-product-file-icon {
    width: 32px;
    height: 32px;
    background: var(--lf-bg-card);
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lf-slate-400);
    flex-shrink: 0;
}

.lf-add-product-file-icon svg {
    width: 18px;
    height: 18px;
}

.lf-add-product-file-info {
    flex: 1;
    min-width: 0;
}

.lf-add-product-file-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--lf-slate-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lf-add-product-file-size {
    display: block;
    font-size: 0.75rem;
    color: var(--lf-slate-500);
}

.lf-add-product-file-remove {
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0.25rem;
    color: var(--lf-slate-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.lf-add-product-file-remove:hover {
    background: var(--lf-slate-200);
    color: var(--lf-danger);
}

.lf-add-product-file-remove svg {
    width: 16px;
    height: 16px;
}

/* Actions */
.lf-add-product-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.lf-add-product-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--lf-primary-600);
    color: white;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    font-family: inherit;
}

.lf-add-product-btn-primary:hover {
    background: var(--lf-primary-700);
}

.lf-add-product-btn-primary:disabled {
    background: var(--lf-primary-300);
    cursor: not-allowed;
}

.lf-add-product-btn-primary svg {
    width: 18px;
    height: 18px;
}

.lf-add-product-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--lf-bg-card);
    color: var(--lf-slate-700);
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid var(--lf-border);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-family: inherit;
}

.lf-add-product-btn-secondary:hover {
    background: var(--lf-slate-50);
    border-color: var(--lf-slate-400);
}

/* Spinner animation */
.lf-spinner {
    animation: lf-spin 1s linear infinite;
}

@keyframes lf-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Filter Sidebar Styles (Products Page)
   ========================================================================== */

.lf-products-layout {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    width: 100%;
}

.lf-filter-sidebar {
    width: 256px;
    min-width: 256px;
    flex-shrink: 0;
}

.lf-products-main {
    flex: 1;
    min-width: 0;
}

.lf-filter-card {
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 5rem;
    overflow: hidden;
}

.lf-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--lf-border);
}

.lf-filter-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--lf-slate-900);
}

.lf-filter-clear {
    font-size: 0.8rem;
    color: var(--lf-primary-600);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    transition: background 0.15s;
}

.lf-filter-clear:hover {
    background: var(--lf-primary-50);
}

.lf-filter-body {
    padding: 1rem;
}

.lf-filter-group {
    margin-bottom: 1.25rem;
}

.lf-filter-group:last-child {
    margin-bottom: 0;
}

.lf-filter-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--lf-slate-700);
    margin-bottom: 0.5rem;
}

.lf-filter-group input,
.lf-filter-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--lf-border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--lf-slate-900);
    background: var(--lf-bg-card);
    box-sizing: border-box;
}

.lf-filter-group input:focus,
.lf-filter-group select:focus {
    outline: none;
    border-color: var(--lf-primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.lf-filter-group input::placeholder {
    color: var(--lf-slate-400);
}

.lf-filter-range {
    display: flex;
    gap: 0.5rem;
}

.lf-filter-range input {
    flex: 1;
    min-width: 0;
}

.lf-filter-dates {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Products count */
.lf-products-count {
    font-size: 0.875rem;
    color: var(--lf-slate-500);
    margin-bottom: 1rem;
}

.lf-products-count strong {
    color: var(--lf-slate-900);
    font-weight: 600;
}

/* Secondary button variant */
.lf-products-btn.secondary {
    background: var(--lf-bg-card);
    color: var(--lf-slate-700);
    border: 1px solid var(--lf-border);
}

.lf-products-btn.secondary:hover {
    background: var(--lf-slate-50);
    color: var(--lf-slate-900);
}

/* Responsive - stack layout on smaller screens */
@media (max-width: 900px) {
    .lf-products-layout {
        flex-direction: column;
    }
    
    .lf-filter-sidebar {
        width: 100%;
        min-width: 100%;
        order: -1; /* Filter hore */
    }
    
    .lf-filter-card {
        position: static;
    }
    
    .lf-filter-body {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .lf-filter-group {
        margin-bottom: 0;
    }
}

@media (max-width: 600px) {
    .lf-filter-body {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .lf-filter-body {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   History Page Styles
   ========================================================================== */

.lf-history-container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.lf-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lf-history-item {
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.lf-history-item-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    transition: background-color 0.15s;
}

.lf-history-item-header:hover {
    background: var(--lf-slate-50);
}

.lf-history-item-toggle {
    color: var(--lf-slate-400);
    flex-shrink: 0;
}

.lf-history-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.lf-history-item-number {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--lf-slate-900);
}

.lf-history-item-date {
    font-size: 0.75rem;
    color: var(--lf-slate-500);
}

.lf-history-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
    flex-shrink: 0;
}

.lf-history-item-count {
    font-size: 0.8rem;
    color: var(--lf-slate-500);
}

.lf-history-item-total {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--lf-slate-900);
}

.lf-history-item-ref {
    font-size: 0.7rem;
    color: var(--lf-primary-600);
    background: var(--lf-primary-50);
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

/* Expandovaný detail */
.lf-history-item-detail {
    border-top: 1px solid var(--lf-border);
    padding: 1.25rem;
    background: var(--lf-bg-muted);
}

.lf-history-item-notes {
    font-size: 0.85rem;
    color: var(--lf-slate-600);
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--lf-bg-card);
    border-radius: 0.5rem;
    border: 1px solid var(--lf-border);
}

/* Tabuľka produktov */
.lf-history-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.5rem;
    overflow: hidden;
}

.lf-history-table thead th {
    padding: 0.625rem 0.75rem;
    background: var(--lf-slate-100);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--lf-slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    white-space: nowrap;
}

.lf-history-table tbody td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--lf-slate-100);
    font-size: 0.8rem;
    color: var(--lf-slate-700);
    vertical-align: middle;
}

.lf-history-table tbody tr:last-child td {
    border-bottom: none;
}

.lf-history-table tbody tr:hover td {
    background: var(--lf-slate-50);
}

.lf-history-table .col-model { width: 28%; }
.lf-history-table .col-material { width: 24%; color: var(--lf-slate-500); font-size: 0.78rem; }
.lf-history-table .col-thickness { width: 10%; text-align: center; }
.lf-history-table .col-qty { width: 8%; text-align: center; font-weight: 500; }
.lf-history-table .col-price { width: 15%; text-align: right; }
.lf-history-table .col-total { width: 15%; text-align: right; font-weight: 600; color: var(--lf-slate-900); }

.lf-history-table thead .col-thickness,
.lf-history-table thead .col-qty { text-align: center; }
.lf-history-table thead .col-price,
.lf-history-table thead .col-total { text-align: right; }

.lf-history-product-name {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--lf-slate-900);
    text-decoration: none;
}

.lf-history-product-name:hover {
    color: var(--lf-primary-600);
}

.lf-auto-badge {
    color: #d97706;
    font-size: 0.65rem;
    font-weight: 500;
    margin-left: 0.25rem;
}

/* Akcie v histórii */
.lf-history-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

.lf-history-actions .lf-product-action-btn {
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
}

@media (max-width: 640px) {
    .lf-history-item-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .lf-history-table thead {
        display: none;
    }

    .lf-history-table,
    .lf-history-table tbody,
    .lf-history-table tr,
    .lf-history-table td {
        display: block;
        width: 100%;
    }

    .lf-history-table tbody tr {
        padding: 0.5rem 0.75rem;
        border-bottom: 1px solid var(--lf-slate-100);
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.125rem 0.5rem;
    }

    .lf-history-table tbody td {
        padding: 0.125rem 0;
        border-bottom: none;
        font-size: 0.78rem;
    }

    .lf-history-table .col-model {
        grid-column: 1 / -1;
        font-weight: 600;
    }

    .lf-history-table .col-price,
    .lf-history-table .col-total {
        text-align: right;
    }

    .lf-cart-table thead { display: none; }
    .lf-cart-table, .lf-cart-table tbody, .lf-cart-table tr, .lf-cart-table td { display: block; width: 100%; }
    .lf-cart-table tbody tr {
        padding: 0.75rem;
        border-bottom: 1px solid var(--lf-slate-100);
        display: grid;
        grid-template-columns: auto 1fr 1fr;
        gap: 0.25rem 0.5rem;
    }
    .lf-cart-table .col-img { grid-row: 1 / 3; }
    .lf-cart-table .col-model { grid-column: 2 / -1; font-weight: 600; }
    .lf-cart-table .col-name { display: none; }
    .lf-cart-table .col-material, .lf-cart-table .col-thickness { font-size: 0.75rem; }
    .lf-cart-table .col-qty, .lf-cart-table .col-price { padding: 0.25rem 0; }
    .lf-cart-table .col-remove { position: absolute; right: 0.5rem; top: 0.5rem; }
    .lf-cart-table tbody tr { position: relative; }
}

/* ==========================================================================
   Topbar Cart Icons
   ========================================================================== */

.fi-topbar-end .lf-topbar-carts,
.lf-topbar-carts {
    display: flex !important;
    align-items: center;
    gap: 0.375rem;
    margin-right: 0.25rem;
    flex-shrink: 0;
}

.lf-topbar-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    text-decoration: none;
}

.lf-topbar-cart svg {
    width: 22px;
    height: 22px;
}

/* Request cart - light orange */
.lf-topbar-cart-request {
    color: #b45309;
    background: #fef3c7;
}

.lf-topbar-cart-request:hover {
    background: #fde68a;
    color: #92400e;
}

/* Order cart - green */
.lf-topbar-cart-order {
    color: #15803d;
    background: #dcfce7;
}

.lf-topbar-cart-order:hover {
    background: #bbf7d0;
    color: #166534;
}

/* Badge */
.lf-topbar-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.lf-topbar-cart-badge-request {
    background: #f59e0b;
}

.lf-topbar-cart-badge-order {
    background: #22c55e;
}

/* ==========================================================================
   Cart Page Styles
   ========================================================================== */

.lf-cart-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

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

.lf-cart-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--lf-slate-900);
    margin: 0;
}

.lf-cart-subtitle {
    font-size: 0.875rem;
    color: var(--lf-slate-500);
    margin: 0.25rem 0 0 0;
}

.lf-cart-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.lf-cart-badge.request {
    background: #fef3c7;
    color: #b45309;
}

.lf-cart-badge.order {
    background: #dcfce7;
    color: #15803d;
}

/* Cart Table */
.lf-cart-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.lf-cart-table thead th {
    padding: 0.625rem 0.75rem;
    background: var(--lf-slate-100);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--lf-slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    white-space: nowrap;
}

.lf-cart-table tbody td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--lf-slate-100);
    font-size: 0.8rem;
    color: var(--lf-slate-700);
    vertical-align: middle;
}

.lf-cart-table tbody tr:last-child td { border-bottom: none; }
.lf-cart-table tbody tr:hover td { background: var(--lf-slate-50); }

.lf-cart-table .col-img { width: 50px; padding: 0.375rem 0.5rem; }
.lf-cart-table .col-model { width: 15%; font-weight: 500; }
.lf-cart-table .col-name { width: 15%; color: var(--lf-slate-500); font-size: 0.78rem; }
.lf-cart-table .col-material { width: 18%; color: var(--lf-slate-500); font-size: 0.78rem; }
.lf-cart-table .col-thickness { width: 8%; text-align: center; }
.lf-cart-table .col-qty { width: 14%; text-align: center; }
.lf-cart-table .col-price { width: 14%; text-align: right; }
.lf-cart-table .col-remove { width: 36px; text-align: center; padding: 0.375rem; }

.lf-cart-table thead .col-thickness,
.lf-cart-table thead .col-qty { text-align: center; }
.lf-cart-table thead .col-price { text-align: right; }

.lf-cart-link {
    font-weight: 500;
    color: var(--lf-slate-900);
    text-decoration: none;
}

.lf-cart-link:hover {
    color: var(--lf-primary-600);
}

.lf-cart-price-value {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--lf-slate-900);
}

.lf-cart-price-unit {
    display: block;
    font-size: 0.7rem;
    color: var(--lf-slate-400);
    font-weight: 400;
}

/* Legacy Cart Items List (unused, kept for safety) */
.lf-cart-items {
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.lf-cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--lf-slate-100);
    transition: background-color 0.15s ease;
}

.lf-cart-item:last-child {
    border-bottom: none;
}

.lf-cart-item:hover {
    background-color: var(--lf-slate-50);
}

.lf-cart-item-image {
    width: 44px;
    height: 44px;
    border-radius: 0.375rem;
    background: var(--lf-slate-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.lf-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lf-cart-item-image svg {
    width: 20px;
    height: 20px;
    color: var(--lf-slate-300);
}

.lf-cart-item-info {
    flex: 1;
    min-width: 0;
}

.lf-cart-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--lf-slate-900);
    margin: 0 0 0.125rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lf-cart-item-name a {
    color: var(--lf-slate-900);
    text-decoration: none;
}

.lf-cart-item-name a:hover {
    color: var(--lf-primary-600);
}

.lf-cart-item-desc {
    font-size: 0.8rem;
    color: var(--lf-slate-500);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lf-cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.lf-cart-item-qty-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lf-slate-100);
    border: 1px solid var(--lf-border);
    border-radius: 0.375rem;
    cursor: pointer;
    color: var(--lf-slate-600);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.15s ease;
    padding: 0;
    font-family: inherit;
}

.lf-cart-item-qty-btn:hover {
    background: var(--lf-slate-200);
    color: var(--lf-slate-900);
}

.lf-cart-item-qty-input {
    width: 48px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--lf-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--lf-slate-900);
    padding: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}

.lf-cart-item-qty-input::-webkit-outer-spin-button,
.lf-cart-item-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.lf-cart-item-qty-input:focus {
    outline: none;
    border-color: var(--lf-primary-500);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.lf-cart-item-price {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--lf-slate-900);
    min-width: 80px;
    text-align: right;
    flex-shrink: 0;
}

.lf-cart-item-price-waiting {
    font-size: 0.75rem;
    color: var(--lf-slate-400);
    font-weight: 400;
    font-style: italic;
}

.lf-cart-item-remove {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    color: var(--lf-slate-400);
    transition: all 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.lf-cart-item-remove:hover {
    background: #fef2f2;
    color: var(--lf-danger);
}

.lf-cart-item-remove svg {
    width: 18px;
    height: 18px;
}

/* Cart Footer / Summary */
.lf-cart-summary {
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.lf-cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.lf-cart-summary-row.total {
    border-top: 2px solid var(--lf-border);
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.lf-cart-summary-label {
    font-size: 0.9rem;
    color: var(--lf-slate-600);
}

.lf-cart-summary-label.total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--lf-slate-900);
}

.lf-cart-summary-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--lf-slate-900);
}

.lf-cart-summary-value.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--lf-primary-700);
}

/* Cart Notes */
.lf-cart-notes {
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.lf-cart-notes h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--lf-slate-900);
    margin: 0 0 0.75rem 0;
}

.lf-cart-notes textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid var(--lf-border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--lf-slate-900);
    background: var(--lf-bg-card);
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

.lf-cart-notes textarea:focus {
    outline: none;
    border-color: var(--lf-primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Cart Actions */
.lf-cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.lf-cart-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: inherit;
}

.lf-cart-submit-btn.request {
    background: #f59e0b;
    color: white;
}

.lf-cart-submit-btn.request:hover {
    background: #d97706;
}

.lf-cart-submit-btn.order {
    background: var(--lf-success);
    color: white;
}

.lf-cart-submit-btn.order:hover {
    background: #16a34a;
}

.lf-cart-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lf-cart-submit-btn svg {
    width: 20px;
    height: 20px;
}

.lf-cart-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--lf-slate-500);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s;
}

.lf-cart-back-link:hover {
    color: var(--lf-primary-600);
}

.lf-cart-back-link svg {
    width: 16px;
    height: 16px;
}

/* Cart Empty State */
.lf-cart-empty {
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    padding: 4rem 2rem;
    text-align: center;
}

.lf-cart-empty svg {
    width: 64px;
    height: 64px;
    color: var(--lf-slate-300);
    margin: 0 auto 1rem;
}

.lf-cart-empty h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--lf-slate-900);
    margin: 0 0 0.5rem 0;
}

.lf-cart-empty p {
    color: var(--lf-slate-500);
    margin: 0 0 1.5rem 0;
}

/* Add to cart buttons on product pages */
.lf-cart-add-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lf-cart-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.lf-cart-add-btn.request {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.lf-cart-add-btn.request:hover {
    background: #fde68a;
}

.lf-cart-add-btn.order {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.lf-cart-add-btn.order:hover {
    background: #bbf7d0;
}

.lf-cart-add-btn svg {
    width: 14px;
    height: 14px;
}

/* ================================================
   Material Autocomplete
   ================================================ */
.lf-autocomplete-item:hover {
    background: var(--lf-bg-muted) !important;
}

.lf-autocomplete-item:last-child {
    border-bottom: none !important;
}

/* ==========================================================================
   Product Gallery & Lightbox
   ========================================================================== */

.lf-gallery-strip {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.lf-gallery-thumb {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 0.375rem;
    border: 2px solid var(--lf-border);
    background: #f8fafc;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.15s;
}

.lf-gallery-thumb:hover {
    border-color: var(--lf-primary-400);
}

.lf-gallery-thumb.active {
    border-color: var(--lf-primary-500);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.lf-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lf-gallery-thumb-wrap {
    position: relative;
    flex-shrink: 0;
}

.lf-gallery-set-main {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--lf-border);
    background: white;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s;
    z-index: 1;
}

.lf-gallery-set-main svg {
    width: 12px;
    height: 12px;
}

.lf-gallery-set-main:hover {
    color: #f59e0b;
    border-color: #f59e0b;
    transform: scale(1.15);
}

.lf-gallery-set-main.active {
    color: #f59e0b;
    border-color: #f59e0b;
    background: #fffbeb;
}

.dark .lf-gallery-set-main {
    background: #1e293b;
    color: #64748b;
    border-color: #334155;
}

.dark .lf-gallery-set-main:hover {
    color: #fbbf24;
    border-color: #fbbf24;
}

.dark .lf-gallery-set-main.active {
    color: #fbbf24;
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
}

.lf-new-file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #ecfdf5;
    border-radius: 0.375rem;
    margin-bottom: 0.375rem;
    border: 1px solid #a7f3d0;
}

.lf-new-file-icon {
    width: 24px;
    height: 24px;
    background: var(--lf-bg-card);
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
    flex-shrink: 0;
}

.lf-new-file-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #065f46;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lf-new-file-remove {
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0.25rem;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lf-new-file-remove:hover {
    color: #ef4444;
}

.dark .lf-new-file-item {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.25);
}

.dark .lf-new-file-icon {
    background: rgba(34, 197, 94, 0.15);
}

.dark .lf-new-file-name {
    color: #86efac;
}

.dark .lf-new-file-remove {
    color: #64748b;
}

.dark .lf-new-file-remove:hover {
    color: #f87171;
}

.lf-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lf-lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 0.5rem;
    z-index: 1;
}

.lf-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: background 0.15s;
}

.lf-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lf-lightbox-close svg {
    width: 24px;
    height: 24px;
}

.lf-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: background 0.15s;
}

.lf-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lf-lightbox-nav svg {
    width: 28px;
    height: 28px;
}

.lf-lightbox-prev {
    left: 1rem;
}

.lf-lightbox-next {
    right: 1rem;
}

.lf-lightbox-caption {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    max-width: 80vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lf-lightbox-counter {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

/* ==========================================================================
   AI Chat Page
   ========================================================================== */

.lf-chat-wrapper {
    display: flex;
    justify-content: center;
    padding: 0;
    height: calc(100vh - 5rem);
    max-height: calc(100vh - 5rem);
}

.lf-chat-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 820px;
    height: 100%;
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ── Header ── */

.lf-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--lf-border);
    background: var(--lf-bg-card);
    flex-shrink: 0;
}

.lf-chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lf-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--lf-primary-500), var(--lf-primary-700));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lf-chat-avatar svg {
    width: 22px;
    height: 22px;
    color: white;
}

.lf-chat-header-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--lf-slate-900);
    margin: 0;
    line-height: 1.3;
}

.lf-chat-header-subtitle {
    font-size: 0.75rem;
    color: var(--lf-slate-500);
    margin: 0;
    line-height: 1.3;
}

.lf-chat-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--lf-slate-600);
    background: var(--lf-bg-muted);
    border: 1px solid var(--lf-border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.lf-chat-new-btn:hover {
    background: var(--lf-slate-200);
    color: var(--lf-slate-900);
    border-color: var(--lf-slate-300);
}

.lf-chat-new-btn svg {
    width: 14px;
    height: 14px;
}

/* ── Messages area ── */

.lf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Message rows ── */

.lf-chat-row {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    max-width: 85%;
}

.lf-chat-row-user {
    align-self: flex-end;
    flex-direction: row;
}

.lf-chat-row-ai {
    align-self: flex-start;
    flex-direction: row;
}

/* ── Avatars ── */

.lf-chat-bubble-avatar {
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.lf-chat-bubble-avatar svg {
    width: 18px;
    height: 18px;
}

.lf-chat-bubble-avatar-ai {
    background: linear-gradient(135deg, var(--lf-primary-500), var(--lf-primary-700));
    color: white;
}

.lf-chat-bubble-avatar-user {
    background: var(--lf-slate-200);
    color: var(--lf-slate-600);
}

.dark .lf-chat-bubble-avatar-user {
    background: var(--lf-slate-300);
    color: var(--lf-slate-500);
}

/* ── Bubbles ── */

.lf-chat-bubble {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
    position: relative;
}

.lf-chat-bubble-user {
    background: var(--lf-primary-600);
    color: white;
    border-radius: 1rem 1rem 0.25rem 1rem;
}

.lf-chat-bubble-ai {
    background: var(--lf-bg-muted);
    color: var(--lf-slate-900);
    border-radius: 1rem 1rem 1rem 0.25rem;
    border: 1px solid var(--lf-border);
}

.lf-chat-bubble p {
    margin: 0;
}

.lf-chat-time {
    display: block;
    font-size: 0.625rem;
    opacity: 0.5;
    margin-top: 0.375rem;
    text-align: right;
}

/* ── Prose inside AI bubbles ── */

.lf-chat-prose {
    font-size: 0.875rem;
    line-height: 1.65;
}

.lf-chat-prose p {
    margin: 0.375rem 0;
}

.lf-chat-prose p:first-child {
    margin-top: 0;
}

.lf-chat-prose p:last-child {
    margin-bottom: 0;
}

.lf-chat-prose ul,
.lf-chat-prose ol {
    margin: 0.375rem 0;
    padding-left: 1.25rem;
}

.lf-chat-prose li {
    margin: 0.125rem 0;
}

.lf-chat-prose a {
    color: var(--lf-primary-600);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dark .lf-chat-prose a {
    color: var(--lf-primary-400);
}

.lf-chat-prose strong {
    font-weight: 600;
}

.lf-chat-prose code {
    font-size: 0.8em;
    background: rgba(0, 0, 0, 0.06);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.dark .lf-chat-prose code {
    background: rgba(255, 255, 255, 0.08);
}

/* ── Typing indicator ── */

.lf-chat-typing {
    padding: 0.875rem 1.125rem;
}

.lf-chat-typing-dots {
    display: flex;
    gap: 0.375rem;
    align-items: center;
    height: 20px;
}

.lf-chat-typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lf-slate-400);
    animation: lf-chat-bounce 1.2s ease-in-out infinite;
}

.lf-chat-typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.lf-chat-typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes lf-chat-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ── Empty state ── */

.lf-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 2rem 1rem;
    min-height: 400px;
}

.lf-chat-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, var(--lf-primary-100), var(--lf-primary-50));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.dark .lf-chat-empty-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.08));
}

.lf-chat-empty-icon svg {
    width: 36px;
    height: 36px;
    color: var(--lf-primary-500);
}

.lf-chat-empty-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--lf-slate-900);
    margin: 0 0 0.375rem 0;
}

.lf-chat-empty-text {
    font-size: 0.875rem;
    color: var(--lf-slate-500);
    margin: 0 0 1.75rem 0;
    max-width: 360px;
}

/* ── Hint buttons ── */

.lf-chat-hints {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
    max-width: 480px;
    width: 100%;
}

@media (max-width: 600px) {
    .lf-chat-hints {
        grid-template-columns: 1fr;
    }
}

.lf-chat-hint {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--lf-slate-700);
    background: var(--lf-bg-card);
    border: 1px solid var(--lf-border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: left;
    line-height: 1.3;
}

.lf-chat-hint:hover {
    border-color: var(--lf-primary-300);
    background: var(--lf-primary-50);
    color: var(--lf-primary-700);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

.dark .lf-chat-hint:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--lf-primary-300);
}

.lf-chat-hint svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--lf-slate-400);
    transition: color 0.2s;
}

.lf-chat-hint:hover svg {
    color: var(--lf-primary-500);
}

/* ── Input area ── */

.lf-chat-input-area {
    padding: 1rem 1.5rem 1rem;
    border-top: 1px solid var(--lf-border);
    background: var(--lf-bg-card);
    flex-shrink: 0;
}

.lf-chat-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.lf-chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 0.625rem;
    background: var(--lf-bg-muted);
    border: 1px solid var(--lf-border);
    border-radius: 0.875rem;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lf-chat-input-wrap:focus-within {
    border-color: var(--lf-primary-400);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.lf-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--lf-slate-900);
    font-size: 0.875rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    padding: 0.375rem 0;
    font-family: inherit;
    min-height: 24px;
    max-height: 120px;
}

.lf-chat-input::placeholder {
    color: var(--lf-slate-400);
}

.lf-chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 0.625rem;
    background: var(--lf-primary-600);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.lf-chat-send-btn:hover {
    background: var(--lf-primary-700);
    transform: scale(1.05);
}

.lf-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.lf-chat-send-btn svg {
    width: 16px;
    height: 16px;
    color: white;
}

.lf-chat-input-hint {
    font-size: 0.65rem;
    color: var(--lf-slate-400);
    margin: 0.5rem 0 0 0;
    text-align: center;
}
