/*
 * J2S Gestão e Vendas — visual base
 * Loaded after the Soft UI/Bootstrap stylesheet. Every class is prefixed with "es-".
 * Breakpoints: desktop >= 1200px, tablet 768–1199px, phone < 768px.
 */

:root {
    --es-bg: #f4f6fb;
    --es-surface: #ffffff;
    --es-surface-2: #fafbfd;
    --es-ink: #1f2a44;
    --es-text: #344767;
    --es-muted: #5f6b85;
    --es-border: #d9dfeb;
    --es-line: #eef1f6;

    /* Accent color: blue by default; other themes below (html[data-theme]) */
    --es-primary: #1d5fd1;
    --es-primary-ink: #174ea6;
    --es-primary-hover: #1a52b8;
    --es-primary-soft: #e6effc;
    --es-primary-soft-hover: #d3e2f9;
    --es-primary-rgb: 29, 95, 209;
    --es-link-hover: #123f86;
    --es-accent-on-dark: #a9c6f5;

    --es-success: #2a6b0f;
    --es-success-dot: #3a8a14;
    --es-success-soft: #e8f5df;
    --es-danger: #b4231f;
    --es-danger-soft: #fdeaea;
    --es-warning: #7a4f00;
    --es-warning-soft: #fff3d6;
    --es-info: #0a6f91;
    --es-info-soft: #e3f3fa;

    --es-radius: 16px;
    --es-radius-sm: 10px;
    --es-shadow: 0 4px 18px rgba(31, 42, 68, 0.06);
    --es-shadow-lg: 0 10px 40px rgba(20, 27, 45, 0.25);
    --es-font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* Optional accent themes, chosen per browser in the sidebar (see app-shell.js) */
html[data-theme="rosa"] {
    --es-primary: #cb0c9f;
    --es-primary-ink: #a30a80;
    --es-primary-hover: #b00a8a;
    --es-primary-soft: #fbe7f6;
    --es-primary-soft-hover: #f6d3ec;
    --es-primary-rgb: 203, 12, 159;
    --es-link-hover: #7d0762;
    --es-accent-on-dark: #f6b6e4;
}

html[data-theme="verde"] {
    --es-primary: #0f766e;
    --es-primary-ink: #0b5e57;
    --es-primary-hover: #0d665f;
    --es-primary-soft: #e0f2f0;
    --es-primary-soft-hover: #c9e8e4;
    --es-primary-rgb: 15, 118, 110;
    --es-link-hover: #084842;
    --es-accent-on-dark: #9fdcd5;
}

html[data-theme="laranja"] {
    --es-primary: #c2410c;
    --es-primary-ink: #9a3412;
    --es-primary-hover: #a8380a;
    --es-primary-soft: #fff1e8;
    --es-primary-soft-hover: #fde0cc;
    --es-primary-rgb: 194, 65, 12;
    --es-link-hover: #7c2a0e;
    --es-accent-on-dark: #fbc39d;
}

/* Theme picker (sidebar) */
.es-themes { margin-top: 20px; padding: 0 12px; display: flex; flex-direction: column; gap: 8px; }
.es-themes__label { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--es-muted); }
.es-themes__list { display: flex; gap: 8px; }

.es-theme-swatch {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid var(--es-surface);
    box-shadow: 0 0 0 1px var(--es-border);
    cursor: pointer;
}

