/* =====================================================================
 * BilalBook – styles (light / dark, LTR / RTL)
 * ===================================================================== */

:root {
	--bb-primary: #2563eb;
	--bb-primary-rgb: 37, 99, 235;
	--bb-bg: #f4f6fb;
	--bb-surface: #ffffff;
	--bb-surface-2: #f8fafc;
	--bb-text: #0f172a;
	--bb-muted: #64748b;
	--bb-line: #e2e8f0;
	--bb-line-strong: #cbd5e1;
	--bb-ok: #16a34a;
	--bb-ok-bg: #dcfce7;
	--bb-ok-fg: #166534;
	--bb-no: #dc2626;
	--bb-no-bg: #fee2e2;
	--bb-no-fg: #991b1b;
	--bb-warn-bg: #fef3c7;
	--bb-warn-fg: #92400e;
	--bb-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
	--bb-shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
	--bb-radius: 14px;
	--bb-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	--bb-side-w: 248px;
	color-scheme: light;
}
:root[data-theme="dark"] {
	--bb-bg: #0b1120;
	--bb-surface: #111a2e;
	--bb-surface-2: #0f1729;
	--bb-text: #e2e8f0;
	--bb-muted: #94a3b8;
	--bb-line: #1e293b;
	--bb-line-strong: #334155;
	--bb-ok-bg: rgba(22, 163, 74, .18);
	--bb-ok-fg: #86efac;
	--bb-no-bg: rgba(220, 38, 38, .18);
	--bb-no-fg: #fca5a5;
	--bb-warn-bg: rgba(217, 119, 6, .2);
	--bb-warn-fg: #fcd34d;
	--bb-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
	--bb-shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
	color-scheme: dark;
}
html[lang="ar"] { --bb-font: "Tajawal", "Inter", -apple-system, "Segoe UI", Tahoma, Arial, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
/* App feel: no scrollbars, no page bounce, no pull-to-refresh, no zoom. Only the content area scrolls. */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
html, body.bb-body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--bb-bg); }
body.bb-body {
	font-family: var(--bb-font); font-size: 14px; line-height: 1.5; color: var(--bb-text);
	-webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
	touch-action: manipulation; -webkit-touch-callout: none;
	transition: background-color .2s, color .2s;
}
body.bb-view-login, body.bb-view-denied { overflow-y: auto; -webkit-overflow-scrolling: touch; }
body.bb-view-app { user-select: none; -webkit-user-select: none; }
body.bb-view-app input, body.bb-view-app textarea, body.bb-view-app select,
.bb-note-text, .bb-card-contact, .bb-grid dd, .bb-client-id p, .bb-log em { user-select: text; -webkit-user-select: text; }
img { -webkit-user-drag: none; }
html[lang="ar"] body.bb-body { font-size: 15px; }
a { color: var(--bb-primary); }
img { max-width: 100%; }
button { font-family: inherit; }
.bb-ico { flex-shrink: 0; vertical-align: middle; }
.bb-muted { color: var(--bb-muted); }
.bb-show-dark { display: none; }
[data-theme="dark"] .bb-show-dark { display: inline-flex; }
[data-theme="dark"] .bb-show-light { display: none; }

/* ---------- controls ---------- */
.bb-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	appearance: none; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px;
	font: inherit; font-weight: 700; line-height: 1.1; cursor: pointer; white-space: nowrap; text-decoration: none;
	transition: background .15s, border-color .15s, opacity .15s, transform .05s, box-shadow .15s;
}
.bb-btn:active { transform: translateY(1px); }
.bb-btn:disabled { opacity: .55; cursor: wait; }
.bb-btn .bb-ico { width: 18px; height: 18px; }
.bb-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.bb-sm .bb-ico { width: 16px; height: 16px; }
.bb-primary { background: var(--bb-primary); color: #fff; box-shadow: 0 4px 14px rgba(var(--bb-primary-rgb), .3); }
.bb-primary:hover { filter: brightness(1.07); }
.bb-ok { background: var(--bb-ok); color: #fff; }
.bb-ok:hover { filter: brightness(1.08); }
.bb-no { background: var(--bb-surface); color: var(--bb-no); border-color: color-mix(in srgb, var(--bb-no) 35%, transparent); }
.bb-no:hover { background: var(--bb-no-bg); }
.bb-ghost { background: var(--bb-surface); color: var(--bb-text); border-color: var(--bb-line); }
.bb-ghost:hover { border-color: var(--bb-line-strong); background: var(--bb-surface-2); }
.bb-block { display: flex; width: 100%; }
.bb-btn.is-busy { position: relative; color: transparent !important; }
.bb-btn.is-busy::after {
	content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: bb-spin .7s linear infinite;
}
.bb-ghost.is-busy::after, .bb-no.is-busy::after { border-color: var(--bb-line-strong); border-top-color: var(--bb-primary); }
.bb-submit.is-busy { color: #fff !important; }
.bb-submit.is-busy::after { position: static; margin-inline-start: 8px; }
.bb-icon-btn {
	display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0;
	border-radius: 10px; border: 1px solid var(--bb-line); background: var(--bb-surface); color: var(--bb-text); cursor: pointer;
	text-decoration: none; transition: background .15s, border-color .15s;
}
.bb-icon-btn:hover { background: var(--bb-surface-2); border-color: var(--bb-line-strong); }
.bb-link { background: none; border: 0; padding: 0; color: var(--bb-primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 13px; }
.bb-link.danger { color: var(--bb-no); }
.bb-input {
	width: 100%; min-height: 42px; padding: 9px 12px; font: inherit; color: var(--bb-text);
	background: var(--bb-surface); border: 1px solid var(--bb-line); border-radius: 10px;
	transition: border-color .15s, box-shadow .15s;
}
.bb-input:focus { outline: none; border-color: var(--bb-primary); box-shadow: 0 0 0 3px rgba(var(--bb-primary-rgb), .18); }
.bb-input.is-invalid { border-color: var(--bb-no); }
textarea.bb-input { resize: vertical; }
:focus-visible { outline: 2px solid rgba(var(--bb-primary-rgb), .6); outline-offset: 2px; }
.bb-label { display: block; font-size: 12px; font-weight: 600; color: var(--bb-muted); margin-bottom: 12px; }
.bb-label .bb-input { margin-top: 5px; }
.bb-check { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 8px 0; }
.bb-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--bb-primary); }
.bb-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.bb-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bb-form-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.bb-form-foot .bb-link { margin-inline-end: auto; }

/* switch */
.bb-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.bb-switch input { position: absolute; opacity: 0; pointer-events: none; }
.bb-switch-ui { position: relative; width: 40px; height: 23px; border-radius: 999px; background: var(--bb-line-strong); transition: background .2s; flex-shrink: 0; }
.bb-switch-ui::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.bb-switch input:checked + .bb-switch-ui { background: var(--bb-primary); }
.bb-switch input:checked + .bb-switch-ui::after { transform: translateX(17px); }
[dir="rtl"] .bb-switch input:checked + .bb-switch-ui::after { transform: translateX(-17px); }
.bb-switch input:focus-visible + .bb-switch-ui { box-shadow: 0 0 0 3px rgba(var(--bb-primary-rgb), .25); }

/* segmented */
.bb-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bb-surface-2); border: 1px solid var(--bb-line); border-radius: 12px; }
.bb-seg label { cursor: pointer; }
.bb-seg input { position: absolute; opacity: 0; pointer-events: none; }
.bb-seg span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--bb-muted); transition: background .15s, color .15s; }
.bb-seg span .bb-ico { width: 16px; height: 16px; }
.bb-seg input:checked + span { background: var(--bb-surface); color: var(--bb-text); box-shadow: var(--bb-shadow); }
.bb-seg input:focus-visible + span { outline: 2px solid rgba(var(--bb-primary-rgb), .5); }

