/* ─────────────────────────────────────────────────────────────────────
   LEYFARMA Public App v3 — Modern POS UI
   Light theme · system font · large touch targets · accent colour
   ───────────────────────────────────────────────────────────────────── */

:root {
    --lf-bg:           #f5f7fa;
    --lf-surface:      #ffffff;
    --lf-surface-2:    #f8fafc;
    --lf-border:       #e5e7eb;
    --lf-border-soft:  #f1f5f9;
    --lf-text:         #0f172a;
    --lf-text-2:       #475569;
    --lf-text-3:       #94a3b8;

    --lf-primary:      #4f46e5;
    --lf-primary-600:  #4338ca;
    --lf-primary-50:   #eef2ff;
    --lf-success:      #16a34a;
    --lf-success-50:   #dcfce7;
    --lf-warning:      #f59e0b;
    --lf-warning-50:   #fef3c7;
    --lf-danger:       #dc2626;
    --lf-danger-50:    #fee2e2;
    --lf-info:         #0ea5e9;
    --lf-info-50:      #e0f2fe;
    --lf-violet:       #8b5cf6;
    --lf-teal:         #14b8a6;

    --lf-shadow-sm:    0 1px 2px 0 rgba(15, 23, 42, .05);
    --lf-shadow:       0 4px 6px -1px rgba(15, 23, 42, .07), 0 2px 4px -2px rgba(15, 23, 42, .05);
    --lf-shadow-lg:    0 10px 15px -3px rgba(15, 23, 42, .08), 0 4px 6px -4px rgba(15, 23, 42, .06);
    --lf-shadow-xl:    0 25px 50px -12px rgba(15, 23, 42, .25);

    --lf-radius-sm:    6px;
    --lf-radius:       10px;
    --lf-radius-lg:    14px;
    --lf-radius-xl:    20px;

    --lf-sidebar-w:    240px;
    --lf-sidebar-w-c:  72px;
    --lf-topbar-h:     64px;
}

.lf-app, .lf-app * { box-sizing: border-box; }

.lf-app {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--lf-bg);
    color: var(--lf-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    overflow: hidden;
}

body:has(#leyfarma-dashboard-root),
body:has(#leyfarma-pos-root),
body.leyfarma-fullscreen-app {
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}
body.leyfarma-fullscreen-app html,
html:has(body.leyfarma-fullscreen-app) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Kill the WP admin bar in case any other plugin re-enables it. */
body.leyfarma-fullscreen-app #wpadminbar,
.lf-app + #wpadminbar { display: none !important; }

/* ─── Safety net — hide third-party floating widgets ──────────────
   The fullscreen template already skips the theme's header/footer, so
   most floating widgets never render. This block is a defence-in-depth
   layer that hides anything fixed-positioned that wasn't injected by us,
   plus selectors known to be used by popular WhatsApp / chat plugins. */
body.leyfarma-fullscreen-app [class*="whatsapp" i],
body.leyfarma-fullscreen-app [id*="whatsapp" i],
body.leyfarma-fullscreen-app [class*="wa-button"],
body.leyfarma-fullscreen-app [class*="wa-chat"],
body.leyfarma-fullscreen-app [id^="joinchat"],
body.leyfarma-fullscreen-app [class*="joinchat"],
body.leyfarma-fullscreen-app [id*="ctc-analytics"],
body.leyfarma-fullscreen-app [class*="ctc-"],
body.leyfarma-fullscreen-app [class*="float-chat"],
body.leyfarma-fullscreen-app [class*="floating-chat"],
body.leyfarma-fullscreen-app [class*="chat-widget"],
body.leyfarma-fullscreen-app [class*="livechat"],
body.leyfarma-fullscreen-app #tawkchat-container,
body.leyfarma-fullscreen-app .tidio-chat,
body.leyfarma-fullscreen-app #crisp-chatbox,
body.leyfarma-fullscreen-app .intercom-launcher,
body.leyfarma-fullscreen-app .intercom-lightweight-app,
body.leyfarma-fullscreen-app #hubspot-messages-iframe-container,
body.leyfarma-fullscreen-app #drift-widget-container,
body.leyfarma-fullscreen-app #cookie-notice,
body.leyfarma-fullscreen-app #cookie-law-info-bar,
body.leyfarma-fullscreen-app .cli-modal,
body.leyfarma-fullscreen-app #gdpr-cookie-consent-bar,
body.leyfarma-fullscreen-app .holler-box,
body.leyfarma-fullscreen-app .ywccb-container,
body.leyfarma-fullscreen-app [id*="back-to-top"],
body.leyfarma-fullscreen-app [class*="back-to-top"],
body.leyfarma-fullscreen-app [class*="scroll-to-top"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ─── Sidebar ────────────────────────────────────────────────────── */
.lf-sidebar {
    width: var(--lf-sidebar-w);
    background: var(--lf-surface);
    border-right: 1px solid var(--lf-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width .2s ease;
}
.lf-app.is-collapsed .lf-sidebar { width: var(--lf-sidebar-w-c); }

.lf-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px;
    border-bottom: 1px solid var(--lf-border-soft);
    position: relative;
}
.lf-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--lf-primary), var(--lf-violet));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.lf-brand-text { flex: 1; min-width: 0; }
.lf-brand-name { font-weight: 700; font-size: 15px; letter-spacing: .3px; }
.lf-brand-sub  { color: var(--lf-text-3); font-size: 11px; }
.lf-app.is-collapsed .lf-brand-text { display: none; }

.lf-collapse-btn {
    background: transparent;
    border: 1px solid var(--lf-border);
    color: var(--lf-text-3);
    width: 26px; height: 26px;
    border-radius: 6px;
    cursor: pointer;
    display: none;
}
@media (min-width: 1100px) {
    .lf-collapse-btn { display: block; }
}

.lf-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}
.lf-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: 0;
    color: var(--lf-text-2);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background .15s, color .15s;
    width: 100%;
}
.lf-nav-item:hover { background: var(--lf-surface-2); color: var(--lf-text); }
.lf-nav-item.active {
    background: var(--lf-primary-50);
    color: var(--lf-primary);
}
.lf-nav-icon { font-size: 18px; flex-shrink: 0; width: 20px; text-align: center; }
.lf-app.is-collapsed .lf-nav-label { display: none; }
.lf-app.is-collapsed .lf-nav-item { justify-content: center; padding: 12px 0; }