.es-theme-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--es-ink); }
.es-theme-swatch--azul { background: #1d5fd1; }
.es-theme-swatch--rosa { background: #cb0c9f; }
.es-theme-swatch--verde { background: #0f766e; }
.es-theme-swatch--laranja { background: #c2410c; }

/* A fieldset that only groups (no border/padding), used instead of role="group" */
:where(.es-fieldset) { border: 0; margin: 0; padding: 0; min-width: 0; }

/* Product import */
.es-import-tips { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.es-input--file { padding: 10px 14px; }
.es-import-confirm { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.es-quick-product { grid-template-columns: 1fr; }
.es-quick-product .es-seg { display: flex; }
.es-quick-product .es-seg__option { flex: 1 1 0; min-height: 40px; }
#quickProductModal .modal-footer > .es-btn { flex: 1 1 auto; justify-content: center; }
.es-themes__label { float: none; width: auto; padding: 0; }
.es-theme-swatch:focus-visible { outline: 3px solid rgba(var(--es-primary-rgb), 0.35); outline-offset: 2px; }

/* ---------- Base ---------- */

body.es-body {
    margin: 0;
    padding: 0;
    background: var(--es-bg);
    font-family: var(--es-font);
    color: var(--es-text);
    font-size: 14px;
}

.es-body a { color: var(--es-primary-ink); }
.es-body a:hover { color: var(--es-link-hover); }
.es-body h1, .es-body h2, .es-body h3 { color: var(--es-ink); }

.es-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.es-icon { flex: none; }

.es-body [hidden] { display: none !important; }

/* Neutralize Soft UI's global label/link rules; :where() keeps specificity low so es- classes still win */
:where(.es-body) label { font-size: inherit; font-weight: inherit; color: inherit; margin: 0; line-height: inherit; }
:where(.es-body) a { letter-spacing: normal; }
:where(.es-body) p { line-height: 1.5; }

/* ---------- App shell ---------- */

.es-app {
    display: flex;
    gap: 24px;
    padding: 24px;
    min-height: 100vh;
    box-sizing: border-box;
}

.es-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.es-topbar { display: none; }
/* Desktop: only the logout button, in the corner on the same line as the page actions */
@media (min-width: 1200px) {
    .es-main-wrap { position: relative; }
    .es-topbar { display: block; position: absolute; top: 0; right: 0; z-index: 1; }
    .es-topbar [data-es-menu-open], .es-topbar .es-brand, .es-topbar .es-pill { display: none !important; }
    .es-main .es-page-header { align-items: flex-start; padding-right: 100px; }
    .es-main > .es-card:first-child { margin-top: 56px; } /* page without a header (access denied) */
}
.es-backdrop { display: none; }

/* Sidebar */
.es-sidebar {
    flex: none;
    width: 260px;
    box-sizing: border-box;
    position: sticky;
    top: 24px;
    align-self: flex-start;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: var(--es-surface);
    border-radius: var(--es-radius);
    box-shadow: var(--es-shadow);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.es-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 20px;
    color: var(--es-ink) !important;
    text-decoration: none;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.es-brand__mark {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
}

/* Close button only exists in the off-canvas menu (< 1200px); higher specificity than .es-btn */
.es-brand__text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.es-brand__name { font-size: 1em; font-weight: 800; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.es-brand__tagline { font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--es-muted); white-space: nowrap; }
.es-auth__brand .es-brand__tagline { color: #c3cbdc; font-size: 13px; }

.es-sidebar .es-sidebar__close { display: none; }

.es-nav-title {
    margin: 18px 12px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--es-muted);
}

/* Collapsible menu groups: the title is a button with a chevron */
.es-nav-group { display: flex; flex-direction: column; gap: 2px; }
.es-nav-group__items { display: flex; flex-direction: column; gap: 2px; }

.es-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 12px 0 2px;
    padding: 6px 12px;
    border: 0;
    border-radius: var(--es-radius-sm);
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.es-nav-toggle:hover { background: var(--es-bg); color: var(--es-text); }
.es-nav-toggle:focus-visible { outline: 3px solid rgba(var(--es-primary-rgb), 0.35); outline-offset: 1px; }
.es-nav-toggle svg { flex: none; transition: transform 0.15s; }
.es-nav-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }

.es-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: var(--es-radius-sm);
    color: var(--es-text) !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.es-nav-link:hover { background: var(--es-bg); }

.es-nav-link.is-active {
    background: var(--es-primary-soft);
    color: var(--es-primary-ink) !important;
    font-weight: 700;
}

.es-user {
    margin-top: 24px;
    padding: 12px;
    border-radius: 12px;
    background: var(--es-bg);
    display: flex;
    align-items: center;
    gap: 10px;
}

.es-user__info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

.es-user__name {
    font-size: 13px;
    font-weight: 700;
    color: var(--es-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.es-user__role { font-size: 12px; color: var(--es-muted); }
.es-user__link { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 4px 0; font-size: 12px; font-weight: 700; color: var(--es-primary-ink); }
.es-user__link:hover { text-decoration: underline; }

.es-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--es-ink);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.es-footer {
    margin-top: auto;
    padding: 8px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--es-muted);
}

/* ---------- Page header ---------- */

.es-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.es-page-header__titles { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.es-breadcrumb {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--es-muted);
}

.es-page-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: var(--es-ink);
}

.es-page-subtitle { margin: 0; font-size: 14px; color: var(--es-muted); }

.es-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- Cards ---------- */

.es-card {
    background: var(--es-surface);
    border-radius: var(--es-radius);
    box-shadow: var(--es-shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.es-card--flush { padding: 0; gap: 0; }

.es-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.es-card--flush .es-card__head { padding: 18px 20px; border-bottom: 1px solid var(--es-line); }

.es-card__title { margin: 0; font-size: 16px; font-weight: 700; color: var(--es-ink); }

.es-card__link { font-size: 13px; font-weight: 700; text-decoration: none; }

.es-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--es-line);
}

.es-card__body { padding: 20px; }

/* Responsive groups of cards */
.es-split { display: flex; flex-wrap: wrap; gap: 20px; }
.es-split > * { flex: 1 1 320px; min-width: 0; }
.es-split > .es-grow-2 { flex: 2 1 480px; }
.es-split > .es-grow-3 { flex: 3 1 480px; }

/* ---------- KPIs ---------- */

.es-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.es-kpi {
    background: var(--es-surface);
    border-radius: var(--es-radius);
    box-shadow: var(--es-shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.es-kpi__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.es-kpi__label { font-size: 13px; font-weight: 600; color: var(--es-muted); }
.es-kpi__value { font-size: 28px; font-weight: 800; color: var(--es-ink); line-height: 1.2; }
.es-kpi__meta { font-size: 13px; color: var(--es-muted); display: flex; align-items: center; gap: 6px; }
.es-kpi__meta--up { color: var(--es-success); font-weight: 600; }
.es-kpi__meta--down { color: var(--es-danger); font-weight: 600; }

.es-kpi__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--es-primary-soft);
    color: var(--es-primary-ink);
}

.es-kpi__icon--info { background: var(--es-info-soft); color: var(--es-info); }
.es-kpi__icon--success { background: var(--es-success-soft); color: var(--es-success); }
.es-kpi__icon--danger { background: var(--es-danger-soft); color: var(--es-danger); }
.es-kpi__icon--warning { background: var(--es-warning-soft); color: var(--es-warning); }

/* ---------- Buttons ---------- */

.es-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: var(--es-radius-sm);
    border: 1px solid transparent;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}

.es-btn:focus-visible,
.es-input:focus-visible,
.es-nav-link:focus-visible,
.es-tab:focus-visible { outline: 3px solid rgba(var(--es-primary-rgb), 0.35); outline-offset: 2px; }

.es-btn[disabled], .es-btn.is-disabled { cursor: not-allowed; opacity: 1; background: var(--es-line) !important; border-color: var(--es-line) !important; color: var(--es-muted) !important; }

.es-btn--primary { background: var(--es-primary); color: #ffffff !important; }
.es-btn--primary:hover { background: var(--es-primary-hover); }
.es-btn--dark { background: var(--es-ink); color: #ffffff !important; }
.es-btn--dark:hover { background: #2c3a5c; }
.es-btn--outline { background: var(--es-surface); border-color: var(--es-border); color: var(--es-text) !important; }
.es-btn--outline:hover { border-color: #bfc8d9; background: var(--es-surface-2); }
.es-btn--soft { background: var(--es-primary-soft); color: var(--es-primary-ink) !important; }
.es-btn--soft:hover { background: var(--es-primary-soft-hover); }
.es-btn--danger { background: var(--es-danger); color: #ffffff !important; }
.es-btn--ghost { color: var(--es-text) !important; }
.es-btn--ghost:hover { background: var(--es-bg); }
.es-btn--ghost-danger { color: var(--es-danger) !important; }
.es-btn--ghost-danger:hover { background: var(--es-danger-soft); }
.es-btn--ghost-success { color: var(--es-success) !important; }
.es-btn--ghost-success:hover { background: var(--es-success-soft); }
.es-btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.es-btn--lg { min-height: 56px; font-size: 16px; font-weight: 800; border-radius: 12px; }
.es-btn--block { width: 100%; }
.es-btn--icon { width: 44px; padding: 0; }
.es-btn--icon.es-btn--sm { width: 36px; }

/* ---------- Badges & pills ---------- */

.es-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    background: var(--es-line);
    color: var(--es-text);
}

.es-badge--success { background: var(--es-success-soft); color: var(--es-success); }
.es-badge--danger { background: var(--es-danger-soft); color: var(--es-danger); }
.es-badge--warning { background: var(--es-warning-soft); color: var(--es-warning); }
.es-badge--info { background: var(--es-info-soft); color: var(--es-info); }
.es-badge--primary { background: var(--es-primary-soft); color: var(--es-primary-ink); }

.es-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    background: var(--es-success-soft);
    color: var(--es-success);
}

.es-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--es-success-dot);
}

.es-pill--off { background: var(--es-line); color: var(--es-muted); }
.es-pill--off::before { background: #8a94a8; }

/* ---------- Alerts ---------- */

.es-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    background: var(--es-success-soft);
    color: var(--es-success);
}

.es-alert--error { background: var(--es-danger-soft); color: var(--es-danger); }
.es-alert--info { background: var(--es-info-soft); color: var(--es-info); }
.es-alert__close {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

/* ---------- Tabs ---------- */

.es-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--es-bg);
}

.es-tab {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 9px;
    color: var(--es-muted) !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
}

.es-tab.is-active {
    background: var(--es-surface);
    box-shadow: 0 1px 4px rgba(31, 42, 68, 0.1);
    color: var(--es-ink) !important;
    font-weight: 700;
}

/* ---------- Toolbar & forms ---------- */

.es-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--es-line);
}

.es-toolbar__group { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.es-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.es-label { font-size: 13px; font-weight: 700; color: var(--es-text); margin: 0; }
.es-label small { font-weight: 400; color: var(--es-muted); }

.es-input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius-sm);
    background: var(--es-surface);
    font-family: inherit;
    font-size: 15px;
    color: var(--es-ink);
    box-sizing: border-box;
}

.es-input:focus { border-color: var(--es-primary); outline: none; box-shadow: 0 0 0 3px rgba(var(--es-primary-rgb), 0.15); }
.es-input[disabled], .es-input[readonly] { background: var(--es-bg); color: var(--es-muted); }
.es-input.is-invalid { border-color: var(--es-danger); }
select.es-input { padding-right: 36px; }
textarea.es-input { padding: 12px 14px; min-height: 96px; }

/* Remove number spinners */
.es-input[type="number"]::-webkit-inner-spin-button,
.es-input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.es-input[type="number"] { -moz-appearance: textfield; }

.es-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 6px 0 14px;
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius-sm);
    background: var(--es-surface);
    box-sizing: border-box;
    color: var(--es-muted);
}

