/* ===== Brand palette ===== */
:root {
    --red: #df0615;
    --yellow: #fcda00;
    --blue: #004098;
    --blue-dark: #002a66;
    --blue-darker: #001b44;

    --bg: #f4f6fa;
    --surface: #ffffff;
    --text: #1b2333;
    --muted: #6b7489;
    --border: #e3e7ef;

    --sidebar-w: 260px;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(0, 27, 68, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Cairo', sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }

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

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--blue-dark), var(--blue-darker));
    color: #fff;
    position: fixed; inset-block: 0; inset-inline-start: 0;
    display: flex; flex-direction: column;
    z-index: 30; transition: transform .25s ease;
}
.sidebar__brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    font-weight: 800; font-size: 17px;
}
.sidebar__brand img { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; }
.sidebar__brand > span { display: flex; flex-direction: column; line-height: 1.3; }
.sidebar__subtitle { color: var(--yellow); font-size: 13px; font-weight: 700; }
.sidebar__nav { padding: 12px; overflow-y: auto; flex: 1; }
.sidebar__link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; margin-bottom: 4px;
    border-radius: 10px; font-weight: 600; font-size: 15px;
    color: rgba(255, 255, 255, .78);
    transition: background .15s, color .15s;
}
.sidebar__link i { width: 20px; text-align: center; color: var(--yellow); }
.sidebar__link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar__link.is-active { background: var(--yellow); color: var(--blue-darker); }
.sidebar__link.is-active i { color: var(--blue-darker); }

/* ===== Main ===== */
.main { flex: 1; margin-inline-start: var(--sidebar-w); min-width: 0; }

.topbar {
    height: 68px; background: var(--surface);
    display: flex; align-items: center; gap: 14px;
    padding: 0 24px;
    border-bottom: 3px solid var(--yellow);
    box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-size: 20px; font-weight: 800; color: var(--blue); flex: 1; }
