:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: #eff6ff;
    --success: #15803d;
    --success-bg: #f0fdf4;
    --warning: #b45309;
    --warning-bg: #fffbeb;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --touch: 44px;
    --bottom-nav-h: 60px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

* { letter-spacing: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    min-height: 52px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
    min-width: 0;
}

.brand-icon { color: var(--accent); font-size: 1.1rem; }
.brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo { width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto; }

.header-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.shop-switcher { display: flex; align-items: center; gap: 0.35rem; }
.shop-switcher select { width: min(220px, 28vw); min-height: 34px; padding: 0.3rem 2rem 0.3rem 0.6rem; font-size: 0.8rem; }
.nav-form { display: inline-flex; }
.nav-form .nav-link { font: inherit; border: 0; cursor: pointer; }
.desktop-more { position: relative; }
.desktop-more summary { list-style: none; cursor: pointer; }
.desktop-more summary::-webkit-details-marker { display: none; }
.desktop-more__menu { position: absolute; right: 0; top: calc(100% + 0.35rem); width: 220px; padding: 0.35rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(15,23,42,0.14); z-index: 420; }
.desktop-more__menu form { margin: 0; }
.desktop-more__menu button.more-menu__item { width: 100%; border: 0; background: transparent; font: inherit; cursor: pointer; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: var(--touch);
    height: var(--touch);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text);
    margin: 0 8px;
}

.desktop-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem;
    padding: 0 1rem 0.65rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: var(--radius);
}

.nav-link:hover, .nav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.nav-icon { width: 1em; text-align: center; }

.user-badge {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--muted);
    padding: 0.25rem 0.5rem;
    background: var(--surface-2);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Bottom nav */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    height: calc(var(--bottom-nav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.06);
}

.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0.25rem;
    color: var(--muted);
    text-decoration: none;
    font: inherit;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.65rem;
}

.bottom-nav__item.active { color: var(--accent); }
.bottom-nav__icon { font-size: 1.1rem; }

.more-menu {
    display: none;
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 6px);
    right: 0.5rem;
    left: 0.5rem;
    max-width: 280px;
    margin-left: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    z-index: 350;
    padding: 0.35rem;
    max-height: calc(100vh - var(--bottom-nav-h) - var(--safe-bottom) - 1.5rem);
    max-height: calc(100dvh - var(--bottom-nav-h) - var(--safe-bottom) - 1.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.more-menu.open { display: block; }

.more-menu__item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.more-menu__item:hover { background: var(--surface-2); }
.more-menu form { margin: 0; }
.more-menu form .more-menu__item { width: 100%; border: 0; background: transparent; font: inherit; cursor: pointer; }
.more-menu::-webkit-scrollbar { width: 7px; }
.more-menu::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 7px; }

/* Main */
.app-main {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.25rem 1rem;
    padding-bottom: calc(1.25rem + var(--safe-bottom));
}

.page-head { margin-bottom: 1rem; }
.page-title { font-size: 1.35rem; font-weight: 600; margin: 0 0 0.2rem; }
.page-subtitle { color: var(--muted); margin: 0; font-size: 0.9rem; }

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