.es-input-group:focus-within { border-color: var(--es-primary); box-shadow: 0 0 0 3px rgba(var(--es-primary-rgb), 0.15); }

.es-input-group input {
    flex-grow: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    color: var(--es-ink);
    min-height: 44px;
}

.es-input-group--sm { min-height: 44px; }
.es-input-group--strong { border-width: 2px; border-color: var(--es-primary); min-height: 52px; }

.es-error { font-size: 12px; font-weight: 600; color: var(--es-danger); }
.es-help { font-size: 12px; color: var(--es-muted); }

.es-form { display: flex; flex-direction: column; gap: 24px; }

.es-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px 20px;
}

.es-form-grid .es-span-2 { grid-column: span 2; }

.es-form-section { display: flex; flex-direction: column; gap: 12px; }
.es-form-section__title { margin: 0; font-size: 14px; font-weight: 700; color: var(--es-ink); }

.es-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--es-line);
}

.es-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px 16px;
}

.es-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--es-line);
    border-radius: var(--es-radius-sm);
    font-size: 14px;
    color: var(--es-text);
    cursor: pointer;
    margin: 0;
}

.es-check input { width: 18px; height: 18px; accent-color: var(--es-primary); margin: 0; flex: none; }

.es-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 700; cursor: pointer; margin: 0; }
.es-switch input { width: 40px; height: 22px; accent-color: var(--es-primary); margin: 0; }

