/* ============================================================
   OMS Business — Feuille de style principale
   Identité : #0A5BEE (primaire), #042552 (foncé), #F6F9FE (fond)
   Mobile-first, cartes arrondies, navigation basse au pouce.
   ============================================================ */
:root {
    --oms-primary: #0A5BEE;
    --oms-primary-dark: #042552;
    --oms-primary-2: #062B5F;
    --oms-bg: #F6F9FE;
    --oms-text: #042552;
    --oms-muted: #65758C;
    --oms-success: #1B9B5F;
    --oms-warning: #F69A28;
    --oms-danger: #DC3545;
    --oms-card: #FFFFFF;
    --oms-border: #E5EDF8;
    --oms-radius: 18px;
    --oms-radius-sm: 12px;
    --oms-shadow: 0 2px 12px rgba(4,37,82,.06);
    --oms-shadow-lg: 0 12px 40px rgba(4,37,82,.12);
    --oms-font: "Inter", "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { background: var(--oms-bg); color: var(--oms-text); font-family: var(--oms-font); }
body { padding-bottom: 88px; min-height: 100vh; -webkit-font-smoothing: antialiased; }

/* ===== Topbar ===== */
.oms-topbar {
    background: var(--oms-card);
    border-radius: 0 0 var(--oms-radius) var(--oms-radius);
    box-shadow: var(--oms-shadow);
    margin-bottom: 14px;
}
.oms-logo {
    border-radius: 10px; object-fit: contain; background: #fff;
    padding: 2px;
}
.oms-title { font-size: 1.05rem; font-weight: 700; color: var(--oms-text); line-height: 1.2; }
.oms-subtitle { color: var(--oms-muted); font-size: .8rem; }
.oms-net-badge {
    background: #E8F4FE; color: var(--oms-primary);
    padding: 6px 12px; border-radius: 100px; font-size: .8rem; font-weight: 600;
}
.oms-net-badge.offline { background: #FFF4E6; color: var(--oms-warning); }

/* ===== Sections / cartes ===== */
.oms-section { padding: 0 14px; margin-bottom: 16px; }
.oms-h2 { font-size: 1.1rem; font-weight: 700; margin: 6px 0 10px; color: var(--oms-text); }
.oms-card {
    background: var(--oms-card);
    border-radius: var(--oms-radius);
    padding: 16px;
    box-shadow: var(--oms-shadow);
}

/* ===== Inputs ===== */
.form-control, .form-select {
    border-radius: var(--oms-radius-sm);
    border: 1px solid var(--oms-border);
    padding: 12px 14px;
    font-size: 1rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--oms-primary);
    box-shadow: 0 0 0 3px rgba(10,91,238,.15);
}
.form-label { color: var(--oms-muted); font-size: .82rem; margin-bottom: 4px; }

.oms-input-with-icon { position: relative; }
.oms-input-with-icon > .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--oms-muted); }
.oms-input-with-icon > input,
.oms-input-with-icon > select { padding-left: 38px; }

