:root {
  --brand: #145c4a;
  --accent: #f4a340;
  --ink: #19231f;
  --muted: #718079;
  --line: #e5ebe8;
  --surface: #ffffff;
  --canvas: #f5f7f6;
  --soft: #edf5f1;
  --danger: #d84848;
  --shadow: 0 1px 2px rgba(20, 43, 34, 0.04), 0 10px 30px rgba(20, 43, 34, 0.05);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Arial, "Noto Sans Arabic", Tahoma, sans-serif;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
input, select, textarea { color: var(--ink); }

.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; background: var(--canvas); }
.sidebar { position: sticky; top: 0; z-index: 30; display: flex; flex-direction: column; height: 100vh; padding: 22px 16px; color: #e7f3ee; background: var(--brand); background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 94%, #071c16), var(--brand)); box-shadow: -8px 0 26px rgba(14, 58, 47, 0.12); }
.brand-block { display: flex; align-items: center; gap: 12px; padding: 3px 7px 24px; border-bottom: 1px solid rgba(255,255,255,.13); }
.brand-block img { width: 50px; height: 50px; flex: 0 0 50px; object-fit: contain; border-radius: 14px; background: white; box-shadow: 0 8px 18px rgba(0,0,0,.13); }
.brand-block div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.brand-block strong { overflow: hidden; color: white; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.brand-block span { overflow: hidden; color: rgba(255,255,255,.68); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar nav { display: flex; flex: 1; flex-direction: column; gap: 7px; padding-top: 24px; }
.sidebar nav button { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 48px; padding: 0 14px; color: rgba(255,255,255,.68); text-align: right; background: transparent; border: 0; border-radius: 12px; transition: .18s ease; }
.sidebar nav button:hover { color: white; background: rgba(255,255,255,.08); }
.sidebar nav button.active { color: var(--brand); font-weight: 700; background: white; box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.sidebar nav button svg { flex: 0 0 20px; }
.sidebar-status { display: flex; align-items: flex-start; gap: 10px; padding: 13px; background: rgba(0,0,0,.13); border: 1px solid rgba(255,255,255,.11); border-radius: 13px; }
.sidebar-status .status-dot { width: 9px; height: 9px; margin-top: 5px; background: #72e7ae; border: 2px solid rgba(255,255,255,.45); border-radius: 50%; box-shadow: 0 0 0 4px rgba(114,231,174,.12); }
.sidebar-status div:last-child { display: flex; flex-direction: column; gap: 3px; }
.sidebar-status strong { font-size: 12px; }
.sidebar-status span { color: rgba(255,255,255,.58); font-size: 9px; line-height: 1.45; }
.main-area { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: 72px; padding: 0 28px; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.page-heading { display: flex; align-items: baseline; gap: 12px; }
.page-heading span { font-size: 20px; font-weight: 800; }
.page-heading small { color: var(--muted); direction: ltr; font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.print-indicator { position: relative; display: grid; place-items: center; width: 42px; height: 42px; color: var(--muted); background: #f7f9f8; border: 1px solid var(--line); border-radius: 11px; }
.print-indicator span { position: absolute; top: -5px; left: -5px; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; color: white; font: 700 10px/1 Arial; background: var(--accent); border: 2px solid white; border-radius: 10px; }
.staff-select { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; background: white; border: 1px solid var(--line); border-radius: 11px; }
.staff-select svg { color: var(--brand); }
.staff-select select { max-width: 170px; font-size: 12px; font-weight: 700; background: transparent; border: 0; outline: 0; }
.content-area { padding: 22px 26px 34px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.section-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-title-row h2 { margin: 0; font-size: 16px; font-weight: 800; }
.section-title-row p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.page-stack { display: flex; flex-direction: column; gap: 20px; }
.page-action-row, .welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 62px; }
.page-action-row h1, .welcome-row h1 { max-width: 760px; margin: 4px 0 0; font-size: 25px; line-height: 1.35; }
.eyebrow { margin: 0; color: var(--brand); font-size: 11px; font-weight: 800; }
.button-row, .report-actions { display: flex; align-items: center; gap: 9px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; font-size: 12px; font-weight: 750; border: 1px solid transparent; border-radius: 11px; transition: .15s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary { color: white; background: var(--brand); box-shadow: 0 7px 16px color-mix(in srgb, var(--brand) 22%, transparent); }
.btn-secondary { color: var(--ink); background: white; border-color: var(--line); }
.btn-accent { color: #3e2608; background: var(--accent); background: color-mix(in srgb, var(--accent) 84%, white); }
.btn-danger-ghost { color: var(--danger); background: #fff7f7; border-color: #f6d9d9; }
.btn-large { min-height: 49px; }
.table-strip { padding: 17px 18px; }
.legend { display: flex; gap: 13px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend i.available { background: #43b980; }
.legend i.occupied { background: var(--accent); }
.table-list { display: flex; gap: 9px; margin-top: 14px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: thin; }
.table-button { position: relative; display: grid; grid-template-columns: 22px auto; align-items: center; flex: 0 0 auto; min-width: 124px; min-height: 62px; padding: 9px 12px; color: var(--ink); text-align: right; background: #f9fbfa; border: 1px solid var(--line); border-radius: 12px; }
.table-button svg { grid-row: 1 / span 2; color: #42a779; }
.table-button strong { font-size: 12px; }
.table-button small { color: var(--muted); direction: ltr; font-size: 9px; }
.table-button.occupied { background: #fff9ef; border-color: color-mix(in srgb, var(--accent) 38%, white); }
.table-button.occupied svg { color: #dc8b27; }
.table-button.selected { color: white; background: var(--brand); border-color: var(--brand); box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 20%, transparent); }
.table-button.selected svg, .table-button.selected small { color: rgba(255,255,255,.78); }
.pos-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 365px; gap: 18px; margin-top: 18px; align-items: start; }
.menu-panel { min-width: 0; min-height: 590px; padding: 17px; }
.menu-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.category-tabs { display: flex; gap: 7px; max-width: calc(100% - 220px); padding: 2px; overflow-x: auto; }
.category-tabs button { flex: 0 0 auto; min-height: 36px; padding: 0 13px; color: var(--muted); font-size: 10px; font-weight: 700; background: #f5f7f6; border: 0; border-radius: 9px; }
.category-tabs button.active { color: white; background: var(--brand); }
.search-box { display: flex; align-items: center; gap: 7px; width: 210px; min-height: 38px; padding: 0 10px; color: var(--muted); background: #f7f9f8; border: 1px solid var(--line); border-radius: 9px; }
.search-box input { width: 100%; font-size: 10px; background: transparent; border: 0; outline: 0; }
.food-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; padding-top: 16px; }
.food-card { position: relative; display: grid; grid-template-columns: 47px minmax(0,1fr); gap: 10px; min-height: 102px; padding: 13px; text-align: right; background: white; border: 1px solid var(--line); border-radius: 13px; transition: .15s ease; }
.food-card:hover { border-color: color-mix(in srgb, var(--brand) 35%, white); box-shadow: 0 8px 20px rgba(21,65,50,.08); transform: translateY(-2px); }
.food-mark { display: grid; place-items: center; width: 47px; height: 47px; font-size: 20px; font-weight: 800; border-radius: 13px; }
.food-details { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.food-details strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.food-details small { color: var(--muted); font-size: 9px; }
.food-card > b { grid-column: 1 / -1; align-self: end; color: var(--brand); direction: ltr; font-size: 11px; text-align: right; }
.add-circle { position: absolute; bottom: 9px; left: 9px; display: grid; place-items: center; width: 27px; height: 27px; color: var(--brand); background: var(--soft); border-radius: 50%; }

.cart-panel { position: sticky; top: 94px; overflow: hidden; }
.cart-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 17px 18px; background: #f3f8f5; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, white), white); border-bottom: 1px solid var(--line); }
.cart-header span { color: var(--muted); font-size: 10px; }
.cart-header h2 { margin: 4px 0 0; font-size: 17px; }
.order-badge { direction: ltr; padding: 6px 8px; color: var(--brand) !important; font-weight: 800; background: white; border: 1px solid var(--line); border-radius: 8px; }
.cart-items { min-height: 130px; max-height: 265px; padding: 5px 15px; overflow-y: auto; }
.cart-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto 27px; align-items: center; gap: 8px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.cart-item-main { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.cart-item-main strong { font-size: 11px; }
.cart-item-main span { color: var(--brand); direction: ltr; font-size: 10px; font-weight: 750; text-align: right; }
.cart-item-main small { display: flex; align-items: center; gap: 3px; color: #3aa170; font-size: 8px; }
.quantity-control { display: flex; align-items: center; gap: 7px; align-self: center; }
.quantity-control button { display: grid; place-items: center; width: 27px; height: 27px; color: var(--brand); background: var(--soft); border: 0; border-radius: 8px; }
.quantity-control b { min-width: 17px; direction: ltr; font-size: 11px; text-align: center; }
.item-note { position: static; display: grid; place-items: center; width: 27px; height: 27px; align-self: center; color: var(--muted); background: #f7f9f8; border: 1px solid var(--line); border-radius: 8px; }
.cart-note { padding: 10px 16px 12px; border-top: 1px solid var(--line); }
.cart-note label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.cart-note input { width: 100%; height: 36px; padding: 0 10px; font-size: 10px; background: #f8faf9; border: 1px solid var(--line); border-radius: 8px; outline: 0; }
.totals { padding: 12px 16px; background: #f8faf9; border-block: 1px solid var(--line); }
.totals > div { display: flex; align-items: center; justify-content: space-between; min-height: 27px; color: var(--muted); font-size: 10px; }
.totals strong { color: var(--ink); direction: ltr; }
.totals .grand-total { margin-top: 6px; padding-top: 9px; color: var(--ink); font-size: 13px; border-top: 1px solid var(--line); }
.totals .grand-total strong { color: var(--brand); font-size: 17px; }
.money-input { display: flex; align-items: center; gap: 4px; }
.money-input input { width: 95px; height: 28px; direction: ltr; text-align: center; background: white; border: 1px solid var(--line); border-radius: 7px; }
.cart-actions { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.cart-actions .btn { width: 100%; }
.empty-state { display: flex; align-items: center; justify-content: center; min-height: 170px; flex-direction: column; gap: 8px; padding: 20px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; color: var(--brand); background: var(--soft); border-radius: 16px; }
.empty-state strong { font-size: 12px; }
.empty-state p { max-width: 250px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.date-chip, .save-hint { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; color: var(--muted); direction: ltr; font-size: 10px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.metric-card { display: flex; align-items: center; gap: 13px; min-height: 120px; padding: 18px; }
.metric-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; }
.metric-card div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.metric-card p { margin: 0; color: var(--muted); font-size: 10px; }
.metric-card strong { direction: ltr; font-size: 18px; text-align: right; white-space: nowrap; }
.metric-card small { color: var(--muted); font-size: 8px; }
.tone-green .metric-icon { color: #178555; background: #e5f7ee; }
.tone-blue .metric-icon { color: #2b6fd2; background: #e9f1ff; }
.tone-orange .metric-icon { color: #d47c18; background: #fff1dc; }
.tone-purple .metric-icon { color: #7b45c9; background: #f1eaff; }
.tone-red .metric-icon { color: #c23d3d; background: #ffebeb; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr); gap: 16px; }
.chart-card, .compact-card, .table-card, .form-card, .category-manager { padding: 18px; }
.bar-chart { display: flex; align-items: end; justify-content: space-between; gap: 10px; height: 230px; padding-top: 24px; }
.bar-column { display: flex; align-items: center; flex: 1; flex-direction: column; gap: 6px; height: 100%; }
.bar-column > span { min-height: 14px; color: var(--muted); font-size: 8px; }
.bar-column > div { position: relative; width: min(34px, 70%); flex: 1; background: #f0f4f2; border-radius: 7px 7px 3px 3px; overflow: hidden; }
.bar-column i { position: absolute; bottom: 0; right: 0; left: 0; background: var(--brand); background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 62%, white), var(--brand)); border-radius: 7px 7px 3px 3px; }
.bar-column small { color: var(--muted); font-size: 8px; }
.ranking-list { display: flex; flex-direction: column; margin-top: 14px; }
.ranking-list > div { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 43px; border-bottom: 1px solid var(--line); }
.ranking-list b { display: grid; place-items: center; width: 23px; height: 23px; color: var(--brand); font-size: 9px; background: var(--soft); border-radius: 7px; }
.ranking-list span { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ranking-list strong { color: var(--muted); font-size: 9px; }
.count-badge { display: grid; place-items: center; min-width: 32px; height: 29px; color: var(--brand); font-size: 11px; font-weight: 800; background: var(--soft); border-radius: 9px; }
.responsive-table { margin-top: 14px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 12px; color: var(--muted); font-size: 9px; font-weight: 700; text-align: right; background: #f8faf9; border-bottom: 1px solid var(--line); }
td { padding: 12px; font-size: 10px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
.status-badge, .availability { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; font-size: 8px; font-weight: 750; border: 0; border-radius: 8px; }
.status-open { color: #8f6200; background: #fff3d4; }
.status-sent, .availability.on { color: #177852; background: #e6f7ef; }
.status-paid { color: #2d63bd; background: #eaf1ff; }
.status-cancelled, .availability.off { color: #b43a3a; background: #ffebeb; }
.category-manager-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.category-manager-list button { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 11px; color: var(--ink); font-size: 10px; background: #f9fbfa; border: 1px solid var(--line); border-radius: 9px; }
.category-manager-list i { width: 9px; height: 9px; border-radius: 50%; }
.row-actions { display: flex; gap: 5px; }
.row-actions button, .icon-btn, .editable-list button { display: grid; place-items: center; width: 30px; height: 30px; color: var(--muted); background: #f6f8f7; border: 1px solid var(--line); border-radius: 8px; }
.row-actions button.danger, .icon-btn.danger { color: var(--danger); background: #fff7f7; border-color: #f5dddd; }
.segmented { display: flex; padding: 4px; background: #e9eeeb; border-radius: 11px; }
.segmented button { min-width: 88px; min-height: 34px; color: var(--muted); font-size: 10px; font-weight: 750; background: transparent; border: 0; border-radius: 8px; }
.segmented button.active { color: var(--brand); background: white; box-shadow: 0 3px 8px rgba(0,0,0,.06); }
.finance-grid, .settings-grid { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.settings-grid { grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); }
.settings-side { display: flex; flex-direction: column; gap: 16px; }
.stack-form { display: flex; flex-direction: column; gap: 13px; margin-top: 17px; }
.stack-form label, .form-grid label, .report-actions label { display: flex; flex-direction: column; gap: 6px; color: #46534d; font-size: 10px; font-weight: 700; }
.stack-form input, .stack-form select, .stack-form textarea, .form-grid input, .form-grid select, .report-actions input, .inline-add input, .inline-add select { width: 100%; min-height: 41px; padding: 0 11px; color: var(--ink); font-size: 11px; background: #fbfcfc; border: 1px solid var(--line); border-radius: 9px; outline: none; }
.stack-form textarea { min-height: 82px; padding-top: 10px; resize: vertical; }
.stack-form input:focus, .stack-form textarea:focus, .form-grid input:focus, .form-grid select:focus { border-color: color-mix(in srgb, var(--brand) 50%, white); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 9%, transparent); }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }

.record-list { display: flex; max-height: 480px; flex-direction: column; margin-top: 12px; overflow-y: auto; }
.record-list > div { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 30px; align-items: center; gap: 10px; min-height: 61px; border-bottom: 1px solid var(--line); }
.record-icon { display: grid; place-items: center; width: 36px; height: 36px; color: #2a71d1; background: #eaf2ff; border-radius: 10px; }
.record-icon.expense { color: #d27a18; background: #fff1dc; }
.record-list > div > div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.record-list strong { font-size: 10px; }
.record-list small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.record-list b { direction: ltr; font-size: 10px; white-space: nowrap; }
.report-actions label { flex-direction: row; align-items: center; }
.report-actions input { width: 132px; min-height: 40px; direction: ltr; }
.progress { width: 110px; height: 6px; background: #edf1ef; border-radius: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.report-note { margin: -5px 4px 0; color: var(--muted); font-size: 9px; }
.logo-editor { display: flex; align-items: center; gap: 17px; margin-top: 16px; padding: 15px; background: #f8faf9; border: 1px solid var(--line); border-radius: 13px; }
.logo-editor > img { width: 76px; height: 76px; flex: 0 0 76px; object-fit: contain; background: white; border: 1px solid var(--line); border-radius: 18px; }
.logo-editor > div { display: flex; flex: 1; flex-direction: column; gap: 7px; }
.logo-editor form { display: flex; align-items: center; gap: 8px; }
.upload-button { display: inline-flex; align-items: center; gap: 7px; min-height: 41px; padding: 0 12px; color: var(--ink); font-size: 10px; font-weight: 700; background: white; border: 1px dashed #b9c8c1; border-radius: 9px; cursor: pointer; }
.upload-button input { display: none; }
.text-button { align-self: flex-start; padding: 0; color: var(--brand); font-size: 9px; background: transparent; border: 0; }
.logo-editor small { color: var(--muted); font-size: 8px; }
.color-fields input { padding: 4px; }
.editable-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 13px; }
.editable-list > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 39px; padding: 0 8px 0 5px; background: #f9fbfa; border: 1px solid var(--line); border-radius: 9px; }
.editable-list span { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 9px; }
.editable-list span small { color: var(--muted); font-size: 7px; }
.editable-list button { width: 26px; height: 26px; }
.inline-add { display: flex; gap: 7px; margin-top: 10px; }
.inline-add .btn { width: 40px; min-height: 40px; padding: 0; }
.staff-add { display: grid; grid-template-columns: 1fr 90px 40px; }
.printer-card { display: flex; align-items: center; gap: 14px; }
.printer-visual { display: grid; place-items: center; width: 52px; height: 52px; flex: 0 0 52px; color: var(--brand); background: var(--soft); border-radius: 14px; }
.printer-card h2 { margin: 0; font-size: 13px; }
.printer-card p { margin: 5px 0; font-size: 10px; }
.printer-card small { display: block; color: var(--muted); font-size: 8px; line-height: 1.55; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(12,28,22,.48); backdrop-filter: blur(4px); }
.modal-card { width: min(560px, 100%); padding: 18px; background: white; border-radius: 17px; box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 16px; }
.modal-header button { display: grid; place-items: center; width: 34px; height: 34px; color: var(--muted); background: #f5f7f6; border: 0; border-radius: 9px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding-top: 16px; }
.span-2 { grid-column: 1 / -1; }
.check-label { flex-direction: row !important; align-items: center; }
.check-label input { width: 18px; min-height: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }
.toast-message { position: fixed; bottom: 22px; left: 24px; z-index: 120; display: flex; align-items: center; gap: 9px; max-width: min(430px, calc(100vw - 32px)); min-height: 48px; padding: 0 16px; color: white; font-size: 11px; font-weight: 700; background: #173d31; border: 1px solid rgba(255,255,255,.15); border-radius: 12px; box-shadow: 0 14px 35px rgba(0,0,0,.23); animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.loading-screen { display: grid; place-items: center; align-content: center; min-height: 100vh; gap: 13px; background: #f5f7f6; }
.loading-screen img { width: 80px; height: 80px; }
.loading-screen p { max-width: 560px; margin: 0; color: var(--muted); font-size: 12px; text-align: center; }
.loading-screen h1 { margin: 5px 0 0; font-size: 20px; }
.loader { width: 30px; height: 30px; border: 3px solid #d9e4df; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1250px) {
  .app-shell { grid-template-columns: 88px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .brand-block { justify-content: center; padding-inline: 0; }
  .brand-block img { width: 48px; height: 48px; flex-basis: 48px; }
  .brand-block div, .sidebar nav button span, .sidebar-status { display: none; }
  .sidebar nav button { justify-content: center; padding: 0; }
  .sidebar nav button svg { width: 22px; height: 22px; }
  .pos-workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .food-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .app-shell { display: block; padding-bottom: 72px; }
  .sidebar { position: fixed; top: auto; right: 0; bottom: 0; left: 0; z-index: 60; display: block; width: auto; height: 66px; padding: 7px 10px; background: var(--brand); }
  .brand-block, .sidebar-status { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; height: 100%; padding: 0; }
  .sidebar nav button { display: flex; min-height: 52px; flex-direction: column; justify-content: center; gap: 3px; padding: 0; font-size: 8px; border-radius: 10px; }
  .sidebar nav button span { display: block; }
  .sidebar nav button svg { width: 18px; height: 18px; }
  .topbar { padding-inline: 16px; }
  .content-area { padding: 15px; }
  .pos-workspace { display: flex; flex-direction: column; }
  .cart-panel { position: static; order: -1; width: 100%; }
  .menu-panel { width: 100%; min-height: 440px; }
  .cart-items { max-height: 230px; }
  .finance-grid, .settings-grid, .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { height: 62px; }
  .page-heading small, .print-indicator { display: none; }
  .staff-select { max-width: 180px; }
  .staff-select select { max-width: 130px; }
  .page-action-row, .welcome-row { align-items: flex-start; flex-direction: column; }
  .button-row, .report-actions { width: 100%; flex-wrap: wrap; }
  .button-row .btn { flex: 1; }
  .metric-grid { grid-template-columns: 1fr; }
  .menu-toolbar { align-items: stretch; flex-direction: column; }
  .category-tabs { max-width: 100%; }
  .search-box { width: 100%; }
  .food-grid { grid-template-columns: 1fr 1fr; }
  .food-card { grid-template-columns: 39px minmax(0,1fr); min-height: 94px; padding: 10px; }
  .food-mark { width: 39px; height: 39px; }
  .table-button { min-width: 112px; }
  .two-fields, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .editable-list { grid-template-columns: 1fr; }
  .logo-editor { align-items: flex-start; }
  .logo-editor form { align-items: stretch; flex-direction: column; }
  .report-actions label { flex: 1 1 140px; }
  .report-actions input { width: 100%; }
}

@media print {
  .sidebar, .topbar, .page-action-row .report-actions, .toast-message { display: none !important; }
  .app-shell { display: block; }
  .content-area { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .report-page { gap: 12px; }
  body { background: white; }
}

/* Windows POS print station */
.printer-link { width: fit-content; margin-top: 10px; }
.print-station-page { min-height: 100vh; padding: 28px; color: #173d31; background: radial-gradient(circle at top right, rgba(244,163,64,.13), transparent 30%), #eef3f0; }
.print-console { width: min(980px, 100%); margin: 0 auto; }
.print-console > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.print-console > header > a { color: var(--brand); font-size: 12px; font-weight: 800; text-decoration: none; }
.print-brand { display: flex; align-items: center; gap: 12px; }
.print-brand img { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 8px 24px rgba(20,92,74,.16); }
.print-brand div { display: grid; gap: 2px; }
.print-brand strong { font-size: 17px; }
.print-brand span { color: var(--muted); font-size: 10px; }
.print-status-panel { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 18px; min-height: 152px; padding: 24px; color: white; background: #173d31; border-radius: 22px; box-shadow: 0 18px 50px rgba(23,61,49,.2); }
.print-status-panel.offline { background: #45544e; }
.print-status-light { width: 19px; height: 19px; background: #f4a340; border: 5px solid rgba(255,255,255,.22); border-radius: 50%; box-shadow: 0 0 0 7px rgba(244,163,64,.13); }
.print-status-panel.online .print-status-light { background: #5ee1a3; box-shadow: 0 0 0 7px rgba(94,225,163,.14); animation: station-pulse 1.7s ease-in-out infinite; }
@keyframes station-pulse { 50% { box-shadow: 0 0 0 12px rgba(94,225,163,0); } }
.print-status-panel small { color: rgba(255,255,255,.64); font-size: 10px; font-weight: 800; }
.print-status-panel h1 { margin: 5px 0 4px; font-size: clamp(19px, 3vw, 29px); }
.print-status-panel p { margin: 0; color: rgba(255,255,255,.7); font-size: 11px; direction: ltr; text-align: right; }
.print-status-panel b { padding: 9px 13px; color: #173d31; font-size: 10px; background: #fff; border-radius: 999px; }
.print-guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-top: 16px; }
.print-guide-grid article { display: flex; gap: 12px; padding: 18px; background: white; border: 1px solid #dce7e1; border-radius: 16px; box-shadow: 0 8px 24px rgba(23,61,49,.05); }
.print-guide-grid article > span { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; color: white; font-weight: 900; background: var(--brand); border-radius: 10px; }
.print-guide-grid strong { font-size: 12px; }
.print-guide-grid p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.print-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.print-controls button { min-height: 46px; padding: 0 18px; border: 0; border-radius: 12px; font: inherit; font-size: 11px; font-weight: 900; cursor: pointer; }
.print-controls .start { color: white; background: var(--brand); box-shadow: 0 9px 24px rgba(20,92,74,.2); }
.print-controls .stop { color: white; background: #b33c38; }
.print-controls .test { color: #173d31; background: white; border: 1px solid #d5e1db; }
.print-footnote { margin-top: 14px; padding: 12px 14px; color: #70501c; font-size: 10px; background: #fff7e9; border: 1px solid #f4d79f; border-radius: 11px; }
.print-history-panel { margin-top: 16px; padding: 18px; }
.print-history-list { display: grid; gap: 6px; margin-top: 13px; }
.print-history-list > div:not(.empty-state):not(.error-box) { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 10px; min-height: 46px; padding: 7px 9px; font-size: 9px; background: #f8faf9; border: 1px solid var(--line); border-radius: 9px; }
.print-history-list span { display: grid; gap: 3px; }
.print-history-list small { color: var(--muted); direction: ltr; text-align: right; }
.print-history-list em { padding: 5px 8px; font-size: 8px; font-style: normal; border-radius: 7px; }
.print-history-list .job-printed { color: #177852; background: #e6f7ef; }
.print-history-list .job-pending, .print-history-list .job-printing { color: #8f6200; background: #fff3d4; }
.print-history-list .job-failed { color: #b43a3a; background: #ffebeb; }
.print-history-list button { min-height: 28px; padding: 0 9px; color: var(--brand); font: inherit; font-weight: 800; background: white; border: 1px solid var(--line); border-radius: 7px; }
.thermal-ticket { display: none; }

@media (max-width: 700px) {
  .print-station-page { padding: 16px; }
  .print-guide-grid { grid-template-columns: 1fr; }
  .print-status-panel { grid-template-columns: auto 1fr; }
  .print-status-panel > b { grid-column: 1 / -1; width: fit-content; }
}

@media print {
  @page neo-receipt { size: auto; margin: 0; }
  html, body { width: 100% !important; min-width: 0 !important; height: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; background: white !important; }
  .print-station-page { width: 100% !important; min-width: 0 !important; height: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; background: white; }
  .print-console { display: none !important; }
  .thermal-ticket { page: neo-receipt; display: block; width: 72mm; max-width: 100%; margin: 0; overflow: visible; color: #000; font-family: Arial, "Noto Sans Arabic", Tahoma, sans-serif; font-size: 10pt; break-before: avoid; break-after: avoid; }
  .thermal-ticket .ticket-logo-image { display: block; width: 16mm; height: 16mm; margin: 0 auto 1.5mm; object-fit: contain; }
  .thermal-ticket h1 { margin: 0; font-size: 15pt; text-align: center; }
  .thermal-ticket > p { margin: 1mm 0; font-size: 8.5pt; text-align: center; }
  .thermal-ticket h2 { margin: 2mm 0; font-size: 12pt; text-align: center; }
  .ticket-rule { margin: 2.5mm 0; border-top: 1px dashed #000; }
  .thermal-ticket dl { margin: 0; }
  .ticket-meta > div { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: baseline; column-gap: 2mm; margin: .8mm 0; }
  .ticket-meta dt { white-space: nowrap; }
  .ticket-meta dd { min-width: 0; overflow-wrap: anywhere; text-align: left; }
  .ticket-meta .ticket-value-ltr { direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-size: 9pt; }
  .ticket-meta .ticket-value-text { unicode-bidi: plaintext; }
  .ticket-totals > div { display: flex; justify-content: space-between; gap: 2mm; margin: .8mm 0; }
  .thermal-ticket dt, .thermal-ticket dd { margin: 0; }
  .thermal-ticket table { width: 100%; table-layout: fixed; border-collapse: collapse; }
  .thermal-ticket th, .thermal-ticket td { padding: 1.4mm .5mm; border-bottom: 1px dotted #777; text-align: right; vertical-align: top; }
  .thermal-ticket th:first-child, .thermal-ticket td:first-child { width: 7mm; text-align: center; }
  .thermal-ticket th:nth-child(2), .thermal-ticket td:nth-child(2) { overflow-wrap: anywhere; }
  .thermal-ticket th:last-child, .thermal-ticket td:last-child { width: 20mm; direction: ltr; unicode-bidi: isolate; text-align: left; font-size: 8.5pt; }
  .thermal-ticket td small { display: block; margin-top: .8mm; font-size: 7.5pt; }
  .ticket-totals .ticket-grand { margin-top: 1.5mm; padding-top: 1.5mm; font-size: 13pt; font-weight: 1000; border-top: 1px solid #000; }
  .ticket-note { margin-top: 2mm; padding: 2mm; font-size: 9pt; border: 1px solid #000; }
  .ticket-thanks { margin-top: 3mm !important; font-weight: 800; }
}

/* PHP/XAMPP edition */
a.btn { text-decoration: none; }
select { appearance: auto; }
.topbar .staff-select > div { display: flex; flex-direction: column; gap: 2px; }
.topbar .staff-select b { font-size: 10px; }
.topbar .staff-select small { color: var(--muted); font-size: 8px; }
.logout-button { width: 42px; height: 42px; }
.print-indicator { padding: 0; cursor: pointer; }
.span-full { grid-column: 1 / -1; }
.empty-cell { padding: 24px; color: var(--muted); text-align: center; }
.row-muted { opacity: .52; }
.category-manager-list button.row-muted { border-style: dashed; }
.category-manager-list button svg { margin-inline-start: 4px; }
.note-preview { color: #9a6b24 !important; }
.danger-toast { background: #8e2f2f; }
.warning-box, .error-box, .success-box { padding: 12px 14px; font-size: 10px; line-height: 1.7; border-radius: 10px; }
.warning-box { color: #77500d; background: #fff6e4; border: 1px solid #f0d39a; }
.error-box { color: #9d2d2d; background: #fff0f0; border: 1px solid #f2c8c8; }
.success-box { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; color: #176d4a; background: #eaf8f1; border: 1px solid #bfe7d2; }
.loading-inline { display: grid; place-items: center; gap: 10px; min-height: 260px; color: var(--muted); }
.report-chart { overflow-x: auto; }
.report-chart .bar-column { min-width: 42px; }
.report-summary h2 { margin-top: 0; font-size: 15px; }
.report-summary dl { margin: 12px 0 0; }
.report-summary dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; font-size: 10px; border-bottom: 1px solid var(--line); }
.report-summary dt, .report-summary dd { margin: 0; }
.report-summary dd { direction: ltr; font-weight: 800; }
.settings-links { flex-wrap: wrap; margin-top: 15px; }
.is-loading { cursor: progress; }

.auth-body { min-height: 100vh; background: radial-gradient(circle at 12% 10%, rgba(244,163,64,.16), transparent 30%), radial-gradient(circle at 88% 88%, rgba(20,92,74,.15), transparent 30%), #eef4f1; }
.login-shell, .setup-shell { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(380px, 1.1fr); width: min(980px, calc(100% - 32px)); min-height: 600px; margin: max(34px, 7vh) auto; overflow: hidden; background: white; border: 1px solid #dce6e1; border-radius: 24px; box-shadow: 0 28px 80px rgba(22,59,47,.15); }
.login-brand-panel, .setup-hero { display: flex; align-items: flex-start; justify-content: center; flex-direction: column; padding: clamp(36px, 6vw, 70px); color: white; background: linear-gradient(155deg, #0d4436, var(--brand)); }
.login-brand-panel img, .setup-hero img { width: 88px; height: 88px; margin-bottom: 25px; object-fit: contain; background: white; border-radius: 23px; box-shadow: 0 15px 36px rgba(0,0,0,.2); }
.login-brand-panel .eyebrow, .setup-hero .eyebrow { color: #ffd28f; }
.login-brand-panel h1, .setup-hero h1 { margin: 7px 0 13px; font-size: clamp(27px, 4vw, 42px); line-height: 1.25; }
.login-brand-panel > p:last-of-type, .setup-hero > p:last-of-type { margin: 0; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.8; }
.login-feature-list { display: grid; gap: 11px; margin-top: 35px; color: rgba(255,255,255,.84); font-size: 10px; }
.login-card, .setup-card { display: flex; justify-content: center; flex-direction: column; padding: clamp(32px, 6vw, 70px); border: 0; border-radius: 0; box-shadow: none; }
.login-card h2 { margin: 7px 0 8px; font-size: 28px; }
.login-card > p:not(.eyebrow) { margin: 0 0 12px; color: var(--muted); font-size: 11px; }
.login-card .stack-form { margin-top: 18px; }
.login-help { display: block; margin-top: 18px; color: var(--muted); font-size: 8px; line-height: 1.6; }
.setup-shell { grid-template-columns: minmax(280px, .75fr) minmax(420px, 1.25fr); min-height: 680px; }
.setup-card { justify-content: flex-start; overflow-y: auto; }
.requirement-list { display: grid; gap: 7px; margin: 17px 0; }
.requirement-list > div { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 43px; padding: 0 11px; background: #f8faf9; border: 1px solid var(--line); border-radius: 10px; }
.requirement-list > div > span { display: grid; place-items: center; width: 23px; height: 23px; color: white; font-size: 11px; font-weight: 900; border-radius: 50%; }
.requirement-list .passed > span { background: #2fa875; }
.requirement-list .failed > span { background: #d84848; }
.requirement-list b { font-size: 10px; }
.requirement-list small { color: var(--muted); font-size: 8px; }
.requirement-list .failed small { color: #b33c38; }
.database-summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 13px; padding: 13px; color: var(--muted); font-size: 9px; background: #f7f9f8; border-radius: 10px; }
.database-summary b { color: var(--ink); }
.setup-form { margin-top: 15px; }
.setup-note { margin: 14px 0 0; padding: 10px 12px; color: #70501c; font-size: 8px; line-height: 1.7; background: #fff8ec; border-radius: 9px; }
.health-shell { min-height: 520px; }

@media (max-width: 760px) {
  .login-shell, .setup-shell { display: block; margin: 16px auto; }
  .login-brand-panel, .setup-hero { min-height: 280px; padding: 35px; }
  .login-brand-panel img, .setup-hero img { width: 68px; height: 68px; margin-bottom: 16px; }
  .login-feature-list { display: none; }
  .login-card, .setup-card { padding: 30px 24px; }
  .setup-shell { overflow: visible; }
}

@media print {
  @page neo-report { size: A4; margin: 12mm; }
  .report-page { page: neo-report; }
  .report-page .metric-grid { grid-template-columns: repeat(4, 1fr); }
  .report-page .chart-card { display: none; }
  .report-page .dashboard-grid { grid-template-columns: 1.5fr .5fr; }
  .report-page .table-card { break-inside: auto; }
}