/* badges & chips */
.bb-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; white-space: nowrap; }
.bb-badge.st-pending { background: var(--bb-warn-bg); color: var(--bb-warn-fg); }
.bb-badge.st-approved, .bb-badge.pay-paid { background: var(--bb-ok-bg); color: var(--bb-ok-fg); }
.bb-badge.st-rejected, .bb-badge.st-canceled, .bb-badge.pay-unpaid { background: var(--bb-no-bg); color: var(--bb-no-fg); }
.bb-badge.st-no-show { background: var(--bb-surface-2); color: var(--bb-muted); border: 1px solid var(--bb-line); }
.bb-badge.pay-partial { background: var(--bb-warn-bg); color: var(--bb-warn-fg); }
.bb-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; line-height: 19px; text-align: center; background: var(--bb-line); color: var(--bb-text); font-weight: 700; }
.bb-count.hot { background: var(--bb-warn-bg); color: var(--bb-warn-fg); }
.bb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.bb-chip {
	display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
	border: 1px solid var(--bb-line); background: var(--bb-surface); color: var(--bb-text);
	font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.bb-chip .bb-ico { width: 16px; height: 16px; }
.bb-chip:hover { border-color: var(--bb-line-strong); }
.bb-chip.wa { color: #16a34a; }
.bb-chip.primary { background: rgba(var(--bb-primary-rgb), .1); border-color: transparent; color: var(--bb-primary); }
.bb-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.bb-avatar {
	display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
	font-weight: 800; font-size: 15px; color: hsl(var(--h) 60% 35%); background: hsl(var(--h) 70% 92%);
}
[data-theme="dark"] .bb-avatar { color: hsl(var(--h) 80% 80%); background: hsl(var(--h) 40% 22%); }

/* ---------- toast / loading / empty ---------- */
.bb-toast {
	position: fixed; left: 16px; right: 16px; bottom: 24px; z-index: 2000; margin-inline: auto;
	display: flex; align-items: center; gap: 8px; width: max-content; max-width: min(520px, calc(100% - 32px));
	padding: 11px 16px; border-radius: 12px; background: #0f172a; color: #fff; font-weight: 600; box-shadow: var(--bb-shadow-lg);
	transform: translateY(16px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.bb-toast.show { opacity: 1; transform: translateY(0); }
.bb-toast.ok { background: #166534; }
.bb-toast.err { background: #991b1b; }
.bb-loading { display: flex; justify-content: center; padding: 48px 0; }
.bb-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--bb-line); border-top-color: var(--bb-primary); animation: bb-spin .8s linear infinite; }
@keyframes bb-spin { to { transform: rotate(360deg); } }
.bb-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; text-align: center; color: var(--bb-muted); }
.bb-empty .bb-ico { width: 28px; height: 28px; opacity: .6; }
.bb-empty p { margin: 0; }
.bb-warn { display: flex; gap: 8px; align-items: flex-start; background: var(--bb-warn-bg); color: var(--bb-warn-fg); padding: 10px 12px; border-radius: 10px; font-size: 13px; }

/* =====================================================================
 * Login
 * ===================================================================== */
.bb-login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.bb-login-hero {
	position: relative; overflow: hidden; color: #fff; padding: 48px;
	background: radial-gradient(1200px 600px at 10% -10%, rgba(255,255,255,.18), transparent 60%),
		linear-gradient(140deg, var(--bb-primary) 0%, color-mix(in srgb, var(--bb-primary) 55%, #0f172a) 100%);
}
.bb-hero-glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; inset-inline-end: -160px; bottom: -200px; background: rgba(255,255,255,.08); filter: blur(10px); }
.bb-hero-inner { position: relative; height: 100%; display: flex; flex-direction: column; gap: 36px; max-width: 520px; }
.bb-hero-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; }
.bb-hero-brand img { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; background: #fff; padding: 4px; }
.bb-hero-copy { margin-top: auto; }
.bb-hero-copy h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.12; margin: 0 0 12px; letter-spacing: -.02em; }
html[lang="ar"] .bb-hero-copy h2 { letter-spacing: 0; line-height: 1.3; }
.bb-hero-copy p { font-size: 17px; opacity: .85; margin: 0 0 24px; }
.bb-hero-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.bb-hero-list li { display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 15px; }
.bb-hero-tick { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.18); }
.bb-hero-tick .bb-ico { width: 16px; height: 16px; }
.bb-hero-mock { display: grid; gap: 10px; max-width: 380px; }
.bb-mock-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(6px); }
.bb-mock-card:nth-child(2) { margin-inline-start: 28px; }
.bb-mock-card b { font-size: 14px; min-width: 44px; }
.bb-mock-line { height: 8px; border-radius: 99px; background: rgba(255,255,255,.4); }
.bb-mock-line.w70 { width: 55%; } .bb-mock-line.w50 { width: 40%; } .bb-mock-line.w60 { width: 48%; }
.bb-mock-pill { margin-inline-start: auto; width: 54px; height: 18px; border-radius: 99px; }
.bb-mock-pill.ok { background: #86efac; } .bb-mock-pill.wait { background: #fcd34d; }
.bb-hero-foot { margin: 0; font-size: 13px; opacity: .7; }

.bb-login-panel { min-width: 0; display: flex; flex-direction: column; padding: 24px clamp(20px, 5vw, 64px); background: var(--bb-surface); }
.bb-login-top { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.bb-lang-pills { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--bb-line); border-radius: 12px; color: var(--bb-muted); }
.bb-lang-pills .bb-ico { width: 18px; height: 18px; margin: 0 6px; }
.bb-lang-pills a { padding: 6px 10px; border-radius: 8px; font-weight: 700; font-size: 12px; color: var(--bb-muted); text-decoration: none; }
.bb-lang-pills a:hover { color: var(--bb-text); }
.bb-lang-pills a.is-active { background: var(--bb-primary); color: #fff; }
.bb-login-form { min-width: 0; width: 100%; max-width: 400px; margin: auto; padding: 32px 0; }
.bb-login-mobile-brand { display: none; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; margin-bottom: 24px; }
.bb-login-mobile-brand img { width: 40px; height: 40px; border-radius: 11px; object-fit: contain; }
.bb-login-form h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -.02em; }
html[lang="ar"] .bb-login-form h1 { letter-spacing: 0; }
.bb-login-sub { color: var(--bb-muted); margin: 0 0 26px; font-size: 15px; }
.bb-field { display: block; margin-bottom: 16px; }
.bb-field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.bb-input-wrap {
	display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 50px;
	background: var(--bb-surface-2); border: 1px solid var(--bb-line); border-radius: 12px;
	transition: border-color .15s, box-shadow .15s, background .15s;
}
.bb-input-wrap:focus-within { border-color: var(--bb-primary); background: var(--bb-surface); box-shadow: 0 0 0 4px rgba(var(--bb-primary-rgb), .15); }
.bb-input-wrap > .bb-ico { color: var(--bb-muted); width: 19px; height: 19px; }
.bb-input-wrap input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--bb-text); font: inherit; font-size: 16px; }
.bb-input-wrap input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--bb-surface-2) inset; -webkit-text-fill-color: var(--bb-text); }
.bb-eye {
	display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-inline-end: -6px;
	border: 0; border-radius: 9px; background: transparent; color: var(--bb-muted); cursor: pointer;
}
.bb-eye:hover { background: var(--bb-line); color: var(--bb-text); }
.bb-eye .bb-eye-closed { display: none; }
.bb-eye.is-on { color: var(--bb-primary); }
.bb-eye.is-on .bb-eye-open { display: none; }
.bb-eye.is-on .bb-eye-closed { display: inline-flex; }
.bb-eye span { display: inline-flex; }
.bb-caps { display: block; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--bb-warn-fg); }
.bb-caps[hidden] { display: none; }
.bb-login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 22px; flex-wrap: wrap; }
.bb-login-row .bb-switch { font-size: 14px; }
.bb-forgot { font-size: 14px; font-weight: 600; text-decoration: none; }
.bb-login-form .bb-submit { height: 50px; font-size: 16px; border-radius: 12px; }
.bb-alert { display: flex; gap: 10px; align-items: flex-start; background: var(--bb-no-bg); color: var(--bb-no-fg); padding: 12px 14px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; }
.bb-shake { animation: bb-shake .35s; }
@keyframes bb-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.bb-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.bb-auth-card { width: 100%; max-width: 400px; background: var(--bb-surface); border: 1px solid var(--bb-line); border-radius: 20px; padding: 32px 26px; box-shadow: var(--bb-shadow); }
.bb-auth-card h1 { margin: 14px 0 6px; font-size: 24px; }
.bb-logo { border-radius: 14px; }

