:root{
  --orange:#fda92c; --orange-dark:#e08f0f; --ink:#1f2430; --muted:#6b7280;
  --line:#ececf1; --bg:#f6f6f9; --card:#ffffff; --closed:#f1f2f6;
  --shadow:0 8px 24px rgba(31,36,48,.08);
}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg); color:var(--ink); min-height:100vh; display:flex; flex-direction:column;
}
.topbar{
  background:linear-gradient(180deg,#fff, #fff 70%, rgba(255,255,255,.9));
  border-bottom:1px solid var(--line); padding:10px 16px 0; position:sticky; top:0; z-index:20;
  padding-top:calc(10px + env(safe-area-inset-top));
}
.bsd{text-align:right; font-size:12px; color:var(--muted); direction:rtl}
.brand{display:flex; align-items:center; gap:10px; padding:2px 0 10px}
.brand-logo{height:46px;border-radius:10px}
.brand-sub{font-size:13px; color:var(--muted); letter-spacing:.4px; font-weight:700}
.views{display:flex; gap:6px; overflow-x:auto}
.nav-btn{
  border:none; background:transparent; padding:9px 14px; font-size:14px; font-weight:600;
  color:var(--muted); border-bottom:3px solid transparent; cursor:pointer; white-space:nowrap;
}
.nav-btn.active{color:var(--orange); border-bottom-color:var(--orange)}
main{flex:1; padding:14px; max-width:1100px; width:100%; margin:0 auto}
.foot{
  padding:10px 16px calc(10px + env(safe-area-inset-bottom)); font-size:12px; color:var(--muted);
  border-top:1px solid var(--line); background:#fff; display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap;
}
.mini-btn{
  border:1px solid var(--line); background:#fff; border-radius:8px; padding:4px 10px;
  font-size:12px; color:var(--ink); cursor:pointer;
}
.mini-btn:active{background:var(--bg)}
.foot-actions{display:flex; gap:6px}

.card{background:var(--card); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow); padding:14px; margin-bottom:14px}
.month-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px}
.month-title{font-size:18px; font-weight:800}
.month-title .heb{font-size:13px; font-weight:600; color:var(--muted); margin-left:8px}
.arrow-btn{
  border:1px solid var(--line); background:#fff; width:36px; height:36px; border-radius:10px;
  font-size:18px; cursor:pointer; color:var(--ink);
}
.arrow-btn:active{background:var(--bg)}

