:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-strong: #eef3f8;

    --text: #111827;
    --text-soft: #374151;
    --muted: #6b7280;
    --muted-light: #9ca3af;

    --border: #e5e7eb;
    --border-strong: #d1d5db;

    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --primary-soft: #eff6ff;

    --success: #15803d;
    --success-hover: #166534;
    --success-soft: #ecfdf3;

    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-soft: #fef2f2;

    --warning: #d97706;
    --warning-hover: #b45309;
    --warning-soft: #fffbeb;

    --dark: #111827;
    --dark-hover: #030712;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);

    --font-main: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    font-family: var(--font-main);
}

html {
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    width: 100%;
    overflow-x: hidden;
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, 0.08), transparent 32%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 42%, #eef3f8 100%);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

img,
canvas,
video {
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: 34px;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--text);
}

h2 {
    margin-bottom: 6px;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
}

h3 {
    margin-bottom: 4px;
    font-size: 17px;
    line-height: 1.2;
    color: var(--text);
}

p {
    color: var(--muted);
}

.subtitle {
    max-width: 760px;
    margin-bottom: 0;
    color: var(--text-soft);
    font-size: 15px;
}

.hidden {
    display: none !important;
}

.section-gap {
    margin-top: 14px;
}

/* Login */

.login-screen {
    min-height: calc(100vh - 48px);
    display: grid;
    place-items: center;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(209, 213, 219, 0.9);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
}

.login-brand,
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #0f766e);
    color: #fff;
    font-weight: 900;
    font-size: 18px;
    box-shadow: 0 12px 24px rgba(29, 78, 216, 0.24);
}

.brand-title {
    font-weight: 800;
    font-size: 17px;
    color: var(--text);
    line-height: 1.1;
}