/* ===== Boutons ===== */
.btn { border-radius: var(--oms-radius-sm); font-weight: 600; padding: 10px 18px; }
.oms-btn-lg { padding: 14px 18px; font-size: 1rem; }
.oms-btn-primary { background: var(--oms-primary); color: #fff; }
.oms-btn-primary:hover { background: #084ccc; color: #fff; }
.oms-btn-secondary { background: #fff; color: var(--oms-primary); border: 1px solid var(--oms-border); }
.oms-btn-success { background: var(--oms-success); color: #fff; }
.oms-btn-success:hover { color: #fff; }
.oms-btn-warning { background: var(--oms-warning); color: #fff; }
.oms-btn-warning:hover { color: #fff; }
.oms-btn-danger { background: var(--oms-danger); color: #fff; }
.oms-btn-danger:hover { color: #fff; }

/* ===== Stat cards (dashboard) ===== */
.oms-stat-card {
    background: var(--oms-card);
    border-radius: var(--oms-radius);
    padding: 16px;
    box-shadow: var(--oms-shadow);
    height: 100%;
}
.oms-stat-icon {
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; background: #E8F4FE; color: var(--oms-primary); font-size: 1rem;
}
.oms-bg-soft-primary { background: #E8F4FE; color: var(--oms-primary); }
.oms-bg-soft-success { background: #E7F7EE; color: var(--oms-success); }
.oms-bg-soft-warning { background: #FFF4E6; color: var(--oms-warning); }
.oms-bg-soft-danger  { background: #FDECEE; color: var(--oms-danger); }
.oms-bg-soft-info    { background: #E8F4FE; color: var(--oms-primary); }
.oms-stat-label { color: var(--oms-muted); font-size: .82rem; margin-top: 8px; }
.oms-stat-value { font-size: 1.6rem; font-weight: 800; color: var(--oms-text); line-height: 1.2; }
.oms-stat-extra { font-size: .78rem; color: var(--oms-success); margin-top: 2px; }
.oms-stat-extra.text-danger { color: var(--oms-danger); }
.oms-stat-extra.text-warning { color: var(--oms-warning); }

/* ===== Quick actions ===== */
.oms-quick-action {
    display: flex; align-items: center; gap: 10px;
    background: var(--oms-card); border-radius: var(--oms-radius); padding: 16px;
    box-shadow: var(--oms-shadow); text-decoration: none; color: var(--oms-text);
    transition: transform .15s ease;
}
.oms-quick-action:hover { transform: translateY(-2px); }
.oms-quick-icon {
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; background: #E8F4FE; color: var(--oms-primary); flex-shrink: 0;
}

/* ===== Bottom nav ===== */
.oms-bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: #fff; border-top: 1px solid var(--oms-border);
    display: flex; justify-content: space-around;
    z-index: 1000; padding-bottom: env(safe-area-inset-bottom);
}
.oms-bn-item {
    display: flex; flex-direction: column; align-items: center;
    color: var(--oms-muted); text-decoration: none;
    font-size: .72rem; padding: 10px 6px; flex: 1; text-align: center;
}
.oms-bn-item.active { color: var(--oms-primary); }
.oms-bn-item i { font-size: 1.2rem; margin-bottom: 2px; }

/* ===== Pills ===== */
.oms-pill {
    padding: 4px 10px; font-size: .75rem; font-weight: 600; border-radius: 100px;
    display: inline-flex; align-items: center; gap: 4px;
}
.oms-pill-success { background: #E7F7EE; color: var(--oms-success); }
.oms-pill-warning { background: #FFF4E6; color: var(--oms-warning); }
.oms-pill-danger  { background: #FDECEE; color: var(--oms-danger); }

/* ===== Photos / scanner ===== */
.oms-photo-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #F0F6FE; border-radius: var(--oms-radius);
    padding: 24px; cursor: pointer; color: var(--oms-primary); border: 1px dashed #B9D0F5;
}
.oms-photo-drop i { font-size: 1.6rem; }
.oms-photo-preview { width: 100%; border-radius: var(--oms-radius); margin-top: 10px; }

.oms-qr-reader { width: 100%; border-radius: var(--oms-radius); overflow: hidden; }
.oms-barcode-display { background: #F8FAFD; border-radius: var(--oms-radius-sm); padding: 6px; }

/* ===== Cart ===== */
.oms-cart-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px dashed var(--oms-border);
}
.oms-cart-row:last-child { border-bottom: 0; }
.oms-cart-total { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--oms-border); }
.oms-total-amount { font-size: 1.6rem; font-weight: 800; color: var(--oms-text); }

.oms-qty-control { display: inline-flex; align-items: center; gap: 6px; }
.oms-qty-control .btn {
    width: 34px; height: 34px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--oms-border); border-radius: 8px; background: #F4F7FC;
}
.oms-qty-control .btn:active { background: #E6EEFB; }
.oms-qty-input {
    width: 64px; text-align: center; padding: 4px 6px;
    border-radius: 8px; -moz-appearance: textfield;
}
.oms-qty-input::-webkit-outer-spin-button,
.oms-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== Suggestions liste produits ===== */
.oms-suggest-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px);
    background: #fff; border: 1px solid var(--oms-border);
    border-radius: var(--oms-radius); box-shadow: var(--oms-shadow);
    max-height: 320px; overflow-y: auto; z-index: 1050;
}
.oms-suggest-item {
    width: 100%; text-align: left; padding: 10px 12px;
    background: #fff; border: 0; border-bottom: 1px solid #F0F2F5;
    cursor: pointer; transition: background .15s;
}
.oms-suggest-item:hover, .oms-suggest-item:focus {
    background: #F4F7FC; outline: none;
}
.oms-suggest-item:last-child { border-bottom: 0; }

/* ===== Login ===== */
.oms-login-page { background: var(--oms-bg); }
.oms-login-card { padding: 24px; box-shadow: var(--oms-shadow-lg); margin: 30px auto; }
.oms-login-logo {
    width: 200px; max-width: 70%; height: 200px;
    object-fit: contain; object-position: center;
    display: block; margin: 0 auto;
}
.oms-pwa-tip { background: #E8F4FE; color: var(--oms-primary); border-radius: var(--oms-radius-sm); padding: 12px; }
.oms-pending-tip { background: #FFF4E6; color: #B36711; border-radius: var(--oms-radius-sm); padding: 14px; }
.oms-success-tip { background: #E7F7EE; color: var(--oms-success); }
.oms-offline-banner { background: #FFF4E6; color: #B36711; }

/* ===== Tabs ===== */
.oms-tabs {
    display: flex; gap: 8px; padding: 4px; background: #fff;
    border-radius: var(--oms-radius); box-shadow: var(--oms-shadow); overflow-x: auto;
}
.oms-tab {
    background: transparent; border: 0; padding: 8px 12px; border-radius: var(--oms-radius-sm);
    font-weight: 600; color: var(--oms-muted); flex-shrink: 0; font-size: .85rem;
}
.oms-tab.active { background: #E8F4FE; color: var(--oms-primary); }

/* ===== Tel cards ===== */
.oms-tel-card {
    background: #fff; border-radius: var(--oms-radius); padding: 14px;
    border: 1.5px solid var(--oms-border); cursor: pointer; transition: border-color .15s;
}
.oms-tel-card.selected { border-color: var(--oms-primary); background: #F4F9FE; }
.oms-tel-card i { font-size: 1.4rem; color: var(--oms-primary); }

/* ===== Radio tiles ===== */
.oms-radio-tile {
    background: #fff; border: 1.5px solid var(--oms-border); border-radius: var(--oms-radius-sm);
    padding: 12px; font-weight: 600; color: var(--oms-text);
}
.oms-radio-tile.selected { border-color: var(--oms-primary); color: var(--oms-primary); }

/* ===== Misc ===== */
.oms-muted { color: var(--oms-muted); }
.oms-empty { text-align: center; padding: 24px; color: var(--oms-muted); }
.oms-loading-skeleton { height: 80px; background: linear-gradient(90deg, #ECF3FB, #F8FAFD, #ECF3FB);
    background-size: 200% 100%; animation: oms-skel 1.4s linear infinite; border-radius: var(--oms-radius); }
@keyframes oms-skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.oms-big-red { color: var(--oms-danger); font-size: 1.8rem; font-weight: 800; }
.oms-link-sync { color: var(--oms-primary); text-decoration: none; font-weight: 600; }
.oms-alerts-list .oms-card { background: #FDECEE; color: #7E1D26; }

.oms-product-row {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border-radius: var(--oms-radius); padding: 12px 14px; box-shadow: var(--oms-shadow);
}
.oms-product-info strong { display: block; }
.oms-product-info small { color: var(--oms-muted); }

.oms-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: #E8F4FE; color: var(--oms-primary);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
}

/* ===== Export target (hors écran) ===== */
.oms-export-target {
    position: fixed; left: -10000px; top: 0;
    background: #fff; width: 800px; padding: 30px; font-family: var(--oms-font); color: var(--oms-text);
}
.oms-export-header { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--oms-primary); }
.oms-export-header h2 { margin: 0; color: var(--oms-primary); }
.oms-export-table { width: 100%; margin-top: 16px; border-collapse: collapse; }
.oms-export-table th, .oms-export-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--oms-border); }
.oms-export-table th { background: #F4F9FE; }
.oms-export-footer { margin-top: 16px; color: var(--oms-muted); text-align: right; font-size: .85rem; }