@media (max-width: 900px) {
	.bb-login { grid-template-columns: minmax(0, 1fr); }
	.bb-login-hero { display: none; }
	.bb-login-mobile-brand { display: flex; }
	.bb-login-panel { min-height: 100vh; min-height: 100dvh; background: var(--bb-bg); padding-top: max(20px, env(safe-area-inset-top)); }
	.bb-login-form { background: var(--bb-surface); border: 1px solid var(--bb-line); border-radius: 22px; padding: 28px 22px; box-shadow: var(--bb-shadow); margin: 24px auto; }
	.bb-login-form h1 { font-size: 26px; }
}

/* =====================================================================
 * App layout – a fixed shell pinned to the visible screen.
 * Header and bottom bar never move; only .bb-view scrolls.
 * ===================================================================== */
.bb-layout {
	position: fixed; left: 0; right: 0; top: var(--bb-vt, 0px); height: var(--bb-vh, 100%);
	display: flex; overflow: hidden;
}
.bb-side {
	height: 100%; overflow-y: auto; width: var(--bb-side-w); flex-shrink: 0;
	display: flex; flex-direction: column; gap: 6px; padding: 18px 14px;
	background: var(--bb-surface); border-inline-end: 1px solid var(--bb-line);
}
.bb-side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; font-weight: 800; font-size: 17px; color: var(--bb-text); text-decoration: none; }
.bb-side-brand img { width: 36px; height: 36px; border-radius: 10px; object-fit: contain; }
.bb-side-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-nav { display: flex; flex-direction: column; gap: 2px; }
.bb-nav-link {
	position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
	color: var(--bb-muted); font-weight: 600; text-decoration: none; transition: background .15s, color .15s;
}
.bb-nav-link:hover { background: var(--bb-surface-2); color: var(--bb-text); }
.bb-nav-link.active { background: rgba(var(--bb-primary-rgb), .1); color: var(--bb-primary); }
.bb-nav-badge { margin-inline-start: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 800; font-style: normal; line-height: 19px; text-align: center; }
.bb-nav-badge[hidden] { display: none; }
.bb-side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--bb-line); }
.bb-user-img { width: 36px; height: 36px; border-radius: 50%; }
.bb-user-txt { min-width: 0; flex: 1; }
.bb-user-txt b, .bb-user-txt small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-user-txt small { color: var(--bb-muted); font-size: 12px; }