.cal-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:4px}
.cal-dow{font-size:11px; font-weight:700; color:var(--muted); text-align:center; padding:4px 0; text-transform:uppercase}
.cal-cell{
  background:#fff; border:1px solid var(--line); border-radius:10px; min-height:86px;
  padding:4px 5px; cursor:pointer; display:flex; flex-direction:column; gap:2px; overflow:hidden;
  transition:border-color .12s;
}
.cal-cell:active{border-color:var(--orange)}
.cal-cell.other{background:#fafafc; color:#b6bac4}
.cal-cell.closed{background:var(--closed)}
.cal-cell.today{border:2px solid var(--orange)}
.cal-date{font-size:13px; font-weight:700; display:flex; justify-content:space-between; align-items:baseline}
.cal-heb{font-size:9.5px; color:var(--muted); direction:rtl; font-weight:600}
.hol-row{display:flex;flex-direction:column;gap:2px}
.cal-hol{font-size:9px; line-height:1.25; border-radius:5px; padding:1px 4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.hol-yomtov{background:#fde2d1; color:#a33c00}
.hol-cholhamoed{background:#fff3d6; color:#8a6100}
.hol-minor,.hol-roshchodesh{background:#e3ecff; color:#3455a5}
.hol-fast{background:#efe0f7; color:#6b2d91}
.hol-erev{background:#eef0f4; color:#5a6170}
.hol-us{background:#e0f4e8; color:#1d7a46}
.hol-shabbos{background:#dfe3ee; color:#3d4560}
.cal-closed-tag{font-size:9px; font-weight:800; color:#9aa0ae; text-transform:uppercase; letter-spacing:.5px}
.chip-row{display:flex; flex-wrap:wrap; gap:2px; margin-top:auto}
.chip{
  font-size:9.5px; font-weight:700; color:#fff; border-radius:6px; padding:1px 5px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%;
}
.chip.more{background:#c7ccd6}
.hours-badge{font-size:9px; color:var(--muted); font-weight:600}

.day-list{display:flex; flex-direction:column; gap:8px}
.day-row{
  display:flex; align-items:center; gap:10px; background:#fff; border:1px solid var(--line);
  border-radius:12px; padding:10px 12px;
}
.day-row .avatar{flex:none}
.avatar{
  width:32px; height:32px; border-radius:50%; color:#fff; font-weight:800; font-size:12px;
  display:flex; align-items:center; justify-content:center; flex:none;
}
.day-row .who{flex:1; min-width:0}
.day-row .who .nm{font-weight:700; font-size:14px}
.day-row .who .hrs{font-size:12px; color:var(--muted)}
.day-row .tot{font-weight:800; font-size:14px; color:var(--orange-dark)}
.icon-btn{border:none; background:transparent; cursor:pointer; font-size:16px; padding:4px}
.big-btn{
  background:var(--orange); color:#fff; border:none; border-radius:12px; padding:11px 16px;
  font-size:14px; font-weight:700; cursor:pointer; width:100%;
}
.big-btn:active{background:var(--orange-dark)}
.ghost-btn{
  background:#fff; color:var(--ink); border:1px solid var(--line); border-radius:12px;
  padding:10px 14px; font-size:13px; font-weight:600; cursor:pointer;
}
.section-title{font-size:15px; font-weight:800; margin:4px 0 10px}
.muted{color:var(--muted); font-size:13px}
.empty-note{padding:22px; text-align:center; color:var(--muted); font-size:13.5px}

.modal-veil{
  position:fixed; inset:0; background:rgba(20,22,30,.4); z-index:40;
  display:flex; align-items:flex-end; justify-content:center;
}
.modal{
  background:#fff; border-radius:20px 20px 0 0; width:100%; max-width:560px; max-height:86vh;
  overflow-y:auto; padding:18px 18px calc(18px + env(safe-area-inset-bottom));
}
.modal h3{font-size:16px; margin-bottom:2px}
.modal .sub{font-size:12.5px; color:var(--muted); margin-bottom:12px}
.form-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:10px 0}
.form-grid label{font-size:11.5px; font-weight:700; color:var(--muted); display:block; margin-bottom:3px}
input[type="time"],input[type="date"],input[type="text"],select{
  width:100%; border:1px solid var(--line); border-radius:10px; padding:9px 10px; font-size:15px;
  background:#fff; color:var(--ink);
}
.staff-pick{display:flex; flex-wrap:wrap; gap:6px; margin:8px 0}
.staff-pick .pick{
  border:1.5px solid var(--line); background:#fff; border-radius:20px; padding:6px 12px;
  font-size:13px; font-weight:700; cursor:pointer; display:flex; align-items:center; gap:6px;
}
.staff-pick .pick.sel{border-color:var(--orange); background:#fff4ec}
.dot{width:10px;height:10px;border-radius:50%;display:inline-block}
.modal-btns{display:flex; gap:8px; margin-top:14px}
.modal-btns .big-btn{flex:1}

.staff-row{display:flex; align-items:center; gap:10px; padding:10px 4px; border-bottom:1px solid var(--line)}
.staff-row:last-child{border-bottom:none}
.staff-row .nm{flex:1; font-weight:700; font-size:14px}
.color-dots{display:flex; gap:6px; flex-wrap:wrap; margin:8px 0}
.color-dots .cd{width:26px;height:26px;border-radius:50%;cursor:pointer;border:2px solid transparent}
.color-dots .cd.sel{border-color:var(--ink)}

.week-totals{display:flex; flex-direction:column; gap:6px}
.wt-row{display:flex; justify-content:space-between; font-size:13.5px; padding:8px 10px; background:#fafafc; border-radius:10px}
.wt-row b{color:var(--orange-dark)}
.person-head{display:flex; align-items:center; gap:12px; margin-bottom:12px}
.person-head .avatar{width:44px;height:44px;font-size:16px}
.person-head .nm{font-size:17px; font-weight:800}
.person-head .tot{font-size:12.5px; color:var(--muted)}
@media (min-width:760px){
  .cal-cell{min-height:110px}
  .modal-veil{align-items:center}
  .modal{border-radius:20px}
}

@media (max-width:560px){
  .cal-cell{min-height:62px; padding:3px 4px; border-radius:8px}
  .cal-date{font-size:12px}
  .cal-heb{font-size:9px}
  .heb-m{display:none}
  .hol-row{flex-direction:row; flex-wrap:wrap; gap:3px; margin-top:1px}
  .cal-hol{font-size:0; width:8px; height:8px; border-radius:50%; padding:0; flex:none}
  .cal-closed-tag{font-size:8px; letter-spacing:.3px}
  .chip{font-size:9px}
  .cal-grid{gap:3px}
  .cal-dow{font-size:10px}
  .brand-logo{height:38px}
  .month-title{font-size:16px}
  .month-title .heb{font-size:11px}
}