.topbar__title i { color: var(--yellow); margin-inline-end: 6px; }
.topbar__toggle { display: none; background: none; border: 0; font-size: 20px; color: var(--blue); cursor: pointer; }
.topbar__icon {
    width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--bg); color: var(--blue);
}
.topbar__icon:hover { background: var(--blue); color: #fff; }

.content { padding: 24px; }

/* ===== Components ===== */
.empty-state {
    background: var(--surface); border: 2px dashed var(--border);
    border-radius: var(--radius);
    min-height: 320px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    color: var(--muted); font-size: 17px; font-weight: 600;
}
.empty-state i { font-size: 48px; color: var(--yellow); }

.topbar__actions { display: flex; align-items: center; gap: 8px; }

/* Tones (shared by cards / badges) */
.tone-yellow { --tone: #b38f00; --tone-bg: #fff8cc; }
.tone-blue   { --tone: var(--blue); --tone-bg: #e5edf8; }
.tone-green  { --tone: #15803d; --tone-bg: #e3f6e9; }
.tone-red    { --tone: var(--red); --tone-bg: #fde6e8; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 8px; border: 1px solid transparent;
    font: 600 14px 'Cairo', sans-serif; cursor: pointer; white-space: nowrap;
    transition: filter .15s;
}
.btn:hover { filter: brightness(.95); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--yellow { background: var(--yellow); color: var(--blue-darker); }
.btn--blue { background: var(--blue); color: #fff; }
.btn--red-outline { background: transparent; color: var(--red); border-color: var(--red); }

/* Stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stats-grid--3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 24px; }
.stat-card {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    border-inline-start: 4px solid var(--tone);
    padding: 18px; display: flex; align-items: center; gap: 14px;
}
.stat-card__icon {
    width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 20px;
    background: var(--tone-bg); color: var(--tone);
}
.stat-card__body { display: flex; flex-direction: column; }
.stat-card__label { color: var(--muted); font-size: 14px; font-weight: 600; }
.stat-card__value { font-size: 26px; font-weight: 800; color: var(--tone); line-height: 1.3; }

/* Card + table */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card__header h2 { font-size: 17px; font-weight: 800; color: var(--blue); }
.link { color: var(--blue); font-weight: 600; font-size: 14px; }
.link:hover { color: var(--red); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 20px; text-align: start; white-space: nowrap; }
.table th { color: var(--muted); font-weight: 700; background: #f9fafc; border-bottom: 1px solid var(--border); }
.table td { border-bottom: 1px solid var(--border); }
.table tbody tr:hover { background: #f9fafc; }
.table__empty { text-align: center !important; color: var(--muted); padding: 40px !important; }

.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 700; background: var(--tone-bg); color: var(--tone);
}

.btn--ghost { background: var(--surface); color: var(--blue); border-color: var(--border); }
.btn.is-loading { opacity: .6; pointer-events: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { display: contents; }

/* Alerts */
.alert {
    background: var(--tone-bg); color: var(--tone);
    border-inline-start: 4px solid var(--tone); border-radius: 8px;
    padding: 12px 16px; margin-bottom: 16px; font-weight: 600; font-size: 14px;
}
.alert--list ul { margin: 8px 0 0; padding-inline-start: 22px; font-weight: 400; line-height: 1.9; }

.btn--sm { padding: 5px 12px; font-size: 13px; }
.btn--wide { flex: 1; justify-content: center; }
.text-green { color: #15803d; }
.text-red { color: var(--red); }

/* Forms */
.input {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: 8px;
    font: 14px 'Cairo', sans-serif; background: #f9fafc; color: var(--text);
}
.input:focus { outline: none; border-color: var(--blue); background: var(--surface); }
.input:disabled { opacity: .6; cursor: not-allowed; }
textarea.input { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid__wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-weight: 700; font-size: 14px; }
.field__hint { color: var(--muted); font-size: 12px; }
.field__error { color: var(--red); font-size: 12px; font-weight: 600; }
.field.has-error .input { border-color: var(--red); }

.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.segmented input { display: none; }
.segmented span {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px; border: 1px solid var(--border); border-radius: 8px;
    font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer;
}
.segmented input:checked + span { border-color: var(--blue); background: #e5edf8; color: var(--blue); }

/* Modal */
.modal { border: 0; border-radius: 16px; padding: 0; width: min(640px, calc(100% - 32px)); margin: auto; box-shadow: 0 20px 60px rgba(0, 27, 68, .25); }
.modal::backdrop { background: rgba(0, 27, 68, .45); }
.modal__box { display: flex; flex-direction: column; max-height: 90vh; }
.modal__header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal__header h3 { font-size: 18px; font-weight: 800; color: var(--blue); }
.modal__close { background: var(--bg); border: 0; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; color: var(--muted); }
.modal__close:hover { color: var(--red); }
.modal__body { padding: 20px 24px; overflow-y: auto; }
.modal__footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }

/* Master-detail (list + details) */
.master-detail { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.md-list { display: flex; flex-direction: column; max-height: calc(100vh - 116px); position: sticky; top: 92px; }
.md-list__header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); }
.md-list__header h2 { font-size: 17px; font-weight: 800; color: var(--blue); }
.md-list__filters { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.md-list__items { flex: 1; overflow-y: auto; padding: 8px; min-height: 120px; }
.md-list__empty { text-align: center; color: var(--muted); padding: 32px 0; }
.md-list__footer { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); text-align: center; }
.md-list__footer div { padding: 12px; display: flex; flex-direction: column; }
.md-list__footer div + div { border-inline-start: 1px solid var(--border); }
.md-list__footer strong { font-size: 18px; font-weight: 800; }
.md-list__footer small { color: var(--muted); font-size: 12px; }
.md-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; }
.md-item:hover { background: var(--bg); }
.md-item.is-active { background: #e5edf8; }
.md-item__body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.md-item__body strong { font-size: 14px; }
.md-item__body small { color: var(--muted); font-size: 12px; text-align: end; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: var(--yellow); flex-shrink: 0; }
.avatar--lg { width: 64px; height: 64px; font-size: 26px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tone); flex-shrink: 0; }

.md-details { min-height: 480px; }
.md-placeholder { height: 480px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-weight: 600; }
.md-placeholder i { font-size: 48px; color: var(--blue); opacity: .5; }
.profile { display: flex; align-items: center; gap: 16px; padding: 24px; border-bottom: 1px solid var(--border); }
.profile h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.profile__main { flex: 1; min-width: 0; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 24px; }
.info-grid__wide { grid-column: span 3; }
.info-grid dt { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.info-grid dd { font-weight: 700; }

/* Finance */
.stats-grid--compact { margin-bottom: 24px; }
.stats-grid--compact .stat-card { padding: 12px 16px; }
.stats-grid--compact .stat-card__icon { width: 38px; height: 38px; font-size: 16px; }
.stats-grid--compact .stat-card__value { font-size: 20px; }
.segmented--auto { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; }
.report-grid div { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.report-grid div:nth-child(odd) { border-inline-end: 1px solid var(--border); }
.report-grid dt { color: var(--muted); font-weight: 600; }
.report-grid dd { font-weight: 800; font-size: 16px; }
.md-placeholder--sm { height: 260px; }

/* Reports */
.toolbar--row { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.inline-field { display: flex; align-items: center; gap: 8px; }
.inline-field label { font-weight: 700; color: var(--muted); white-space: nowrap; }
.inline-field .input { width: auto; }
.section-gap { margin-top: 16px; }
.section-title { font-size: 16px; font-weight: 800; color: var(--blue); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.section-title.section-gap { margin-top: 24px; }
.text-yellow { color: #b38f00; }

/* Inline forms (form inside a card) */
.inline-form { display: grid; grid-template-columns: repeat(3, 1fr) 2fr; gap: 16px; padding: 20px; align-items: start; }
.inline-form__submit { grid-column: 1; justify-content: center; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; }
.icon-btn:hover { color: var(--red); background: var(--tone-bg, #fde6e8); }
.page-header p { font-size: 14px; }

/* Zones */
.modal--sm { width: min(440px, calc(100% - 32px)); }
.input--price { max-width: 180px; }
.input.is-invalid { border-color: var(--red); }
.table-note { padding: 12px 20px; }
.table td .badge { margin-inline-start: 6px; }

/* Zone location picker */
.modal--map { width: min(1100px, calc(100% - 32px)); }
.modal--map .picker__map { height: min(60vh, 520px); }
.modal--map .modal__body { display: flex; flex-direction: column; gap: 16px; }
.picker { gap: 8px; }
.picker__search { position: relative; }
.picker__results {
    position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 1000; list-style: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
    max-height: 260px; overflow-y: auto;
}
.picker__results li { padding: 10px 14px; cursor: pointer; display: flex; flex-direction: column; border-bottom: 1px solid var(--border); }
.picker__results li:last-child { border-bottom: 0; }
.picker__results li:hover { background: #f3f7fd; }
.picker__results small { color: var(--muted); font-size: 12px; }
.picker__results .picker__empty { cursor: default; color: var(--muted); }
.picker__map { height: 320px; border-radius: 10px; border: 1px solid var(--border); z-index: 0; }
.picker__selected { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.zone-map { height: 260px; margin: 0 24px 16px; border-radius: 10px; border: 1px solid var(--border); z-index: 0; }

/* Live map */
.map-card { display: flex; flex-direction: column; }
.map-wrap { position: relative; flex: 1; min-height: 520px; }
#map { position: absolute; inset: 0; border-radius: 0 0 var(--radius) var(--radius); z-index: 0; }
.map-empty {
    position: absolute; inset: 0; z-index: 500;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: rgba(255, 255, 255, .85); color: var(--muted); font-weight: 600; text-align: center; padding: 16px;
}
.map-empty[hidden] { display: none; }
.map-empty i { font-size: 44px; color: var(--blue); opacity: .6; }
button.md-item { width: 100%; border: 0; background: none; font: inherit; text-align: start; cursor: pointer; color: inherit; }
.md-item.is-muted { opacity: .55; }

/* Notifications */
.topbar__icon { position: relative; }
.topbar__badge {
    position: absolute; top: -4px; inset-inline-end: -4px;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.notification { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.notification:hover { background: #f9fafc; }
.notification.is-unread { background: #f3f7fd; }
.notification.is-unread strong::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-inline-end: 8px; vertical-align: middle; }
.notification__icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--tone-bg); color: var(--tone); flex-shrink: 0; }
.notification__body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.notification__body small { color: var(--muted); }
.notification time { font-size: 12px; white-space: nowrap; }
p.table__empty { padding: 40px; }

/* Settings */
.btn--red { background: var(--red); color: #fff; }
.link-list { padding: 8px 20px; }
.link-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.link-row:last-child { border-bottom: 0; }
.link-row__label { width: 140px; font-weight: 700; flex-shrink: 0; }
.link-row__url { flex: 1; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: end; }
.danger-zone { border: 1px solid #f5c2c7; }
.danger-zone .card__header { border-bottom: 0; gap: 16px; }
.danger-zone p { margin-top: 4px; font-size: 14px; }

/* Login */
.login-page {
    min-height: 100vh; display: grid; place-items: center; padding: 16px;
    background:
        radial-gradient(circle at 15% 20%, rgba(252, 218, 0, .18), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(223, 6, 21, .14), transparent 40%),
        linear-gradient(160deg, var(--blue-dark), var(--blue-darker));
}
.login-card {
    width: min(420px, 100%); background: var(--surface); border-radius: 20px; overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}
.login-card__brand {
    text-align: center; padding: 32px 24px 24px;
    background: linear-gradient(180deg, var(--blue), var(--blue-dark)); color: #fff;
    border-bottom: 4px solid var(--yellow);
}
.login-card__brand img { width: 110px; height: 110px; border-radius: 26px; object-fit: cover; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); }
.login-card__brand h1 { font-size: 24px; font-weight: 800; margin-top: 10px; }
.login-card__brand p { color: var(--yellow); font-weight: 700; }
.login-card__form { padding: 28px 24px; display: flex; flex-direction: column; gap: 18px; }
.login-card__form .alert { margin-bottom: 0; }
.login-card__back { display: block; text-align: center; padding: 0 24px 22px; color: var(--muted, #6b7280); font-weight: 700; font-size: 14px; text-decoration: none; }
.login-card__back:hover { color: #004098; }
.login-field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
.login-field__control { position: relative; display: block; }
.login-field__control > i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.login-field__control .input { padding: 12px 42px; font-size: 15px; text-align: start; }
.login-field__toggle { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; }
.login-card__submit { justify-content: center; padding: 13px; font-size: 16px; font-weight: 800; }

/* Filters panel */
.filters { border-bottom: 1px solid var(--border); }
.filters__toggle {
    list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
    padding: 12px 20px; font-weight: 700; color: var(--blue); user-select: none;
}
.filters__toggle::-webkit-details-marker { display: none; }
.filters__chevron { margin-inline-start: auto; transition: transform .2s; color: var(--muted); }
.filters[open] .filters__chevron { transform: rotate(180deg); }
.filters__form { padding: 0 20px 16px; }
.filters__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.filter-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.filter-field .input--sm { width: 100%; min-width: 0; padding: 8px 10px; }
.filters__actions { display: flex; gap: 8px; margin-top: 12px; }
.md-list .filters__grid { grid-template-columns: 1fr 1fr; }
.md-list .filters__form { padding: 0 12px 12px; }
.md-list .filters__toggle { padding: 10px 16px; }

/* Restaurant menu */
.detail-tabs { padding: 12px 24px; border-bottom: 1px solid var(--border); }
.text-blue { color: var(--blue); }
.menu { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.menu__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.menu__head h2 { font-size: 19px; font-weight: 800; color: var(--blue); }
.menu__box { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: #fafbfd; }
.menu__box--flush { padding: 0; background: var(--surface); overflow: hidden; }
.menu__box h3 { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.menu__list-title { padding: 16px 20px 0; }
.menu__category-form { display: grid; grid-template-columns: 1fr 1fr 1.2fr auto; gap: 10px; }
.input--file { padding: 7px 10px; font-size: 13px; }
.menu__chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.chip { position: relative; display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.chip__label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 0; background: none; font: 600 13px 'Cairo', sans-serif; color: var(--text); cursor: pointer; }
.chip__label:hover { color: var(--blue); }
.chip__label img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.chip__label small { color: var(--muted); }
.chip form { position: absolute; top: -7px; inset-inline-end: -7px; }
.chip__remove { width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-size: 10px; cursor: pointer; display: grid; place-items: center; }
.menu-item { display: flex; align-items: center; gap: 12px; }
.menu-item__img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.menu-item__img--empty { display: grid; place-items: center; color: var(--muted); background: var(--bg); }
.menu-item__desc { max-width: 260px; white-space: normal !important; color: var(--muted); font-size: 13px; }
.menu-modal__flags { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; cursor: pointer; }
.check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
@media (max-width: 860px) { .menu__category-form { grid-template-columns: 1fr; } }

/* Row actions (edit/delete) */
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn--edit:hover { color: var(--blue); background: #e5edf8; }

/* Control center */
.input--sm { padding: 6px 10px; font-size: 13px; width: auto; min-width: 140px; }
.select--tone { background: var(--tone-bg); color: var(--tone); border-color: transparent; font-weight: 700; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-header h2 { font-size: 22px; font-weight: 800; color: var(--blue); }
.muted { color: var(--muted); font-weight: 600; }
.text-end { text-align: end !important; }

/* Toolbar: tabs + search */
.toolbar { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
    font-size: 14px; font-weight: 600; color: var(--muted); background: var(--surface);
}
.tab:hover { border-color: var(--blue); color: var(--blue); }
.tab.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.tab__count { background: var(--bg); color: var(--blue); border-radius: 20px; padding: 0 8px; font-size: 12px; }
.tab.is-active .tab__count { background: var(--yellow); color: var(--blue-darker); }

.search { position: relative; }
.search i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input {
    width: 100%; padding: 10px 40px 10px 14px;
    border: 1px solid var(--border); border-radius: 8px;
    font: 14px 'Cairo', sans-serif; background: #f9fafc;
}
.search input:focus { outline: none; border-color: var(--blue); background: var(--surface); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 16px; flex-wrap: wrap; }
.page {
    min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px;
    display: grid; place-items: center; font-weight: 600; font-size: 14px;
    border: 1px solid var(--border); color: var(--blue);
}
.page:hover { border-color: var(--blue); }
.page.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.page.is-disabled { color: var(--muted); opacity: .5; }

/* ===== Responsive ===== */
.overlay { display: none; }
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .info-grid { grid-template-columns: repeat(2, 1fr); }
    .info-grid__wide { grid-column: span 2; }
}
@media (max-width: 860px) {
    .inline-form { grid-template-columns: 1fr 1fr; }
    .inline-form__wide { grid-column: 1 / -1; }
    .master-detail { grid-template-columns: 1fr; }
    .md-list { position: static; max-height: 420px; }
}
@media (max-width: 600px) {
    .stats-grid, .stats-grid--3 { grid-template-columns: 1fr; }
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar__title { font-size: 16px; }
    .topbar__actions .btn span { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .segmented { grid-template-columns: 1fr 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .info-grid__wide { grid-column: auto; }
    .report-grid { grid-template-columns: 1fr; }
    .report-grid div:nth-child(odd) { border-inline-end: 0; }
}
@media (max-width: 992px) {
    .sidebar { transform: translateX(100%); }
    .main { margin-inline-start: 0; }
    .topbar__toggle { display: block; }
    .content { padding: 16px; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .overlay { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 25; }
}

/* ===== Several zones (restaurants / drivers) ===== */
.zone-picker__chips { display: flex; flex-wrap: wrap; gap: 8px; max-height: 180px; overflow-y: auto; padding: 2px; }
.zone-chip { cursor: pointer; }
.zone-chip input { position: absolute; opacity: 0; pointer-events: none; }
.zone-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 20px; font-size: 13.5px; font-weight: 700; color: var(--muted); background: var(--surface); transition: .15s; }
.zone-chip span i { display: none; font-size: 11px; }
.zone-chip input:checked + span { border-color: var(--blue); background: #e5edf8; color: var(--blue); }
.zone-chip input:checked + span i { display: inline; }
.zone-chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