.lf-sidebar-foot {
    padding: 12px 18px;
    color: var(--lf-text-3);
    font-size: 11px;
    border-top: 1px solid var(--lf-border-soft);
}
.lf-app.is-collapsed .lf-sidebar-foot { text-align: center; }

/* ─── Main / Topbar ───────────────────────────────────────────── */
.lf-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.lf-topbar {
    height: var(--lf-topbar-h);
    background: var(--lf-surface);
    border-bottom: 1px solid var(--lf-border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}
.lf-burger {
    background: transparent;
    border: 0;
    font-size: 22px;
    cursor: pointer;
    color: var(--lf-text-2);
    display: none;
    padding: 6px 8px;
    border-radius: 6px;
}
.lf-burger:hover { background: var(--lf-surface-2); }
@media (max-width: 1099px) {
    .lf-burger { display: block; }
    .lf-sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        z-index: 100;
        transform: translateX(0);
        transition: transform .25s;
    }
    .lf-app.is-collapsed .lf-sidebar { transform: translateX(-100%); width: var(--lf-sidebar-w); }
}

.lf-page-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--lf-text);
}
.lf-topbar-spacer { flex: 1; }
.lf-topbar-stats { display: flex; gap: 8px; }

.lf-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 12px;
    background: var(--lf-surface-2);
    border: 1px solid var(--lf-border-soft);
    border-radius: 999px;
    font-size: 12px;
}
.lf-chip-label { color: var(--lf-text-3); }
.lf-chip-value { font-weight: 700; color: var(--lf-text); }
.lf-chip-warn { background: var(--lf-warning-50); border-color: transparent; }
.lf-chip-warn .lf-chip-value { color: var(--lf-warning); }

/* ─── Content area & pages ───────────────────────────────────── */
.lf-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--lf-bg);
}
.lf-page { display: flex; flex-direction: column; gap: 20px; }

/* ─── Cards / sections ───────────────────────────────────────── */
.lf-card {
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-lg);
    padding: 20px;
    box-shadow: var(--lf-shadow-sm);
}
.lf-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.lf-card-head h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--lf-text);
}

