:root {
  --bg: #f3f7f5;
  --surface: #ffffff;
  --surface-soft: #fff9f0;
  --text: #202a2e;
  --muted: #64706c;
  --line: #dde6e1;
  --primary: #0f4c3a;
  --primary-dark: #083629;
  --primary-soft: #e8f5ef;
  --gold: #f4b942;
  --green: #168c63;
  --green-soft: #e1f6ed;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --blue: #1d4ed8;
  --blue-soft: #dbeafe;
  --yellow: #a16207;
  --yellow-soft: #fef3c7;
  --shadow: 0 10px 28px rgba(15, 76, 58, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100%; color: var(--text); background: var(--bg); font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }

.app-shell { display: grid; grid-template-columns: 255px minmax(0, 1fr); min-height: 100vh; }
.app-shell.pos-shell { display: block; min-height: 100vh; background: #edf3f0; }
.sidebar { position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, #0f4c3a 0%, #06271f 100%); color: #f7f4eb; padding: 22px 16px; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 24px; color: #fff; }
.brand span:last-child { min-width: 0; }
.brand strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand small, .sidebar-user small { display: block; color: #cbdad3; font-size: 12px; }
.brand-mark { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--gold)); font-weight: 900; color: white; }
.brand-logo { width: 50px; height: 50px; flex: 0 0 50px; object-fit: contain; border-radius: 14px; border: 1px solid rgba(244, 185, 66, .8); background: rgba(255, 255, 255, .06); box-shadow: 0 5px 16px rgba(0, 0, 0, .24); }
.nav-list { display: grid; gap: 5px; }
.nav-list a { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 11px; color: #d4d4d8; }
.nav-list a:hover, .nav-list a.active { background: rgba(244, 185, 66, .16); color: #fff; }
.nav-list a.active { box-shadow: inset 3px 0 var(--gold); }
.nav-icon { width: 24px; text-align: center; font-size: 18px; }
.sidebar-user { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255, 255, 255, .14); display: grid; gap: 12px; }
.main-content { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 86px; padding: 18px 28px; display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 23px; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.topbar-action { margin-left: auto; }
.menu-toggle { display: none; border: 0; background: transparent; font-size: 25px; }
.page-content { width: 100%; padding: 26px 28px 50px; max-width: 1600px; margin: 0 auto; flex: 1; }
.pos-page-content { max-width: none; padding: 16px 18px 24px; }
.pos-topbar { min-height: 80px; padding: 12px 20px; color: #fff; background: linear-gradient(105deg, #083629, #0f4c3a); border-bottom: 3px solid var(--gold); }
.pos-brand { min-width: 205px; display: flex; align-items: center; gap: 10px; }
.pos-brand img { width: 46px; height: 46px; object-fit: contain; border: 1px solid rgba(244,185,66,.75); border-radius: 13px; }
.pos-brand strong, .pos-brand small { display: block; }
.pos-brand small { color: #d7e7e0; font-size: 11px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-heading { padding-left: 20px; border-left: 1px solid rgba(255,255,255,.2); }
.pos-heading h1 { color: #fff; }
.pos-heading p { color: #cde0d8; }
.pos-top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.pos-top-actions .btn-secondary { border-color: rgba(255,255,255,.3); color: #fff; background: rgba(255,255,255,.1); }
.pos-top-actions .btn-ghost { border-color: rgba(255,255,255,.35); }
.pos-top-actions form { margin: 0; }
.pos-user { padding: 0 11px; line-height: 1.2; }
.pos-user strong, .pos-user small { display: block; }
.pos-user small { margin-top: 3px; color: #cde0d8; font-size: 10px; text-transform: uppercase; }
.app-footer { padding: 18px 28px 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; color: var(--muted); font-size: 12px; text-align: center; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .7); }
.app-footer strong { color: var(--primary); }

.grid { display: grid; gap: 18px; }
.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)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h2, .card-header h3 { margin: 0; font-size: 17px; }
.card-body { padding: 20px; }
.kpi { padding: 20px; display: flex; justify-content: space-between; align-items: flex-start; }
.kpi small { display: block; color: var(--muted); margin-bottom: 8px; }
.kpi strong { display: block; font-size: 27px; line-height: 1.1; }
.kpi-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 20px; }

.btn { border: 1px solid transparent; border-radius: 10px; min-height: 40px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; transition: .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--green); color: white; }
.btn-danger { background: var(--red); color: white; }
.btn-secondary { background: #fff; border-color: #d1d5db; color: var(--text); }
.btn-ghost { background: transparent; color: inherit; border-color: #52525b; }
.btn-small { min-height: 32px; padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-group { display: grid; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }
label { font-weight: 700; font-size: 13px; }
.form-control { width: 100%; min-height: 43px; border: 1px solid #d1d5db; border-radius: 10px; padding: 9px 11px; color: var(--text); background: #fff; outline: none; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 76, 58, .13); }
textarea.form-control { min-height: 90px; resize: vertical; }
.help { color: var(--muted); font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.toolbar { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.toolbar form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: #fafafa; }
tbody tr:hover { background: #f5faf7; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge-warning { color: var(--yellow); background: var(--yellow-soft); }
.badge-info { color: var(--blue); background: var(--blue-soft); }
.badge-primary { color: var(--primary); background: var(--primary-soft); }
.badge-success { color: var(--green); background: var(--green-soft); }
.badge-danger { color: var(--red); background: var(--red-soft); }
.badge-muted { color: #52525b; background: #e4e4e7; }

.alert { margin-bottom: 18px; padding: 13px 15px; border-radius: 11px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.alert button { border: 0; background: transparent; font-size: 20px; color: inherit; }
.alert-success { color: var(--green); background: var(--green-soft); border: 1px solid #86efac; }
.alert-danger { color: var(--red); background: var(--red-soft); border: 1px solid #fca5a5; }
.alert-warning { color: var(--yellow); background: var(--yellow-soft); border: 1px solid #fde68a; }
.empty-state { padding: 38px 20px; text-align: center; color: var(--muted); }
.section-gap { margin-top: 20px; }

.kpi-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.trend { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 7px; font-size: 11px; font-weight: 800; }
.trend-up { color: var(--green); background: var(--green-soft); }
.trend-down { color: var(--red); background: var(--red-soft); }
.trend-flat { color: #52525b; background: #e4e4e7; }
.chart-card { min-width: 0; overflow: hidden; }
.chart-card .card-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.chart-wrap { padding: 12px 16px 17px; min-height: 285px; }
.business-chart { width: 100%; min-height: 250px; }
.business-chart canvas { display: block; max-width: 100%; }
.chart-empty { min-height: 250px; display: grid; place-content: center; gap: 8px; text-align: center; color: var(--muted); }
.chart-empty span { font-size: 32px; color: #d1d5db; }
.chart-empty strong { font-size: 14px; }
.report-intro { margin-bottom: 18px; padding: 15px 18px; border: 1px solid #b9d8ca; border-radius: 14px; background: #f0f9f4; color: #174f3e; }
.report-intro strong { color: var(--primary); }
.period-presets { display: flex; flex-wrap: wrap; gap: 7px; }
.period-presets .btn { min-height: 34px; font-size: 12px; }
.orders-filter-card { overflow: visible; }
.orders-filter-form { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)) minmax(260px, 2fr); gap: 14px; align-items: start; }
.orders-search-group { min-width: 0; }
.search-control { position: relative; }
.search-control > span { position: absolute; left: 13px; top: 50%; z-index: 1; color: var(--primary); font-size: 20px; line-height: 1; transform: translateY(-50%); pointer-events: none; }
.search-control .form-control { padding-left: 39px; }
.orders-filter-options { grid-column: 1 / span 4; display: flex; align-items: center; min-height: 40px; }
.orders-filter-actions { grid-column: 5 / span 2; display: flex; justify-content: flex-end; gap: 9px; }
.orders-filter-footer { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.orders-results-header strong { color: var(--primary); }
.orders-empty-state { display: grid; justify-items: center; gap: 8px; }
.orders-empty-state strong { color: var(--text); font-size: 17px; }
.insights-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.insight-item { min-height: 128px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #fff, #f6fbf8); }
.insight-item .insight-icon { width: 38px; height: 38px; margin-bottom: 12px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: 19px; }
.insight-item strong { display: block; margin-bottom: 5px; font-size: 17px; }
.insight-item p { margin: 0; color: var(--muted); font-size: 13px; }
.insight-item.warning { border-color: #fdba74; background: #fff7ed; }
.insight-item.good { border-color: #86efac; background: #f0fdf4; }
.report-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.metric-strip { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.metric-strip strong { color: var(--text); }
.report-note { padding: 12px 16px; border-radius: 11px; background: #f9fafb; color: var(--muted); font-size: 12px; }
.table-rank { display: inline-grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 900; }
.preparation-kpi { min-height: 120px; padding: 18px; display: flex; gap: 14px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #fff, #f2f8f5); }
.preparation-kpi > span { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 13px; color: var(--primary); background: var(--primary-soft); font-size: 20px; }
.preparation-kpi small { display: block; color: var(--muted); }
.preparation-kpi strong { display: block; margin: 4px 0; font-size: 22px; }
.preparation-kpi p { margin: 0; color: var(--muted); font-size: 12px; }
.preparation-details { align-items: center; }

.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; background: radial-gradient(circle at top left, rgba(244, 185, 66, .3), transparent 36%), radial-gradient(circle at bottom right, rgba(15, 76, 58, .17), transparent 35%), linear-gradient(145deg, #fff9f0, #edf5f1); }
.login-card { width: min(440px, 100%); padding: 30px; }
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand .brand-mark { margin: 0 auto 12px; }
.login-brand .brand-logo { width: 104px; height: 104px; margin: 0 auto 15px; display: block; border-width: 3px; }
.login-brand h1 { margin-bottom: 5px; }
.brand-logo-full { display: block; width: min(300px, 100%); height: auto; object-fit: contain; }
.login-brand .brand-logo-full { margin: 0 auto 8px; }
.product-tagline { margin: 0; color: var(--primary); font-weight: 800; }
.login-establishment { margin-top: 16px; padding: 9px 12px; border: 1px solid #d6e5de; border-radius: 999px; color: var(--muted); background: #f7fbf9; font-size: 13px; }
.login-establishment strong { color: var(--text); }
.login-credit { margin: 0; color: #486158; font-size: 12px; text-align: center; }

.brand-preview { display: flex; align-items: center; gap: 20px; padding: 18px; border: 1px solid #bfdacc; border-radius: 14px; background: linear-gradient(135deg, #f4fbf7, #fff9f0); }
.brand-preview .brand-logo { width: 82px; height: 82px; flex-basis: 82px; }
.brand-preview strong { display: block; font-size: 18px; color: var(--primary); }
.brand-preview small { color: var(--muted); }
.brand-preview-product .brand-logo-full { width: min(290px, 42%); flex: 0 0 auto; }
.brand-preview-product p { margin: 6px 0; color: var(--text); font-weight: 700; }
.restaurant-logo-editor { display: flex; align-items: center; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #f9fbfa; }
.restaurant-logo-preview, .restaurant-logo-placeholder { width: 126px; height: 96px; flex: 0 0 126px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.restaurant-logo-preview { object-fit: contain; padding: 7px; }
.restaurant-logo-placeholder { display: grid; place-items: center; color: var(--muted); text-align: center; font-weight: 800; line-height: 1.1; border-style: dashed; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 12px; }
.product-card { min-height: 225px; border: 1px solid var(--line); border-top: 4px solid var(--product-color, var(--primary)); border-radius: 13px; background: #fff; padding: 0; overflow: hidden; text-align: left; display: flex; flex-direction: column; }
.product-card:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-2px); }
.product-image { height: 108px; flex: 0 0 108px; background-color: #edf3f0; background-image: linear-gradient(180deg, transparent 58%, rgba(8, 54, 41, .22)), url('menu-etablissement.png'); background-repeat: no-repeat; background-size: 100% 100%, 500% 200%; }
.product-image--roast-chicken { background-position: center, 0 0; }
.product-image--pizza { background-position: center, 25% 0; }
.product-image--fries { background-position: center, 50% 0; }
.product-image--burger { background-position: center, 75% 0; }
.product-image--wrap { background-position: center, 100% 0; }
.product-image--fried-chicken { background-position: center, 0 100%; }
.product-image--skewer { background-position: center, 25% 100%; }
.product-image--spring-roll { background-position: center, 50% 100%; }
.product-image--drinks { background-position: center, 75% 100%; }
.product-image--plate { background-position: center, 100% 100%; }
.product-image--custom { width: 100%; object-fit: cover; background: #f4ead6; }
.product-card-content { flex: 1; min-height: 113px; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.product-card strong { font-size: 15px; line-height: 1.3; }
.product-card small { color: var(--muted); }
.product-price { color: var(--primary); font-weight: 900; margin-top: auto; padding-top: 8px; }
.category-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 15px; }
.category-tab { border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 8px 13px; white-space: nowrap; }
.category-tab.active { color: white; background: var(--primary); border-color: var(--primary); }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.pos-catalogue { min-height: calc(100vh - 120px); }
.pos-catalogue-header { background: linear-gradient(180deg, #fff, #fbfdfc); }
.pos-product-search { width: min(360px, 36vw); }
.cart-panel { position: sticky; top: 96px; max-height: calc(100vh - 112px); overflow-y: auto; border-top: 4px solid var(--gold); }
.cart-list { display: grid; gap: 10px; max-height: 43vh; overflow-y: auto; }
.cart-line { border: 1px solid var(--line); border-radius: 11px; padding: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.cart-line small { color: var(--muted); }
.cart-line-actions { display: flex; gap: 5px; align-items: center; }
.cart-line-actions button { width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 8px; }
.cart-total { display: flex; justify-content: space-between; font-size: 19px; font-weight: 900; padding: 15px 0; border-top: 1px solid var(--line); margin-top: 14px; }

.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.restaurant-table { padding: 18px; border-radius: 15px; border: 1px solid var(--line); background: #fff; min-height: 125px; display: flex; flex-direction: column; justify-content: space-between; }
.restaurant-table.busy { border-color: #fdba74; background: #fff7ed; }
.restaurant-table strong { font-size: 17px; }
.kitchen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.kitchen-ticket { border-top: 5px solid var(--primary); }
.ticket-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.ticket-items { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 9px; }
.ticket-items li { padding: 9px 10px; background: #fafafa; border-radius: 9px; }
.ticket-items small { display: block; color: var(--red); }
.preparation-live-time { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; color: #92400e; background: #fef3c7; font-weight: 800; font-variant-numeric: tabular-nums; }

.notification-center { position: fixed; top: 96px; right: 22px; z-index: 100; width: min(410px, calc(100vw - 28px)); display: grid; gap: 12px; pointer-events: none; }
.preparation-notification { position: relative; display: grid; grid-template-columns: 50px minmax(0, 1fr) 28px; gap: 12px; padding: 17px; color: var(--text); background: rgba(255,255,255,.98); border: 1px solid #9dd9bd; border-left: 5px solid var(--green); border-radius: 16px; box-shadow: 0 18px 55px rgba(6,39,31,.24); opacity: 0; transform: translateX(24px) scale(.98); transition: opacity .22s ease, transform .22s ease; pointer-events: auto; overflow: hidden; }
.preparation-notification::after { content: ''; position: absolute; inset: auto 0 0; height: 3px; background: linear-gradient(90deg, var(--green), var(--gold)); }
.preparation-notification.visible { opacity: 1; transform: translateX(0) scale(1); }
.preparation-notification-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--green)); font-size: 25px; font-weight: 900; box-shadow: 0 7px 18px rgba(15,76,58,.2); }
.preparation-notification-content { display: grid; align-items: start; gap: 3px; }
.preparation-notification-content small { color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.preparation-notification-content strong { font-size: 18px; }
.preparation-notification-content p { margin: 1px 0; font-weight: 700; }
.preparation-notification-content > span { margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.preparation-notification-content .btn { justify-self: start; }
.preparation-notification-close { width: 28px; height: 28px; border: 0; border-radius: 9px; color: var(--muted); background: #f3f4f6; font-size: 19px; }

.recipe-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 36px; gap: 8px; margin-bottom: 8px; }
.product-image-editor { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fafafa; }
.product-image-preview { width: 150px; height: 110px; flex: 0 0 150px; object-fit: cover; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.image-remove-option { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--red); }
.product-list-thumb { width: 58px; height: 45px; display: block; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.product-list-placeholder { width: 58px; height: 45px; display: grid; place-items: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 800; }
.low-stock { background: #fff7ed; }
.danger-zone { border-color: #fecaca; }
.danger-zone .card-header { background: #fff7f7; }
.check-line { display: flex; align-items: center; gap: 9px; }
.sidebar-overlay { display: none; }
.print-only { display: none; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insights-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
  .orders-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .orders-search-group { grid-column: span 2; }
  .orders-filter-options { grid-column: span 2; }
  .orders-filter-actions { grid-column: auto; }
}

@media (min-width: 900px) and (max-width: 1100px) {
  .pos-shell .pos-layout { grid-template-columns: minmax(0, 1fr) 370px; }
  .pos-shell .cart-panel { position: sticky; top: 96px; }
  .pos-top-actions .pos-user { display: none; }
  .pos-top-actions .btn { padding-left: 10px; padding-right: 10px; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -275px; width: 255px; transition: left .2s ease; }
  .menu-open .sidebar { left: 0; }
  .menu-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 25; }
  .menu-toggle { display: block; }
  .topbar { padding: 14px 16px; min-height: 74px; }
  .topbar h1 { font-size: 19px; }
  .page-content { padding: 18px 14px 40px; }
  .pos-page-content { padding: 10px; }
  .pos-topbar { min-height: 68px; padding: 9px 12px; }
  .pos-brand { min-width: 0; }
  .pos-brand img { width: 42px; height: 42px; }
  .pos-brand span, .pos-heading, .pos-top-actions .pos-user, .pos-top-actions .btn-secondary { display: none; }
  .pos-top-actions .btn-ghost { min-height: 36px; padding: 7px 10px; }
  .pos-product-search { width: 100%; }
  .pos-catalogue-header { align-items: stretch; flex-direction: column; }
  .pos-catalogue-header .actions { width: 100%; }
  .pos-layout { gap: 10px; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .topbar-action { display: none; }
  .form-group.full { grid-column: auto; }
  .product-image-editor { align-items: stretch; flex-direction: column; }
  .product-image-preview { width: 100%; height: 190px; flex-basis: auto; }
  .brand-preview, .restaurant-logo-editor { align-items: stretch; flex-direction: column; }
  .brand-preview-product .brand-logo-full { width: min(280px, 100%); }
  .restaurant-logo-preview, .restaurant-logo-placeholder { width: 100%; height: 140px; flex-basis: auto; }
  .insights-panel { grid-template-columns: 1fr; }
  .chart-wrap { padding-left: 8px; padding-right: 8px; }
  .orders-filter-form { grid-template-columns: 1fr; }
  .orders-search-group, .orders-filter-options, .orders-filter-actions { grid-column: auto; }
  .orders-filter-actions { justify-content: stretch; }
  .orders-filter-actions .btn { flex: 1; }
  .orders-filter-footer { align-items: stretch; flex-direction: column; }
  .orders-filter-footer > .btn { width: 100%; }
  .notification-center { top: 78px; right: 10px; width: calc(100vw - 20px); }
  .preparation-notification { grid-template-columns: 42px minmax(0, 1fr) 28px; padding: 13px; }
  .preparation-notification-icon { width: 40px; height: 40px; border-radius: 12px; }
}

@media print {
  .sidebar, .topbar, .no-print, .sidebar-overlay, .app-footer { display: none !important; }
  .app-shell { display: block; }
  .page-content { padding: 0; }
  .card { box-shadow: none; }
  .print-only { display: block; }
  .business-chart { break-inside: avoid; }
  .chart-card, .insight-item { break-inside: avoid; }
}
