/* Madafa — "Crystal Clear" theme: frosted glass surfaces floating over a soft aurora. */
:root {
  --bg: #eaf1fb; --surface: rgba(255, 255, 255, .64); --solid: #f7fafe; --ink: #0f1e33; --muted: #5a6a82;
  --line: rgba(130, 155, 190, .26); --hair: rgba(130, 155, 190, .16);
  --brand: #0e7fa0; --brand-ink: #fff; --brand-soft: rgba(14, 165, 200, .11);
  --grad: linear-gradient(135deg, #06b6d4 0%, #3b82f6 55%, #6366f1 100%);
  --glow: 0 8px 22px rgba(59, 130, 246, .32);
  --side-ink: #b6c6dc;
  --blue: #2563eb; --green: #0f9d6b; --gray: #64748b; --red: #e11d48; --amber: #d97706;
  --radius: 16px; --blur: saturate(160%) blur(18px);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 1px 2px rgba(30, 60, 110, .05), 0 12px 32px rgba(30, 60, 110, .09);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif; background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
/* the aurora behind everything */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background:
  radial-gradient(42vw 42vw at 88% -6%, rgba(56, 189, 248, .42), transparent 62%),
  radial-gradient(38vw 38vw at 4% 12%, rgba(167, 139, 250, .34), transparent 60%),
  radial-gradient(46vw 46vw at 70% 105%, rgba(94, 234, 212, .36), transparent 62%),
  radial-gradient(34vw 34vw at 18% 96%, rgba(96, 165, 250, .26), transparent 60%),
  linear-gradient(180deg, #f3f8ff, #e8eff9); }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 24px; margin: 0; letter-spacing: -.2px; } h2 { font-size: 17px; margin: 0 0 10px; } h3 { font-size: 15.5px; margin: 0; } h4 { margin: 16px 0 8px; font-size: 14px; }
small, .muted { color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(56, 189, 248, .3); }
* { scrollbar-width: thin; scrollbar-color: rgba(100, 130, 170, .45) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; } ::-webkit-scrollbar-thumb { background: rgba(100, 130, 170, .4); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }

/* layout */
.shell { display: grid; grid-template-columns: 258px 1fr; min-height: 100vh; }
.sidebar { margin: 12px; margin-inline-end: 0; border-radius: 22px; color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 12px; height: calc(100vh - 24px); overflow: hidden;
  background: linear-gradient(165deg, rgba(14, 30, 58, .93), rgba(15, 44, 82, .9) 55%, rgba(12, 62, 92, .9));
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 18px 40px rgba(15, 35, 70, .28); }
.sidebar::before { content: ''; position: absolute; inset: -30% -40% auto auto; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(56, 189, 248, .35), transparent 65%); pointer-events: none; }
.sidebar > * { position: relative; }
.brand { padding: 20px 20px 14px; font-size: 22px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 11px; }
.brand i { width: 36px; height: 36px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; font-style: normal; font-size: 18px; box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .45); }
.brand img { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 6px 14px rgba(59, 130, 246, .55)); }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; overflow: auto; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px; color: var(--side-ink); font-weight: 500; border: 1px solid transparent; transition: background .18s, color .18s, transform .18s; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; transform: translateX(-2px); }
html[dir=ltr] .nav a:hover { transform: translateX(2px); }
.nav a.active { background: var(--grad); color: #fff; border-color: rgba(255, 255, 255, .22); box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .35); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { padding: 14px 16px; margin: 8px 10px 10px; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); font-size: 13px; }
.side-foot b { color: #fff; display: block; }
/* The user box stays folded to one line; the arrow opens it upwards. */
.sf-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.sf-who { flex: 1; min-width: 0; }
.sf-arrow { flex: none; opacity: .8; transition: transform .2s; }
.side-foot.open .sf-arrow { transform: rotate(180deg); }
.sf-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; }
.sf-dot.on { background: #22c55e; }
.side-foot.open .sf-dot { display: none; }
.sf-more { display: none; }
.side-foot.open .sf-more { display: block; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { margin: 12px 22px 0; padding: 9px 14px; border-radius: 18px; display: flex; align-items: center; gap: 10px; position: sticky; top: 12px; z-index: 20;
  background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid rgba(255, 255, 255, .75); box-shadow: var(--shadow); }
.topbar .grow { flex: 1; }
/* notification bell */
.bell { position: relative; }
.bell-btn { position: relative; padding-inline: 10px; }
.bell-n { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.bell-n[hidden] { display: none; }
.bell-panel { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; background: #fff; color: #0f172a; border-radius: 16px; box-shadow: 0 18px 50px rgba(15, 23, 42, .25); border: 1px solid #e2e8f0; z-index: 60; }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid #eef2f7; position: sticky; top: 0; background: #fff; }
.bell-note { padding: 8px 14px; font-size: 12.5px; color: #b45309; background: #fffbeb; }
.bell-note.ok { color: #15803d; background: #f0fdf4; }
.bell-item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-bottom: 1px solid #f1f5f9; text-decoration: none; color: inherit; }
.bell-item[href]:hover { background: #f8fafc; }
.bell-item.new { background: #eff6ff; }
.bell-ic { font-size: 18px; line-height: 1.3; flex: none; }
.bell-t { flex: 1; min-width: 0; } .bell-t b { display: block; font-size: 13.5px; } .bell-t small { display: block; color: #64748b; font-size: 12.5px; }
.bell-ago { flex: none; color: #94a3b8; font-size: 11.5px; white-space: nowrap; }
.bell-empty { padding: 26px 14px; text-align: center; color: #94a3b8; }
.topbar select { background: rgba(255, 255, 255, .5); }
.content { padding: 22px; max-width: 1500px; width: 100%; }
#page > * { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.banner { margin: 12px 22px 0; padding: 9px 16px; border-radius: 14px; background: rgba(254, 243, 199, .8); color: #92400e; font-weight: 500; border: 1px solid rgba(217, 119, 6, .22); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.banner.red { background: rgba(254, 226, 226, .82); color: #9f1239; border-color: rgba(225, 29, 72, .22); }
.menu-btn { display: none; }

/* elements */
.btn { border: 1px solid rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .62); padding: 7px 15px; border-radius: 11px; cursor: pointer; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(30, 60, 110, .08), 0 0 0 1px var(--line); transition: transform .15s, box-shadow .15s, background .15s, filter .15s; }
.btn:hover { background: rgba(255, 255, 255, .92); transform: translateY(-1px); box-shadow: inset 0 1px 0 #fff, 0 6px 16px rgba(30, 60, 110, .13), 0 0 0 1px rgba(100, 140, 190, .38); }
.btn:active { transform: none; }
.btn.primary { background: var(--grad); border-color: rgba(255, 255, 255, .3); color: var(--brand-ink); box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn.primary:hover { background: var(--grad); filter: brightness(1.08) saturate(1.1); box-shadow: 0 12px 28px rgba(59, 130, 246, .42), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn.danger { color: var(--red); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(225, 29, 72, .28); }
.btn.sm { padding: 4px 11px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 2px 6px; font-weight: 600; border-radius: 6px; }
.link:hover { background: var(--brand-soft); }
.link.danger { color: var(--red); } .link.danger:hover { background: rgba(225, 29, 72, .09); }
.card { background: var(--surface); border: 1px solid rgba(255, 255, 255, .8); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.card.flush { padding: 0; overflow: hidden; }
.card > .card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card.flush > .card-head { padding: 14px 18px; margin: 0; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { background: linear-gradient(120deg, #0f1e33 30%, #1d5fa8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.page-head h1 > * { -webkit-text-fill-color: initial; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; background: var(--surface); border: 1px solid rgba(255, 255, 255, .8); border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: transform .2s, box-shadow .2s; }
.kpi::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); opacity: .85; }
.kpi::after { content: ''; position: absolute; inset: -40px auto auto -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(56, 189, 248, .2), transparent 68%); pointer-events: none; }
.kpi:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 #fff, 0 18px 40px rgba(30, 60, 110, .15); }
.kpi span { color: var(--muted); font-size: 13px; display: block; position: relative; }
.kpi b { font-size: 21.5px; display: block; margin-top: 3px; position: relative; letter-spacing: -.2px; white-space: nowrap; }
.kpi b:not(.neg):not(.pos) { background: linear-gradient(120deg, #0f1e33, #1d5fa8 70%, #0891b2); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.kpi small { font-size: 12.5px; position: relative; }
input, select, textarea { border: 1px solid rgba(120, 145, 180, .38); border-radius: 11px; padding: 7px 11px; background: rgba(255, 255, 255, .72); width: 100%; min-width: 0; box-shadow: inset 0 1px 2px rgba(30, 60, 110, .05); transition: border-color .15s, box-shadow .15s, background .15s; }
input:hover, select:hover, textarea:hover { border-color: rgba(59, 130, 246, .45); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: #38bdf8; background: #fff; box-shadow: 0 0 0 4px rgba(56, 189, 248, .22); }
input[type=checkbox] { width: auto; accent-color: #0891b2; box-shadow: none; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters > * { width: auto; }
.filters input[type=search] { min-width: 230px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.field > span { color: #3f5068; font-weight: 500; }
.field.check { flex-direction: row; align-items: center; gap: 8px; padding-top: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 10px 14px; background: rgba(236, 243, 252, .7); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, .45); }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: rgba(56, 189, 248, .1); }
.tbl .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.actions { text-align: end; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; background: rgba(236, 243, 252, .7); }
.table-wrap { overflow-x: auto; }
.empty { padding: 34px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: rgba(226, 232, 240, .75); color: #475569; white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); }
.st-confirmed { background: rgba(191, 219, 254, .75); color: #1d4ed8; } .st-checked_in { background: rgba(187, 247, 208, .75); color: #0b6b4a; }
.st-checked_out { background: rgba(226, 232, 240, .8); color: #475569; } .st-cancelled { background: rgba(254, 205, 211, .75); color: #be123c; } .st-no_show { background: rgba(254, 215, 170, .75); color: #c2410c; }
.hk-cleaned { background: rgba(253, 230, 138, .8); color: #92400e; } .hk-clean { background: rgba(187, 247, 208, .75); color: #0b6b4a; } .hk-dirty { background: rgba(254, 205, 211, .75); color: #be123c; } .hk-inspected { background: rgba(191, 219, 254, .75); color: #1d4ed8; } .hk-oos { background: rgba(226, 232, 240, .8); color: #475569; }
.pos { color: var(--green); } .neg { color: var(--red); }
tr.rev td { color: var(--red); } tr.revd td { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.35); }
tr.revd td .badge, tr.revd td.actions { text-decoration: none; }
.tabs { display: inline-flex; max-width: 100%; gap: 4px; padding: 4px; margin-bottom: 18px; overflow-x: auto; border-radius: 14px; background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .8); box-shadow: var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.tabs a { padding: 7px 15px; color: var(--muted); font-weight: 500; border-radius: 10px; white-space: nowrap; transition: background .15s, color .15s; }
.tabs a:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.tabs a.active { color: #fff; background: var(--grad); box-shadow: var(--glow); }

/* modal & toast */
.overlay { position: fixed; inset: 0; background: rgba(15, 30, 55, .32); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); display: grid; place-items: start center; padding: 5vh 14px; overflow: auto; z-index: 100; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: rgba(250, 252, 255, .9); -webkit-backdrop-filter: saturate(170%) blur(26px); backdrop-filter: saturate(170%) blur(26px); border: 1px solid rgba(255, 255, 255, .9); border-radius: 20px; width: min(560px, 100%); box-shadow: inset 0 1px 0 #fff, 0 30px 80px rgba(15, 35, 70, .35); animation: pop .22s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal.wide { width: min(760px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.modal .x { border: 0; background: rgba(120, 145, 180, .14); width: 30px; height: 30px; border-radius: 50%; font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; transition: background .15s, transform .15s; }
.modal .x:hover { background: rgba(225, 29, 72, .14); color: var(--red); transform: rotate(90deg); }
.modal-body { padding: 16px 20px; }
.modal-err { color: var(--red); padding: 0 20px; font-weight: 500; }
.modal-err:not(:empty) { padding-bottom: 10px; }
.modal footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
#toasts { position: fixed; bottom: 18px; inset-inline-start: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: rgba(15, 30, 55, .86); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: #fff; padding: 11px 18px; border-radius: 13px; border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 14px 34px rgba(15, 35, 70, .32); max-width: 360px; animation: pop .25s ease; }
.toast.err { background: rgba(190, 18, 60, .9); }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; padding: 14px; gap: 14px; }
.auth-art { position: relative; overflow: hidden; border-radius: 28px; color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(150deg, #0b1e3d 0%, #10407a 48%, #0891b2 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 24px 60px rgba(15, 35, 70, .3); }
.auth-art::before, .auth-art::after { content: ''; position: absolute; border-radius: 34% 66% 61% 39% / 44% 39% 61% 56%; border: 1px solid rgba(255, 255, 255, .28); background: linear-gradient(135deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .03)); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: drift 14s ease-in-out infinite alternate; }
.auth-art::before { width: 340px; height: 340px; inset: -90px auto auto -80px; }
.auth-art::after { width: 240px; height: 240px; inset: auto -60px -70px auto; animation-duration: 18s; animation-direction: alternate-reverse; }
@keyframes drift { to { transform: translate(26px, 22px) rotate(24deg); border-radius: 58% 42% 38% 62% / 52% 60% 40% 48%; } }
.auth-art > * { position: relative; z-index: 1; }
.auth-art h1 { font-size: 46px; margin-bottom: 12px; background: linear-gradient(120deg, #fff, #a5f3fc); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.auth-logo { width: 84px; height: 84px; margin-bottom: 14px; filter: drop-shadow(0 12px 26px rgba(34, 211, 238, .45)); }
.auth-art .tagline { font-size: 15px; letter-spacing: .3px; color: #a5f3fc; margin: -6px 0 14px; font-weight: 500; }
.auth-art p { font-size: 17px; opacity: .92; max-width: 460px; }
.auth-art ul { padding: 0; list-style: none; margin-top: 26px; display: grid; gap: 10px; font-size: 15.5px; }
.auth-art li { padding: 10px 14px; border-radius: 13px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .16); max-width: 420px; }
.auth-art li::before { content: '✓'; margin-inline-end: 10px; color: #67e8f9; font-weight: 700; }
.auth-form { display: grid; place-items: center; padding: 30px; border-radius: 28px; background: rgba(255, 255, 255, .58); border: 1px solid rgba(255, 255, 255, .85); box-shadow: var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.auth-form form { width: min(380px, 100%); display: grid; gap: 13px; }
.auth-form h2 { font-size: 25px; margin: 0; }
.auth-brand { display: none; align-items: center; justify-content: center; gap: 10px; font-size: 26px; margin-bottom: 6px; }
.auth-brand img { width: 54px; height: 54px; filter: drop-shadow(0 8px 18px rgba(59, 130, 246, .4)); }
.auth-form input { padding: 10px 12px; }

/* calendar */
.cal-wrap { overflow: auto; max-height: calc(100vh - 210px); padding: 0; }
.cal { width: max-content; min-width: 100%; }
.cal-row { display: flex; border-bottom: 1px solid var(--hair); }
.cal-label { width: 150px; flex: none; position: sticky; inset-inline-start: 0; background: var(--solid); z-index: 3; padding: 0 12px; display: flex; align-items: center; gap: 6px; border-inline-end: 1px solid var(--line); font-size: 13.5px; overflow: hidden; white-space: nowrap; }
.cal-track { position: relative; display: flex; }
.cal-cell { width: 48px; flex: none; min-height: 38px; border-inline-end: 1px solid var(--hair); transition: background .12s; }
.cal-head { position: sticky; top: 0; z-index: 5; background: var(--solid); border-bottom: 1px solid var(--line); }
.cal-head .cal-label { z-index: 6; }
.cal-head .cal-cell { text-align: center; padding: 5px 0; line-height: 1.25; background: var(--solid); }
.cal-head .cal-cell small { display: block; font-size: 11px; } .cal-head .cal-cell b { font-size: 14px; }
.cal-cell.wk { background: rgba(226, 235, 248, .45); } .cal-cell.today { background: rgba(56, 189, 248, .2) !important; }
.cal-head .cal-cell.wk { background: #edf2fa; } .cal-head .cal-cell.today { background: #cdeefb !important; }
.cal-type { background: rgba(236, 243, 252, .6); } .cal-type .cal-label { background: #e9f0fa; font-weight: 700; }
.cal-type .cal-cell { text-align: center; font-size: 11px; line-height: 1.3; padding: 4px 0; min-height: 0; color: var(--muted); }
.cal-type .cal-cell b { display: block; font-size: 13px; color: var(--green); }
.cal-type .cal-cell.full b { color: var(--red); } .cal-type .cal-cell.closed { background: repeating-linear-gradient(45deg, rgba(254, 205, 211, .8), rgba(254, 205, 211, .8) 4px, transparent 4px, transparent 8px); }
.cal-room .cal-cell { cursor: pointer; } .cal-room .cal-cell:hover { background: rgba(56, 189, 248, .22); }
.cal-bar { position: absolute; height: 28px; border-radius: 9px; padding: 0 9px; font-size: 12.5px; font-weight: 600; line-height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; z-index: 2; border: 1px solid rgba(255, 255, 255, .35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 10px rgba(30, 60, 110, .2); transition: transform .15s, filter .15s; }
.cal-bar:hover { transform: translateY(-1px); filter: brightness(1.08); }
.cal-bar.st-confirmed { background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; } .cal-bar.st-checked_in { background: linear-gradient(135deg, #10b981, #0891b2); color: #fff; } .cal-bar.st-checked_out { background: linear-gradient(135deg, #a3b2c7, #8494ab); color: #fff; }
.cal-bar.block { background: repeating-linear-gradient(45deg, #cbd5e1, #cbd5e1 6px, #e2e8f0 6px, #e2e8f0 12px); color: #334155; box-shadow: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.cleaned { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); } .dot.clean { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); } .dot.dirty { background: #f43f5e; box-shadow: 0 0 0 3px rgba(244, 63, 94, .18); } .dot.inspected { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); } .dot.oos { background: #94a3b8; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; margin-inline-end: 5px; vertical-align: -1px; }

/* misc */
.bars { display: flex; align-items: flex-end; gap: 5px; height: 140px; }
.bars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; font-size: 10.5px; color: var(--muted); }
.bars i { display: block; width: 100%; background: linear-gradient(180deg, #38bdf8, #6366f1); border-radius: 7px 7px 2px 2px; min-height: 2px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45); transition: filter .15s; }
.bars > div:hover i { filter: brightness(1.15); }
.bars span { margin-top: 3px; white-space: nowrap; }
.list { display: grid; }
.list > a, .list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--hair); color: inherit; transition: background .12s; }
.list > :last-child { border-bottom: 0; }
.list > a:hover { background: rgba(56, 189, 248, .1); }
.room-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.room-card { background: var(--surface); border: 1px solid rgba(255, 255, 255, .8); border-radius: var(--radius); padding: 12px 14px; border-inline-start: 4px solid #94a3b8; display: grid; gap: 7px; box-shadow: var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: transform .18s; }
.room-card:hover { transform: translateY(-2px); }
.room-card.cleaned { border-inline-start-color: #f59e0b; } .room-card.clean { border-inline-start-color: #22c55e; } .room-card.dirty { border-inline-start-color: #f43f5e; } .room-card.inspected { border-inline-start-color: #3b82f6; }
.room-card h3 { font-size: 18px; } .room-card select { padding: 4px 8px; font-size: 13px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 500; }
.totals { margin-inline-start: auto; width: min(320px, 100%); display: grid; gap: 4px; padding: 14px 18px; }
.totals div { display: flex; justify-content: space-between; } .totals .big { font-size: 17px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.quote { background: var(--brand-soft); border: 1px solid rgba(14, 165, 200, .2); border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-weight: 500; }
.quote.warn { background: rgba(254, 243, 199, .8); color: #92400e; border-color: rgba(217, 119, 6, .22); }
.results { border: 1px solid var(--line); border-radius: 11px; max-height: 170px; overflow: auto; margin-top: 4px; background: rgba(255, 255, 255, .8); }
.results:empty { display: none; }
.results button { display: block; width: 100%; text-align: start; border: 0; background: transparent; padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--hair); }
.results button:hover { background: var(--brand-soft); }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--brand-soft); color: var(--brand); border-radius: 99px; padding: 4px 12px; font-weight: 600; border: 1px solid rgba(14, 165, 200, .2); }
.rate-grid td, .rate-grid th { text-align: center; padding: 6px 4px; min-width: 64px; font-size: 13px; }
.rate-grid td:first-child, .rate-grid th:first-child { text-align: start; position: sticky; inset-inline-start: 0; background: var(--solid); min-width: 150px; padding-inline: 14px; z-index: 1; }
.rate-grid td.cell { cursor: pointer; } .rate-grid td.cell:hover { background: rgba(56, 189, 248, .2); }
.rate-grid td.ov b { color: var(--brand); } .rate-grid td.closed { background: rgba(254, 205, 211, .7); }
.rate-grid td small { display: block; font-size: 11px; }
.print-only { display: none; }
code.url { background: rgba(226, 235, 248, .7); padding: 4px 8px; border-radius: 8px; direction: ltr; display: inline-block; word-break: break-all; font-size: 13px; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.plan { border: 1px solid rgba(255, 255, 255, .8); border-radius: var(--radius); padding: 16px; background: var(--surface); box-shadow: var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.plan.current { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, .25), var(--glow); }
.plan b.price { font-size: 26px; display: block; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; margin: 0; height: 100vh; border-radius: 0; width: 250px; z-index: 60; transform: translateX(110%); transition: transform .22s; }
  html[dir=ltr] .sidebar { transform: translateX(-110%); }
  .shell.open .sidebar { transform: none; }
  .menu-btn { display: inline-flex; }
  .content { padding: 14px; } .topbar { margin: 8px 10px 0; top: 8px; padding: 8px 10px; } .banner { margin: 8px 10px 0; }
  .cols-2, .cols-3, .form-grid.c4 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; } .auth-brand { display: flex; }
  .cal-label { width: 96px; }
  .hide-sm { display: none !important; }
}
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
/* installed app (PWA) on phones: respect the notch / home bar, make controls finger-sized */
@media (max-width: 900px) {
  .topbar { margin-top: max(8px, env(safe-area-inset-top)); }
  .content { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .btn { padding: 9px 15px; } .btn.sm { padding: 6px 12px; }
  input, select, textarea { padding: 9px 11px; font-size: 16px; }   /* 16px stops iOS from zooming into fields */
  .nav a { padding: 11px 12px; }
  .modal footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
[hidden] { display: none !important; }
/* AI chat */
.chat-card { max-width: 860px; }
.chat { display: flex; flex-direction: column; gap: 9px; min-height: 260px; max-height: 56vh; overflow: auto; padding: 4px 2px; }
.bubble { max-width: 88%; padding: 9px 14px; border-radius: 16px; white-space: pre-wrap; line-height: 1.7; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-start; color: #fff; background: var(--grad); border-end-start-radius: 5px; box-shadow: var(--glow); }
.bubble.assistant { align-self: flex-end; background: rgba(255, 255, 255, .85); border: 1px solid var(--line); border-end-end-radius: 5px; }
.bubble.err { background: rgba(254, 226, 226, .85); color: #9f1239; border-color: rgba(225, 29, 72, .25); }
.bubble.typing { display: inline-flex; gap: 5px; padding: 13px 16px; } .bubble.typing i { width: 7px; height: 7px; border-radius: 50%; background: #7aa2d6; animation: blink 1s infinite ease-in-out; }
.bubble.typing i:nth-child(2) { animation-delay: .15s; } .bubble.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1.1); } }
.chat-input { display: flex; gap: 8px; margin-top: 12px; align-items: stretch; } .chat-input textarea { flex: 1; resize: none; }
.chat-empty { display: grid; gap: 8px; justify-items: start; padding: 10px 2px; }
.chip-btn { text-align: start; border: 1px solid var(--line); background: rgba(255, 255, 255, .7); border-radius: 14px; padding: 8px 14px; cursor: pointer; font: inherit; transition: background .15s, transform .15s; }
.chip-btn:hover { background: #fff; transform: translateY(-1px); border-color: #38bdf8; }
.summary-card { border-inline-start: 4px solid #38bdf8; } .summary-text { white-space: pre-wrap; line-height: 1.9; font-size: 15px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  body::before { display: none; }
  .sidebar, .topbar, .banner, .no-print, #toasts { display: none !important; }
  .shell { display: block; } .content { padding: 0; } body { background: #fff; }
  .card, .kpi { box-shadow: none; break-inside: avoid; background: #fff; border-color: #d9e0ea; -webkit-backdrop-filter: none; backdrop-filter: none; } .print-only { display: block; }
  .page-head h1, .kpi b { -webkit-text-fill-color: currentColor !important; background: none !important; }
  #page > * { animation: none; }
  .cols-2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) { .pos-grid { grid-template-columns: 1fr !important; } }

/* duty switch in the side menu: amber while off, green while at work */
.duty-btn { width: 100%; margin-top: 10px; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; cursor: pointer; text-align: start; font: inherit;
  border: 1px solid rgba(251, 191, 36, .55); background: rgba(251, 191, 36, .14); color: #fde68a; transition: background .18s, border-color .18s; }
.duty-btn:hover { background: rgba(251, 191, 36, .22); }
.duty-btn b { display: block; color: #fef3c7; font-size: 13.5px; }
.duty-btn small { display: block; opacity: .85; font-size: 11.5px; }
.duty-btn .dot { flex: none; width: 11px; height: 11px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .28); }
.duty-btn.on { border-color: rgba(74, 222, 128, .6); background: rgba(34, 197, 94, .18); color: #bbf7d0; }
.duty-btn.on:hover { background: rgba(34, 197, 94, .26); }
.duty-btn.on b { color: #dcfce7; }
.duty-btn.on .dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .3); animation: dutyPulse 2s ease-in-out infinite; }
.duty-btn:disabled { opacity: .6; cursor: wait; }
@keyframes dutyPulse { 50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, .08); } }
@media (prefers-reduced-motion: reduce) { .duty-btn.on .dot { animation: none; } }
