/* ==========================================================
   NOOK — booking page + staff dashboard (loads after style.css)
   ========================================================== */

/* the hidden attribute must always win over component display rules */
[hidden] { display: none !important; }

/* ---------- shared form controls ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > label, .lbl { font-weight: 600; font-size: .92rem; color: var(--navy); }
.field .opt { color: var(--muted); font-weight: 400; }
.field input[type="text"], .field input[type="tel"], .field input[type="email"], .field input[type="number"],
.field input[type="password"], .field input[type="datetime-local"], .field input[type="date"], .field input[type="search"], .field select, .field textarea, input.sh-in {
  width: 100%; min-height: 48px; padding: .7em 1em; border: 2px solid var(--line); border-radius: 14px; background: #fff;
  color: var(--ink); font: inherit; font-size: 1rem; transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(47, 126, 216, .15); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--bad); }
.field input:disabled, .field select:disabled { background: #F3F7FD; color: var(--muted); }
.field input[dir="ltr"], .field .ltr-in { text-align: start; }
[dir="rtl"] .field input[dir="ltr"] { text-align: right; }
.err { margin: 0; color: var(--bad); font-size: .85rem; min-height: 0; }
.err:empty { display: none; }
.hint { margin: 0; color: var(--muted); font-size: .85rem; }
.hint.ok { color: var(--ok); font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-danger { background: #fff; color: var(--bad); border-color: #F1C4BE; }
.btn-danger:hover { background: #FDE5E2; }
.btn-ok { background: var(--ok); color: #fff; box-shadow: 0 12px 26px -12px rgba(30, 142, 90, .9); }
.btn-ok:hover { background: #17734A; }
.btn-line { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-line:hover { border-color: var(--secondary); background: var(--bg); }
.btn-block { width: 100%; padding-block: 1.05em; font-size: 1.05rem; }

/* segmented radio buttons */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.seg span { display: grid; gap: 2px; justify-items: center; padding: 12px 6px; border: 2px solid var(--line); border-radius: 16px; background: #fff; text-align: center; transition: border-color .2s, background .2s, transform .2s; }
.seg b { font-weight: 700; color: var(--navy); }
.seg small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.seg input:checked + span { border-color: var(--primary); background: var(--bg); box-shadow: 0 8px 20px -14px rgba(47, 126, 216, .9); }
.seg input:checked + span small { color: var(--primary); }
.seg input:focus-visible + span { outline: 3px solid var(--secondary); outline-offset: 2px; }

.stepper { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.stepper button { width: 48px; height: 48px; border: 0; background: var(--bg); color: var(--navy); font-size: 1.4rem; font-weight: 700; cursor: pointer; }
.stepper button:hover { background: #D9E9FF; }
.stepper input { width: 72px; height: 48px; border: 0 !important; border-radius: 0 !important; text-align: center !important; font-weight: 700; font-size: 1.1rem; box-shadow: none !important; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- toast notifications ---------- */
.toasts { position: fixed; inset-inline: 0; top: 14px; z-index: 300; display: grid; gap: 10px; justify-items: center; padding-inline: 14px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; width: min(100%, 520px); padding: 14px 16px; border-radius: 18px; background: var(--navy); color: #fff; box-shadow: 0 24px 50px -20px rgba(11, 52, 112, .8); animation: toastIn .35s ease; }
.toast.ok { background: #14683F; }
.toast.err { background: #A8281B; }
.toast .i { margin-top: 3px; }
.toast p { margin: 0; flex: 1; font-weight: 600; }
.toast button { border: 0; background: transparent; color: inherit; opacity: .8; cursor: pointer; padding: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

/* ---------- booking page ---------- */
.bk-hero { color: #fff; background: radial-gradient(900px 400px at 85% 0%, rgba(47, 126, 216, .9), transparent 60%), linear-gradient(135deg, var(--navy), var(--navy-2)); padding: 46px 0 96px; position: relative; overflow: hidden; }
.bk-hero h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.2rem); margin: .3em 0 .2em; font-weight: 800; }
.bk-hero p { color: rgba(255, 255, 255, .88); font-size: 1.1rem; max-width: 36em; margin: 0; }
.bk-hero .deco { position: absolute; width: 300px; height: 300px; border: 2px solid rgba(255, 255, 255, .1); border-radius: 56px; inset-inline-end: 6%; top: -80px; transform: rotate(14deg); pointer-events: none; }
.bk-wrap { display: grid; grid-template-columns: 1.55fr 1fr; gap: 24px; margin-top: -64px; padding-bottom: 80px; position: relative; align-items: start; }
.card-form, .card-side { background: #fff; border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); padding: clamp(22px, 3.4vw, 38px); }
.demo-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: #FFF4DC; color: #7A4F00; font-size: .9rem; margin-bottom: 22px; }
.demo-note .i { margin-top: 2px; }
.f-sec { border: 0; margin: 0 0 8px; padding: 0; min-width: 0; }
.f-sec + .f-sec { margin-top: 14px; padding-top: 24px; border-top: 1px dashed var(--line); }
.f-sec > h2 { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; margin: 0 0 18px; }
.num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font: 700 .95rem/1 'Poppins', sans-serif; }
.ends { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.ends b { color: var(--navy); }

.total-box { margin-top: 18px; padding: 20px; border-radius: 22px; background: var(--bg); border: 1px solid var(--line); }
.total-box dl { display: grid; gap: 8px; margin: 0; }
.total-box .tr { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; color: var(--muted); }
.total-box .tr b { color: var(--navy); font-weight: 600; }
.total-box .tr.big { padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); color: var(--navy); font-weight: 700; }
.total-box .tr.big b { font: 800 1.9rem/1 'Poppins', 'Cairo', sans-serif; color: var(--primary); }
.avail { margin: 14px 0 0; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; }
.avail.ok { color: var(--ok); } .avail.warn { color: var(--warn); } .avail.bad { color: var(--bad); }
.small-note { margin: 12px 0 0; color: var(--muted); font-size: .88rem; }
.submit-wrap { margin-top: 20px; }

.card-side h3 { font-size: 1.15rem; margin-bottom: 14px; }
.how { display: grid; gap: 14px; margin: 0 0 22px; padding: 0; list-style: none; counter-reset: s; }
.how li { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--navy); }
.how li::before { counter-increment: s; content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--navy); font: 700 .9rem/1 'Poppins', sans-serif; }
.side-box { padding: 16px; border-radius: 18px; background: var(--bg); margin-bottom: 14px; font-size: .94rem; }
.side-box p { margin: 0 0 .4em; }
.side-box a { display: flex; align-items: center; gap: 10px; padding: .35em 0; font-weight: 600; color: var(--navy); }
.side-box a:hover { color: var(--primary); }

.done { text-align: center; padding: 10px 0 4px; }
.done .big-ico { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: #DDF5E8; color: var(--ok); }
.done .big-ico .i { width: 2.6em; height: 2.6em; stroke-width: 2.4; }
.done h2 { margin-bottom: .3em; }
.done .refbox { display: inline-block; margin: 16px 0; padding: .6em 1.4em; border-radius: 16px; background: var(--bg); font: 700 1.4rem/1.2 'Poppins', sans-serif; color: var(--primary); letter-spacing: .04em; direction: ltr; }
.done .sum { text-align: start; margin: 18px auto 24px; max-width: 460px; padding: 18px 20px; border-radius: 20px; border: 1px solid var(--line); display: grid; gap: 8px; }
.done .sum div { display: flex; justify-content: space-between; gap: 14px; }
.done .sum span { color: var(--muted); }
.done .sum b { color: var(--navy); text-align: end; }
.done .btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ==========================================================
   DASHBOARD
   ========================================================== */
body.dash { background: #F1F6FD; min-height: 100vh; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 500px at 80% 0%, rgba(47, 126, 216, .85), transparent 60%), linear-gradient(140deg, var(--navy), var(--navy-2)); }
.login-card { width: min(100%, 430px); background: #fff; border-radius: 30px; padding: clamp(24px, 5vw, 40px); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .7); }
.login-card .brand { color: var(--primary); margin-bottom: 8px; }
.login-card h1 { font-size: 1.5rem; margin: .4em 0 .2em; }
.login-card .sub { color: var(--muted); margin-bottom: 22px; }
.login-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cred-hint { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: #FFF4DC; color: #7A4F00; font-size: .88rem; }
.cred-hint code { background: rgba(0, 0, 0, .06); padding: 1px 6px; border-radius: 6px; direction: ltr; unicode-bidi: isolate; display: inline-block; }

.app { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 20px 14px; background: linear-gradient(180deg, var(--navy), #0A2C5F); color: #fff; z-index: 60; }
.side .brand { color: #fff; padding: 4px 10px 18px; }
.side .brand img { width: 38px; }
.nav-v { display: grid; gap: 4px; }
.nav-v a, .nav-v button.grp { display: flex; align-items: center; gap: 12px; width: 100%; padding: .78em 1em; border: 0; border-radius: 14px; background: transparent; color: rgba(255, 255, 255, .82); font: 600 .98rem/1.2 inherit; text-align: start; cursor: pointer; transition: background .2s, color .2s; }
.nav-v a:hover, .nav-v button.grp:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.nav-v a.on { background: #fff; color: var(--navy); }
.nav-v .sub { display: grid; gap: 4px; padding-inline-start: 18px; margin-inline-start: 18px; border-inline-start: 2px solid rgba(255, 255, 255, .16); }
.nav-v .sub[hidden] { display: none; }
.nav-v .cnt { margin-inline-start: auto; min-width: 24px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--navy); font-size: .8rem; font-weight: 800; text-align: center; }
.nav-v .cnt.hot { background: #FFB300; }
.nav-v a.on .cnt { background: var(--primary); color: #fff; }
.nav-v .chev { margin-inline-start: auto; transition: transform .2s; }
.nav-v .grp[aria-expanded="true"] .chev { transform: rotate(90deg); }
[dir="rtl"] .nav-v .chev { transform: scaleX(-1); }
[dir="rtl"] .nav-v .grp[aria-expanded="true"] .chev { transform: scaleX(-1) rotate(90deg); }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .12); margin: 10px 8px; }
.side-foot { margin-top: auto; padding-top: 18px; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .08); margin-bottom: 10px; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--navy); font-weight: 800; }
.me b { display: block; line-height: 1.2; overflow-wrap: anywhere; }
.me small { color: rgba(255, 255, 255, .65); }
.side-foot .mini { display: flex; gap: 8px; }
.side-foot .mini button { flex: 1; padding: .6em .4em; border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px; background: transparent; color: #fff; font: 600 .85rem/1.2 inherit; cursor: pointer; }
.side-foot .mini button:hover { background: rgba(255, 255, 255, .12); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 14px clamp(16px, 3vw, 32px); background: rgba(241, 246, 253, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: clamp(1.15rem, 2.4vw, 1.6rem); flex: 1; min-width: 0; }
.topbar .lang { background: #fff; }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: #fff; color: var(--navy); cursor: pointer; align-items: center; justify-content: center; box-shadow: 0 6px 16px -10px rgba(11, 52, 112, .6); }
.scrim { display: none; }
.content { padding: clamp(16px, 3vw, 32px); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 20px; background: #fff; border: 1px solid var(--line); }
.stat .ico { margin: 0; flex: none; width: 50px; height: 50px; }
.stat b { display: block; font: 800 1.5rem/1.1 'Poppins', 'Cairo', sans-serif; color: var(--navy); }
.stat span { color: var(--muted); font-size: .88rem; font-weight: 600; }
.stat.hot { background: #FFF8E6; border-color: #F5DFA2; }
.stat.hot .ico { background: #FFE9A8; color: #8A5A00; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: clamp(16px, 2.6vw, 28px); margin-bottom: 20px; }
.panel > h2, .panel > .ph > h2 { font-size: 1.15rem; margin: 0; }
.ph { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.tools .field { margin: 0; flex: 1; min-width: 200px; }
.chips-f { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-f button { padding: .5em 1em; border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy); font: 600 .88rem/1 inherit; cursor: pointer; }
.chips-f button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty .i { width: 2.6em; height: 2.6em; color: var(--secondary); margin-bottom: 8px; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; padding: 10px 12px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--line); white-space: nowrap; }
html[lang="ar"] .tbl th { letter-spacing: 0; text-transform: none; font-size: .88rem; }
.tbl td { padding: 14px 12px; border-bottom: 1px solid #E8EFF9; vertical-align: middle; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: #F5F9FF; }
.tbl .nm { font-weight: 700; color: var(--navy); display: block; }
.tbl .sm { color: var(--muted); font-size: .86rem; display: block; }
.tbl .num-c { font-weight: 700; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.tbl .acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.tbl .room-pill { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 12px; background: var(--bg); color: var(--navy); font: 800 1rem/1 'Poppins', sans-serif; }
.tbl .room-pill.none { background: #F1F3F7; color: #8B98AD; font-weight: 600; }

.bdg { display: inline-flex; align-items: center; gap: 6px; padding: .28em .8em; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.bdg::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.bdg.pending { background: #FFF1CC; color: #8A5A00; }
.bdg.confirmed { background: #DDF5E8; color: #17734A; }
.bdg.active { background: #DCEBFF; color: #1B58A6; }
.bdg.completed { background: #E9EDF3; color: #4A5A72; }
.bdg.cancelled { background: #FDE5E2; color: #A8281B; }
.bdg.today { background: #FFE9A8; color: #7A4F00; }
.bdg.late { background: #FDE5E2; color: #A8281B; }
.bdg.ok { background: #DDF5E8; color: #17734A; }
.docs-mini { display: flex; gap: 6px; }
.docs-mini span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #F1F3F7; color: #8B98AD; font-size: .7rem; font-weight: 800; }
.docs-mini span.has { background: #DDF5E8; color: #17734A; }

/* forms in dashboard */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.sec-t { margin: 22px 0 14px; font-size: 1rem; color: var(--primary); display: flex; align-items: center; gap: 10px; }
.sec-t::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.check { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--bg); font-weight: 600; color: var(--navy); cursor: pointer; margin-bottom: 16px; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.pay-box { padding: 18px 20px; border-radius: 20px; background: var(--accent); margin: 8px 0 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pay-box b { font: 800 1.8rem/1 'Poppins', 'Cairo', sans-serif; color: var(--navy); }
.pay-box span { color: var(--navy); font-weight: 600; }

/* rooms */
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.room-card { border: 2px solid var(--line); border-radius: 22px; padding: 18px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.room-card .top2 { display: flex; justify-content: space-between; align-items: center; }
.room-card .rn { font: 800 2rem/1 'Poppins', sans-serif; color: var(--navy); }
.room-card.occ { border-color: #9CC4F5; background: #F5F9FF; }
.room-card.res { border-color: #B9E3CB; }
.room-card.off { background: #F4F5F7; border-color: #DADFE7; }
.room-card .who { font-weight: 700; color: var(--navy); }
.room-card .meta { color: var(--muted); font-size: .88rem; margin: 0; }
.room-card .adm { margin-top: auto; display: grid; gap: 8px; }
.room-card select, .room-card input { width: 100%; min-height: 40px; padding: .4em .7em; border: 2px solid var(--line); border-radius: 12px; font: inherit; font-size: .9rem; background: #fff; }

/* modal */
.modal-back { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(8, 32, 70, .55); animation: fade .2s ease; }
.modal { width: min(940px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: 28px; box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .7); overflow: hidden; }
.modal.sm { width: min(520px, 100%); }
.m-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 26px; border-bottom: 1px solid var(--line); background: #F8FBFF; }
.m-head h2 { margin: 0; font-size: 1.25rem; }
.m-head .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; color: var(--muted); font-size: .9rem; }
.m-x { flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: #fff; color: var(--navy); cursor: pointer; display: grid; place-items: center; border: 1px solid var(--line); }
.m-body { padding: 8px 26px 22px; overflow-y: auto; flex: 1; }
.m-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 16px 26px; border-top: 1px solid var(--line); background: #F8FBFF; }
.m-foot .sp { flex: 1; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; margin: 0; }
.kv > div { min-width: 0; }
.kv dt { color: var(--muted); font-size: .8rem; font-weight: 600; margin-bottom: 2px; }
.kv dd { margin: 0; font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.kv dd a { color: var(--primary); }
.kv dd .ltr { direction: ltr; unicode-bidi: isolate; }
.money-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 4px 0 16px; }
.money-row div { padding: 14px; border-radius: 16px; background: var(--bg); }
.money-row small { display: block; color: var(--muted); font-weight: 600; font-size: .8rem; }
.money-row b { font: 800 1.15rem/1.3 'Poppins', 'Cairo', sans-serif; color: var(--navy); }
.money-row .due b { color: var(--bad); }
.money-row .due.zero b { color: var(--ok); }
.pay-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.pay-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); font-size: .92rem; flex-wrap: wrap; }
.pay-list b { color: var(--navy); }
.pay-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.pay-add .field { margin: 0; }
.docs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.doc { border: 2px dashed var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 10px; text-align: center; background: #FBFDFF; }
.doc.has { border-style: solid; border-color: #B9E3CB; background: #F4FCF8; }
.doc h4 { margin: 0; font-size: .95rem; color: var(--navy); }
.doc .thumb { aspect-ratio: 4 / 3; border-radius: 12px; background: #EEF3FA center / cover no-repeat; display: grid; place-items: center; color: #8B98AD; font-size: .85rem; overflow: hidden; }
.doc .thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.doc .row-b { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.doc .row-b .btn { padding: .5em .9em; font-size: .85rem; }
.hist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .88rem; color: var(--muted); }
.hist li { display: flex; gap: 10px; flex-wrap: wrap; }
.hist time { color: var(--navy); font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.warn-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #FFF4DC; color: #7A4F00; margin: 12px 0; font-size: .92rem; }
.warn-box .i { margin-top: 2px; flex: none; }
.warn-box.bad { background: #FDE5E2; color: #8F2418; }
.lightbox { position: fixed; inset: 0; z-index: 400; background: rgba(0, 0, 0, .85); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .bk-wrap { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(300px, 86vw); height: 100%; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
  [dir="rtl"] .side { transform: translateX(105%); }
  body.nav-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(8, 32, 70, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
  .tbl td { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 7px 0; border: 0; text-align: end; }
  .tbl td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; text-align: start; flex: none; }
  .tbl td.nolabel::before { display: none; }
  .tbl td.nolabel { justify-content: flex-end; }
  .tbl .acts { width: 100%; }
  .tbl .acts .btn { flex: 1; }
  .form-grid, .row2, .row3 { grid-template-columns: 1fr; }
  .pay-add { grid-template-columns: 1fr; }
  .money-row { grid-template-columns: repeat(2, 1fr); }
  .seg { grid-template-columns: repeat(2, 1fr); }
  .modal-back { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: 24px 24px 0 0; }
  .m-head, .m-body, .m-foot { padding-inline: 16px; }
  .m-foot .btn { flex: 1 1 100%; }
  .m-foot .sp { display: none; }
  .bk-hero { padding-bottom: 80px; }
  .stats { gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat .ico { width: 42px; height: 42px; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { flex-direction: column; align-items: flex-start; }
}

/* extras */
body.modal-lock { overflow: hidden; }
.chk { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.chk li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #F6F8FB; font-weight: 600; }
.chk li.ok { background: #E7F7EE; color: #17734A; }
.chk li.no { background: #FDE9E6; color: #A8281B; }
.chk li.soft { background: #FFF4DC; color: #7A4F00; }
.m-body .sec-t:first-child { margin-top: 18px; }
.doc .row-b .btn { padding: .5em .9em; font-size: .85rem; }

/* ---------- discount code, closed periods, consent ---------- */
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; text-transform: uppercase; letter-spacing: .06em; }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--bad); }
.closed-note { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: #FFF6E0; color: #7A5200; font-size: .88rem; line-height: 1.5; }
.closed-note .i { flex: none; margin-top: 2px; }
.total-box .tr.disc b, .total-box .tr.disc { color: var(--ok); }
.check.agree { margin: 16px 0 6px; align-items: flex-start; font-weight: 500; }
.check.agree input { margin-top: 3px; flex: none; }
.check.agree a { color: var(--primary); text-decoration: underline; }

/* ---------- reports, shift, settings ---------- */
.rp-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.sh-in { max-width: 170px; }
.loc-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: start; padding: 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 16px; }
#view textarea { width: 100%; font: inherit; }

/* ---------- pricing lines, messages, calendar, occupancy ---------- */
.total-box .tr.adj.pos b { color: #B45309; }
.total-box .tr.adj.neg, .total-box .tr.adj.neg b { color: var(--ok); }
.msg-box { display: grid; gap: 8px; }
.msg-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.msg-t { display: grid; gap: 2px; min-width: 150px; }
.msg-t small { color: var(--muted); font-size: .8rem; }
.msg-t small.ok { color: var(--ok); }
.msg-a { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.msg-a select { min-height: 36px; padding: 0 .6em; border: 2px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }

.cal-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; margin-top: 12px; }
.cal { font-size: .85rem; }
.cal-row { display: flex; border-bottom: 1px solid var(--line); }
.cal-row:last-child { border-bottom: 0; }
.cal-lab { flex: 0 0 150px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; gap: 2px; border-inline-end: 1px solid var(--line); background: #F6FAFF; position: sticky; inset-inline-start: 0; z-index: 3; }
.cal-track { position: relative; flex: 1; min-height: 46px; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(100% / var(--n)) 100%; }
[dir="rtl"] .cal-track { background-image: linear-gradient(to left, var(--line) 1px, transparent 1px); }
.cal-track.off { background-color: #F1F1F1; }
.cal-head .cal-track { display: grid; grid-template-columns: repeat(var(--n), 1fr); background-image: none; min-height: 0; }
.cal-day { padding: 6px 0; text-align: center; display: grid; line-height: 1.2; border-inline-start: 1px solid var(--line); }
.cal-day small { color: var(--muted); font-size: .72rem; }
.cal-day.we { background: #FFF8EA; }
.cal-day.today { background: #E4F0FF; color: var(--primary); }
.cal-bar { position: absolute; top: 7px; bottom: 7px; border: 0; border-radius: 9px; padding: 0 8px; display: flex; align-items: center; overflow: hidden; cursor: pointer; font: 600 .78rem/1 inherit; color: #fff; z-index: 2; }
.cal-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bar.pending { background: #E0A100; }
.cal-bar.confirmed { background: var(--primary); }
.cal-bar.active { background: #0F8A5F; }
.cal-bar.active.late { background: #C0392B; }
.cal-bar.completed { background: #8EA0B8; }
.cal-bar:focus-visible { outline: 3px solid var(--navy); outline-offset: 1px; }
.cal-closed { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(192,57,43,.14), rgba(192,57,43,.14) 6px, rgba(192,57,43,.04) 6px, rgba(192,57,43,.04) 12px); z-index: 1; }
.cal-now { position: absolute; top: 0; bottom: 0; width: 2px; background: #C0392B; z-index: 3; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font-size: .8rem; }
.cal-legend .lg::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: 6px; vertical-align: -1px; }
.lg.pending::before { background: #E0A100; } .lg.confirmed::before { background: var(--primary); } .lg.active::before { background: #0F8A5F; } .lg.completed::before { background: #8EA0B8; }
.lg.off::before { background: #D9D9D9; } .lg.closedday::before { background: repeating-linear-gradient(45deg, rgba(192,57,43,.5), rgba(192,57,43,.5) 3px, rgba(192,57,43,.15) 3px, rgba(192,57,43,.15) 6px); }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 54px; min-height: 4px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--primary), #6AA8EB); position: relative; }
.bar span { position: absolute; top: -20px; inset-inline: 0; text-align: center; font-weight: 700; font-size: .8rem; color: var(--navy); }
.bar-col small { color: var(--muted); font-size: .75rem; }
.meter { display: inline-block; width: 90px; height: 8px; border-radius: 6px; background: #E3ECF8; overflow: hidden; vertical-align: middle; margin-inline-end: 6px; }
.meter i { display: block; height: 100%; background: var(--primary); }

/* ---- monitor / audit ---- */
.tbl td { overflow-wrap: anywhere; }
.rep-text { white-space: pre-wrap; overflow-wrap: anywhere; background: #F5F8FD; border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 14px 0 0; font-family: inherit; font-size: .92rem; line-height: 1.8; max-height: 420px; overflow: auto; color: var(--navy); }
.warn-box.ok-box { background: #E8F7EF; border-color: #BFE6D1; color: #17734A; }
.chips-f button[data-tab] { font-size: .92rem; }