.lf-grid { display: grid; gap: 20px; }
.lf-grid-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.lf-grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.lf-grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ─── Stat cards ─────────────────────────────────────────────── */
.lf-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.lf-stat-card {
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--lf-shadow-sm);
    transition: transform .15s, box-shadow .15s;
}
.lf-stat-card:hover { transform: translateY(-2px); box-shadow: var(--lf-shadow); }
.lf-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--lf-primary-50);
    color: var(--lf-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.lf-stat-body { min-width: 0; flex: 1; }
.lf-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--lf-text);
    line-height: 1.2;
}
.lf-stat-label {
    color: var(--lf-text-3);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-top: 2px;
}

.lf-tint-blue   .lf-stat-icon { background: var(--lf-info-50);    color: var(--lf-info); }
.lf-tint-amber  .lf-stat-icon { background: var(--lf-warning-50); color: var(--lf-warning); }
.lf-tint-red    .lf-stat-icon { background: var(--lf-danger-50);  color: var(--lf-danger); }
.lf-tint-green  .lf-stat-icon { background: var(--lf-success-50); color: var(--lf-success); }
.lf-tint-violet .lf-stat-icon { background: #f3e8ff;              color: var(--lf-violet); }
.lf-tint-teal   .lf-stat-icon { background: #ccfbf1;              color: var(--lf-teal); }

/* ─── Quick actions on dashboard ─────────────────────────────── */
.lf-quick-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
}
.lf-qa {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--lf-surface-2);
    border: 1px solid var(--lf-border-soft);
    border-radius: 10px;
    color: var(--lf-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background .15s, border-color .15s, transform .1s;
}
.lf-qa:hover { background: var(--lf-primary-50); border-color: var(--lf-primary); color: var(--lf-primary); }
.lf-qa-primary {
    background: var(--lf-primary);
    color: #fff;
    border-color: var(--lf-primary);
}
.lf-qa-primary:hover { background: var(--lf-primary-600); color: #fff; }
.lf-qa-icon { font-size: 20px; }

/* ─── Mini list (dashboard expirations) ──────────────────────── */
.lf-mini-list { list-style: none; padding: 0; margin: 0; }
.lf-mini-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--lf-border-soft);
    gap: 16px;
}
.lf-mini-item:last-child { border-bottom: 0; }
.lf-mini-main { min-width: 0; flex: 1; }
.lf-mini-title { font-weight: 500; color: var(--lf-text); }
.lf-mini-sub   { font-size: 12px; color: var(--lf-text-3); }
.lf-mini-right { text-align: right; }
.lf-mini-date  { font-size: 11px; color: var(--lf-text-3); margin-top: 2px; }

/* ─── Toolbars ───────────────────────────────────────────────── */
.lf-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.lf-toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lf-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: 10px;
    height: 40px;
    transition: border-color .15s, box-shadow .15s;
}
.lf-search:focus-within { border-color: var(--lf-primary); box-shadow: 0 0 0 3px var(--lf-primary-50); }
.lf-search input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--lf-text);
    min-width: 100px;
}
.lf-search-icon { color: var(--lf-text-3); font-size: 14px; }
.lf-search-clear {
    background: transparent; border: 0; cursor: pointer;
    color: var(--lf-text-3); font-size: 18px; line-height: 1;
}
.lf-search-grow { flex: 1; max-width: 480px; }

.lf-cat-pills {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.lf-cat-pill {
    padding: 6px 12px;
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    color: var(--lf-text-2);
    transition: background .15s, color .15s, border-color .15s;
}
.lf-cat-pill:hover { background: var(--lf-surface-2); }
.lf-cat-pill.active {
    background: var(--lf-primary);
    color: #fff;
    border-color: var(--lf-primary);
}

.lf-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: 10px;
    flex-wrap: wrap;
}
.lf-tab {
    padding: 8px 14px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--lf-text-2);
    white-space: nowrap;
}
.lf-tab:hover { background: var(--lf-surface-2); }
.lf-tab.active { background: var(--lf-primary); color: #fff; }
.lf-tabs-lg .lf-tab { padding: 10px 18px; font-size: 14px; }

/* ─── Buttons ────────────────────────────────────────────────── */
.lf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--lf-surface);
    color: var(--lf-text);
    border: 1px solid var(--lf-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, transform .1s;
    white-space: nowrap;
}
.lf-btn:hover { background: var(--lf-surface-2); }
.lf-btn:active { transform: scale(.98); }
.lf-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.lf-btn-primary {
    background: var(--lf-primary);
    color: #fff;
    border-color: var(--lf-primary);
}
.lf-btn-primary:hover { background: var(--lf-primary-600); }