.brand-subtitle {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.login-header {
    margin-top: 30px;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 30px;
    margin-bottom: 8px;
}

.login-header p {
    margin-bottom: 0;
}

.form-stack {
    display: grid;
    gap: 14px;
}

.login-actions {
    margin-top: 18px;
}

/* App shell */

.app-shell {
    display: grid;
    gap: 20px;
}

.topbar,
.auth-bar {
    position: sticky;
    top: 12px;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(209, 213, 219, 0.85);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
}

.topbar-session {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-user {
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

.auth-user strong {
    color: var(--text);
    font-weight: 800;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: stretch;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.88)),
        radial-gradient(circle at top right, rgba(29, 78, 216, 0.12), transparent 38%);
    border: 1px solid rgba(209, 213, 219, 0.86);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.hero-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    background: var(--dark);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: #fff;
}

.hero-panel-label {
    margin-bottom: 8px;
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.hero-panel-title {
    font-size: 20px;
    font-weight: 850;
    line-height: 1.2;
}

.hero-panel-text {
    margin-top: 8px;
    color: #d1d5db;
    font-size: 14px;
}

/* Cards */

.card {
    width: 100%;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.card-header p {
    margin-bottom: 0;
    font-size: 14px;
}

.edit-alert {
    display: none;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--warning-soft);
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    color: #92400e;
    font-size: 14px;
    font-weight: 600;
}

.edit-alert.active {
    display: block;
}

/* Barcode scanner */

.input-action-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-action-row input {
    min-width: 0;
}

.btn-scan {
    flex: 0 0 auto;
}

.barcode-scanner {
    margin-bottom: 18px;
    padding: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.barcode-scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.barcode-scanner-header h3 {
    margin-bottom: 4px;
}

.barcode-scanner-header p {
    margin-bottom: 0;
    font-size: 13px;
}

.barcode-video-box {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background: #020617;
    border-radius: var(--radius-lg);
    aspect-ratio: 4 / 3;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.barcode-video-box video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.barcode-scan-frame {
    position: absolute;
    left: 10%;
    right: 10%;
    top: 34%;
    height: 28%;
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 14px;
    box-shadow:
        0 0 0 999px rgba(2, 6, 23, 0.35),
        0 0 24px rgba(29, 78, 216, 0.35);
    pointer-events: none;
}

.barcode-scan-frame::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: 50%;
    height: 2px;
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.9);
}

.barcode-scanner-message {
    margin-top: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.barcode-scanner-message.success {
    background: var(--success-soft);
    border-color: #bbf7d0;
    color: #166534;
}

.barcode-scanner-message.error {
    background: var(--danger-soft);
    border-color: #fecaca;
    color: #991b1b;
}

/* Forms */

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.field {
    min-width: 0;
}

label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input[type="file"] {
    padding: 9px 12px;
    color: var(--muted);
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(29, 78, 216, 0.72);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.11);
}

textarea {
    min-height: 112px;
    resize: vertical;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.check-inline {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.check-inline input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

.check-inline label {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
}

/* Buttons */

button {
    min-height: 42px;
    border: none;
    border-radius: var(--radius-md);
    padding: 11px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.2;
    white-space: nowrap;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, opacity 140ms ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

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

.btn-secondary {
    background: var(--success);
    color: #fff;
}

.btn-secondary:hover {
    background: var(--success-hover);
}

.btn-dark {
    background: #444;
    color: #fff;
}

.btn-dark:hover {
    background: var(--dark-hover);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-warning:hover {
    background: var(--warning-hover);
}

.btn-light {
    background: var(--surface-strong);
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.message {
    display: none;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 650;
}

.message.success {
    display: block;
    background: var(--success-soft);
    color: #166534;
    border: 1px solid #bbf7d0;
}

.message.error {
    display: block;
    background: var(--danger-soft);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.meta {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

/* Filters */

.filters {
    display: grid;
    grid-template-columns: 2fr 1fr auto auto auto;
    gap: 14px;
    align-items: end;
}

.filter-check {
    min-height: 44px;
    justify-content: center;
}

/* Stats */

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.stat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--muted);
    font-size: 14px;
    font-weight: 750;
}

.stat-card strong {
    color: var(--primary);
    font-size: 22px;
    font-weight: 900;
}

/* Table */

.selection-bar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.selection-bar h2 {
    margin-bottom: 4px;
}

.table-subtitle {
    margin-bottom: 0;
    font-size: 14px;
}

.selection-info {
    flex: 0 0 auto;
    padding: 9px 12px;
    background: var(--primary-soft);
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.35;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 14px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--surface-soft);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

tbody tr {
    transition: background 140ms ease;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody tr:last-child td {
    border-bottom: none;
}

.product-image {
    width: 74px;
    height: 74px;
    object-fit: cover;
    display: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.empty {
    padding: 28px;
    text-align: center;
    color: var(--muted);
    font-style: italic;
}

.small-btn {
    min-height: 36px;
    margin-right: 6px;
    margin-bottom: 6px;
    padding: 8px 11px;
    font-size: 13px;
}

.tag {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    margin-bottom: 5px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.tag-new {
    background: var(--primary-soft);
    color: var(--primary);
}

.tag-promo {
    background: var(--danger-soft);
    color: var(--danger);
}

.price {
    color: var(--success);
    font-weight: 900;
    white-space: nowrap;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

/* Tablette : proche PC, seulement plus compact */

@media (max-width: 1100px) {
    .container {
        padding: 18px;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters > div:last-child {
        grid-column: span 2;
    }

    .filters button {
        width: 100%;
    }

    table {
        min-width: 980px;
    }
}

/* Petite tablette : adaptation légère, pas de transformation complète */

@media (max-width: 850px) {
    .container {
        padding: 14px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 21px;
    }

    .topbar,
    .auth-bar {
        position: static;
        align-items: center;
    }

    .topbar-session {
        flex-direction: row;
        align-items: center;
    }

    .hero {
        padding: 20px;
    }

    .card {
        padding: 18px;
    }

    .grid-4,
    .grid-3,
    .grid-2,
    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters > div:first-child {
        grid-column: span 2;
    }

    .filters > div:last-child {
        grid-column: span 2;
    }

    .stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .form-footer {
        align-items: center;
    }

    .actions {
        gap: 10px;
    }

    .selection-bar {
        align-items: flex-start;
    }

    table {
        min-width: 920px;
    }

    th,
    td {
        padding: 11px;
    }
}

/* Téléphone : même structure que PC, mais compacte */

@media (max-width: 700px) {
    body {
        background: var(--bg);
        font-size: 14px;
    }

    .container {
        padding: 10px;
    }

    .app-shell {
        gap: 12px;
    }

    h1 {
        font-size: 24px;
        line-height: 1.15;
        margin-bottom: 6px;
    }

    h2 {
        font-size: 19px;
        margin-bottom: 4px;
    }

    p,
    .subtitle,
    .card-header p,
    .table-subtitle,
    .meta {
        font-size: 13px;
        line-height: 1.4;
    }

    .login-screen {
        min-height: calc(100vh - 20px);
    }

    .login-card {
        max-width: 100%;
        padding: 18px;
        border-radius: 18px;
    }

    .login-header {
        margin-top: 20px;
        margin-bottom: 14px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 16px;
    }

    .brand-title {
        font-size: 15px;
    }

    .brand-subtitle {
        font-size: 12px;
    }

    .topbar,
    .auth-bar {
        padding: 12px;
        border-radius: 16px;
        gap: 10px;
        flex-direction: row;
        align-items: center;
    }

    .topbar-brand {
        min-width: 0;
    }

    .topbar-session {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .auth-user {
        font-size: 12px;
        white-space: normal;
    }

    .topbar .brand-subtitle {
        display: none;
    }

    .hero {
        display: block;
        padding: 16px;
        border-radius: 18px;
    }

    .hero-panel {
        display: none;
    }

    .eyebrow {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .card {
        padding: 14px;
        border-radius: 18px;
    }

    .card-header {
        margin-bottom: 12px;
    }

    .grid-4,
    .grid-3,
    .grid-2,
    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .field {
        min-width: 0;
    }

    label {
        font-size: 12px;
        margin-bottom: 5px;
    }

    input[type="email"],
    input[type="password"],
    input[type="text"],
    input[type="number"],
    input[type="file"],
    textarea,
    select {
        min-height: 38px;
        padding: 8px 10px;
        border-radius: 10px;
        font-size: 13px;
    }

    input[type="file"] {
        padding: 7px 8px;
        font-size: 12px;
    }

    textarea {
        min-height: 76px;
    }

    .input-action-row {
        gap: 6px;
    }

    .btn-scan {
        padding-left: 10px;
        padding-right: 10px;
    }

    .barcode-scanner {
        padding: 12px;
        border-radius: 16px;
        margin-bottom: 14px;
    }

    .barcode-scanner-header {
        gap: 10px;
        margin-bottom: 10px;
    }

    .barcode-scanner-header p {
        font-size: 12px;
    }

    .barcode-video-box {
        max-width: 100%;
        border-radius: 14px;
    }

    .barcode-scanner-message {
        padding: 8px 10px;
        font-size: 12px;
    }

    .form-footer {
        margin-top: 12px;
        padding-top: 12px;
        gap: 10px;
        align-items: center;
        flex-direction: row;
    }

    .checks {
        gap: 8px;
    }

    .check-inline {
        min-height: 34px;
        padding: 6px 9px;
        border-radius: 10px;
    }

    .check-inline input {
        width: 14px;
        height: 14px;
    }

    .check-inline label {
        font-size: 12px;
    }

    button {
        min-height: 36px;
        padding: 8px 12px;
        border-radius: 10px;
        font-size: 13px;
        white-space: nowrap;
    }

    .form-footer button {
        flex: 0 0 auto;
    }

    .actions {
        gap: 8px;
        margin-top: 14px;
        display: flex;
        flex-wrap: wrap;
    }

    .actions button {
        flex: 1 1 150px;
        width: auto;
    }

    .message {
        margin-top: 10px;
        padding: 9px 10px;
        font-size: 13px;
    }

    .edit-alert {
        margin-bottom: 12px;
        padding: 9px 10px;
        font-size: 13px;
    }

    .filters > div:first-child,
    .filters > div:last-child {
        grid-column: span 2;
    }

    .filter-check {
        min-height: 34px;
    }

    .stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-top: 12px;
    }

    .stat-card {
        display: block;
        padding: 10px;
        border-radius: 12px;
        font-size: 11px;
        text-align: center;
    }

    .stat-card strong {
        display: block;
        margin-top: 3px;
        font-size: 18px;
    }

    .selection-bar {
        gap: 10px;
        margin-bottom: 12px;
        align-items: flex-start;
    }

    .selection-info {
        padding: 7px 9px;
        font-size: 12px;
        border-radius: 12px;
        white-space: normal;
    }

    .table-wrap {
        overflow-x: auto;
        border-radius: 14px;
        border: 1px solid var(--border);
        background: #fff;
    }

    table {
        display: table;
        width: 100%;
        min-width: 920px;
        border-collapse: collapse;
        background: #fff;
    }

    thead {
        display: table-header-group;
    }

    tbody {
        display: table-row-group;
    }

    tr {
        display: table-row;
        padding: 0;
        margin: 0;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    th,
    td {
        display: table-cell;
        padding: 9px;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
        word-break: normal;
    }

    td::before {
        content: none !important;
        display: none !important;
    }

    th {
        font-size: 10px;
    }

    td {
        font-size: 12px;
    }

    .product-image {
        width: 52px;
        height: 52px;
        border-radius: 10px;
    }

    .small-btn {
        width: auto;
        min-height: 30px;
        padding: 6px 8px;
        margin-right: 4px;
        margin-bottom: 4px;
        font-size: 11px;
        border-radius: 8px;
    }

    .tag {
        padding: 4px 7px;
        font-size: 10px;
    }

    .price {
        white-space: nowrap;
    }

    .empty {
        padding: 18px;
        text-align: center;
        font-size: 13px;
    }
}

/* Très petit téléphone : encore plus compact */

@media (max-width: 420px) {
    .container {
        padding: 8px;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 18px;
    }

    .topbar,
    .auth-bar {
        padding: 10px;
    }

    .auth-user {
        font-size: 11px;
    }

    .btn-dark {
        padding-left: 9px;
        padding-right: 9px;
    }

    .hero,
    .card,
    .login-card {
        padding: 12px;
        border-radius: 16px;
    }

    .grid-4,
    .grid-3,
    .grid-2,
    .filters {
        gap: 8px;
    }

    input[type="email"],
    input[type="password"],
    input[type="text"],
    input[type="number"],
    input[type="file"],
    textarea,
    select {
        min-height: 36px;
        padding: 7px 9px;
        font-size: 12px;
    }

    label {
        font-size: 11px;
    }

    button {
        min-height: 34px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .checks {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-footer button {
        width: 100%;
    }

    .actions button {
        flex-basis: 100%;
    }

    .stats {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .stat-card {
        padding: 8px 6px;
    }

    .stat-card strong {
        font-size: 16px;
    }

    .input-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-scan {
        width: 100%;
    }

    .barcode-scanner-header {
        flex-direction: column;
        align-items: stretch;
    }

    .barcode-scanner-header button {
        width: 100%;
    }

    table {
        min-width: 860px;
    }

    th,
    td {
        padding: 8px;
    }

    .product-image {
        width: 48px;
        height: 48px;
    }
}


/* Correctif urgent mobile après ajout scanner */
@media (max-width: 700px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .container,
    .app-shell,
    .card,
    .hero,
    .grid-4,
    .grid-3,
    .grid-2,
    .filters,
    .field,
    .input-action-row {
        min-width: 0;
        max-width: 100%;
    }

    .container {
        padding: 10px;
        overflow-x: hidden;
    }

    .app-shell {
        gap: 12px;
        overflow-x: hidden;
    }

    .card {
        padding: 14px;
        border-radius: 18px;
        overflow-x: hidden;
    }

    .hero {
        display: block;
        padding: 16px;
        border-radius: 18px;
    }

    .hero-panel {
        display: none;
    }

    .grid-4,
    .grid-3,
    .grid-2,
    .filters {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .filters > div:first-child,
    .filters > div:last-child {
        grid-column: auto !important;
    }

    input[type="email"],
    input[type="password"],
    input[type="text"],
    input[type="number"],
    input[type="file"],
    textarea,
    select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 38px;
        padding: 8px 10px;
        border-radius: 10px;
        font-size: 13px;
    }

    input[type="file"] {
        font-size: 12px;
        padding: 7px 8px;
    }

    .input-action-row {
        display: flex;
        width: 100%;
        gap: 6px;
        align-items: center;
    }

    .input-action-row input {
        flex: 1 1 auto;
        min-width: 0;
    }

    .btn-scan {
        flex: 0 0 auto;
        padding-left: 10px;
        padding-right: 10px;
    }

    button {
        min-height: 36px;
        padding: 8px 12px;
        border-radius: 10px;
        font-size: 13px;
        white-space: normal;
    }

    .form-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .form-footer button {
        width: 100%;
    }

    .checks {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .check-inline {
        min-height: 34px;
        padding: 6px 9px;
        border-radius: 10px;
        justify-content: center;
    }

    .actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 14px;
    }

    .actions button {
        width: 100%;
    }

    .topbar,
    .auth-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        border-radius: 16px;
    }

    .topbar-session {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .auth-user {
        white-space: normal;
        font-size: 12px;
    }

    .barcode-scanner {
        padding: 12px;
        border-radius: 16px;
        margin-bottom: 14px;
        overflow-x: hidden;
    }

    .barcode-video-box {
        max-width: 100%;
        border-radius: 14px;
    }

    .table-wrap {
        overflow-x: auto;
        max-width: 100%;
        border-radius: 14px;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 860px;
    }
}

@media (max-width: 420px) {
    .container {
        padding: 8px;
    }

    .hero,
    .card,
    .login-card {
        padding: 12px;
        border-radius: 16px;
    }

    .input-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-scan {
        width: 100%;
    }

    .barcode-scanner-header {
        flex-direction: column;
        align-items: stretch;
    }

    .barcode-scanner-header button {
        width: 100%;
    }

    table {
        min-width: 820px;
    }
}


.whatsapp-result {
    white-space: pre-line;
}

.client-status {
    font-weight: 900;
}

#clientTableBody td {
    vertical-align: middle;
}

#whatsappSendStatus {
    white-space: pre-line;
}

.catalog-choice-box {
    margin-top: 18px;
    padding: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.compact-header {
    margin-bottom: 14px;
}

.compact-header h2 {
    font-size: 18px;
}

#selectedCatalogInfo {
    font-weight: 800;
}

.whatsapp-result {
    white-space: pre-line;
}