/* Consentement Google : composant partagé entre le site public et l'application. */
.consent-banner[hidden], .consent-modal[hidden] { display: none !important; }
.consent-banner { position: fixed; z-index: 1200; left: 24px; right: 24px; bottom: 24px; max-width: 1180px; margin: 0 auto; padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 22px; border: 1px solid #d8e2ec; border-radius: 18px; background: rgba(255,255,255,.98); box-shadow: 0 24px 70px rgba(15,23,42,.22); color: #172033; }
.consent-banner > div:first-child { display: flex; align-items: flex-start; gap: 14px; max-width: 760px; }
.consent-banner__icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px; color: #087bb8; background: #e8f6fc; }
.consent-banner strong { display: block; margin-bottom: 4px; font-size: 1rem; }
.consent-banner p { margin: 0; color: #536174; line-height: 1.55; font-size: .9rem; }
.consent-banner__actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.consent-modal { position: fixed; z-index: 1250; inset: 0; display: grid; place-items: center; padding: 20px; }
.consent-modal__backdrop { position: absolute; inset: 0; border: 0; background: rgba(7,15,29,.68); backdrop-filter: blur(5px); }
.consent-modal__dialog { position: relative; width: min(680px, 100%); max-height: min(760px, calc(100vh - 32px)); overflow: auto; padding: 26px; border-radius: 22px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.3); color: #172033; }
.consent-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.consent-modal__head span { color: #087bb8; text-transform: uppercase; letter-spacing: .09em; font-size: .72rem; font-weight: 800; }
.consent-modal__head h2 { margin: 4px 0 0; font-size: 1.6rem; }
.consent-modal__head > button { width: 38px; height: 38px; border: 0; border-radius: 10px; background: #f1f5f9; cursor: pointer; }
.consent-modal__dialog > p { color: #607086; line-height: 1.6; }
.consent-option { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-top: 1px solid #e6edf3; }
.consent-option span { display: grid; gap: 4px; }
.consent-option small { max-width: 430px; color: #65758a; line-height: 1.5; }
.consent-option label { display: grid; grid-template-columns: auto; justify-items: center; gap: 5px; cursor: pointer; }
.consent-option label input { position: absolute; opacity: 0; pointer-events: none; }
.consent-option label i { position: relative; display: block; width: 48px; height: 26px; border-radius: 999px; background: #cbd5e1; transition: .2s ease; }
.consent-option label i::after { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: .2s ease; }
.consent-option label input:checked + i { background: #087bb8; }
.consent-option label input:checked + i::after { transform: translateX(22px); }
.consent-option label input:disabled + i { opacity: .7; }
.consent-option label em { font-size: .69rem; font-style: normal; color: #667085; white-space: nowrap; }
.consent-modal__actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 20px; border-top: 1px solid #e6edf3; }
.consent-modal__actions > a { color: #087bb8; font-weight: 700; font-size: .85rem; }
body.consent-open { overflow: hidden; }
.app-footer__legal { display: inline-flex; gap: 12px; margin-left: auto; }
.app-footer__legal a, .app-footer__legal button { padding: 0; border: 0; color: inherit; background: transparent; font: inherit; font-size: .78rem; cursor: pointer; text-decoration: none; }
.app-footer__legal a:hover, .app-footer__legal button:hover { text-decoration: underline; }

@media (max-width: 760px) {
    .consent-banner { left: 10px; right: 10px; bottom: 10px; padding: 17px; align-items: stretch; flex-direction: column; }
    .consent-banner__actions { display: grid; grid-template-columns: 1fr 1fr; }
    .consent-banner__actions .btn:last-child { grid-column: 1 / -1; }
    .consent-modal { padding: 10px; align-items: end; }
    .consent-modal__dialog { padding: 21px 18px; border-radius: 20px 20px 12px 12px; }
    .consent-option { align-items: flex-start; }
    .consent-modal__actions { align-items: stretch; flex-direction: column; }
}

.page-section { margin: 1.25rem 0; padding: 0.25rem 0 1rem; }
.page-section + .page-section { border-top: 1px solid var(--border); padding-top: 1.25rem; }
.section-head { display: flex; align-items: center; gap: 0.75rem; min-height: 36px; margin-bottom: 0.85rem; }
.section-head h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.section-head > :last-child:not(h2) { margin-left: auto; }
.section-count { color: var(--muted); font-size: 0.8rem; }
.empty-state { color: var(--muted); text-align: center; padding: 1.5rem !important; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Grid */
.grid { display: grid; gap: 1rem; width: 100%; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
    .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.card h3 {
    margin: 0 0 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.stat-value { font-size: 1.5rem; font-weight: 600; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.25rem; }

/* Shortcuts */
.shortcut-list { display: flex; flex-direction: column; gap: 0.5rem; }

.shortcut-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s;
}

.shortcut-link:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.shortcut-link__icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: var(--radius);
    color: var(--accent);
    flex-shrink: 0;
}

.shortcut-link__text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.shortcut-link__text strong { font-size: 0.95rem; color: var(--text); }

/* Help */
.help-box {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--accent-soft);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    font-size: 0.875rem;
    position: relative;
}

.help-box p { margin: 0; flex: 1; }
.help-box__icon { color: var(--accent); margin-top: 0.1rem; }

.help-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0.25rem;
}

.step-hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    padding-bottom: 2px;
}

.tab-btn {
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    border-radius: var(--radius);
    font-size: 0.875rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    min-height: 38px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-2); }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: none; }
.btn-ghost:hover { color: var(--danger); background: var(--danger-bg); }

.btn-sm { padding: 0.3rem 0.6rem; min-height: 32px; font-size: 0.8rem; }
.btn-lg { padding: 0.65rem 1.15rem; min-height: 42px; }
.btn-block { width: 100%; }

/* Forms */
.form-stack { display: flex; flex-direction: column; gap: 0.85rem; }
.form-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.form-row > * { flex: 1 1 140px; min-width: 0; }

.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.field label i { margin-right: 0.25rem; color: var(--accent); }
.password-field { position: relative; }
.password-field input { padding-right: 3rem; }
.password-field .password-toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.password-field .password-toggle:hover, .password-field .password-toggle:focus-visible { color: var(--accent); background: var(--accent-soft); }

input, select, textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
}

.input-lg {
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    min-height: 42px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

table.data-table th,
table.data-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table.data-table th {
    background: var(--surface-2);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0;
}

table.data-table tbody tr:hover { background: #f8fafc; }
table.data-table tbody tr:last-child td { border-bottom: 0; }
.actions-cell > * { margin: 0.15rem 0.15rem 0.15rem 0; vertical-align: middle; }
.actions-cell form { display: inline-flex; }
.actions-cell .table-edit { display: none; margin-top: 0.75rem; min-width: min(720px, 78vw); }
.actions-cell .table-edit.open { display: block; }

/* Items */
.item-list { display: flex; flex-direction: column; gap: 0.5rem; }

.item-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem;
}

.item-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.item-card__title { margin: 0; font-size: 0.95rem; font-weight: 600; }
.item-card__meta { font-size: 0.8rem; color: var(--muted); margin: 0.25rem 0 0; }
.item-card__row { font-size: 0.85rem; margin-top: 0.35rem; }
.item-card__actions { display: flex; gap: 0.5rem; margin-top: 0.65rem; flex-wrap: wrap; }

.collapse-panel { display: none; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.collapse-panel.open { display: block; }

/* Stock colors */
.stock-ok { color: var(--success); font-weight: 500; }
.stock-low { color: var(--warning); font-weight: 500; }
.stock-critical { color: var(--danger); font-weight: 600; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.badge-ok { background: var(--success-bg); color: var(--success); }
.badge-low { background: var(--warning-bg); color: var(--warning); }
.badge-critical { background: var(--danger-bg); color: var(--danger); }
.badge-high { background: var(--danger-bg); color: var(--danger); }
.badge-medium { background: var(--warning-bg); color: var(--warning); }
.badge-low-priority { background: var(--success-bg); color: var(--success); }

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid;
}
.alert-error { background: var(--danger-bg); border-color: #fecaca; color: var(--danger); }
.alert-success { background: var(--success-bg); border-color: #bbf7d0; color: var(--success); }
.alert-warning { background: var(--warning-bg); border-color: #fde68a; color: var(--warning); }
.alert-info { background: #eef7fc; border-color: #bae6fd; color: #075985; }

.alert-panel { border-left: 3px solid var(--danger); }

.chart-container {
    position: relative;
    width: 100%;
    height: 260px;
}

.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: end;
}
.form-grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field--wide { grid-column: span 2; }
.form-actions { display: flex; align-items: flex-end; gap: 0.5rem; }
.color-field input[type="color"] { min-height: 42px; padding: 0.25rem; }
.toggle-field { display: flex; align-items: center; gap: 0.55rem; min-height: 42px; font-size: 0.875rem; }
.toggle-field input { width: 18px; height: 18px; }

.platform-settings-form { padding: 0.25rem 0; }
.platform-settings-form .tab-panel { padding: 0.35rem 0 0.5rem; }
.platform-settings-form .form-grid { align-items: start; }
.platform-settings-form .field textarea { resize: vertical; min-height: 88px; }
.platform-settings-actions { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.integration-status-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.settings-security-note { margin: 1rem 0 0; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); background: #f8fafc; font-size: 0.82rem; line-height: 1.5; }
.settings-security-note i { margin-right: 0.35rem; color: var(--accent); }
.settings-security-note code { overflow-wrap: anywhere; }

.toolbar-search { display: flex; gap: 0.5rem; align-items: center; margin: 1rem 0; max-width: 720px; }
.toolbar-search input { flex: 1; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 1.4rem;
}
.stats-grid--compact { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat-card {
    display: flex;
    flex-direction: column;
    min-height: 104px;
    padding: 0.9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.stat-card > span { color: var(--muted); font-size: 0.78rem; }
.stat-card > strong { margin-top: 0.3rem; font-size: 1.35rem; line-height: 1.25; overflow-wrap: anywhere; }
.stat-card > small { margin-top: auto; padding-top: 0.45rem; color: var(--muted); }
.stat-card--success { border-left: 3px solid var(--success); }
.stat-card--warning { border-left: 3px solid var(--warning); }
.stat-card--danger { border-left: 3px solid var(--danger); }

.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.6rem; }
.shortcut-grid .shortcut-link { min-height: 64px; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr); gap: 1.25rem; align-items: start; }
.attention-list { border-top: 1px solid var(--border); }
.attention-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.attention-list span { color: var(--muted); text-align: right; }

.plan-fieldset, .checkout-fieldset { margin: 0; padding: 0; border: 0; }
.plan-fieldset > legend, .checkout-fieldset > legend { margin-bottom: 0.55rem; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.plan-option { position: relative; display: block; cursor: pointer; }
.plan-option > input { position: absolute; opacity: 0; pointer-events: none; }
.plan-option__body { display: flex; min-height: 130px; flex-direction: column; gap: 0.25rem; padding: 0.9rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.plan-option__body > span, .plan-option__body > small { color: var(--muted); }
.plan-option__body > b { margin-top: auto; color: var(--text); }
.plan-option > input:checked + .plan-option__body { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.plan-option > input:focus-visible + .plan-option__body { outline: 2px solid var(--accent); outline-offset: 2px; }
.registration-card { max-width: 900px; }
.registration-page { align-items: flex-start; padding-top: 2rem; }
.login-action { margin: 1.25rem 0 0; }

.segmented-control { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.segmented-control label { position: relative; cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; }
.segmented-control span { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 0.35rem; color: var(--muted); font-size: 0.78rem; border-right: 1px solid var(--border); }
.segmented-control label:last-child span { border-right: 0; }
.segmented-control input:checked + span { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.conditional-fields { margin-top: 0.65rem; }
.checkout-form { display: flex; flex-direction: column; gap: 0.75rem; }
.checkout-payment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
.checkout-payment-grid > :first-child { grid-column: 1 / -1; }
.payment-form { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(130px, 1fr); gap: 0.4rem; min-width: 290px; }
.payment-form button { grid-column: 1 / -1; }

.shop-list { border-top: 1px solid var(--border); }
.shop-row { display: grid; grid-template-columns: minmax(240px, 1.3fr) minmax(240px, 1fr) auto; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.shop-row--current { border-left: 3px solid var(--accent); padding-left: 0.75rem; }
.shop-row__identity { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.shop-row__identity h3 { margin: 0; font-size: 0.95rem; }
.shop-row__identity p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.78rem; }
.shop-row__meta { display: flex; flex-direction: column; color: var(--muted); font-size: 0.8rem; }
.shop-colors { display: flex; flex-direction: column; gap: 3px; }
.shop-colors i { width: 24px; height: 12px; background: var(--swatch); border: 1px solid rgba(15,23,42,0.15); }
.shop-edit { grid-column: 1 / -1; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.7fr); gap: 2rem; align-items: start; }
.shop-preview { position: sticky; top: 112px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.shop-preview__head { display: flex; align-items: center; gap: 0.75rem; padding: 1rem; background: var(--preview-primary); color: #fff; }
.shop-preview__head img { width: 52px; height: 52px; object-fit: contain; background: #fff; padding: 0.25rem; border-radius: 4px; }
.shop-preview__head > i { font-size: 1.5rem; }
.shop-preview__head strong, .shop-preview__head span { display: block; }
.shop-preview__head span { margin-top: 0.2rem; font-size: 0.8rem; }
.shop-preview__body { padding: 1rem; font-size: 0.85rem; }
.shop-preview__button { display: inline-flex; padding: 0.45rem 0.8rem; background: var(--preview-accent); color: #fff; border-radius: var(--radius); }

.notification-list { border-top: 1px solid var(--border); }
.notification-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 0.75rem; align-items: start; padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.notification-row--unread { background: var(--accent-soft); padding-inline: 0.75rem; }
.notification-row__icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; color: var(--warning); background: var(--warning-bg); border-radius: var(--radius); }
.notification-row p { margin: 0; font-size: 0.875rem; }
.notification-row small { color: var(--muted); }

.profile-details { margin: 0; border-top: 1px solid var(--border); }
.profile-details > div { display: grid; grid-template-columns: 140px 1fr; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.profile-details dt { color: var(--muted); font-size: 0.8rem; }
.profile-details dd { margin: 0; font-weight: 500; }

.invoice-page { min-height: 100vh; padding: 1rem; background: var(--bg); }
.invoice-actions { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1rem; }
.invoice-ticket { width: min(720px, 100%); margin: 0 auto; padding: 2rem; background: #fff; color: #111827; border: 1px solid #d1d5db; border-radius: var(--radius); }
.invoice-head { text-align: center; }
.invoice-head img { max-width: 96px; max-height: 64px; object-fit: contain; }
.invoice-head h1 { margin: 0.35rem 0; font-size: 1.35rem; }
.invoice-head p { margin: 0; color: #4b5563; font-size: 0.8rem; }
.invoice-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin: 1.25rem 0; padding: 0.75rem 0; border-block: 1px solid #e5e7eb; font-size: 0.8rem; }
.invoice-customer { display: flex; flex-direction: column; margin-bottom: 1rem; font-size: 0.85rem; }
.invoice-customer span { color: #4b5563; }
.invoice-lines { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.invoice-lines th, .invoice-lines td { padding: 0.55rem; border-bottom: 1px solid #e5e7eb; text-align: right; }
.invoice-lines th:first-child, .invoice-lines td:first-child { text-align: left; }
.invoice-totals { width: min(300px, 100%); margin: 1rem 0 1rem auto; }
.invoice-totals p { display: flex; justify-content: space-between; margin: 0; padding: 0.35rem 0; }
.invoice-totals p:first-child { font-size: 1.1rem; border-bottom: 1px solid #d1d5db; }
.invoice-payment { display: flex; justify-content: space-between; padding: 0.75rem; background: #f8fafc; font-size: 0.82rem; }
.invoice-footer { margin-top: 1.5rem; text-align: center; }
.invoice-footer p { margin-bottom: 0.25rem; }
.invoice-footer small { color: #6b7280; }

@media print {
    .no-print { display: none !important; }
    .invoice-page { padding: 0; background: #fff; }
    .invoice-ticket { width: 100%; border: 0; padding: 0; }
}

.app-footer {
    text-align: center;
    padding: 0.85rem;
    font-size: 0.75rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* ─── POS / Vente ─── */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 380px);
    gap: 1rem;
    align-items: start;
}

.pos-shortcuts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.pos-shortcuts kbd {
    min-width: 1.6rem;
    padding: 0.15rem 0.35rem;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 0.35rem;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    text-align: center;
}

.pos-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.pos-panel--cart {
    position: sticky;
    top: 60px;
    display: flex;
    flex-direction: column;
    max-height: none;
}

.pos-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.pos-cart-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cart-lines {
    flex: 1;
    overflow-y: auto;
    min-height: 120px;
    max-height: 36vh;
}

.cart-lines[aria-busy="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.cart-notice {
    margin: 0 0 0.65rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--text);
    font-size: 0.78rem;
    line-height: 1.4;
}

.cart-notice--error {
    border-color: color-mix(in srgb, var(--danger) 38%, var(--border));
    background: var(--danger-bg);
    color: var(--danger);
}

.cart-empty {
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
    padding: 2rem 0.5rem;
    margin: 0;
}

.cart-line {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.cart-line:last-child { border-bottom: none; }

.cart-line--invalid {
    margin-inline: -0.45rem;
    padding-inline: 0.45rem;
    border-radius: var(--radius);
    background: var(--danger-bg);
}

.cart-line__name { font-weight: 500; display: block; }
.cart-line__price { font-size: 0.75rem; color: var(--muted); }
.cart-line__issue { display: block; margin-top: 0.2rem; color: var(--danger); font-size: 0.72rem; line-height: 1.35; }

.cart-line__qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.qty-btn:hover { background: var(--border); }

.qty-val {
    min-width: 28px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.qty-input {
    width: 4.25rem;
    height: 32px;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-align: center;
    font-weight: 600;
}

.cart-line__sub {
    font-weight: 600;
    min-width: 4.5rem;
    text-align: right;
}

.cart-line__remove {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--radius);
}

.cart-line__remove:hover { color: var(--danger); background: var(--danger-bg); }

.pos-checkout {
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.cart-total-row strong { font-size: 1.25rem; font-weight: 600; }

.payment-preview,
.cart-validation {
    min-height: 1.15rem;
    margin: -0.25rem 0 0.65rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.cart-validation {
    color: var(--danger);
    font-weight: 600;
}

.search-wrap { position: relative; }

.suggestions {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    max-height: 220px;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover:not(.disabled) { background: var(--accent-soft); }
.suggestion-item.disabled { opacity: 0.45; cursor: not-allowed; }

.suggestion-item__meta { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}

.quick-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.quick-btn__name { font-size: 0.85rem; font-weight: 500; color: var(--text); }
.quick-btn__meta { font-size: 0.7rem; color: var(--muted); margin-top: 0.15rem; }

.pos-toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-120%);
    z-index: 500;
    padding: 0.6rem 1rem;
    background: var(--text);
    color: #fff;
    border-radius: var(--radius);
    font-size: 0.875rem;
    opacity: 0;
    transition: transform 0.25s, opacity 0.25s;
    pointer-events: none;
    max-width: 90%;
}

.pos-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.pos-toast--error { background: var(--danger); }

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg);
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.login-card .brand-icon {
    display: block;
    text-align: center;
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.login-hint {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0 0 1.25rem;
}

.login-card .form-group { margin-bottom: 1rem; }
.login-card label { font-size: 0.85rem; font-weight: 500; color: var(--text); }
.login-card .btn { width: 100%; margin-top: 0.25rem; }

.notif-item { padding: 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.notif-item.unread { background: var(--accent-soft); }
.live-alerts { max-height: 40vh; overflow-y: auto; }

.hide-mobile { display: revert; }
.show-mobile { display: none; }

@media (max-width: 1024px) {
    .app-main {
        padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 1rem);
    }
    .bottom-nav { display: flex; }
    .desktop-nav { display: none; }
    .desktop-more { display: none; }
    .desktop-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem 1rem;
        box-shadow: var(--shadow);
    }
    .nav-toggle { display: flex; }
    .pos-layout { grid-template-columns: 1fr; }
    .pos-panel--cart {
        position: static;
        max-height: none;
        z-index: auto;
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }
    .pos-panel--search { padding-bottom: 1rem; }
    .cart-lines { max-height: 42vh; }
    .dashboard-columns, .settings-layout { grid-template-columns: 1fr; }
    .shop-preview { position: static; }
    .shop-row { grid-template-columns: minmax(0, 1fr) auto; }
    .shop-row__meta { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 0.75rem; }
}

@media (min-width: 1025px) {
    .bottom-nav, .more-menu { display: none !important; }
}

@media (max-width: 700px) {
    .app-main { padding-inline: 0.75rem; }
    .header-row { padding-inline: 0.75rem; }
    .shop-switcher select { width: 130px; }
    .shop-switcher .btn { display: none; }
    .form-grid, .form-grid--compact { grid-template-columns: 1fr; }
    .field--wide { grid-column: auto; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-card { min-height: 96px; padding: 0.75rem; }
    .stat-card > strong { font-size: 1.1rem; }
    .shortcut-grid { grid-template-columns: 1fr 1fr; }
    .toolbar-search { align-items: stretch; flex-wrap: wrap; }
    .toolbar-search input { flex-basis: 100%; }
    .shop-row { grid-template-columns: 1fr; }
    .shop-row > .btn { justify-self: start; }
    .actions-cell .table-edit { min-width: 520px; }
    .cart-line { grid-template-columns: minmax(0, 1fr) auto auto; }
    .cart-line__sub { grid-column: 1; text-align: left; }
    .cart-line__remove { grid-column: 3; grid-row: 1; }
    .checkout-payment-grid { grid-template-columns: 1fr; }
    .checkout-payment-grid > :first-child { grid-column: auto; }
    .payment-form { min-width: 250px; grid-template-columns: 1fr; }
    .payment-form button { grid-column: auto; }
    .registration-card { padding: 1.2rem; }
    .invoice-ticket { padding: 1rem; }
    .invoice-meta, .invoice-payment { flex-direction: column; }
    .profile-details > div { grid-template-columns: 1fr; gap: 0.15rem; }
}

@media (max-width: 420px) {
    .stats-grid, .shortcut-grid { grid-template-columns: 1fr; }
    .brand-text { max-width: 150px; }
    .shop-switcher { display: none; }
    .segmented-control span { font-size: 0.7rem; }
}

/* Futermind 2026 — shell, command palette and business cockpit */
:root {
    --sidebar-width: 244px;
    --radius: 10px;
    --radius-lg: 16px;
    --surface-muted: #f8fafc;
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 22px rgba(15, 23, 42, 0.04);
    --shadow-float: 0 24px 70px rgba(15, 23, 42, 0.22);
}

body { background: #f4f6fa; color: #101828; }
body.command-open { overflow: hidden; }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 260;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 1rem 0.8rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.22) transparent;
    color: #d0d5dd;
    background:
        radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 32%),
        #101828;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.app-sidebar::-webkit-scrollbar { width: 6px; }
.app-sidebar::-webkit-scrollbar-track { background: transparent; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); border-radius: 99px; }
.app-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.34); }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 52px;
    padding: 0.35rem 0.45rem 1rem;
    margin-bottom: 0.75rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #fff;
    background: var(--accent);
    border-radius: 11px;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent);
    flex: 0 0 auto;
}
.sidebar-brand > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.sidebar-brand strong { font-size: 0.96rem; letter-spacing: -0.01em; }
.sidebar-brand small { color: #98a2b3; font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand .brand-logo { width: 36px; height: 36px; padding: 3px; background: #fff; border-radius: 10px; }
.sidebar-label { padding: 0 0.65rem; margin: 0.25rem 0 0.35rem; color: #667085; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.18rem; }
.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.72rem;
    min-height: 40px;
    width: 100%;
    padding: 0.52rem 0.7rem;
    color: #98a2b3;
    background: transparent;
    border: 0;
    border-radius: 9px;
    text-decoration: none;
    text-align: left;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: color .15s ease, background .15s ease, transform .15s ease;
}
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,0.07); }
.sidebar-link.active { color: #fff; background: color-mix(in srgb, var(--accent) 25%, rgba(255,255,255,0.04)); }
.sidebar-link.active::before { content: ''; position: absolute; left: -0.8rem; top: 9px; bottom: 9px; width: 3px; background: var(--accent); border-radius: 0 4px 4px 0; }
.sidebar-link__icon, .sidebar-link > .nav-icon { width: 22px; color: #667085; text-align: center; }
.sidebar-link.active .sidebar-link__icon, .sidebar-link.active > .nav-icon, .sidebar-link:hover .sidebar-link__icon, .sidebar-link:hover > .nav-icon { color: #fff; }
.sidebar-count { margin-left: auto; min-width: 21px; padding: 0.12rem 0.35rem; color: #fff; background: #f04438; border-radius: 99px; text-align: center; font-size: 0.65rem; }
.sidebar-spacer { flex: 1; min-height: 1rem; }
.sidebar-form { margin: 0; }
.sidebar-user { display: flex; align-items: center; gap: 0.65rem; margin-top: 0.85rem; padding: 0.8rem 0.5rem 0.15rem; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-user > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.sidebar-user strong { color: #f9fafb; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user small { color: #667085; font-size: 0.68rem; }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; color: #fff; background: color-mix(in srgb, var(--accent) 75%, #fff); border-radius: 50%; font-size: 0.75rem; font-weight: 800; flex: 0 0 auto; }

.app-header {
    margin-left: var(--sidebar-width);
    background: rgba(255,255,255,0.94);
    border-bottom-color: #eaecf0;
    box-shadow: none;
    backdrop-filter: blur(14px);
}
.header-row { min-height: 66px; padding: 0 1.75rem; gap: 1rem; }
.header-context { display: flex; flex-direction: column; min-width: 130px; }
.header-context strong { color: #101828; font-size: 0.92rem; line-height: 1.25; }
.header-context small { color: #98a2b3; font-size: 0.7rem; }
.mobile-brand { display: none; align-items: center; gap: 0.5rem; color: #101828; text-decoration: none; font-weight: 700; }
.mobile-brand .sidebar-brand__mark { width: 32px; height: 32px; border-radius: 9px; }
.global-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    width: min(390px, 34vw);
    min-height: 38px;
    margin-right: auto;
    padding: 0.4rem 0.65rem;
    color: #667085;
    background: #f9fafb;
    border: 1px solid #eaecf0;
    border-radius: 9px;
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.global-search-trigger:hover { color: #344054; background: #fff; border-color: #d0d5dd; box-shadow: 0 0 0 3px #f2f4f7; }
.global-search-trigger span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.global-search-trigger kbd { margin-left: auto; padding: 0.13rem 0.36rem; color: #98a2b3; background: #fff; border: 1px solid #d0d5dd; border-bottom-width: 2px; border-radius: 5px; font-family: inherit; font-size: 0.65rem; }
.header-actions { flex: 1; }
.header-sale-action { min-height: 38px; border-radius: 9px; white-space: nowrap; }
.header-icon-button { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; color: #667085; background: #fff; border: 1px solid #eaecf0; border-radius: 9px; text-decoration: none; }
.header-icon-button:hover, .header-icon-button.active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 32%, #eaecf0); background: var(--accent-soft); }
.notification-dot { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; color: #fff; background: #f04438; border: 2px solid #fff; border-radius: 10px; font-size: 0.55rem; font-weight: 800; }
.shop-switcher select { min-height: 38px; border-color: #eaecf0; }

.app-main { max-width: none; width: calc(100% - var(--sidebar-width)); margin: 0 0 0 var(--sidebar-width); padding: 1.75rem clamp(1rem, 2.2vw, 2.25rem) 2.5rem; }
.app-footer { margin-left: var(--sidebar-width); padding: 1rem 2rem; color: #98a2b3; font-size: 0.72rem; }
.page-title { letter-spacing: -0.02em; }

/* Global command palette */
.command-palette { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: start center; padding: min(12vh, 110px) 1rem 1rem; }
.command-palette__backdrop { position: absolute; inset: 0; width: 100%; height: 100%; background: rgba(16,24,40,0.58); border: 0; backdrop-filter: blur(4px); cursor: default; }
.command-palette__dialog { position: relative; width: min(680px, 100%); max-height: min(670px, 78vh); display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid rgba(255,255,255,0.5); border-radius: 18px; box-shadow: var(--shadow-float); animation: commandIn .16s ease-out; }
@keyframes commandIn { from { opacity: 0; transform: translateY(-10px) scale(.985); } to { opacity: 1; transform: none; } }
.command-search-box { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 0.9rem 0.8rem 1.1rem; border-bottom: 1px solid #eaecf0; }
.command-search-box > i { color: var(--accent); }
.command-search-box input { flex: 1; min-width: 0; min-height: 42px; padding: 0; color: #101828; background: transparent; border: 0; outline: 0; font-size: 1rem; }
.command-close { display: grid; place-items: center; width: 34px; height: 34px; color: #667085; background: #f2f4f7; border: 0; border-radius: 8px; cursor: pointer; }
.command-palette__content { min-height: 220px; padding: 0.9rem; overflow-y: auto; }
.command-section-label { display: block; padding: 0.3rem 0.5rem 0.45rem; color: #98a2b3; font-size: 0.66rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.command-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.command-quick-grid a { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem; color: #344054; background: #f9fafb; border: 1px solid #f2f4f7; border-radius: 11px; text-decoration: none; }
.command-quick-grid a:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, #eaecf0); background: var(--accent-soft); }
.command-quick-grid a > i { width: 30px; text-align: center; color: var(--accent); }
.command-quick-grid a span { display: flex; flex-direction: column; }
.command-quick-grid strong { font-size: 0.78rem; }
.command-quick-grid small { color: #98a2b3; font-size: 0.68rem; }
.command-result-group + .command-result-group { margin-top: 0.65rem; }
.command-result { display: flex; align-items: center; gap: 0.75rem; padding: 0.62rem 0.65rem; color: #344054; border-radius: 10px; text-decoration: none; }
.command-result:hover, .command-result.active { color: #101828; background: var(--accent-soft); }
.command-result__icon { display: grid; place-items: center; width: 34px; height: 34px; color: var(--accent); background: #f2f4f7; border-radius: 9px; flex: 0 0 auto; }
.command-result:hover .command-result__icon, .command-result.active .command-result__icon { background: #fff; }
.command-result__body { min-width: 0; display: flex; flex-direction: column; }
.command-result__body strong { overflow: hidden; color: inherit; font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.command-result__body small { overflow: hidden; color: #98a2b3; font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.command-result__meta { margin-left: auto; color: #344054; font-size: 0.72rem; white-space: nowrap; }
.command-empty { min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; color: #98a2b3; text-align: center; }
.command-empty > i { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 0.4rem; color: #667085; background: #f2f4f7; border-radius: 50%; }
.command-empty strong { color: #344054; font-size: 0.85rem; }
.command-empty span { max-width: 350px; font-size: 0.72rem; }
.command-footer { display: flex; gap: 1.1rem; padding: 0.65rem 1rem; color: #98a2b3; background: #f9fafb; border-top: 1px solid #eaecf0; font-size: 0.63rem; }
.command-footer kbd { display: inline-block; min-width: 20px; margin-right: 2px; padding: 0.08rem 0.25rem; color: #667085; background: #fff; border: 1px solid #d0d5dd; border-bottom-width: 2px; border-radius: 4px; font: inherit; text-align: center; }

/* Business cockpit */
.dashboard-welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.eyebrow { margin: 0 0 0.2rem; color: var(--accent); font-size: 0.68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.dashboard-title { margin: 0 0 0.2rem; color: #101828; font-size: clamp(1.55rem, 2.4vw, 2.05rem); line-height: 1.15; letter-spacing: -0.035em; }
.dashboard-primary-action { min-height: 42px; padding-inline: 1rem; box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 23%, transparent); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem; }
.metric-card { position: relative; min-width: 0; min-height: 168px; display: flex; flex-direction: column; padding: 1rem; overflow: hidden; background: #fff; border: 1px solid #eaecf0; border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.metric-card::after { content: ''; position: absolute; right: -34px; bottom: -48px; width: 120px; height: 120px; background: currentColor; border-radius: 50%; opacity: .035; }
.metric-card__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .9rem; }
.metric-card__icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--accent); background: var(--accent-soft); border-radius: 10px; }
.metric-card--success .metric-card__icon { color: #067647; background: #ecfdf3; }
.metric-card--danger .metric-card__icon { color: #b42318; background: #fef3f2; }
.metric-card--violet .metric-card__icon { color: #6938ef; background: #f4f3ff; }
.metric-card--amber .metric-card__icon { color: #b54708; background: #fffaeb; }
.metric-delta { display: inline-flex; align-items: center; gap: .22rem; padding: .2rem .4rem; border-radius: 99px; font-size: .63rem; font-weight: 700; white-space: nowrap; }
.metric-delta--positive { color: #067647; background: #ecfdf3; }
.metric-delta--negative { color: #b42318; background: #fef3f2; }
.metric-delta--neutral { color: #667085; background: #f2f4f7; }
.metric-card__label { color: #667085; font-size: .75rem; font-weight: 600; }
.metric-card__value { margin: .15rem 0; overflow: hidden; color: #101828; font-size: clamp(1.28rem, 2vw, 1.7rem); line-height: 1.2; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.metric-card > small { margin-top: auto; color: #98a2b3; font-size: .65rem; }

.operations-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: .85rem 0 1.1rem; padding: .6rem; background: #fff; border: 1px solid #eaecf0; border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.03); }
.operation-item { min-width: 0; display: flex; align-items: center; gap: .65rem; padding: .5rem .8rem; color: #344054; border-right: 1px solid #eaecf0; text-decoration: none; }
.operation-item:last-child { border-right: 0; }
.operation-item:hover strong { color: var(--accent); }
.operation-item__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto; }
.operation-item__icon--blue { color: #175cd3; background: #eff8ff; }
.operation-item__icon--amber { color: #b54708; background: #fffaeb; }
.operation-item__icon--violet { color: #6938ef; background: #f4f3ff; }
.operation-item__icon--red { color: #b42318; background: #fef3f2; }
.operation-item > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.operation-item small { color: #98a2b3; font-size: .64rem; }
.operation-item strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.operation-item--alert strong { color: #b42318; }

.dashboard-main-grid, .dashboard-lists-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr); gap: 1rem; margin-bottom: 1rem; }
.dashboard-lists-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-card, .quick-actions-panel { min-width: 0; padding: 1.05rem; background: #fff; border: 1px solid #eaecf0; border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.panel-card__head { min-height: 38px; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.panel-card__head h2 { margin: 0; color: #101828; font-size: .92rem; letter-spacing: -.015em; }
.panel-kicker { display: block; margin-bottom: .08rem; color: #98a2b3; font-size: .61rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.panel-summary { display: flex; flex-direction: column; align-items: flex-end; }
.panel-summary strong { color: #101828; font-size: .9rem; }
.panel-summary small { color: #98a2b3; font-size: .63rem; }
.text-link { color: var(--accent); text-decoration: none; font-size: .67rem; font-weight: 700; white-space: nowrap; }

.sales-bars { height: 220px; display: grid; grid-template-columns: repeat(7, minmax(28px, 1fr)); gap: clamp(.35rem, 1vw, .75rem); align-items: end; padding-top: .4rem; }
.sales-bar { height: 100%; min-width: 0; display: grid; grid-template-rows: 22px 1fr 22px; align-items: end; text-align: center; }
.sales-bar__value { overflow: hidden; color: #98a2b3; font-size: .57rem; text-overflow: ellipsis; }
.sales-bar__track { position: relative; width: min(30px, 78%); height: 100%; margin: 0 auto; overflow: hidden; background: #f2f4f7; border-radius: 8px 8px 4px 4px; }
.sales-bar__track > span { position: absolute; inset: auto 0 0; min-height: 5px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 75%, #fff), var(--accent)); border-radius: 8px 8px 4px 4px; transition: height .25s ease; }
.sales-bar:last-child .sales-bar__track > span { box-shadow: 0 0 0 3px var(--accent-soft); }
.sales-bar small { align-self: end; color: #667085; font-size: .63rem; font-weight: 700; text-transform: capitalize; }

.focus-list { display: flex; flex-direction: column; gap: .55rem; }
.focus-item { display: flex; align-items: flex-start; gap: .65rem; padding: .72rem; color: #344054; background: #f9fafb; border: 1px solid #f2f4f7; border-radius: 11px; text-decoration: none; }
.focus-item:hover { border-color: #d0d5dd; background: #fff; }
.focus-item__icon { display: grid; place-items: center; width: 32px; height: 32px; color: #175cd3; background: #eff8ff; border-radius: 9px; flex: 0 0 auto; }
.focus-item--danger .focus-item__icon { color: #b42318; background: #fef3f2; }
.focus-item--warning .focus-item__icon { color: #b54708; background: #fffaeb; }
.focus-item--success .focus-item__icon { color: #067647; background: #ecfdf3; }
.focus-item__body { min-width: 0; display: flex; flex-direction: column; }
.focus-item__body strong { font-size: .75rem; }
.focus-item__body small { margin: .1rem 0 .32rem; color: #98a2b3; font-size: .64rem; line-height: 1.35; }
.focus-item__body b { color: var(--accent); font-size: .63rem; }

.quick-actions-panel { margin-bottom: 1rem; }
.shortcut-grid--dashboard { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shortcut-grid--dashboard .shortcut-link { min-height: 78px; padding: .72rem; background: #f9fafb; border-color: #f2f4f7; border-radius: 11px; }
.shortcut-grid--dashboard .shortcut-link:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, #eaecf0); transform: translateY(-1px); }
.shortcut-grid--dashboard .shortcut-link__icon { width: 36px; height: 36px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.07); }
.shortcut-grid--dashboard .shortcut-link__text strong { font-size: .75rem; }
.shortcut-grid--dashboard .shortcut-link__text span { font-size: .62rem; }

.performance-list, .recent-sales-list { display: flex; flex-direction: column; }
.performance-item { display: grid; grid-template-columns: 26px minmax(0,1fr) auto; align-items: center; gap: .65rem; padding: .62rem 0; border-bottom: 1px solid #f2f4f7; }
.performance-item:last-child, .recent-sale:last-child { border-bottom: 0; }
.performance-item__rank { display: grid; place-items: center; width: 24px; height: 24px; color: #667085; background: #f2f4f7; border-radius: 7px; font-size: .62rem; font-weight: 800; }
.performance-item:first-child .performance-item__rank { color: #b54708; background: #fffaeb; }
.performance-item__body { min-width: 0; }
.performance-item__body > div { display: flex; justify-content: space-between; gap: .4rem; }
.performance-item__body strong { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.performance-item__body span { color: #98a2b3; font-size: .61rem; white-space: nowrap; }
.progress-track { display: block; height: 4px; margin-top: .35rem; overflow: hidden; background: #f2f4f7; border-radius: 99px; }
.progress-track > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.performance-item__value { display: flex; flex-direction: column; align-items: flex-end; }
.performance-item__value strong { font-size: .7rem; }
.performance-item__value small { font-size: .58rem; }
.recent-sale { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: .62rem; padding: .58rem 0; color: #344054; border-bottom: 1px solid #f2f4f7; text-decoration: none; }
.recent-sale:hover .recent-sale__main strong { color: var(--accent); }
.recent-sale__icon { display: grid; place-items: center; width: 32px; height: 32px; color: #667085; background: #f2f4f7; border-radius: 9px; }
.recent-sale__main, .recent-sale__amount { min-width: 0; display: flex; flex-direction: column; }
.recent-sale__main strong { overflow: hidden; font-size: .71rem; text-overflow: ellipsis; white-space: nowrap; }
.recent-sale__main small { color: #98a2b3; font-size: .6rem; }
.recent-sale__amount { align-items: flex-end; gap: .1rem; }
.recent-sale__amount > strong { font-size: .69rem; }
.status-pill { padding: .08rem .28rem; border-radius: 99px; font-size: .52rem; font-weight: 700; white-space: nowrap; }
.status-pill--success { color: #067647; background: #ecfdf3; }
.status-pill--warning { color: #b54708; background: #fffaeb; }
.catalog-search { margin-top: 0; max-width: 620px; }
.inventory-layout { display: grid; gap: 1rem; }
.inventory-layout .card { min-width: 0; }
.inventory-preview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
.inventory-preview > span { min-width: 0; padding: .75rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.inventory-preview small, .inventory-preview strong { display: block; }
.inventory-preview small { margin-bottom: .15rem; color: var(--muted); font-size: .68rem; }
.inventory-preview strong { overflow: hidden; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.inventory-history { max-height: 720px; overflow-y: auto; }
.sales-filters { display: grid; grid-template-columns: 1fr; gap: .75rem; align-items: end; }
.sales-ledger { overflow: hidden; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.sales-ledger__head { display: none; }
.sales-ledger__row { position: relative; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; padding: 1rem 3rem 1rem 1rem; border-bottom: 1px solid var(--border); }
.sales-ledger__row:last-of-type { border-bottom: 0; }
.sales-ledger__row > div { min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.sales-ledger__row > div::before { content: attr(data-label); margin-bottom: .1rem; color: var(--muted); font-size: .6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sales-ledger__row strong, .sales-ledger__row span { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.sales-ledger__row small { overflow: hidden; color: var(--muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.sales-ledger__invoice { position: absolute; top: .85rem; right: .8rem; display: grid; place-items: center; width: 32px; height: 32px; color: var(--accent); background: var(--accent-soft); border-radius: 9px; text-decoration: none; }
.sales-ledger__invoice:hover { color: #fff; background: var(--accent); }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; color: var(--muted); font-size: .75rem; }
.btn.disabled { opacity: .45; pointer-events: none; }

@media (max-width: 1320px) and (min-width: 1025px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-card { min-height: 150px; }
    .shortcut-grid--dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .global-search-trigger { width: min(300px, 28vw); }
}

@media (max-width: 1120px) {
    .dashboard-main-grid, .dashboard-lists-grid { grid-template-columns: 1fr; }
}

@media (min-width: 1100px) {
    .inventory-layout { grid-template-columns: minmax(360px,.8fr) minmax(0,1.2fr); align-items: start; }
}

@media (min-width: 760px) {
    .sales-filters { grid-template-columns: minmax(220px,1.4fr) repeat(2,minmax(130px,.65fr)); }
    .sales-filters__search { grid-column: span 2; }
}

@media (min-width: 1200px) {
    .sales-filters { grid-template-columns: minmax(220px,1.5fr) repeat(4,minmax(120px,.65fr)) auto; }
    .sales-filters__search { grid-column: auto; }
    .sales-ledger__head,
    .sales-ledger__row { display: grid; grid-template-columns: 72px 100px minmax(150px,1.35fr) minmax(105px,.8fr) 110px 125px 105px 36px; gap: .75rem; align-items: center; }
    .sales-ledger__head { padding: .65rem 1rem; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
    .sales-ledger__row { padding: .75rem 1rem; }
    .sales-ledger__row:hover { background: color-mix(in srgb, var(--accent) 3%, var(--surface)); }
    .sales-ledger__row > div::before { display: none; }
    .sales-ledger__invoice { position: static; }
}

@media (max-width: 1024px) {
    :root { --sidebar-width: 0px; }
    .app-sidebar { display: none; }
    .app-header { margin-left: 0; }
    .app-main { width: 100%; margin-left: 0; padding-top: 1.25rem; }
    .app-footer { margin-left: 0; padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + .75rem); }
    .header-row { padding-inline: 1rem; }
    .mobile-brand { display: inline-flex; }
    .header-context { display: none; }
    .global-search-trigger { width: 40px; min-height: 38px; justify-content: center; padding: 0; margin-left: auto; margin-right: 0; }
    .global-search-trigger span, .global-search-trigger kbd { display: none; }
    .header-actions { flex: 0 1 auto; }
    .operations-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .operation-item:nth-child(2) { border-right: 0; }
    .operation-item:nth-child(-n+2) { border-bottom: 1px solid #eaecf0; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .shortcut-grid--dashboard { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 700px) {
    .header-row { min-height: 58px; padding-inline: .75rem; gap: .45rem; }
    .mobile-brand > span:last-child { display: none; }
    .header-sale-action span { display: none; }
    .header-sale-action { width: 38px; padding: 0; justify-content: center; }
    .dashboard-welcome { align-items: flex-start; }
    .dashboard-welcome .dashboard-primary-action { display: none; }
    .metric-card { min-height: 145px; padding: .85rem; }
    .metric-card__value { font-size: 1.25rem; }
    .operations-strip { padding: .4rem; }
    .operation-item { padding: .5rem; }
    .panel-card, .quick-actions-panel { padding: .85rem; border-radius: 13px; }
    .sales-bars { height: 190px; gap: .28rem; }
    .sales-bar__value { display: none; }
    .sales-bar { grid-template-rows: 1fr 22px; }
    .command-palette { padding-top: 1rem; place-items: start center; }
    .command-palette__dialog { max-height: calc(100vh - 2rem); border-radius: 14px; }
    .command-quick-grid { grid-template-columns: 1fr; }
    .command-footer { display: none; }
}

@media (max-width: 520px) {
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 136px; }
    .operations-strip { grid-template-columns: 1fr; }
    .operation-item { border-right: 0; border-bottom: 1px solid #eaecf0; }
    .operation-item:nth-child(-n+2) { border-bottom: 1px solid #eaecf0; }
    .operation-item:last-child { border-bottom: 0; }
    .shortcut-grid--dashboard { grid-template-columns: 1fr; }
    .performance-item { grid-template-columns: 24px minmax(0,1fr); }
    .performance-item__value { grid-column: 2; align-items: flex-start; }
    .recent-sale { grid-template-columns: 32px minmax(0,1fr); }
    .recent-sale__amount { grid-column: 2; align-items: flex-start; flex-direction: row; gap: .4rem; }
}

/* Measurement units */
.measurement-fields { display: grid; gap: .75rem; padding: .9rem; border: 1px solid #e4e7ec; border-radius: 12px; background: #f9fafb; }
.measurement-fields[hidden] { display: none; }
.custom-unit-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(120px,.45fr); gap: .75rem; }
.custom-unit-fields[hidden] { display: none; }
@media (max-width: 620px) { .custom-unit-fields { grid-template-columns: 1fr; } }

/* Logistics — mobile first, expanded operational cockpit on large screens */
.logistics-head { align-items: flex-start; }
.logistics-head .btn { width: 100%; margin-top: .5rem; }
.logistics-stats { grid-template-columns: 1fr; }
.logistics-alerts { display: grid; gap: .55rem; margin: 0 0 1rem; }
.logistics-alert { display: grid; grid-template-columns: 32px minmax(0,1fr) 20px; align-items: center; gap: .65rem; padding: .75rem; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; text-decoration: none; }
.logistics-alert > span:first-child { display: grid; place-items: center; width: 32px; height: 32px; background: #fef3c7; border-radius: 9px; }
.logistics-alert > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.logistics-alert small { color: #a16207; }
.logistics-tabs { position: sticky; top: 58px; z-index: 20; padding-top: .35rem; background: var(--bg); overflow-x: auto; scrollbar-width: none; }
.logistics-tabs .tab-btn { flex: 0 0 auto; white-space: nowrap; }
.transfer-list { display: grid; gap: .75rem; }
.transfer-card { display: block; min-width: 0; padding: .9rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); text-decoration: none; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.transfer-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: 0 8px 24px rgba(15,23,42,.08); transform: translateY(-1px); }
.transfer-card__top, .transfer-card__foot { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.transfer-card__top > div { min-width: 0; display: flex; flex-direction: column; }
.transfer-card__top strong { font-size: .9rem; }
.transfer-card__top span:not(.status-pill) { overflow: hidden; color: var(--muted); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.transfer-card__metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem; margin: .75rem 0; }
.transfer-card__metrics > span { min-width: 0; padding: .55rem; background: var(--surface-2); border-radius: 9px; }
.transfer-card__metrics small, .transfer-card__metrics b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-card__metrics small { color: var(--muted); font-size: .61rem; }
.transfer-card__metrics b { margin-top: .08rem; font-size: .77rem; }
.transfer-card__metrics > span:last-child { grid-column: 1 / -1; }
.transfer-card__foot { align-items: center; color: var(--muted); font-size: .64rem; }
.status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: .22rem .5rem; font-size: .62rem; }
.status-pill--info { color: #075985; background: #e0f2fe; }
.status-pill--danger { color: #b42318; background: #fef3f2; }
.status-pill--neutral { color: #475467; background: #f2f4f7; }
.product-movement-list { overflow: hidden; border: 1px solid var(--border); border-radius: 13px; }
.movement-list-head { display: grid; gap: .55rem; padding: .75rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.movement-list-head input { min-width: 0; }
.movement-product { display: grid; gap: .65rem; padding: .75rem; border-bottom: 1px solid var(--border); }
.movement-product:last-child { border-bottom: 0; }
.movement-product > div:first-child { min-width: 0; display: flex; flex-direction: column; }
.movement-product > div:first-child strong { font-size: .8rem; }
.movement-product > div:first-child span { color: var(--muted); font-size: .67rem; }
.movement-product__inputs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
.movement-product__inputs label { color: var(--muted); font-size: .63rem; font-weight: 700; }
.movement-product__inputs input { width: 100%; margin-top: .2rem; }
.signature-field { padding: .8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; }
.signature-field > label { display: block; margin-bottom: .45rem; font-weight: 700; }
.signature-field > small { display: block; margin-top: .4rem; color: var(--muted); }
.signature-pad { display: block; width: 100%; height: 160px; margin-bottom: .45rem; background: #fff; border: 1px dashed #98a2b3; border-radius: 9px; cursor: crosshair; touch-action: none; }
.management-grid { display: grid; gap: 1rem; }
.transfer-detail { padding: .85rem; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.transfer-detail__head { display: grid; gap: .75rem; }
.transfer-detail__head h2 { margin: .35rem 0 0; font-size: 1.2rem; }
.transfer-detail__head p { margin: .15rem 0 0; color: var(--muted); }
.transfer-detail__actions, .action-panel__buttons { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.transfer-flow { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .2rem; margin: 1rem 0; }
.transfer-flow__step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .25rem; color: #98a2b3; font-size: .58rem; font-weight: 700; text-align: center; }
.transfer-flow__step::before { content: ''; position: absolute; z-index: 0; top: 7px; right: 50%; width: 100%; height: 2px; background: #e4e7ec; }
.transfer-flow__step:first-child::before { display: none; }
.transfer-flow__step i { z-index: 1; display: block; width: 16px; height: 16px; background: #fff; border: 3px solid #d0d5dd; border-radius: 50%; }
.transfer-flow__step.is-active { color: var(--accent); }
.transfer-flow__step.is-active i { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.logistics-table td small, .quantity-table td small { display: block; color: var(--muted); font-size: .62rem; }
.detail-grid { display: grid; gap: .75rem; margin: .85rem 0; }
.detail-card { min-width: 0; padding: .85rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.detail-card h3 { margin: 0 0 .6rem; font-size: .82rem; }
.detail-card p, .detail-card a { display: flex; flex-direction: column; margin: 0; padding: .55rem 0; color: var(--text); border-bottom: 1px solid var(--border); font-size: .73rem; text-decoration: none; }
.detail-card p:last-child, .detail-card a:last-child { border-bottom: 0; }
.detail-card span, .detail-card small { color: var(--muted); font-size: .64rem; }
.action-panel { display: grid; gap: .75rem; margin: .85rem 0; padding: .85rem; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 20%, #fff); border-radius: 12px; }
.action-panel p, .form-intro { margin: .2rem 0 0; color: var(--muted); font-size: .7rem; }
.transfer-operations { margin-top: 1rem; }
.transfer-operations .tab-panel { padding-top: .85rem; }
.quantity-table input { min-width: 88px; width: 100%; }
.return-request { margin: .75rem 0; }
.delivery-history { margin-top: 1.1rem; }
.delivery-history > h3 { margin: 0 0 .7rem; font-size: .9rem; }
.delivery-records { display: grid; gap: .75rem; }
.delivery-record { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.delivery-record > header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: .75rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.delivery-record > header > div { min-width: 0; display: flex; flex-direction: column; }
.delivery-record > header strong { font-size: .78rem; }
.delivery-record > header span:not(.status-pill) { color: var(--muted); font-size: .63rem; }
.delivery-record__meta { display: grid; gap: .5rem; padding: .75rem; border-bottom: 1px solid var(--border); }
.delivery-record__meta span { display: flex; flex-direction: column; color: var(--text); font-size: .7rem; }
.delivery-record__meta b { margin-bottom: .1rem; color: var(--muted); font-size: .58rem; text-transform: uppercase; letter-spacing: .04em; }
.delivery-record .table-wrap { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.delivery-record__observation { margin: 0; padding: .7rem .75rem; color: var(--muted); background: #fffbeb; border-top: 1px solid #fde68a; font-size: .68rem; }
.timeline-section { margin-top: 1.2rem; }
.timeline-section h3 { font-size: .9rem; }
.transfer-timeline { margin-left: .45rem; padding-left: 1rem; border-left: 2px solid #e4e7ec; }
.transfer-timeline article { position: relative; display: flex; gap: .7rem; padding: 0 0 1rem; }
.timeline-dot { position: absolute; left: -1.37rem; top: .2rem; width: 10px; height: 10px; background: var(--accent); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent-soft); }
.transfer-timeline strong { display: block; font-size: .72rem; }
.transfer-timeline p { margin: .15rem 0 0; color: var(--muted); font-size: .63rem; }
.mobile-stock-indicator { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: .55rem; margin: .55rem 0 0; padding: .55rem .65rem; color: #075985; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 10px; font-size: .68rem; }
.mobile-stock-indicator > i { display: grid; place-items: center; width: 30px; height: 30px; background: #e0f2fe; border-radius: 8px; }
.mobile-stock-indicator > span { min-width: 0; display: flex; flex-direction: column; }
.mobile-stock-indicator a { color: #0369a1; font-weight: 800; text-decoration: none; }

@media (min-width: 600px) {
    .logistics-head { display: flex; align-items: center; justify-content: space-between; }
    .logistics-head .btn { width: auto; margin-top: 0; }
    .logistics-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .movement-list-head { grid-template-columns: minmax(0,1fr) minmax(220px,.45fr); align-items: center; }
    .movement-product { grid-template-columns: minmax(0,1fr) minmax(260px,.6fr); align-items: center; }
    .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .delivery-record__meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .action-panel { grid-template-columns: minmax(0,1fr) auto; align-items: center; }
}

@media (min-width: 900px) {
    .logistics-tabs { position: static; }
    .transfer-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .transfer-card__metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .transfer-card__metrics > span:last-child { grid-column: auto; }
    .management-grid { grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); align-items: start; }
    .transfer-detail { padding: 1.2rem; }
    .transfer-detail__head { grid-template-columns: minmax(0,1fr) auto; align-items: start; }
}

@media (min-width: 1280px) {
    .logistics-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
    .transfer-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .transfer-detail { padding: 1.5rem; }
}

/* Planification logistique multi-boutiques */
.destination-planner { padding: 0; overflow: hidden; }
.destination-planner > summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem; cursor: pointer; list-style: none; background: var(--surface-2); }
.destination-planner > summary::-webkit-details-marker { display: none; }
.destination-planner > summary::after { content: '+'; display: grid; place-items: center; width: 26px; height: 26px; color: var(--accent); background: var(--accent-soft); border-radius: 8px; font-weight: 900; }
.destination-planner[open] > summary::after { content: '−'; }
.destination-planner > summary span { color: var(--muted); font-size: .7rem; }
.destination-planner > .form-grid { padding: .85rem; }
.destination-planner > .table-wrap { margin: 0 .85rem .85rem; }
.destination-planner input[type="number"] { min-width: 92px; width: 100%; }
.timeline { margin-left: .45rem; padding-left: 1rem; border-left: 2px solid var(--border); }
.timeline article { position: relative; padding: 0 0 .9rem; }
.timeline article > i { position: absolute; left: -1.36rem; top: .25rem; width: 10px; height: 10px; background: var(--accent); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent-soft); }
.timeline article strong, .timeline article span { display: block; }
.timeline article span { margin-top: .12rem; color: var(--muted); font-size: .65rem; }
.recovery-code-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
.recovery-code-grid code,.mfa-secret code { padding: .7rem; background: #0f172a; color: #f8fafc; border-radius: 8px; font-weight: 800; letter-spacing: .08em; text-align: center; }
.security-steps { padding-left: 1.25rem; color: var(--muted); }
.security-steps li { margin-bottom: .45rem; }
.mfa-secret { display: grid; gap: .55rem; margin: .75rem 0 1rem; padding: .8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.mfa-secret small { color: var(--muted); }
.mfa-secret a { font-size: .72rem; font-weight: 700; }

@media (min-width: 900px) {
    .destination-planner > .form-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