.lf-btn-ghost {
    background: transparent;
    border-color: var(--lf-border);
    color: var(--lf-text-2);
}
.lf-btn-ghost:hover { background: var(--lf-surface-2); color: var(--lf-text); }

.lf-btn-xl {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
}

.lf-icon-btn {
    background: transparent;
    border: 0;
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 6px;
    font-size: 16px;
    color: var(--lf-text-2);
}
.lf-icon-btn:hover { background: var(--lf-surface-2); color: var(--lf-text); }

.lf-link {
    background: transparent;
    border: 0;
    color: var(--lf-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}
.lf-link:hover { background: var(--lf-primary-50); }
.lf-link-danger { color: var(--lf-danger); }
.lf-link-danger:hover { background: var(--lf-danger-50); }

/* ─── Inputs ─────────────────────────────────────────────────── */
.lf-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--lf-text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.lf-input:focus { border-color: var(--lf-primary); box-shadow: 0 0 0 3px var(--lf-primary-50); }
textarea.lf-input { height: auto; padding: 10px 12px; resize: vertical; }
.lf-input-lg { height: 56px; font-size: 22px; font-weight: 600; text-align: center; }
.lf-input-sm { height: 32px; font-size: 13px; padding: 0 10px; border-radius: 8px; max-width: 160px; }

.lf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lf-field > span {
    font-size: 12px;
    font-weight: 500;
    color: var(--lf-text-2);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.lf-inline-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--lf-text-2);
    font-size: 13px;
}

/* ─── Tables ─────────────────────────────────────────────────── */
.lf-table-wrap {
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-lg);
    overflow-x: auto;
}
.lf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.lf-table th, .lf-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--lf-border-soft);
    vertical-align: middle;
}
.lf-table th {
    background: var(--lf-surface-2);
    color: var(--lf-text-2);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.lf-table tbody tr { transition: background .1s; }
.lf-table tbody tr:hover { background: var(--lf-surface-2); }
.lf-table tbody tr:last-child td { border-bottom: 0; }

.lf-cell-prod {
    display: flex;
    align-items: center;
    gap: 10px;
}
.lf-cell-prod img {
    width: 36px; height: 36px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--lf-surface-2);
    flex-shrink: 0;
}
.lf-cell-prod-ph {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--lf-primary-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* ─── Pills / badges ──────────────────────────────────────────── */
.lf-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    background: var(--lf-surface-2);
    color: var(--lf-text-2);
}
.lf-pill-info     { background: var(--lf-info-50);    color: var(--lf-info); }
.lf-pill-ok       { background: var(--lf-success-50); color: var(--lf-success); }
.lf-pill-warning  { background: var(--lf-warning-50); color: var(--lf-warning); }
.lf-pill-critical { background: #ffedd5;              color: #c2410c; }
.lf-pill-expired  { background: var(--lf-danger-50);  color: var(--lf-danger); }

.lf-stock-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.lf-stock-ok  { background: var(--lf-success-50); color: var(--lf-success); }
.lf-stock-low { background: var(--lf-warning-50); color: var(--lf-warning); }
.lf-stock-out { background: var(--lf-danger-50);  color: var(--lf-danger); }

/* ─── POS layout ─────────────────────────────────────────────── */
.lf-pos {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    height: calc(100vh - var(--lf-topbar-h) - 48px);
    align-items: stretch;
}
.lf-pos-products {
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.lf-pos-toolbar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--lf-border-soft);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.lf-product-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    align-content: start;
}
.lf-prod {
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    text-align: left;
    transition: transform .12s, box-shadow .15s, border-color .15s;
    display: flex;
    flex-direction: column;
    font-family: inherit;
}
.lf-prod:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--lf-shadow); border-color: var(--lf-primary); }
.lf-prod:active { transform: scale(.98); }
.lf-prod.is-disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.lf-prod-img {
    aspect-ratio: 1;
    background: var(--lf-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.lf-prod-img img { width: 100%; height: 100%; object-fit: cover; }
.lf-prod-img-fallback { font-size: 36px; opacity: .5; }
.lf-prod-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.lf-prod-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--lf-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lf-prod-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.lf-prod-price { font-weight: 700; color: var(--lf-text); font-size: 13px; }
.lf-prod-stock {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}

/* ─── Cart ───────────────────────────────────────────────────── */
.lf-pos-cart {
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.lf-cart-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--lf-border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.lf-cart-head h3 { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.lf-cart-badge {
    background: var(--lf-primary);
    color: #fff;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 4px;
}
.lf-cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--lf-text-3);
    text-align: center;
    padding: 40px 20px;
}
.lf-cart-empty-icon { font-size: 48px; opacity: .3; }
.lf-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}
.lf-cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
}
.lf-cart-item:hover { background: var(--lf-surface-2); }
.lf-cart-info { min-width: 0; }
.lf-cart-name { font-weight: 500; font-size: 13px; line-height: 1.3; color: var(--lf-text); }
.lf-cart-price { font-size: 11px; color: var(--lf-text-3); }
.lf-cart-qty { display: flex; align-items: center; gap: 4px; }
.lf-cart-qty button {
    width: 28px; height: 28px;
    border: 1px solid var(--lf-border);
    background: var(--lf-surface);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    color: var(--lf-text-2);
}
.lf-cart-qty button:hover { background: var(--lf-primary-50); color: var(--lf-primary); border-color: var(--lf-primary); }
.lf-cart-qty input {
    width: 44px;
    height: 28px;
    border: 1px solid var(--lf-border);
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    font-family: inherit;
}
.lf-cart-line { font-weight: 700; font-size: 13px; min-width: 70px; text-align: right; }
.lf-cart-rm {
    background: transparent; border: 0; cursor: pointer;
    color: var(--lf-text-3); font-size: 18px; padding: 4px 8px;
    border-radius: 6px;
}
.lf-cart-rm:hover { color: var(--lf-danger); background: var(--lf-danger-50); }