/* Repeating rows (stock entry) */
.es-repeat-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 44px;
    gap: 12px;
    align-items: end;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--es-line);
}

/* ---------- Tables ---------- */

.es-table-wrap { overflow-x: auto; }

.es-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin: 0;
}

.es-table th {
    text-align: left;
    padding: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--es-muted);
    background: var(--es-surface-2);
    white-space: nowrap;
}

.es-table td {
    padding: 12px;
    border-top: 1px solid var(--es-line);
    vertical-align: middle;
    color: var(--es-text);
}

.es-table th:first-child, .es-table td:first-child { padding-left: 20px; }
.es-table th:last-child, .es-table td:last-child { padding-right: 20px; }

.es-table .es-num { text-align: right; white-space: nowrap; }
.es-table .es-strong { font-weight: 700; color: var(--es-ink); }
.es-table .es-muted { color: var(--es-muted); }
.es-table .es-actions { text-align: right; white-space: nowrap; padding-top: 6px; padding-bottom: 6px; }
.es-table tfoot td { font-weight: 800; color: var(--es-ink); background: var(--es-surface-2); }

.es-actions form { display: inline; margin: 0; }

.es-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--es-muted);
    font-size: 14px;
}

.es-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 12px;
    border-radius: 16px;
    background: var(--es-bg);
    color: var(--es-muted);
}

.es-empty__title { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--es-ink); }

/* Simple key/value list */
.es-list { display: flex; flex-direction: column; }

.es-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--es-line);
}

.es-list__item:last-child { border-bottom: 0; }
.es-list__main { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.es-list__title { font-size: 14px; font-weight: 700; color: var(--es-ink); }
.es-list__meta { font-size: 12px; color: var(--es-muted); }
.es-list__value { font-size: 14px; font-weight: 800; color: var(--es-ink); white-space: nowrap; }

/* Horizontal progress bars */
.es-meter { display: flex; flex-direction: column; gap: 6px; }
.es-meter__row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.es-meter__label { font-weight: 600; }
.es-meter__value { font-weight: 700; color: var(--es-ink); }
.es-meter__track { height: 8px; border-radius: 99px; background: var(--es-line); overflow: hidden; }
.es-meter__fill { height: 8px; border-radius: 99px; background: var(--es-primary); }
.es-meter__progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--es-line); overflow: hidden; appearance: none; -webkit-appearance: none; color: var(--es-primary); }
.es-meter__progress::-webkit-progress-bar { background: var(--es-line); border-radius: 99px; }
.es-meter__progress::-webkit-progress-value { background: var(--es-primary); border-radius: 99px; }
.es-meter__progress::-moz-progress-bar { background: var(--es-primary); border-radius: 99px; }

/* Vertical bar chart */
.es-bars {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    height: 220px;
    padding-top: 8px;
    border-bottom: 1px solid #e3e7ef;
}