.bb-main { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; }
.bb-top {
	flex: none; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 14px 28px; padding-top: max(14px, env(safe-area-inset-top));
	background: var(--bb-surface); border-bottom: 1px solid var(--bb-line);
}
.bb-top-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bb-top-title h1 { margin: 0; font-size: 22px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.bb-top-logo { display: none; width: 32px; height: 32px; border-radius: 9px; object-fit: contain; }
.bb-top-actions { display: flex; align-items: center; gap: 8px; }
.bb-lang { position: relative; display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--bb-line); border-radius: 10px; background: var(--bb-surface); color: var(--bb-muted); padding-inline-start: 9px; }
.bb-lang .bb-ico { width: 17px; height: 17px; pointer-events: none; }
.bb-lang select { appearance: none; border: 0; background: transparent; color: var(--bb-text); font: inherit; font-weight: 600; font-size: 13px; padding: 0 12px 0 6px; height: 100%; cursor: pointer; outline: none; }
.bb-lang select option { color: #0f172a; }
.bb-view {
	flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
	overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
	padding: 24px max(28px, calc((100% - 1440px) / 2)) 48px;
}
.bb-enter { animation: bb-in .22s ease-out; }
@keyframes bb-in { from { opacity: 0; transform: translateY(6px); } }

.bb-bottom {
	display: none; flex: none; z-index: 50;
	padding: 6px 6px max(6px, env(safe-area-inset-bottom));
	background: var(--bb-surface); border-top: 1px solid var(--bb-line);
}
.bb-bottom .bb-nav-link { flex: 1; flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 11px; justify-content: center; text-align: center; }
.bb-bottom .bb-nav-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bb-bottom .bb-nav-link.active { background: transparent; }
.bb-bottom .bb-nav-badge { position: absolute; top: 2px; inset-inline-start: calc(50% + 6px); margin: 0; }
/* While the keyboard is open the bottom bar steps aside instead of riding up with it. */
html.bb-kb .bb-bottom { display: none !important; }

/* Rotate-your-phone screen (portrait only on phones). */
.bb-rotate { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
	.bb-rotate {
		display: flex; position: fixed; inset: 0; z-index: 5000; flex-direction: column; align-items: center; justify-content: center;
		gap: 14px; padding: 24px; text-align: center; background: var(--bb-bg); color: var(--bb-text); font-weight: 600;
	}
	.bb-rotate .bb-ico { width: 56px; height: 56px; color: var(--bb-primary); animation: bb-turn 2s ease-in-out infinite; }
	.bb-rotate p { margin: 0; max-width: 320px; }
}
@keyframes bb-turn { 0%, 25% { transform: rotate(-90deg); } 65%, 100% { transform: rotate(0); } }

/* ---------- panels ---------- */
.bb-panel { background: var(--bb-surface); border: 1px solid var(--bb-line); border-radius: var(--bb-radius); padding: 18px; box-shadow: var(--bb-shadow); margin-bottom: 18px; }
.bb-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.bb-panel h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 800; }
.bb-panel h3 .bb-ico { width: 18px; height: 18px; color: var(--bb-muted); }
.bb-section-title { font-size: 15px; margin: 22px 0 6px; }