.lf-cart-foot {
    padding: 16px 20px;
    border-top: 1px solid var(--lf-border-soft);
    background: var(--lf-surface-2);
}
.lf-cart-totals { margin-bottom: 12px; }
.lf-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
    font-size: 13px;
    color: var(--lf-text-2);
}
.lf-totals-total {
    border-top: 1px dashed var(--lf-border);
    margin-top: 6px;
    padding-top: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--lf-text);
}
.lf-cart-foot .lf-btn-xl { width: 100%; }

@media (max-width: 1099px) {
    .lf-pos { grid-template-columns: 1fr; height: auto; }
    .lf-pos-products, .lf-pos-cart { min-height: 400px; }
}

/* ─── Modal ──────────────────────────────────────────────────── */
.lf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: lf-fade .15s;
}
@keyframes lf-fade { from { opacity: 0; } }

.lf-modal {
    background: var(--lf-surface);
    border-radius: var(--lf-radius-xl);
    box-shadow: var(--lf-shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: lf-pop .2s;
}
.lf-modal-md { max-width: 640px; }
.lf-modal-lg { max-width: 720px; }
@keyframes lf-pop { from { opacity: 0; transform: scale(.96); } }

.lf-modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--lf-border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.lf-modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.lf-modal-amount {
    color: var(--lf-primary);
    margin-left: 6px;
}
.lf-modal-close {
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: var(--lf-text-3);
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 8px;
}
.lf-modal-close:hover { background: var(--lf-surface-2); color: var(--lf-text); }

.lf-modal-body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.lf-modal-actions {
    padding: 16px 24px;
    border-top: 1px solid var(--lf-border-soft);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--lf-surface-2);
}
.lf-modal-actions .lf-btn-xl { flex: 1; }
.lf-modal-actions .lf-btn-ghost { flex: 0 0 auto; }

/* ─── Checkout ───────────────────────────────────────────────── */
.lf-pay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}
.lf-pay-opt {
    padding: 16px 12px;
    background: var(--lf-surface);
    border: 2px solid var(--lf-border);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--lf-text-2);
    transition: all .15s;
    font-family: inherit;
}
.lf-pay-opt:hover { border-color: var(--lf-primary); color: var(--lf-primary); }
.lf-pay-opt.active {
    border-color: var(--lf-primary);
    background: var(--lf-primary-50);
    color: var(--lf-primary);
}
.lf-pay-icon { font-size: 24px; }
.lf-pay-label { font-weight: 600; }

