:root { --sidebar-w: 250px; }
body { font-family: "Segoe UI", Tahoma, Arial, sans-serif; background: #f5f6fa; }
#sidebar { width: var(--sidebar-w); min-height: 100vh; transition: margin .25s; flex-shrink: 0; }
#sidebar .nav-link { color: #cfd3dc; padding: .55rem 1rem; border-radius: .375rem; margin: 0 .5rem; }
#sidebar .nav-link i { width: 22px; display: inline-block; }
#sidebar .nav-link:hover, #sidebar .nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
#sidebar .nav-header { color: #8b93a3; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; padding: .9rem 1.2rem .3rem; }
[dir="rtl"] #wrapper.collapsed #sidebar { margin-right: calc(-1 * var(--sidebar-w)); }
[dir="ltr"] #wrapper.collapsed #sidebar { margin-left: calc(-1 * var(--sidebar-w)); }
@media (max-width: 992px) {
  [dir="rtl"] #sidebar { margin-right: calc(-1 * var(--sidebar-w)); }
  [dir="ltr"] #sidebar { margin-left: calc(-1 * var(--sidebar-w)); }
  [dir="rtl"] #wrapper.collapsed #sidebar { margin-right: 0; }
  [dir="ltr"] #wrapper.collapsed #sidebar { margin-left: 0; }
}
.kpi-card { border: 0; border-radius: .75rem; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.kpi-card .kpi-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.kpi-card .kpi-value { font-size: 1.8rem; font-weight: 700; }
.card { border-radius: .6rem; }
.table > :not(caption) > * > * { vertical-align: middle; }
.menu-grid td { min-width: 220px; }
.menu-grid textarea { font-size: .85rem; min-height: 60px; }
.img-thumb { width: 130px; height: 130px; object-fit: cover; border-radius: .5rem; cursor: pointer; border: 1px solid #ddd; }
.field-card { cursor: grab; }
.field-card.dragging { opacity: .5; }
.req::after { content: " *"; color: #dc3545; }
.login-card { border: 0; border-radius: 1rem; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.timeline { border-inline-start: 2px solid #dee2e6; padding-inline-start: 1rem; }
.timeline .item { position: relative; margin-bottom: .9rem; }
.timeline .item::before { content: ""; position: absolute; inset-inline-start: -1.45rem; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: #0d6efd; }
.calendar-cell { min-height: 80px; font-size: .8rem; }
.kpi-click { cursor: pointer; transition: transform .1s; }
.kpi-click:hover { transform: translateY(-2px); }
#rTable tbody tr[data-href]:hover > td { background: #eef4ff; }
/* documentation flagged (poor quality / mismatch) */
tr.doc-issue > td { background: #fde2e4 !important; }
tr.doc-issue > td:first-child { box-shadow: inset 4px 0 0 #dc3545; }
[dir="rtl"] tr.doc-issue > td:first-child { box-shadow: inset -4px 0 0 #dc3545; }
.doc-issue-swatch { width: 14px; height: 14px; background: #fde2e4; border: 1px solid #dc3545; vertical-align: middle; }
.card.doc-issue-card { border: 2px solid #dc3545; }
.dish-cell { min-width: 210px; border: 1px solid transparent; border-radius: .35rem; padding: 2px; }
.dish-cell.border-danger { border-color: #dc3545 !important; background: #fff5f5; }
.meal-row.bg-danger-subtle { transition: background .2s; }
pre.json { background: #1e1e1e; color: #d4d4d4; padding: 1rem; border-radius: .5rem; direction: ltr; text-align: left; }

/* status progress track: one dash per step under a status badge */
.status-cell { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; vertical-align: middle; }
.status-cell > .badge + .badge { margin-top: 0; }
.step-track { display: inline-flex; gap: 3px; margin-top: 5px; line-height: 0; }
.step-track i { display: inline-block; width: 18px; height: 4px; border-radius: 3px; background: rgba(15, 23, 42, .13); }
.step-track i.done { background: #198754; }
.step-track i.now { background: #f0812a; }
.step-track i.fail { background: #dc3545; }
.status-cell .step-track { align-self: stretch; }

.status-cell > .status-row { display: inline-flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.status-cell > .status-row > .badge.ms-1 { margin-inline-start: 0 !important; }

/* ============ customer / catering company apps (body.app-mode, opened from /c/app or /s/app) ============ */
.app-mode { --pa-h: 56px; --pa-tab-h: 62px; background: #f4f5f8; padding-bottom: calc(var(--pa-tab-h) + env(safe-area-inset-bottom)); }
.app-mode #sidebar, .app-mode #page > header.navbar, .app-mode #page > footer { display: none !important; }
.app-mode #page { min-height: 100vh; min-width: 0; }
.app-mode main.container-fluid { padding: 12px !important; }
.app-mode main .card { border-radius: 14px; }
.app-mode main h1, .app-mode main .h1 { font-size: 1.35rem; }
.app-mode main .table { font-size: .86rem; }
.app-mode main .table-responsive { -webkit-overflow-scrolling: touch; }
.app-mode main .btn { min-height: 38px; }
.app-mode .alert { border-radius: 12px; }
.pa-top { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 10px; height: calc(var(--pa-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0; background: #fff; border-bottom: 1px solid #e6e8ee; }
.pa-top-logo { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; }
.pa-top-title { flex: 1; min-width: 0; line-height: 1.15; }
.pa-top-title b { display: block; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-top-title small { display: block; color: #6b7280; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px;
  color: #1f2937; font-size: 1.25rem; text-decoration: none; flex-shrink: 0; }
.pa-icon-btn:active { background: #eef0f4; }
.pa-dot { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #dc3545; color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; font-style: normal; }
.pa-tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; display: flex; height: calc(var(--pa-tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid #e6e8ee; box-shadow: 0 -2px 12px rgba(15, 23, 42, .05); }
.pa-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #6b7280; text-decoration: none; font-size: .7rem; min-width: 0; }
.pa-tab-ic { position: relative; font-size: 1.3rem; line-height: 1; padding: 3px 14px; border-radius: 14px; }
.pa-tab-ic .pa-dot { top: -6px; inset-inline-end: 2px; }
.pa-tab-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
.pa-tab.active { color: var(--pa-color, #4c2a85); font-weight: 600; }
.pa-tab.active .pa-tab-ic { background: color-mix(in srgb, var(--pa-color, #4c2a85) 13%, transparent); }
.pa-c { --pa-color: #4c2a85; }
.pa-s { --pa-color: #b45309; }
/* «More» screen */
.pa-hello { display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff; border-radius: 14px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.pa-hello b { display: block; } .pa-hello small { color: #6b7280; }
.pa-avatar { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #fff; background: var(--pa-color, #4c2a85); }
.pa-section { color: #6b7280; font-size: .8rem; font-weight: 600; margin: 16px 4px 8px; }
.pa-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.pa-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; background: #fff; border-radius: 14px; text-align: center;
  color: #1f2937; text-decoration: none; font-size: .82rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.pa-tile:active { background: #eef0f4; }
.pa-tile-ic { position: relative; width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
  color: var(--pa-color, #4c2a85); background: color-mix(in srgb, var(--pa-color, #4c2a85) 11%, #fff); }
.pa-tile-ic .pa-dot { top: -6px; inset-inline-end: -6px; }
.pa-list .list-group-item { display: flex; align-items: center; gap: 10px; padding: 13px 14px; }
.pa-list { border-radius: 14px; overflow: hidden; }
.app-mode .pa-qr-card { display: none; }   /* the QR code is for opening the app from a computer */

/* ============ phone & tablet (v45) ============ */
/* the page column may shrink below its content: wide tables scroll inside their card instead of widening the whole page */
#page { min-width: 0; }
main.container-fluid { min-width: 0; }
@media (max-width: 576px) {
  #page > header.navbar .navbar-nav .dropdown-toggle { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #page > header.navbar > span, #page > header.navbar .navbar-brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main.container-fluid { padding-left: .75rem !important; padding-right: .75rem !important; }
}/* weekly menu on a phone: one block per day instead of a 7-column table */
.menu-days { padding: .5rem; display: grid; gap: .5rem; }
.menu-day { border: 1px solid var(--bs-border-color, #dee2e6); border-radius: .6rem; overflow: hidden; background: #fff; }
.menu-day-h { background: var(--bs-tertiary-bg, #f8f9fa); padding: .45rem .75rem; font-weight: 600; font-size: .92rem; border-bottom: 1px solid var(--bs-border-color, #dee2e6); }
.menu-day-cat { padding: .35rem .75rem 0; font-size: .8rem; color: var(--bs-primary, #0d6efd); font-weight: 600; }
.menu-day-meal { padding: .4rem .75rem; border-top: 1px dashed var(--bs-border-color, #e5e7eb); }
.menu-day-cat + .menu-day-meal, .menu-day-h + .menu-day-meal { border-top: 0; }