/* ---------- dashboard ---------- */
.bb-hello h2 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.bb-hello p { margin: 2px 0 18px; color: var(--bb-muted); }
.bb-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.bb-kpi {
	display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; text-align: start;
	background: var(--bb-surface); border: 1px solid var(--bb-line); border-radius: var(--bb-radius); box-shadow: var(--bb-shadow);
	color: var(--bb-text); font: inherit; cursor: pointer; transition: transform .15s, border-color .15s;
}
.bb-kpi:not(:disabled):hover { transform: translateY(-2px); border-color: var(--bb-line-strong); }
.bb-kpi:disabled { cursor: default; opacity: 1; }
.bb-kpi-ico { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; }
.bb-kpi-txt small { display: block; color: var(--bb-muted); font-weight: 600; font-size: 12px; }
.bb-kpi-txt b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; word-break: break-word; }
.bb-kpi-txt em { display: block; font-style: normal; font-size: 12px; color: var(--bb-muted); }
.tone-blue .bb-kpi-ico { background: #dbeafe; color: #1d4ed8; }
.tone-amber .bb-kpi-ico { background: #fef3c7; color: #b45309; }
.tone-violet .bb-kpi-ico { background: #ede9fe; color: #6d28d9; }
.tone-green .bb-kpi-ico { background: #dcfce7; color: #15803d; }
.tone-red .bb-kpi-ico { background: #fee2e2; color: #b91c1c; }
.tone-teal .bb-kpi-ico { background: #ccfbf1; color: #0f766e; }
.tone-gray .bb-kpi-ico { background: var(--bb-surface-2); color: var(--bb-muted); }
[data-theme="dark"] .bb-kpi-ico { background: rgba(255,255,255,.06) !important; }
.bb-kpi.is-hot { border-color: #fcd34d; box-shadow: 0 0 0 3px rgba(252, 211, 77, .25); }
.bb-dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.bb-dash-grid .bb-panel { margin: 0; }
.bb-span2 { grid-column: 1 / -1; }
.bb-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.bb-week-day { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border: 0; background: none; color: var(--bb-text); border-radius: 12px; cursor: pointer; font: inherit; }
.bb-week-day:hover { background: var(--bb-surface-2); }
.bb-week-n { font-weight: 800; font-size: 13px; }
.bb-week-bar { display: flex; align-items: flex-end; width: 100%; max-width: 44px; height: 90px; border-radius: 10px; background: var(--bb-surface-2); overflow: hidden; }
.bb-week-bar i { display: block; width: 100%; border-radius: 10px; background: rgba(var(--bb-primary-rgb), .35); transition: height .4s; }
.bb-week-day.is-today .bb-week-bar i { background: var(--bb-primary); }
.bb-week-l { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--bb-muted); font-weight: 600; }
.bb-week-l small { font-size: 15px; color: var(--bb-text); font-weight: 800; }

.bb-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.bb-row + .bb-row { border-top: 1px solid var(--bb-line); border-radius: 0; }
.bb-row:hover { background: var(--bb-surface-2); border-radius: 12px; }
.bb-row-time { min-width: 56px; }
.bb-row-time b { display: block; font-size: 15px; }
.bb-row-time small { color: var(--bb-muted); font-size: 11px; white-space: nowrap; }
.bb-row-bar { width: 4px; align-self: stretch; border-radius: 4px; flex-shrink: 0; }
.bb-row-main { flex: 1; min-width: 0; }
.bb-row-main b, .bb-row-main small { unicode-bidi: plaintext; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-row-main small { color: var(--bb-muted); font-size: 12px; }
.bb-row-end { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.bb-due { color: var(--bb-no); font-weight: 800; }

/* ---------- bookings ---------- */
.bb-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.bb-tabs::-webkit-scrollbar { display: none; }
.bb-tab { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--bb-line); background: var(--bb-surface); border-radius: 999px; padding: 8px 15px; font: inherit; font-weight: 700; font-size: 13px; color: var(--bb-muted); cursor: pointer; }
.bb-tab.active { background: var(--bb-text); border-color: var(--bb-text); color: var(--bb-bg); }
.bb-tab.active .bb-count { background: rgba(127,127,127,.3); color: inherit; }
.bb-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-items: center; }
.bb-filters .bb-input { width: auto; }
.bb-search { position: relative; flex: 1 1 240px; display: flex; align-items: center; }
.bb-search .bb-ico { position: absolute; inset-inline-start: 12px; width: 18px; height: 18px; color: var(--bb-muted); pointer-events: none; }
.bb-search .bb-input { width: 100%; padding-inline-start: 38px; }
.bb-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--bb-muted); font-weight: 600; }
.bb-day { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--bb-muted); margin: 22px 0 10px; font-weight: 800; }
html[lang="ar"] .bb-day { letter-spacing: 0; font-size: 13px; }
.bb-day:first-child { margin-top: 0; }
.bb-today { display: inline-block; background: rgba(var(--bb-primary-rgb), .12); color: var(--bb-primary); border-radius: 999px; padding: 1px 9px; font-size: 11px; margin-inline-start: 6px; letter-spacing: 0; }
.bb-card {
	display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
	background: var(--bb-surface); border: 1px solid var(--bb-line); border-inline-start: 4px solid var(--bb-line-strong);
	border-radius: var(--bb-radius); padding: 13px 15px; margin-bottom: 9px; cursor: pointer; box-shadow: var(--bb-shadow);
	transition: transform .15s, border-color .15s;
}
.bb-card:hover { transform: translateY(-1px); }
.bb-card.st-pending { border-inline-start-color: #f59e0b; }
.bb-card.st-approved { border-inline-start-color: var(--bb-ok); }
.bb-card.st-rejected, .bb-card.st-canceled { border-inline-start-color: var(--bb-no); opacity: .72; }
.bb-card-time b { display: block; font-size: 17px; font-weight: 800; }
.bb-card-time span { color: var(--bb-muted); font-size: 12px; }
.bb-card-name, .bb-client-main b, .bb-detail-id b, .bb-cal-chip { unicode-bidi: plaintext; }
.bb-card-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-weight: 800; font-size: 15px; }
.bb-card-meta, .bb-card-contact { color: var(--bb-muted); font-size: 13px; margin-top: 3px; }
.bb-card-contact a { text-decoration: none; }
.bb-card-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bb-more { text-align: center; margin: 18px 0; }

/* ---------- calendar ---------- */
.bb-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.bb-cal-nav { display: flex; align-items: center; gap: 10px; }
.bb-cal-nav h2 { margin: 0; font-size: 20px; min-width: 170px; text-align: center; text-transform: capitalize; }
.bb-cal { background: var(--bb-surface); border: 1px solid var(--bb-line); border-radius: var(--bb-radius); box-shadow: var(--bb-shadow); overflow: hidden; }
.bb-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.bb-cal-wd { padding: 10px 6px; text-align: center; font-size: 12px; font-weight: 700; color: var(--bb-muted); border-bottom: 1px solid var(--bb-line); text-transform: capitalize; }
.bb-cal-cell {
	position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 108px; padding: 7px;
	border: 0; border-inline-end: 1px solid var(--bb-line); border-bottom: 1px solid var(--bb-line);
	background: var(--bb-surface); color: var(--bb-text); font: inherit; text-align: start; cursor: pointer; transition: background .15s;
}
.bb-cal-cell:nth-child(7n) { border-inline-end: 0; }
.bb-cal-cell:hover { background: var(--bb-surface-2); }
.bb-cal-cell.is-out { background: var(--bb-surface-2); cursor: default; }
.bb-cal-num { font-weight: 700; font-size: 13px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.bb-cal-cell.is-today .bb-cal-num { background: var(--bb-primary); color: #fff; }
.bb-cal-cell.is-selected { box-shadow: inset 0 0 0 2px var(--bb-primary); }
.bb-cal-count { position: absolute; top: 8px; inset-inline-end: 8px; font-size: 11px; font-weight: 800; color: var(--bb-muted); }
.bb-cal-count.has-pending { color: #d97706; }
.bb-cal-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bb-cal-chip { display: block; font-style: normal; font-size: 11px; padding: 2px 6px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: color-mix(in srgb, var(--c) 16%, transparent); border-inline-start: 3px solid var(--c); }
.bb-cal-chip.st-pending { background: var(--bb-warn-bg); border-inline-start-color: #f59e0b; }
.bb-cal-chip.st-rejected, .bb-cal-chip.st-canceled { opacity: .5; text-decoration: line-through; }
.bb-cal-more { font-style: normal; font-size: 11px; color: var(--bb-muted); font-weight: 700; padding: 0 4px; }
.bb-cal-dots { display: none; gap: 3px; justify-content: center; }
.bb-cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--bb-ok); }
.bb-cal-dots i.st-pending { background: #f59e0b; }
.bb-cal-day { margin-top: 18px; }
.bb-cal-day > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.bb-cal-day h3 { margin: 0; font-size: 16px; }

/* ---------- clients ---------- */
.bb-clients { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.bb-client {
	display: flex; align-items: center; gap: 14px; padding: 12px 15px; background: var(--bb-surface);
	border: 1px solid var(--bb-line); border-radius: var(--bb-radius); color: var(--bb-text); text-decoration: none; box-shadow: var(--bb-shadow);
	transition: transform .15s;
}
.bb-client:hover { transform: translateY(-1px); }
.bb-client-main { flex: 1; min-width: 0; }
.bb-client-main b, .bb-client-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-client-main small { color: var(--bb-muted); font-size: 13px; }
.bb-client-stats { display: flex; align-items: center; gap: 18px; text-align: center; }
.bb-client-stats b { display: block; font-size: 15px; }
.bb-client-stats small { color: var(--bb-muted); font-size: 11px; }
.bb-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; margin-bottom: 14px; }
[dir="rtl"] .bb-back .bb-ico { transform: scaleX(-1); }
.bb-client-id { display: flex; align-items: center; gap: 14px; }
.bb-client-id h2 { margin: 0; font-size: 22px; }
.bb-client-id p { margin: 2px 0 0; }
.bb-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 16px; }
.bb-tiles > div { background: var(--bb-surface-2); border: 1px solid var(--bb-line); border-radius: 12px; padding: 12px; }
.bb-tiles small { display: block; color: var(--bb-muted); font-size: 12px; font-weight: 600; }
.bb-tiles b { font-size: 19px; }
.bb-tiles .is-due b { color: var(--bb-no); }

/* ---------- settings ---------- */
.bb-settings { max-width: 860px; }
.bb-set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--bb-line); flex-wrap: wrap; }
.bb-panel > header + .bb-set-row, .bb-form > .bb-set-row:first-child { border-top: 0; padding-top: 4px; }
.bb-set-row > div:first-child b { display: block; }
.bb-set-row small, .bb-switch-row small { display: block; color: var(--bb-muted); font-size: 13px; }
.bb-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--bb-line); cursor: pointer; }
.bb-switch-row b { display: block; }
.bb-me { display: flex; align-items: center; gap: 12px; }
.bb-me img { width: 42px; height: 42px; border-radius: 50%; }
.bb-logo-edit { display: flex; align-items: center; gap: 10px; }
.bb-logo-edit img { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; background: var(--bb-surface-2); border: 1px solid var(--bb-line); padding: 4px; }
.bb-logo-edit label { cursor: pointer; }
.bb-swatches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bb-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--bb-surface); box-shadow: 0 0 0 1px var(--bb-line-strong); cursor: pointer; }
.bb-swatch.on { box-shadow: 0 0 0 2px var(--bb-text); }
.bb-swatches input[type="color"] { width: 38px; height: 34px; padding: 0; border: 1px solid var(--bb-line); border-radius: 9px; background: none; cursor: pointer; }