.lf-pay-panel {
    padding: 16px;
    background: var(--lf-surface-2);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.lf-cash-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.lf-quick-amt {
    flex: 1; min-width: 80px;
    padding: 8px 12px;
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}
.lf-quick-amt:hover { background: var(--lf-primary); color: #fff; border-color: var(--lf-primary); }

.lf-change-box {
    background: var(--lf-success-50);
    color: var(--lf-success);
    padding: 12px 16px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 16px;
}
.lf-change-box strong { font-size: 22px; }

.lf-pay-qr {
    align-items: center;
    text-align: center;
}
.lf-qr-img {
    width: 200px; height: 200px;
    object-fit: contain;
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--lf-border);
}
.lf-qr-missing {
    padding: 24px;
    background: var(--lf-warning-50);
    color: var(--lf-warning);
    border-radius: 10px;
    text-align: center;
}
.lf-qr-phone { font-size: 16px; color: var(--lf-text); }

.lf-order-summary {
    padding: 12px 16px;
    background: var(--lf-surface-2);
    border-radius: 10px;
}

/* ─── Success view ───────────────────────────────────────────── */
.lf-success {
    padding: 40px 24px;
    text-align: center;
}
.lf-success-check {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--lf-success);
    color: #fff;
    font-size: 40px;
    line-height: 72px;
    margin: 0 auto 20px;
    animation: lf-pop .3s;
}
.lf-success h2 { margin: 0 0 8px; font-size: 22px; color: var(--lf-text); }
.lf-success-num { color: var(--lf-text-2); font-size: 14px; margin-bottom: 16px; }
.lf-success-total {
    font-size: 36px;
    font-weight: 800;
    color: var(--lf-success);
    margin-bottom: 12px;
}
.lf-success-change { font-size: 15px; color: var(--lf-text-2); }

/* ─── Empty / loading ────────────────────────────────────────── */
.lf-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--lf-text-3);
    font-size: 14px;
}
.lf-loading {
    padding: 60px 20px;
    text-align: center;
    color: var(--lf-text-3);
    font-size: 14px;
}

/* ─── Bar chart ──────────────────────────────────────────────── */
.lf-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lf-bar-row {
    display: grid;
    grid-template-columns: 100px 1fr 120px;
    gap: 12px;
    align-items: center;
    font-size: 13px;
}
.lf-bar-label { color: var(--lf-text-2); font-size: 12px; }
.lf-bar-track {
    height: 12px;
    background: var(--lf-surface-2);
    border-radius: 6px;
    overflow: hidden;
}
.lf-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lf-primary), var(--lf-violet));
    border-radius: 6px;
    transition: width .4s ease;
}
.lf-bar-value { text-align: right; font-weight: 600; color: var(--lf-text); }

/* ─── Branded sidebar logo (image) ───────────────────────────── */
.lf-brand-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    padding: 2px;
    flex-shrink: 0;
    border: 1px solid var(--lf-border-soft);
}
.lf-app.is-collapsed .lf-brand-logo-img {
    width: 40px;
    height: 40px;
}

/* ─── Voided invoices (row + helpers) ────────────────────────── */
.lf-row-voided td {
    color: var(--lf-text-3);
    text-decoration: line-through;
    text-decoration-color: var(--lf-danger);
}
.lf-row-voided .lf-pill {
    text-decoration: none;
}

.lf-row-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.lf-icon-btn-danger:hover {
    background: var(--lf-danger-50);
    color: var(--lf-danger);
}

/* ─── Customer block toggle in checkout ──────────────────────── */
.lf-customer-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    background: var(--lf-surface-2);
    border-radius: 12px;
    border: 1px dashed var(--lf-border);
}
.lf-customer-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--lf-text);
    text-align: left;
    width: 100%;
}
.lf-customer-toggle:hover { color: var(--lf-primary); }
.lf-customer-block .lf-form-grid { margin-top: 4px; }

/* ─── Clickable table rows (Products) ────────────────────────── */
.lf-table-clickable tbody tr {
    cursor: pointer;
}
.lf-table-clickable tbody tr:hover {
    background: var(--lf-primary-50);
}
.lf-table-clickable tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--lf-primary);
}

/* ─── Product modal form ─────────────────────────────────────── */
.lf-product-form .lf-form-grid {
    display: grid;
    gap: 16px;
}
.lf-product-form .lf-form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.lf-product-form .lf-field-wide {
    grid-column: 1 / -1;
}
@media (max-width: 600px) {
    .lf-product-form .lf-form-grid-2 { grid-template-columns: 1fr; }
}

.lf-image-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.lf-btn-danger-soft {
    color: var(--lf-danger);
}
.lf-btn-danger-soft:hover {
    background: var(--lf-danger-50);
    border-color: var(--lf-danger);
}
.lf-image-preview {
    margin-top: 10px;
    max-width: 160px;
    max-height: 160px;
    object-fit: cover;
    border: 1px solid var(--lf-border);
    border-radius: 10px;
    background: var(--lf-surface-2);
    display: block;
}