.es-bars__col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    height: 100%;
    min-width: 0;
}

.es-bars__value { font-size: 11px; color: var(--es-muted); white-space: nowrap; }
.es-bars__bar { width: 100%; max-width: 48px; min-height: 2px; border-radius: 8px 8px 0 0; background: #d9dfeb; }
.es-bars__col.is-current .es-bars__bar { background: var(--es-primary); }
.es-bars { margin: 0; }

/* Bar heights of the home chart, in steps of 5% */
.es-h-0 { height: 0%; }
.es-h-5 { height: 5%; }
.es-h-10 { height: 10%; }
.es-h-15 { height: 15%; }
.es-h-20 { height: 20%; }
.es-h-25 { height: 25%; }
.es-h-30 { height: 30%; }
.es-h-35 { height: 35%; }
.es-h-40 { height: 40%; }
.es-h-45 { height: 45%; }
.es-h-50 { height: 50%; }
.es-h-55 { height: 55%; }
.es-h-60 { height: 60%; }
.es-h-65 { height: 65%; }
.es-h-70 { height: 70%; }
.es-h-75 { height: 75%; }
.es-h-80 { height: 80%; }
.es-h-85 { height: 85%; }
.es-h-90 { height: 90%; }
.es-h-95 { height: 95%; }
.es-h-100 { height: 100%; }
.es-bars__col.is-current .es-bars__value { color: var(--es-primary-ink); font-weight: 700; }

.es-bars-labels { display: flex; gap: 16px; margin-top: -8px; }
.es-bars-labels span { flex: 1 1 0; text-align: center; font-size: 12px; color: var(--es-muted); min-width: 0; }
.es-bars-labels span.is-current { color: var(--es-ink); font-weight: 700; }

/* ---------- Pagination ---------- */

.es-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.es-pagination__info { font-size: 13px; color: var(--es-muted); }
.es-pagination__pages { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

.es-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: var(--es-radius-sm);
    border: 1px solid var(--es-border);
    background: var(--es-surface);
    color: var(--es-text) !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    box-sizing: border-box;
}

.es-page.is-active { background: var(--es-ink); border-color: var(--es-ink); color: #ffffff !important; }
.es-page.is-disabled { color: #a4adbf !important; background: var(--es-surface-2); }

/* ---------- Modal (Bootstrap) restyle ---------- */

.es-body .modal-content { border: 0; border-radius: 20px; box-shadow: var(--es-shadow-lg); }
.es-body .modal-header { padding: 20px 24px; border-bottom: 1px solid var(--es-line); }
.es-body .modal-title { font-size: 18px; font-weight: 800; color: var(--es-ink); }
.es-body .modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.es-body .modal-footer { padding: 16px 24px; border-top: 1px solid var(--es-line); gap: 10px; }
.es-body .modal-footer > * { margin: 0; }

/* ---------- PDV ---------- */

.es-pdv { display: flex; gap: 24px; align-items: flex-start; }
.es-pdv__products { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.es-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.es-chip {
    flex: none;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--es-border);
    background: var(--es-surface);
    color: var(--es-text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.es-chip.is-active { background: var(--es-ink); border-color: var(--es-ink); color: #ffffff; font-weight: 700; }
a.es-chip { display: inline-flex; align-items: center; text-decoration: none; }
a.es-chip:hover { color: var(--es-ink); border-color: var(--es-ink); }
a.es-chip.is-active:hover { color: #ffffff; }

/* ---------- Reports ---------- */

.es-report-filters__shortcuts { display: flex; flex-wrap: wrap; gap: 8px; }

.es-report-filters__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px 16px;
    align-items: end;
}

.es-report-filters__grid .es-input { min-height: 44px; }
.es-report-filters__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Finance ---------- */

a.es-kpi--link { text-decoration: none; color: inherit; transition: box-shadow 0.15s; }
a.es-kpi--link:hover { box-shadow: 0 0 0 2px rgba(var(--es-primary-rgb), 0.35), var(--es-shadow); }

.es-inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.es-inline-form > .es-field { flex: 1 1 240px; }
.es-inline-form--compact { flex-wrap: nowrap; align-items: center; gap: 4px; }
.es-inline-form--compact .es-input { min-height: 40px; max-width: 320px; }

.es-month-nav { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 20px; }
.es-month-nav .es-input { width: auto; min-height: 44px; }

.es-negative { color: var(--es-danger) !important; }
.es-input--narrow { max-width: 140px; min-height: 44px; }

/* PDV: customer and due date of a sale on credit (fiado) */
.es-fiado { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 150px); gap: 10px; padding: 12px; border-radius: 12px; background: var(--es-primary-soft); }
.es-fiado .es-input { min-height: 44px; }
.es-table .es-row--current td { background: var(--es-primary-soft); }

.es-products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

button.es-page { font-family: inherit; cursor: pointer; }

.es-product {
    background: var(--es-surface);
    border-radius: var(--es-radius);
    box-shadow: var(--es-shadow);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.es-product[hidden] { display: none; }
.es-product__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.es-product__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.es-product__name { font-size: 16px; font-weight: 800; color: var(--es-ink); overflow-wrap: anywhere; }
.es-product__price { font-size: 13px; color: var(--es-muted); }
.es-product__stock { font-size: 12px; font-weight: 700; color: var(--es-success); }
.es-product__stock--low { color: var(--es-warning); }
.es-product__stock--critical { color: var(--es-danger); }
.es-product__actions { display: flex; gap: 8px; margin-top: 4px; }
.es-product__actions .es-btn { flex: 1 1 0; padding: 0 8px; }

.es-cart {
    flex: none;
    width: 360px;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    box-sizing: border-box;
    background: var(--es-surface);
    border-radius: var(--es-radius);
    box-shadow: var(--es-shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.es-cart__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.es-cart__title { margin: 0; font-size: 18px; font-weight: 800; color: var(--es-ink); }
.es-cart__handle { display: none; }
.es-cart__close { display: none !important; }
.es-cart__items { display: flex; flex-direction: column; }
.es-cart__empty { padding: 24px 8px; text-align: center; color: var(--es-muted); font-size: 14px; }

.es-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--es-line);
}

.es-cart-item__info { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.es-cart-item__name { font-size: 14px; font-weight: 700; color: var(--es-ink); overflow-wrap: anywhere; }
.es-cart-item__meta { font-size: 12px; color: var(--es-muted); }
.es-cart-item__actions { display: flex; align-items: center; gap: 2px; flex: none; }
.es-cart-item__actions .es-btn--sm { min-height: 40px; padding: 0 10px; }
.es-input--lg { min-height: 56px; font-size: 22px; font-weight: 700; text-align: right; }

.es-cart-item__total { width: 76px; text-align: right; font-size: 14px; font-weight: 800; color: var(--es-ink); white-space: nowrap; }

.es-stepper { display: flex; align-items: center; border: 1px solid var(--es-border); border-radius: var(--es-radius-sm); flex: none; }

.es-stepper button {
    width: 36px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--es-text);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.es-stepper__input {
    width: 44px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    text-align: center;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--es-ink);
    -moz-appearance: textfield;
}

.es-stepper__input::-webkit-inner-spin-button,
.es-stepper__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.es-stepper__input:focus { outline: none; background: var(--es-primary-soft); box-shadow: 0 0 0 2px rgba(var(--es-primary-rgb), 0.35); }

.es-total { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 12px; background: var(--es-bg); }
.es-total__row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; color: var(--es-muted); }
.es-total__label { font-size: 15px; font-weight: 700; color: var(--es-ink); }
.es-total__value { font-size: 32px; font-weight: 800; color: var(--es-ink); white-space: nowrap; }
.es-total__row--discount { color: var(--es-success); font-weight: 700; }

/* Sale discount: R$ / % switch + value */
.es-discount { display: flex; flex-direction: column; gap: 6px; }
.es-discount__row { display: flex; gap: 8px; }
.es-discount__row .es-input { min-height: 44px; }

.es-seg { display: inline-flex; flex: none; padding: 3px; gap: 2px; border: 1px solid var(--es-border); border-radius: var(--es-radius-sm); background: var(--es-bg); }

.es-seg__option {
    min-width: 44px;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--es-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.es-seg__option.is-active { background: var(--es-surface); color: var(--es-primary-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); }

.es-strike { text-decoration: line-through; color: var(--es-muted) !important; }

.es-pay { margin: 0; padding: 0; border: 0; min-width: 0; }
.es-pay legend { float: none; width: auto; padding: 0; margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--es-text); }
.es-pay__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.es-pay__option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--es-border);
    background: var(--es-surface);
    color: var(--es-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.es-pay__option.is-active { border: 2px solid var(--es-primary); background: var(--es-primary-soft); color: var(--es-primary-ink); font-weight: 800; }

.es-cartbar { display: none; }
.es-sheet-backdrop { display: none; }

/* ---------- Auth (login) ---------- */

.es-auth { display: flex; flex-wrap: wrap; min-height: 100vh; background: var(--es-bg); }

.es-auth__brand {
    flex: 1 1 420px;
    min-width: 0;
    background: var(--es-ink);
    color: #ffffff;
    padding: 56px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
}

.es-auth__brand .es-brand { color: #ffffff !important; padding: 0; font-size: 22px; }
.es-auth__brand .es-brand__mark { width: 44px; height: 44px; }
.es-auth__headline { margin: 0; font-size: 40px; line-height: 1.15; font-weight: 800; color: #ffffff !important; max-width: 460px; }
.es-auth__features { display: flex; flex-direction: column; gap: 18px; max-width: 460px; }
.es-auth__feature { display: flex; align-items: flex-start; gap: 14px; }

.es-auth__feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #2c3a5c;
    color: var(--es-accent-on-dark);
}

.es-auth__feature-title { display: block; font-size: 15px; font-weight: 700; }
.es-auth__feature-text { display: block; font-size: 14px; color: #c3cbdc; }
.es-auth__copy { margin: 0; font-size: 13px; color: #c3cbdc; }
.es-auth__help { display: inline-flex; align-items: center; gap: 8px; align-self: center; padding: 8px 0; font-size: 14px; font-weight: 700; color: var(--es-primary-ink); }
.es-auth__help:hover { text-decoration: underline; }

.es-auth__form-wrap {
    flex: 1 1 480px;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    box-sizing: border-box;
}

.es-auth__form {
    width: 100%;
    max-width: 400px;
    background: var(--es-surface);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 42, 68, 0.08);
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===================================================================
 * Tablet and below (< 1200px): sidebar becomes an off-canvas menu
 * =================================================================== */
@media (max-width: 1199.98px) {
    .es-app { display: block; padding: 0; }

    .es-topbar {
        position: sticky;
        top: 0;
        z-index: 1030;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 20px;
        background: var(--es-surface);
        box-shadow: 0 2px 10px rgba(31, 42, 68, 0.06);
    }

    .es-topbar .es-brand { padding: 0; flex-grow: 1; font-size: 17px; }
    .es-topbar .es-brand__mark { width: 32px; height: 32px; }

    .es-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1050;
        width: 304px;
        /* Explicit height: without it the drawer grows to its content and there is nothing to scroll */
        height: 100vh;
        height: 100dvh;
        max-height: none;
        overscroll-behavior: contain;
        border-radius: 0;
        box-shadow: 8px 0 32px rgba(20, 27, 45, 0.25);
        padding: 16px 14px;
        transform: translateX(-105%);
        transition: transform .2s ease;
        visibility: hidden;
    }

    .es-app.is-menu-open .es-sidebar { transform: none; visibility: visible; }

    .es-sidebar__header { display: flex; align-items: center; justify-content: space-between; }
    .es-sidebar__header .es-brand { padding: 0 0 14px 10px; }
    .es-sidebar .es-sidebar__close { display: inline-flex; margin-bottom: 14px; }

    .es-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: rgba(20, 27, 45, 0.55);
    }

    .es-app.is-menu-open .es-backdrop { display: block; }

    .es-main { padding: 24px 20px; }

    .es-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .es-kpi__value { font-size: 26px; }

    .es-cart { width: 310px; padding: 18px; }
    .es-total__value { font-size: 26px; }
    .es-products { gap: 12px; }
}

/* ===================================================================
 * Phone (< 768px)
 * =================================================================== */
/* Small tablets: the cart leaves little room, so the PDV grid drops to 2 columns */
@media (min-width: 768px) and (max-width: 1023.98px) {
    .es-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .es-topbar { padding: 10px 16px; }
    .es-topbar__logout .es-btn { width: 44px; padding: 0; }
    .es-topbar__logout-label { display: none; }
    .es-main { padding: 16px; gap: 16px; }

    .es-page-title { font-size: 22px; }
    .es-page-header { gap: 12px; }
    .es-page-actions { width: 100%; }
    .es-page-actions > .es-btn { flex: 1 1 auto; }

    .es-card { padding: 16px; border-radius: 14px; }
    .es-card--flush { padding: 0; }
    .es-card--flush .es-card__head, .es-toolbar, .es-card__foot { padding-left: 16px; padding-right: 16px; }
    .es-split { gap: 16px; }

    .es-kpis { gap: 12px; }
    .es-kpi { padding: 14px; border-radius: 14px; gap: 6px; }
    .es-kpi__icon { display: none; }
    .es-kpi__label { font-size: 12px; }
    .es-kpi__value { font-size: 20px; }
    .es-kpi__meta { font-size: 12px; }

    .es-bars { height: 140px; gap: 8px; }
    .es-bars__value { display: none; }
    .es-bars-labels { gap: 8px; }
    .es-bars-labels span { font-size: 11px; }

    .es-toolbar__group { width: 100%; }
    .es-toolbar__group > * { flex: 1 1 auto; }
    .es-tabs { width: 100%; }
    .es-tab { flex: 1 1 0; justify-content: center; }

    .es-form-grid { grid-template-columns: 1fr; }
    .es-form-grid .es-span-2 { grid-column: auto; }
    .es-form-actions > .es-btn { flex: 1 1 auto; }

    .es-repeat-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
    .es-repeat-row > .es-field:first-child { grid-column: 1 / -1; }

    /* Tables become stacked cards */
    .es-table--stack thead { display: none; }
    .es-table--stack, .es-table--stack tbody, .es-table--stack tfoot { display: block; }

    .es-table--stack tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 12px;
        padding: 14px 16px;
        border-top: 1px solid var(--es-line);
    }

    .es-table--stack td {
        display: block;
        padding: 0 !important;
        border: 0;
        font-size: 13px;
    }

    .es-table--stack td[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--es-muted);
        font-weight: 600;
    }

    .es-table--stack td.es-td-title { flex: 1 1 100%; font-size: 15px; font-weight: 800; color: var(--es-ink); }
    .es-table--stack td.es-td-title::before { content: none; }
    .es-table--stack td.es-actions { flex: 1 1 100%; display: flex; justify-content: flex-end; gap: 6px; }
    .es-table--stack td.es-actions .es-btn--icon { border: 1px solid var(--es-line); }
    .es-table--stack tfoot tr { background: var(--es-surface-2); }

    .es-pagination { justify-content: center; }

    .es-theme-swatch { width: 40px; height: 40px; }

    /* PDV: comfortable touch targets in the cart */
    .es-stepper button, .es-stepper__input { height: 44px; }

    /* PDV: cart turns into a bottom sheet */
    .es-pdv { display: block; }
    .es-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; }
    .es-products { grid-template-columns: 1fr; gap: 10px; }
    .es-pdv__products { padding-bottom: 96px; }

    .es-product { flex-direction: row; align-items: center; padding: 12px 12px 12px 14px; border-radius: 14px; }
    .es-product__head { flex: 1 1 auto; }
    .es-product__head .es-badge { display: none; }
    .es-product__actions { margin: 0; flex: none; gap: 6px; }
    .es-product__actions .es-btn { width: 54px; flex: none; }
    .es-product__name { font-size: 15px; }

    .es-cart {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 1060;
        width: auto;
        max-height: 88vh;
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -10px 40px rgba(20, 27, 45, 0.25);
        padding: 10px 16px 20px;
        transform: translateY(105%);
        transition: transform .2s ease;
        visibility: hidden;
    }

    .es-pdv.is-cart-open .es-cart { transform: none; visibility: visible; }

    .es-cart__handle { display: block; align-self: center; width: 44px; height: 5px; border-radius: 99px; background: var(--es-border); }
    .es-cart__close { display: inline-flex !important; }

    .es-pdv.is-cart-open .es-sheet-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1055;
        background: rgba(20, 27, 45, 0.55);
    }

    .es-cartbar {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1020;
        padding: 12px 16px 20px;
        background: var(--es-surface);
        box-shadow: 0 -6px 24px rgba(31, 42, 68, 0.12);
    }

    .es-cartbar__btn {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        min-height: 56px;
        padding: 0 16px;
        border: 0;
        border-radius: 14px;
        background: var(--es-primary);
        color: #ffffff;
        font-family: inherit;
        cursor: pointer;
    }

    .es-cartbar__count {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 30px;
        height: 30px;
        padding: 0 6px;
        border-radius: 99px;
        background: #ffffff;
        color: var(--es-primary-ink);
        font-size: 14px;
        font-weight: 800;
        box-sizing: border-box;
    }

    .es-cartbar__label { flex-grow: 1; text-align: left; font-size: 15px; font-weight: 800; }
    .es-cartbar__total { font-size: 17px; font-weight: 800; }

    /* Login */
    .es-auth__brand { padding: 32px 24px; gap: 24px; flex-basis: 100%; }
    .es-auth__headline { font-size: 28px; }
    .es-auth__features, .es-auth__copy { display: none; }
    .es-auth__form-wrap { padding: 24px 16px 40px; }
    .es-auth__form { padding: 28px 20px; }
}

/* Avoid page scroll behind open overlays */
body.es-lock { overflow: hidden; }

@media print {
    .es-sidebar, .es-topbar, .es-page-actions, .es-backdrop { display: none !important; }
    .es-app { display: block; padding: 0; }
    .es-card { box-shadow: none; }
}

/* ---------- Toasts (standard notices: success, error, warning, info) ---------- */
.es-toasts { position: fixed; top: 16px; right: 16px; z-index: 1090; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.es-toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 12px; border-left: 4px solid currentColor; background: var(--es-surface, #fff); box-shadow: var(--es-shadow-lg); font-size: 14px; font-weight: 600; color: var(--es-success); pointer-events: auto; animation: es-toast-in .18s ease-out; }
.es-toast.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity .18s, transform .18s; }
.es-toast--error { color: var(--es-danger); }
.es-toast--warning { color: var(--es-warning); }
.es-toast--info { color: var(--es-info); }
.es-toast__icon { display: flex; flex: none; padding-top: 1px; }
.es-toast__text { flex: 1 1 auto; color: var(--es-ink); line-height: 1.4; }
.es-toast__close { display: flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; margin: -4px -4px 0 0; border: 0; border-radius: 8px; background: transparent; color: var(--es-muted); }
.es-toast__close:hover { background: var(--es-bg); }
@keyframes es-toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .es-toast { animation: none; } .es-toast.is-leaving { transition: none; } }
@media (max-width: 575.98px) { .es-toasts { top: 8px; right: 16px; left: 16px; width: auto; } }