/* ---------- modal ---------- */
.bb-modal[hidden] { display: none; }
.bb-modal { position: fixed; left: 0; right: 0; top: var(--bb-vt, 0px); height: var(--bb-vh, 100%); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.bb-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, .55); backdrop-filter: blur(3px); animation: bb-fade .2s; }
.bb-dialog {
	position: relative; display: flex; flex-direction: column; width: min(660px, calc(100vw - 32px)); max-height: calc(var(--bb-vh, 100vh) - 48px);
	background: var(--bb-surface); border: 1px solid var(--bb-line); border-radius: 20px; box-shadow: var(--bb-shadow-lg); animation: bb-pop .22s ease-out;
}
.bb-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--bb-line); }
.bb-dialog-head h2 { margin: 0; font-size: 17px; }
.bb-dialog-head .bb-icon-btn { border: 0; }
.bb-dialog-body { min-width: 0; overflow-x: hidden; padding: 18px 20px 22px; overflow-y: auto; overscroll-behavior: contain; }
@keyframes bb-fade { from { opacity: 0; } }
@keyframes bb-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.bb-detail-top { display: flex; align-items: center; gap: 14px; }
.bb-detail-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bb-detail-id b { font-size: 20px; }
.bb-detail-id > span { color: var(--bb-muted); font-size: 13px; }
.bb-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.bb-grid { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; margin: 6px 0 12px; }
.bb-grid dt { color: var(--bb-muted); }
.bb-grid dd { margin: 0; font-weight: 600; word-break: break-word; }
.bb-sec { border-top: 1px solid var(--bb-line); padding-top: 16px; margin-top: 16px; }
.bb-sec h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--bb-muted); }
html[lang="ar"] .bb-sec h4 { letter-spacing: 0; font-size: 13px; }
.bb-sec h4 .bb-ico { width: 16px; height: 16px; }
.bb-sec > .bb-input { margin: 8px 0; }
.bb-btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.bb-inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bb-sm-input { width: 110px; min-height: 34px; padding: 6px 10px; }
.bb-pay { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.bb-pay > div { background: var(--bb-surface-2); border: 1px solid var(--bb-line); border-radius: 12px; padding: 10px 12px; }
.bb-pay small { display: block; color: var(--bb-muted); font-size: 12px; font-weight: 600; }
.bb-pay b { font-size: 17px; }
.bb-pay b.ok { color: var(--bb-ok); }
.bb-pay b.no { color: var(--bb-no); }
.bb-notify { background: var(--bb-surface-2); border: 1px solid var(--bb-line); border-radius: 14px; padding: 12px 14px; }
.bb-notes { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.bb-notes li { background: var(--bb-warn-bg); border-radius: 12px; padding: 10px 12px; }
.bb-note-text { color: var(--bb-text); }
.bb-note-meta { font-size: 12px; color: var(--bb-muted); margin-top: 4px; }
.bb-detail-foot { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ---------- print receipt ---------- */
.bb-print { display: none; }
@media print {
	@page { margin: 14mm; }
	html, body.bb-printing { background: #fff !important; height: auto !important; overflow: visible !important; }
	body.bb-printing .bb-layout, body.bb-printing .bb-modal, body.bb-printing .bb-toast { display: none !important; }
	body.bb-printing .bb-print { display: block; color: #0f172a; font-size: 13px; }
}
.bb-receipt header { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 3px solid var(--bb-primary); }
.bb-receipt header img { width: 64px; height: 64px; object-fit: contain; }
.bb-receipt header h1 { margin: 0; font-size: 22px; }
.bb-receipt header p { margin: 2px 0 0; color: #64748b; }
.bb-r-meta { margin-inline-start: auto; text-align: end; display: flex; flex-direction: column; }
.bb-r-meta b { font-size: 18px; text-transform: uppercase; color: var(--bb-primary); }
.bb-r-client { display: flex; flex-direction: column; margin: 20px 0; }
.bb-r-client small { color: #64748b; text-transform: uppercase; font-size: 11px; font-weight: 700; }
.bb-r-client b { font-size: 17px; }
.bb-receipt table { width: 100%; border-collapse: collapse; }
.bb-receipt th { background: #f1f5f9; text-align: start; padding: 9px 10px; font-size: 12px; }
.bb-receipt td { padding: 10px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.bb-r-totals { margin-inline-start: auto; width: 260px; margin-top: 16px; }
.bb-r-totals div { display: flex; justify-content: space-between; padding: 6px 0; }
.bb-r-totals .grand { border-top: 2px solid #0f172a; font-size: 16px; margin-top: 4px; padding-top: 8px; }
.bb-r-status { margin-top: 18px; color: #475569; }
.bb-receipt footer { margin-top: 36px; text-align: center; color: #64748b; font-style: italic; }

/* Big screens: calendar and the chosen day side by side. */
@media (min-width: 1400px) {
	.bb-cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
	.bb-cal-day { margin-top: 0; padding-top: 52px; }
	.bb-cal-day .bb-card { grid-template-columns: 54px 1fr; }
	.bb-cal-day .bb-card-actions { grid-column: 1 / -1; }
	.bb-cal-day .bb-card-actions .bb-btn { flex: 1; }
	.bb-cal-cell { min-height: 118px; }
}

/* =====================================================================
 * Responsive
 * ===================================================================== */
@media (max-width: 1180px) {
	.bb-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.bb-side { display: none; }
	.bb-bottom { display: flex; }
	.bb-top { background: var(--bb-surface); }
	.bb-top { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
	.bb-top-title h1 { font-size: 18px; }
	.bb-top-logo { display: block; }
	.bb-new span { display: none; }
	.bb-new { width: 38px; height: 38px; padding: 0; }
	.bb-view { padding: 16px 16px 28px; }
	.bb-dash-grid { grid-template-columns: minmax(0, 1fr); }
	.bb-cal-cell { min-height: 58px; padding: 5px 3px; align-items: center; }
	.bb-cal-chips, .bb-cal-count { display: none; }
	.bb-cal-dots { display: flex; }
	.bb-cal-nav h2 { font-size: 17px; min-width: 130px; }
	.bb-hide-sm { display: none; }
}
@media (max-width: 640px) {
	.bb-week { gap: 3px; }
	.bb-week-bar { height: 70px; }
	.bb-panel { padding: 14px; }
	body.bb-body { font-size: 15px; }
	.bb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.bb-kpi { padding: 13px; gap: 10px; }
	.bb-kpi-txt b { font-size: 19px; }
	.bb-card { grid-template-columns: 54px 1fr; }
	.bb-card-actions { grid-column: 1 / -1; }
	.bb-card-actions .bb-btn { flex: 1; }
	.bb-filters .bb-input, .bb-mini { flex: 1 1 45%; }
	.bb-mini .bb-input { width: 100%; }
	.bb-row2, .bb-row3 { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.bb-lang select { width: 0; padding: 0; position: absolute; inset: 0; width: 100%; opacity: 0; }
	.bb-lang { width: 38px; justify-content: center; padding: 0; }
	.bb-modal { align-items: flex-end; }
	.bb-dialog { width: 100%; max-height: calc(var(--bb-vh, 100vh) - 24px); border-radius: 22px 22px 0 0; animation: bb-sheet .25s ease-out; }
	.bb-dialog-body { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
	.bb-grid { grid-template-columns: 100px 1fr; }
	.bb-client-stats { gap: 10px; }
	.bb-row-end .bb-btn span { display: none; }
	.bb-tiles b, .bb-pay b { font-size: 15px; }
	.bb-input, .bb-input-wrap input { font-size: 16px; }
	.bb-toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
	html.bb-kb .bb-toast { bottom: 12px; }
}
@keyframes bb-sheet { from { transform: translateY(40px); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- push notifications ---------- */
.bb-push-banner {
	display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 14px 16px;
	border-radius: var(--bb-radius); border: 1px solid rgba(var(--bb-primary-rgb), .25);
	background: linear-gradient(135deg, rgba(var(--bb-primary-rgb), .12), rgba(var(--bb-primary-rgb), .04));
}
.bb-push-ico { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; background: var(--bb-primary); color: #fff; flex-shrink: 0; }
.bb-push-ico .bb-ico { animation: bb-ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes bb-ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-4deg); } }
.bb-push-txt { flex: 1; min-width: 0; }
.bb-push-txt b { display: block; }
.bb-push-txt small { display: block; color: var(--bb-muted); font-size: 13px; }
.bb-push-x { border: 0; background: transparent; }
.bb-push-help { margin: -4px 0 14px; }
.bb-push-status { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 0 12px; }
.bb-push-status.on { color: var(--bb-ok); }
.bb-push-devices { margin: 10px 0 0; font-size: 13px; }
@media (max-width: 640px) {
	.bb-push-banner { flex-wrap: wrap; }
	.bb-push-banner .bb-btn { order: 3; width: 100%; }
	.bb-push-x { position: absolute; }
	.bb-push-banner { position: relative; padding-inline-end: 44px; }
	.bb-push-x { top: 8px; inset-inline-end: 8px; }
}

/* ---------- live / offline / delivery status ---------- */
.bb-offline { display: flex; align-items: center; gap: 8px; margin: 12px 28px 0; padding: 10px 14px; border-radius: 12px; background: var(--bb-warn-bg); color: var(--bb-warn-fg); font-weight: 600; font-size: 13px; }
.bb-offline[hidden] { display: none; }
@media (max-width: 900px) { .bb-offline { margin: 10px 16px 0; } }
.bb-diag { margin-top: 16px; border-top: 1px solid var(--bb-line); padding-top: 12px; }
.bb-diag summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; color: var(--bb-muted); list-style: none; }
.bb-diag summary::-webkit-details-marker { display: none; }
.bb-diag summary .bb-ico { width: 16px; height: 16px; }
.bb-diag[open] summary { margin-bottom: 12px; }
.bb-diag .bb-grid { grid-template-columns: minmax(120px, 210px) 1fr; }
.bb-diag dd.ok { color: var(--bb-ok); }
.bb-diag dd.bad { color: var(--bb-no); }
.bb-diag h5 { margin: 16px 0 8px; font-size: 13px; }
.bb-copy { display: flex; gap: 6px; margin-top: 5px; }
.bb-copy .bb-input { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.bb-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.bb-log li { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bb-surface-2); border: 1px solid var(--bb-line); }
.bb-log-time { color: var(--bb-muted); white-space: nowrap; min-width: 92px; }
.bb-log em { display: block; font-style: normal; color: var(--bb-no); font-size: 12px; word-break: break-word; }
@media (max-width: 640px) { .bb-diag .bb-grid { grid-template-columns: 1fr; } .bb-diag .bb-grid dd { margin-bottom: 6px; } .bb-log li { flex-direction: column; gap: 2px; } }

/* ---------- touch feel ---------- */
@media (hover: none) {
	.bb-card:hover, .bb-client:hover, .bb-kpi:not(:disabled):hover { transform: none; }
	.bb-row:hover, .bb-cal-cell:hover, .bb-week-day:hover, .bb-nav-link:hover { background: inherit; }
	.bb-nav-link.active:hover { background: rgba(var(--bb-primary-rgb), .1); }
	.bb-bottom .bb-nav-link.active:hover { background: transparent; }
}
.bb-card, .bb-row, .bb-kpi, .bb-client, .bb-cal-cell, .bb-week-day, .bb-chip, .bb-tab, .bb-nav-link { transition: transform .12s, background .15s; }
.bb-card:active, .bb-client:active, .bb-kpi:not(:disabled):active, .bb-chip:active, .bb-tab:active { transform: scale(.98); }
.bb-row:active, .bb-cal-cell:active, .bb-week-day:active { background: var(--bb-surface-2); }
.bb-bottom .bb-nav-link:active { transform: scale(.92); }

/* ---------- notification check ---------- */
.bb-push-check { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--bb-surface-2); border: 1px solid var(--bb-line); }
.bb-push-check[hidden] { display: none; }
.bb-push-check h5 { margin: 0 0 10px; font-size: 13px; }
.bb-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bb-steps li { display: flex; gap: 10px; align-items: flex-start; color: var(--bb-muted); }
.bb-steps li b { display: block; color: var(--bb-text); font-weight: 600; }
.bb-steps li small { display: block; font-size: 12px; word-break: break-word; }
.bb-step-ico { flex: none; display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: var(--bb-line); }
.bb-step-ico .bb-ico { width: 14px; height: 14px; }
.bb-steps li.is-ok .bb-step-ico { background: var(--bb-ok-bg); color: var(--bb-ok-fg); }
.bb-steps li.is-fail .bb-step-ico { background: var(--bb-no-bg); color: var(--bb-no-fg); }
.bb-steps li.is-fail small { color: var(--bb-no); }
.bb-steps li.is-wait .bb-step-ico { background: var(--bb-warn-bg); color: var(--bb-warn-fg); }
.bb-steps li.is-wait small { color: var(--bb-warn-fg); }
.bb-spinner.sm { width: 14px; height: 14px; border-width: 2px; }
.bb-check-result { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; font-weight: 600; }
.bb-check-result:empty { display: none; }
.bb-check-result.ok { color: var(--bb-ok); }
.bb-check-result.bad { color: var(--bb-no); }
.bb-check-result.warn { color: var(--bb-warn-fg); }
#bb-push-section > .bb-btnrow { margin-top: 4px; }
.bb-mail-form { margin-top: 14px; border-top: 1px solid var(--bb-line); }
.bb-danger-zone { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--bb-line); }

/* ---------- client app settings (staff side) ---------- */
.bb-copy .bb-btn { flex: none; }
.bb-small { font-size: 13px; }
.bb-small code { padding: 2px 6px; border-radius: 6px; background: var(--bb-surface-2); border: 1px solid var(--bb-line); }
.bb-weekdays { display: flex; margin: 4px 0 6px; }
.bb-weekdays label { flex: 1; }
.bb-weekdays span { justify-content: center; text-transform: capitalize; padding-inline: 4px; }
.bb-seg input[type="checkbox"]:checked + span { background: var(--bb-primary); color: #fff; }