.lf-radio-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lf-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--lf-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: background .15s, border-color .15s;
}
.lf-radio:hover { background: var(--lf-surface-2); }
.lf-radio.active {
    background: var(--lf-primary-50);
    border-color: var(--lf-primary);
    color: var(--lf-primary);
    font-weight: 600;
}
.lf-radio input[type="radio"] {
    margin: 0;
    accent-color: var(--lf-primary);
}

/* Banner inside the modal */
.lf-banner {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
}
.lf-banner-warn {
    background: var(--lf-warning-50);
    color: #92400e;
    border-left: 3px solid var(--lf-warning);
}

/* Danger button — for delete in product modal */
.lf-btn-danger {
    background: var(--lf-danger);
    color: #fff;
    border-color: var(--lf-danger);
}
.lf-btn-danger:hover { background: #b91c1c; }

/* In modals, push delete to the left so it doesn't sit next to "Save" */
.lf-modal-actions .lf-btn-danger { margin-right: auto; }

/* ─── Receipt preview ────────────────────────────────────────── */
.lf-receipt-preview {
    background: var(--lf-surface-2);
    border-radius: 10px;
    padding: 16px;
}

/* ─── Toast ──────────────────────────────────────────────────── */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100000;
    padding: 12px 18px;
    border-radius: 10px;
    background: var(--lf-text);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--lf-shadow-lg);
    animation: lf-slide-in .25s;
    max-width: 360px;
}
@keyframes lf-slide-in { from { transform: translateX(100%); opacity: 0; } }
.toast-success { background: var(--lf-success); }
.toast-error   { background: var(--lf-danger); }
.toast-warn    { background: var(--lf-warning); color: #422006; }
.toast-info    { background: var(--lf-info); }

/* ─── AI Assistant (floating) ────────────────────────────────── */
.lf-ai-host {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9998;
}
/* `!important` on shape props guards against theme/plugin overrides that
   sometimes square off floating buttons. */
.lf-ai-fab {
    width: 56px !important;
    height: 56px !important;
    aspect-ratio: 1 / 1;
    padding: 0 !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--lf-primary), var(--lf-violet));
    color: #fff;
    border: 0;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--lf-shadow-lg);
    transition: transform .2s;
}
.lf-ai-fab:hover { transform: scale(1.05); }
.lf-ai-fab.active { transform: rotate(15deg); }

.lf-ai-panel {
    position: absolute;
    bottom: 72px;
    left: 0;
    width: 360px;
    max-height: 540px;
    background: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: 16px;
    box-shadow: var(--lf-shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.lf-ai-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--lf-border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--lf-primary-50), #fff);
}
.lf-ai-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
    max-height: 380px;
}
.lf-ai-welcome { display: flex; flex-direction: column; gap: 8px; }
.lf-ai-suggest {
    background: var(--lf-surface-2);
    border: 1px solid var(--lf-border-soft);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    color: var(--lf-text-2);
    font-family: inherit;
}
.lf-ai-suggest:hover { background: var(--lf-primary-50); color: var(--lf-primary); border-color: var(--lf-primary); }

.lf-ai-msg {
    padding: 10px 14px;
    border-radius: 14px;
    max-width: 85%;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
}
.lf-ai-user {
    background: var(--lf-primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.lf-ai-ai {
    background: var(--lf-surface-2);
    color: var(--lf-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.lf-ai-input {
    padding: 12px;
    border-top: 1px solid var(--lf-border-soft);
    display: flex;
    gap: 8px;
}
.lf-ai-input input {
    flex: 1;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--lf-border);
    border-radius: 10px;
    outline: none;
    font-size: 13px;
    font-family: inherit;
}
.lf-ai-input input:focus { border-color: var(--lf-primary); }
.lf-ai-input button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: var(--lf-primary);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
}
.lf-ai-input button:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Mobile tweaks ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .lf-content { padding: 14px; }
    .lf-topbar { padding: 0 14px; }
    .lf-topbar-stats { display: none; }
    .lf-modal { border-radius: 16px 16px 0 0; align-self: flex-end; max-height: 95vh; }
    .lf-modal-overlay { align-items: flex-end; padding: 0; }
    .lf-product-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .lf-ai-panel { width: calc(100vw - 32px); left: -8px; }
}
