/* =========================================================
   MUM'S KD POS - Feuille de style principale
   ========================================================= */

/* ---------- Bandeau mode hors-ligne ---------- */
.offline-banner {
    position: sticky; top: 0; z-index: 200; text-align: center; padding: 9px 14px;
    font-size: 13px; font-weight: 700; color: #fff; transition: all .2s;
}
.offline-banner.hidden { display: none; }
.offline-banner.offline { background: #b3261e; }
.offline-banner.syncing { background: #dc9a15; }
.offline-banner.error { background: #b3261e; }
.offline-banner.ok { background: #16a161; }
:root {
    --primary: #3b1f7a;
    --primary-dark: #241354;
    --primary-darker: #180d3a;
    --primary-light: #6742c4;
    --primary-50: #f4f1fc;
    --primary-100: #ece5fb;
    --accent: #f2b705;
    --accent-dark: #c99400;
    --bg: #f3f1f9;
    --surface: #ffffff;
    --text: #221836;
    --text-muted: #746e8c;
    --border: #e6e1f3;
    --success: #16a161;
    --success-dark: #0f7d4c;
    --danger: #e0384a;
    --warning: #dc9a15;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(36, 19, 84, 0.06);
    --shadow: 0 4px 16px rgba(36, 19, 84, 0.08);
    --shadow-lg: 0 16px 40px rgba(24, 13, 58, 0.16);
    --font: 'Plus Jakarta Sans', 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font); letter-spacing: -0.01em; }

a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d8d0ee; border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: #c3b8e6; }

.app-shell { display: flex; min-height: 100vh; }

/* ---------- Logo mark ---------- */
.logo-mark {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    background: linear-gradient(145deg, var(--accent), #d99a00);
    color: #2a1657; font-weight: 800; font-size: 15px; letter-spacing: -0.02em;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.4);
}
.logo-mark.lg { width: 60px; height: 60px; border-radius: 16px; font-size: 20px; margin: 0 auto 14px; }
.logo-mark.has-image { background: #fff; padding: 4px; box-shadow: 0 3px 10px rgba(0,0,0,.14), inset 0 0 0 1px rgba(0,0,0,.05); }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }

/* ---------- Topbar ---------- */
.topbar {
    background: linear-gradient(120deg, var(--primary-darker), var(--primary) 65%, var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 22px;
    box-shadow: 0 2px 14px rgba(24, 13, 58, 0.22);
    position: sticky; top: 0; z-index: 50;
}
.topbar .brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 17px; }
.topbar .brand small { display: block; font-weight: 500; font-size: 11px; opacity: .8; letter-spacing: .01em; }
.topbar .user-box { display: flex; align-items: center; gap: 14px; font-size: 13.5px; }
.topbar .user-box .who { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1); padding: 6px 12px 6px 6px; border-radius: 30px; }
.topbar .user-box .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #2a1657; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.topbar .user-box a.btn-logout {
    background: rgba(255,255,255,.12); padding: 7px 14px; border-radius: 30px; font-weight: 600; font-size: 13px;
    border: 1px solid rgba(255,255,255,.15); transition: background .15s;
}
.topbar .user-box a.btn-logout:hover { background: rgba(255,255,255,.24); }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
    padding: 9px 16px; border-radius: 30px; font-size: 13.5px; font-weight: 600; transition: background .15s, color .15s;
    color: rgba(255,255,255,.82);
}
.topbar nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar nav a.active { background: #fff; color: var(--primary); }
.topbar .hamburger-btn, .sidebar .hamburger-btn { display: none; }
.topbar-collapsible, .sidebar-collapsible { display: contents; }

/* ---------- Sidebar (admin) ---------- */
.sidebar {
    width: 232px; background: linear-gradient(190deg, var(--primary-darker), #1d1046 70%); color: #fff; min-height: 100vh;
    padding: 20px 0; flex-shrink: 0; position: sticky; top: 0; align-self: flex-start;
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 0 20px 18px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .brand .brand-text { font-weight: 800; font-size: 15.5px; line-height: 1.2; }
.sidebar .brand small { display: block; font-weight: 400; font-size: 10.5px; opacity: .65; margin-top: 3px; }
.sidebar a { display: flex; align-items: center; gap: 11px; padding: 10px 20px; margin: 2px 10px; border-radius: 10px; font-size: 13.5px; color: rgba(255,255,255,.78); font-weight: 500; transition: background .15s, color .15s; }
.sidebar a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.active { background: linear-gradient(120deg, var(--accent), #d99a00); color: #2a1657; font-weight: 700; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.sidebar .divider { height: 1px; background: rgba(255,255,255,.1); margin: 10px 20px; }
.sidebar a.back-link { opacity: .75; font-size: 12.5px; }
.main-content { flex: 1; padding: 26px 28px; max-width: 100%; overflow-x: auto; }

/* ---------- Cards / layout ---------- */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px; border: 1px solid rgba(230, 225, 243, 0.6); }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-header h1 { font-size: 23px; margin: 0; font-weight: 800; letter-spacing: -0.02em; }
.grid { display: grid; gap: 18px; }
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 22px; }
.stat-card {
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 20px;
    position: relative; overflow: hidden; border: 1px solid rgba(230, 225, 243, 0.6);
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}
.stat-card.warning::before { background: linear-gradient(90deg, var(--warning), var(--accent)); }
.stat-card.success::before { background: linear-gradient(90deg, var(--success), #35c37f); }
.stat-card.danger::before { background: linear-gradient(90deg, var(--danger), #ff6b78); }
.stat-card .icon-chip {
    width: 34px; height: 34px; border-radius: 10px; background: var(--primary-50); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: 10px;
}
.stat-card.warning .icon-chip { background: #fdf1d9; color: var(--warning); }
.stat-card.success .icon-chip { background: #e2f8ee; color: var(--success); }
.stat-card.danger .icon-chip { background: #fde3e6; color: var(--danger); }
.stat-card .label { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat-card .value { font-size: 25px; font-weight: 800; margin-top: 3px; letter-spacing: -0.02em; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: 10px; border: none; font-size: 13.5px; font-weight: 700;
    cursor: pointer; background: var(--primary); color: #fff; transition: all .15s;
    font-family: var(--font); box-shadow: 0 2px 6px rgba(59, 31, 122, 0.25);
}
.btn:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59, 31, 122, 0.32); }
.btn:active { transform: translateY(0); }
.btn.btn-sm { padding: 6px 12px; font-size: 12px; box-shadow: none; }
.btn.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); box-shadow: none; }
.btn.btn-outline:hover { background: var(--primary); color: #fff; }
.btn.btn-danger { background: var(--danger); box-shadow: 0 2px 6px rgba(224, 56, 74, 0.3); }
.btn.btn-danger:hover { background: #c22638; }
.btn.btn-success { background: linear-gradient(120deg, var(--success), var(--success-dark)); box-shadow: 0 3px 10px rgba(22, 161, 97, 0.35); }
.btn.btn-success:hover { filter: brightness(1.06); }
.btn.btn-warning { background: var(--accent); color: #3a2a00; box-shadow: 0 2px 6px rgba(242, 183, 5, 0.35); }
.btn.btn-light { background: var(--primary-100); color: var(--primary); box-shadow: none; }
.btn.btn-light:hover { background: #ded0fb; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 17px; padding: 2px 6px; border-radius: 6px; transition: all .15s; }
.icon-btn:hover { color: var(--danger); background: #fde3e6; }

/* ---------- Forms ---------- */
label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
input, select, textarea {
    width: 100%; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: 10px;
    font-size: 14px; font-family: inherit; background: #fcfbff; color: var(--text); transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-light); background: #fff; }
.form-group { margin-bottom: 15px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 160px; }

/* ---------- Tables ---------- */
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th, table.data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13.5px; }
table.data-table th { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; background: var(--primary-50); }
table.data-table th:first-child { border-top-left-radius: 10px; }
table.data-table th:last-child { border-top-right-radius: 10px; }
table.data-table tr:hover td { background: #faf9ff; }
table.data-table tr:last-child td { border-bottom: none; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { background: #e2f8ee; color: var(--success-dark); }
.badge.danger { background: #fde3e6; color: var(--danger); }
.badge.warning { background: #fdf1d9; color: var(--warning); }
.badge.muted { background: #ece9f6; color: var(--text-muted); }

.alert { padding: 13px 17px; border-radius: 12px; margin-bottom: 16px; font-size: 13.5px; font-weight: 600; border: 1px solid transparent; }
.alert.error { background: #fde3e6; color: #a02030; border-color: #f7c1c9; }
.alert.success { background: #e2f8ee; color: #0f7d4c; border-color: #b9ecd3; }
.alert.info { background: #eaf1fd; color: #1c4d99; border-color: #c4d9f7; }

/* ---------- Login ---------- */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
    background: radial-gradient(circle at 20% 20%, #4e2a99, transparent 55%), radial-gradient(circle at 85% 80%, #6742c4, transparent 50%), linear-gradient(160deg, var(--primary-darker), var(--primary-dark) 60%, var(--primary));
}
.login-wrap::before, .login-wrap::after {
    content: ''; position: absolute; border-radius: 50%; background: rgba(242, 183, 5, 0.12); filter: blur(10px);
}
.login-wrap::before { width: 320px; height: 320px; top: -100px; right: -80px; }
.login-wrap::after { width: 220px; height: 220px; bottom: -80px; left: -60px; background: rgba(255,255,255,.06); }
.login-card { background: #fff; border-radius: 22px; padding: 40px 36px; width: 380px; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); text-align: center; position: relative; z-index: 1; }
.login-card h1 { margin: 0 0 3px; color: var(--primary-dark); font-size: 23px; font-weight: 800; letter-spacing: -0.02em; }
.login-card p.tagline { color: var(--text-muted); font-size: 12.5px; margin: 0 0 26px; }
.login-card .form-group { text-align: left; }
.login-card .btn { padding: 12px; font-size: 14.5px; }

/* ---------- POS: choix type de commande ---------- */
.order-type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-top: 20px; }
.order-type-card {
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 32px 20px; text-align: center;
    cursor: pointer; border: 2px solid transparent; transition: all .18s;
}
.order-type-card:hover { border-color: var(--primary-light); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.order-type-card .icon-circle {
    width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, var(--primary-100), #fff); color: var(--primary); transition: all .18s;
}
.order-type-card .icon-circle svg { width: 28px; height: 28px; }
.order-type-card:hover .icon-circle { background: linear-gradient(145deg, var(--primary), var(--primary-light)); color: #fff; transform: scale(1.06); }
.order-type-card h3 { margin: 0 0 4px; font-size: 16.5px; font-weight: 800; }
.order-type-card p { margin: 0; color: var(--text-muted); font-size: 13px; }

/* ---------- Tables grid ---------- */
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 14px; margin-top: 16px; }
.table-tile {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 10px;
    text-align: center; cursor: pointer; border: 1.5px solid var(--border); position: relative; transition: all .15s;
}
.table-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.table-tile .ticon { margin-bottom: 8px; color: var(--text-muted); display: flex; justify-content: center; }
.table-tile .ticon svg { width: 26px; height: 26px; }
.table-tile.libre .ticon { color: var(--success); }
.table-tile.occupee .ticon { color: var(--danger); }
.table-tile .tname { font-weight: 800; font-size: 15px; }
.table-tile .tcap { font-size: 11.5px; color: var(--text-muted); margin: 3px 0 8px; }
.table-tile .tstatus { font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; }
.table-tile.libre .tstatus { color: var(--success-dark); background: #e2f8ee; }
.table-tile.occupee .tstatus { color: var(--danger); background: #fde3e6; }
.table-tile.occupee .tstatus::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse-dot 1.4s infinite; }
.table-tile.libre .tstatus::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.table-select-btn { border: none; background: none; width: 100%; padding: 0; cursor: pointer; font-family: inherit; color: inherit; }
.table-free-form { position: absolute; top: 8px; right: 8px; z-index: 2; }
.table-free-btn {
    width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
    background: #fde3e6; color: var(--danger); font-size: 13px; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm); transition: all .15s;
}
.table-free-btn:hover { background: var(--danger); color: #fff; transform: scale(1.08); }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.room-legend { display: flex; gap: 16px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.legend-item .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-item .dot.libre { background: var(--success); }
.legend-item .dot.occupee { background: var(--danger); }

/* ---------- POS order screen ---------- */
.pos-layout { display: flex; gap: 20px; align-items: flex-start; }
.pos-menu { flex: 1.6; min-width: 0; }
.pos-cart { flex: 1; min-width: 320px; position: sticky; top: 88px; }
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.category-tabs button {
    padding: 9px 18px; border-radius: 30px; border: 1.5px solid var(--border); background: #fff;
    cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-muted); transition: all .15s;
}
.category-tabs button:hover { border-color: var(--primary-light); color: var(--primary); }
.category-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 3px 10px rgba(59, 31, 122, 0.3); }
.search-box { margin-bottom: 18px; position: relative; }
.search-box input { padding-left: 38px; background: #fff; }
.search-box::before { content: '🔎'; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .5; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 16px; }
.product-card {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
    cursor: pointer; border: 1.5px solid rgba(230, 225, 243, 0.7); transition: all .15s; position: relative;
}
.product-card:hover { border-color: var(--primary-light); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-card:active { transform: translateY(-1px) scale(.98); }
.product-card.out-of-stock { opacity: .48; cursor: not-allowed; }
.product-card.out-of-stock:hover { transform: none; box-shadow: var(--shadow); }
.product-card .thumb {
    height: 92px; background: linear-gradient(150deg, var(--primary-light), var(--primary) 60%, var(--primary-dark)); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800;
    background-size: cover; background-position: center; position: relative;
}
.product-card .thumb::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.22), transparent 55%);
}
.product-card .info { padding: 11px 13px 13px; }
.product-card .pname { font-size: 13px; font-weight: 700; line-height: 1.3; margin-bottom: 6px; min-height: 34px; }
.product-card .pprice { color: var(--primary); font-weight: 800; font-size: 14.5px; letter-spacing: -0.01em; }
.product-card .stock-tag { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; font-weight: 600; }

.cart-box { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: calc(100vh - 108px); border: 1px solid rgba(230, 225, 243, 0.7); overflow: hidden; }
.cart-header { padding: 18px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(120deg, var(--primary-50), #fff); }
.cart-header h3 { margin: 0; font-size: 16px; font-weight: 800; }
.cart-header .cart-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 600; }
.cart-items { flex: 1; overflow-y: auto; padding: 6px 16px; max-height: 42vh; }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: none; }
.cart-item .ci-name { flex: 1; font-size: 13.5px; font-weight: 700; }
.cart-item .ci-price { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.qty-control { display: flex; align-items: center; gap: 7px; background: var(--primary-50); border-radius: 20px; padding: 3px; }
.qty-control button { width: 24px; height: 24px; border-radius: 50%; border: none; background: #fff; cursor: pointer; font-weight: 800; color: var(--primary); box-shadow: var(--shadow-sm); transition: all .1s; }
.qty-control button:hover { background: var(--primary); color: #fff; }
.qty-control span { min-width: 16px; text-align: center; font-weight: 800; font-size: 13px; }
.cart-footer { padding: 16px 20px 18px; border-top: 1px solid var(--border); }
.cart-total-row { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 4px; color: var(--text-muted); font-weight: 600; }
.cart-total-row.grand { font-size: 21px; font-weight: 800; color: var(--primary-dark); margin: 8px 0 16px; letter-spacing: -0.02em; }
.empty-cart { text-align: center; color: var(--text-muted); padding: 36px 10px; font-size: 13px; }
.empty-cart::before { content: '🛒'; display: block; font-size: 30px; margin-bottom: 8px; opacity: .5; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,10,40,.55); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal-overlay.open { display: flex; animation: fade-in .15s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-box { background: #fff; border-radius: var(--radius-lg); padding: 26px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); animation: modal-pop .18s ease; }
@keyframes modal-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-box h2 { margin-top: 0; font-size: 19px; font-weight: 800; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.payment-method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.payment-method-grid button {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 12px 6px 11px; border-radius: 12px; border: 2px solid var(--border); background: #fcfbff;
    cursor: pointer; font-weight: 700; color: var(--text-muted); transition: all .15s;
}
.payment-method-grid button svg { border-radius: 9px; flex-shrink: 0; }
.payment-method-grid button span { font-size: 11.5px; line-height: 1.2; }
.payment-method-grid button:hover { border-color: var(--primary-light); }
.payment-method-grid button.active { border-color: var(--primary); background: var(--primary-50); color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }

.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .gap-8 { gap: 8px; } .items-center { align-items: center; }
.w-100 { width: 100%; }

/* ---------- Responsive / mobile ---------- */
@media (max-width: 900px) {
    .pos-layout { flex-direction: column; }
    .pos-cart { width: 100%; position: static; }

    /* Toutes les grilles a colonnes fixes (souvent en style inline, ex: "320px 1fr")
       s'empilent sur mobile - sinon le formulaire masque la liste juste a cote. */
    .grid { grid-template-columns: 1fr !important; }

    .app-shell { flex-direction: column; }

    /* ---- Hamburger : la nav/le menu se replient dans un panneau deroulant ---- */
    .hamburger-btn {
        display: flex !important; align-items: center; justify-content: center;
        width: 38px; height: 38px; border-radius: 10px; border: none; cursor: pointer;
        background: rgba(255,255,255,.12); color: #fff; flex-shrink: 0;
    }
    .hamburger-btn svg { width: 20px; height: 20px; }

    .sidebar {
        width: 100%; min-height: auto; position: sticky; top: 0; z-index: 60;
        display: flex; flex-direction: row; align-items: center; justify-content: space-between;
        padding: 10px 14px;
    }
    .sidebar .brand { padding: 0; margin: 0; border-bottom: none; }
    .sidebar .brand small { display: none; }
    .sidebar-collapsible {
        display: none; flex-direction: column; width: 100%;
        position: absolute; top: 100%; left: 0; right: 0; padding: 8px 10px 14px;
        background: linear-gradient(190deg, var(--primary-darker), #1d1046 70%); box-shadow: var(--shadow-lg);
        max-height: calc(100vh - 60px); overflow-y: auto;
    }
    .sidebar.nav-open { position: relative; }
    .sidebar.nav-open .sidebar-collapsible { display: flex; }
    .sidebar .divider { display: none; }
    .sidebar a { padding: 11px 14px; margin: 1px 0; font-size: 14px; }
    .sidebar a.back-link { order: -1; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.12); padding-bottom: 12px; border-radius: 0; }

    .main-content { padding: 16px; overflow-x: hidden; }

    .topbar { padding: 10px 14px; position: relative; }
    .topbar .brand small { display: none; }
    .topbar-collapsible {
        display: none; flex-direction: column; align-items: stretch; gap: 4px; width: 100%;
        position: absolute; top: 100%; left: 0; right: 0; padding: 10px 14px 16px;
        background: linear-gradient(180deg, var(--primary), var(--primary-darker)); box-shadow: var(--shadow-lg);
        z-index: 55;
    }
    .topbar.nav-open .topbar-collapsible { display: flex; }
    .topbar-collapsible nav { flex-direction: column; gap: 4px; width: 100%; }
    .topbar-collapsible nav a { padding: 11px 14px; }
    .topbar-collapsible .user-box { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.15); }
    .topbar-collapsible .user-box .who { justify-content: flex-start; border-radius: 10px; padding: 8px 10px; }
    .topbar-collapsible .user-box .who span { display: inline; }
    .topbar-collapsible .user-box a.btn-logout { text-align: center; }

    .page-header h1 { font-size: 19px; }
    .card { padding: 16px; }

    /* Tableaux -> liste de cartes empilees sur mobile (plus lisible qu'un defilement horizontal). */
    table.data-table thead { display: none; }
    table.data-table, table.data-table tbody, table.data-table tr, table.data-table td { display: block; width: 100%; }
    table.data-table tr {
        margin-bottom: 12px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
        box-shadow: var(--shadow-sm); background: var(--surface);
    }
    table.data-table tr:hover td { background: none; }
    table.data-table td {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        text-align: right; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: normal;
    }
    table.data-table td:last-child { border-bottom: none; }
    table.data-table td[data-label]::before {
        content: attr(data-label); text-align: left; font-weight: 700; color: var(--text-muted);
        font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; flex-shrink: 0;
    }
    table.data-table td:not([data-label]) { justify-content: flex-start; text-align: left; }
    table.data-table td:not([data-label]) .btn { margin-right: 6px; }

    .order-type-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .order-type-card { padding: 16px 10px; }
    .order-type-card .icon-circle { width: 46px; height: 46px; margin-bottom: 8px; }
    .order-type-card .icon-circle svg { width: 20px; height: 20px; }
    .order-type-card h3 { font-size: 14px; }
    .order-type-card p { font-size: 11.5px; }
}

@media (max-width: 480px) {
    .login-card { padding: 30px 22px; }
    .payment-method-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .payment-method-grid button svg { width: 28px; height: 28px; }
    .modal-box { padding: 20px; }
    .order-type-grid { grid-template-columns: 1fr; }
}
