/* LEUMI | ועד CALENDAR — styles
   Palette: Leumi-style royal blue, sky (תכלת), white and grey.
   Colour carries meaning only: category, status, warning. */

:root {
  --navy: #0A2557;
  --blue: #123E8C;
  --blue-600: #1A50B0;
  --blue-50: #EEF3FB;
  --blue-100: #E2EBF8;
  --sky: #3FA9E0;
  --sky-100: #E6F4FC;
  --sky-700: #1D6E9E;
  --bg: #F3F6FA;
  --surface: #FFFFFF;
  --weekend: #F7F9FC;
  --line: #DDE4EE;
  --line-strong: #C4CFDE;
  --text: #17253B;
  --text-2: #4A5A73;
  --text-3: #76849A;
  --ok: #15704A;
  --ok-bg: #E7F5EE;
  --warn: #8F5600;
  --warn-bg: #FFF5E1;
  --warn-line: #F0CF8E;
  --danger: #B42318;
  --danger-bg: #FDEDEB;
  --danger-line: #F3B9B2;
  --focus: #7CC4EC;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;
  --shadow-float: 0 12px 32px rgba(10, 37, 87, 0.18);
  --font-ui: 'IBM Plex Sans Hebrew', 'Segoe UI', 'Arial Hebrew', Arial, sans-serif;
  --font-display: 'Frank Ruhl Libre', 'David', 'Times New Roman', serif;
  --topbar-h: 58px;
  --bottomnav-h: 62px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- boot / standalone screens ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--text-2); }
.solo {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(180deg, var(--blue-50) 0, var(--bg) 320px);
}
.solo-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-l); padding: 28px 24px;
}
.solo-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.solo-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.solo-sub { color: var(--text-2); margin-top: 4px; }
.solo-card form { display: grid; gap: 14px; margin-top: 18px; }
.solo-foot { margin-top: 18px; color: var(--text-3); font-size: 13px; }
.code-input { letter-spacing: 0.4em; text-align: center; font-size: 22px; direction: ltr; font-variant-numeric: tabular-nums; }

/* ---------- brand mark ---------- */
.mark {
  width: 38px; height: 38px; border-radius: 10px; background: var(--blue); color: #fff;
  display: grid; place-items: center; flex: none;
}
.mark svg { width: 22px; height: 22px; }
.logo-img { height: 38px; width: auto; max-width: 120px; object-fit: contain; flex: none; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
}
.topbar-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.topbar-title h1 { font-size: 15px; font-weight: 600; color: var(--navy); line-height: 1.2; }
.topbar-nav { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--text-2);
}
.icon-btn:hover { background: var(--blue-50); color: var(--blue); }
.icon-btn svg { width: 22px; height: 22px; }
.count-badge {
  position: absolute; top: 4px; inset-inline-end: 3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; line-height: 1; border: 2px solid var(--surface);
}
.pending-pill {
  display: none; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 18px;
  border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn); font-weight: 600; text-decoration: none;
  font-size: 14px;
}
.pending-pill b { background: var(--warn); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; line-height: 20px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--blue-100); color: var(--blue);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.menu-pop {
  position: absolute; top: calc(var(--topbar-h) - 6px); inset-inline-end: 8px; z-index: 40; width: 250px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: var(--shadow-float); padding: 8px;
}
.menu-pop .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-pop .who strong { display: block; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 8px;
  background: transparent; text-align: start; text-decoration: none; color: var(--text);
}
.menu-item:hover { background: var(--blue-50); }
.menu-item svg { width: 18px; height: 18px; color: var(--text-3); }

.main { max-width: 1240px; margin: 0 auto; padding: 0 0 88px; }
.page { padding: 16px 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-title { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--navy); }
.page-lead { color: var(--text-2); margin-top: 2px; }

.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line); display: flex;
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-3); text-decoration: none; font-size: 11.5px; position: relative;
}
.bottom-nav a svg { width: 23px; height: 23px; }
.bottom-nav a[aria-current='page'] { color: var(--blue); font-weight: 600; }
.bottom-nav .count-badge { top: 4px; inset-inline-end: calc(50% - 22px); }

.fab {
  position: fixed; z-index: 25; inset-inline-end: 14px; bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 14px);
  height: 52px; padding: 0 20px 0 18px; border-radius: 26px; border: 0; background: var(--blue); color: #fff;
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15.5px; box-shadow: var(--shadow-float);
}
.fab svg { width: 22px; height: 22px; }
.fab:hover { background: var(--blue-600); }

/* ---------- buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--navy);
  font-weight: 600; font-size: 14.5px; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--blue-50); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); }
.btn-danger { color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-solid-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-solid-danger:hover { background: #9A1D14; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #0F5C3B; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row.end { justify-content: flex-end; }
label.btn { position: relative; cursor: pointer; }
label.btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.field { display: grid; gap: 6px; align-content: start; }
.field > label, .field-label { font-weight: 600; font-size: 14px; color: var(--text); }
.field .req { color: var(--danger); margin-inline-start: 2px; }
.field-hint { font-size: 13px; color: var(--text-3); }
.date-hint { font-size: 13px; color: var(--text-2); margin-top: -6px; }
.field-error { font-size: 13px; color: var(--danger); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
}
.textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(63, 169, 224, 0.25); }
.input[aria-invalid='true'], .select[aria-invalid='true'], .textarea[aria-invalid='true'] { border-color: var(--danger); }
.input[type='date'], .input[type='time'] { direction: rtl; }
.ltr { direction: ltr; text-align: left; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid { display: grid; gap: 16px; }
.radio-list { display: grid; gap: 8px; }

/* ---------- badges & tags ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--blue-50); color: var(--blue);
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.grey { background: #EEF1F5; color: var(--text-2); }
.badge.demo { background: #F1ECFB; color: #5B3B9A; }
.cat-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--text-3)); flex: none; }

/* ---------- calendar header (the one display moment) ---------- */
.cal-head { padding: 18px 14px 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cal-title { min-width: 0; }
.cal-title h2 {
  font-family: var(--font-display); font-weight: 700; color: var(--navy);
  font-size: 34px; line-height: 1.05; letter-spacing: -0.01em;
}
.cal-title h2 .yr { font-weight: 500; color: var(--blue); margin-inline-start: 6px; }
.cal-title .heb { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.cal-nav { display: flex; align-items: center; gap: 4px; flex: none; }
.cal-nav .icon-btn { width: 40px; height: 40px; border: 1px solid var(--line-strong); background: var(--surface); }
.today-btn { min-height: 40px; }

.cal-tools { padding: 0 14px 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; padding: 3px; }
.seg button {
  border: 0; background: transparent; height: 34px; padding: 0 14px; border-radius: 6px; color: var(--text-2); font-weight: 600; font-size: 14px;
}
.seg button[aria-pressed='true'] { background: var(--blue); color: #fff; }
.search { position: relative; flex: 1 1 100%; order: 3; }
.search svg { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.search .input { padding-inline-start: 36px; min-height: 42px; }
.filter-btn b { background: var(--blue); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; line-height: 20px; }
.active-filters { padding: 0 14px 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip-x {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 10px; border-radius: 15px;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; color: var(--text-2);
}
.chip-x button { border: 0; background: transparent; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); padding: 0; }
.chip-x button:hover { background: var(--blue-50); }
.chip-x svg { width: 14px; height: 14px; }

.sync-line { padding: 0 14px 8px; font-size: 12.5px; color: var(--text-3); display: flex; gap: 8px; align-items: center; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.sync-dot.live { background: #1E9E63; }
.sync-dot.poll { background: var(--sky); }
.sync-dot.off { background: var(--danger); }
.linkish { border: 0; background: none; padding: 0; color: var(--blue); text-decoration: underline; font-size: inherit; }

.banner {
  margin: 0 14px 10px; padding: 10px 12px; border-radius: var(--radius-m); font-size: 14px;
  background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); display: flex; gap: 8px; align-items: flex-start;
}
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.banner.info { background: var(--sky-100); color: var(--sky-700); border-color: #BFE1F4; }

/* ---------- layout of the calendar page ---------- */
.cal-layout { display: grid; gap: 14px; }
.cal-main { min-width: 0; }
.side { display: none; }

/* ---------- month grid ---------- */
.month { background: var(--surface); border-block: 1px solid var(--line); }
.month-dows, .month-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-dows div { padding: 8px 0 6px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--text-3); border-bottom: 1px solid var(--line); }
.month-week + .month-week .day { border-top: 1px solid var(--line); }
.day {
  position: relative; min-height: 58px; padding: 5px 4px 6px; border: 0; background: transparent; text-align: start;
  display: flex; flex-direction: column; gap: 3px; min-width: 0; border-inline-start: 1px solid var(--line);
}
.day:first-child { border-inline-start: 0; }
.day.weekend { background: var(--weekend); }
.day.major { background: #F0F8FD; }
.day.other { color: var(--text-3); }
.day-top { display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.dnum-btn { border: 0; background: none; padding: 0; border-radius: 50%; }
.dnum {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text);
}
.day.other .dnum { color: #A9B4C4; }
.day.today .dnum { background: var(--blue); color: #fff; }
.day.selected { box-shadow: inset 0 0 0 2px var(--sky); }
.hday { font-size: 10.5px; color: var(--text-3); }
.hol { font-size: 10.5px; line-height: 1.25; color: var(--sky-700); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day .hol { display: none; }
.day.has-hol .hday { color: var(--sky-700); font-weight: 700; }
.dots { display: flex; flex-wrap: wrap; gap: 3px; padding-inline: 3px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); display: block; }
.dots i.cancelled { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.dots .more { font-size: 10px; color: var(--text-3); line-height: 7px; }
.chips { display: none; }
.mchip {
  display: flex; align-items: center; gap: 4px; min-width: 0; height: 21px; padding: 0 6px; border: 0; border-radius: 4px;
  background: #EEF1F6; background: color-mix(in srgb, var(--c) 13%, white); border-inline-start: 3px solid var(--c);
  font-size: 12px; color: var(--text); text-align: start; cursor: pointer;
}
.mchip .t { font-variant-numeric: tabular-nums; color: var(--text-2); flex: none; }
.mchip .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mchip.cont-start { border-start-start-radius: 0; border-end-start-radius: 0; }
.mchip.cancelled .n { text-decoration: line-through; color: var(--text-3); }
.more-link { border: 0; background: none; padding: 0 6px; font-size: 12px; color: var(--blue); text-align: start; }

/* ---------- agenda (selected day / list view / week on phones) ---------- */
.agenda { background: var(--surface); border-block: 1px solid var(--line); }
.agenda-head { padding: 14px 14px 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.agenda-head h3 { font-size: 16px; color: var(--navy); }
.agenda-head .heb { font-size: 13px; color: var(--text-3); }
.agenda-hol { padding: 0 14px 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.erow {
  width: 100%; display: grid; grid-template-columns: 62px 4px 1fr; gap: 0 12px; align-items: stretch; padding: 11px 14px;
  border: 0; border-top: 1px solid var(--line); background: transparent; text-align: start; cursor: pointer; color: inherit;
}
.erow:hover { background: var(--blue-50); }
.erow .time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy); font-size: 14px; padding-top: 1px; }
.erow .time small { display: block; font-weight: 400; color: var(--text-3); font-size: 12px; }
.erow .bar { border-radius: 2px; background: var(--c); }
.erow .body { min-width: 0; display: grid; gap: 3px; }
.erow .title { font-weight: 600; font-size: 15px; line-height: 1.35; }
.erow.cancelled .title { text-decoration: line-through; color: var(--text-3); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-2); }
.meta span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.meta svg { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.empty-day { padding: 14px; color: var(--text-3); border-top: 1px solid var(--line); font-size: 14px; }
.list-group-head {
  position: sticky; top: var(--topbar-h); z-index: 5; padding: 9px 14px; background: var(--bg);
  border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
}
.list-group-head strong { color: var(--navy); font-size: 14.5px; }
.list-group-head span { font-size: 12.5px; color: var(--text-3); }
.list-group-head.today strong::after { content: 'היום'; margin-inline-start: 8px; font-size: 11.5px; color: #fff; background: var(--blue); border-radius: 8px; padding: 1px 7px; vertical-align: 2px; }

/* ---------- week grid (desktop) ---------- */
.week { display: none; }
.week-agenda .day-block + .day-block { border-top: 6px solid var(--bg); }

/* ---------- empty states ---------- */
.empty { padding: 36px 20px; text-align: center; color: var(--text-2); display: grid; gap: 10px; justify-items: center; }
.empty h3 { color: var(--navy); font-size: 17px; }

/* ---------- modal / sheet ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(10, 30, 70, 0.42); display: flex; align-items: flex-end; justify-content: center; }
.modal {
  width: 100%; max-height: 94vh; background: var(--surface); border-radius: var(--radius-l) var(--radius-l) 0 0;
  display: flex; flex-direction: column; box-shadow: var(--shadow-float); outline: none;
  animation: sheet-in 0.22s ease-out;
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.modal.full { height: 100%; max-height: 100%; border-radius: 0; }
.modal-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 10px 8px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; font-size: 17px; color: var(--navy); padding-top: 9px; }
.modal-body { padding: 16px 16px 20px; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }

/* event detail */
.ev-cat { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); font-weight: 500; }
.ev-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.2; margin: 6px 0 14px; }
.ev-title.cancelled { text-decoration: line-through; color: var(--text-3); }
.facts { display: grid; gap: 12px; margin-bottom: 16px; }
.fact { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.fact svg { width: 20px; height: 20px; color: var(--text-3); margin-top: 1px; }
.fact .sub { color: var(--text-3); font-size: 13.5px; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; display: grid; gap: 8px; }
.section h3 { font-size: 14px; color: var(--text-2); }
.notice {
  padding: 10px 12px; border-radius: var(--radius-m); background: var(--blue-50); color: var(--navy); font-size: 14px;
  display: flex; gap: 8px; align-items: flex-start;
}
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--blue); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.warn svg { color: var(--warn); }
.notice.danger { background: var(--danger-bg); color: var(--danger); }
.notice.danger svg { color: var(--danger); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.ok svg { color: var(--ok); }

/* conflicts */
.conflicts { border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: var(--radius-m); padding: 12px; display: grid; gap: 10px; }
.conflicts.quiet { border-color: var(--line); background: #F7F9FC; }
.conflicts-head { display: flex; gap: 8px; align-items: flex-start; color: var(--warn); font-weight: 600; }
.conflicts.quiet .conflicts-head { color: var(--text-2); }
.conflicts-head svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.conflict { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 6px; }
.conflict.high { border-color: var(--danger-line); }
.conflict-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.conflict-title { font-weight: 600; }
.reasons { display: flex; flex-wrap: wrap; gap: 5px; }
.reason { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #EEF1F5; color: var(--text-2); font-weight: 500; }
.reason.strong { background: var(--danger-bg); color: var(--danger); }
.reason.mid { background: var(--warn-bg); color: var(--warn); }

/* diff */
.diff { width: 100%; border-collapse: collapse; font-size: 14px; }
.diff th, .diff td { text-align: start; padding: 8px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.diff thead th { border-top: 0; color: var(--text-3); font-weight: 600; font-size: 12.5px; }
.diff th[scope='row'] { color: var(--text-2); font-weight: 600; width: 26%; white-space: nowrap; }
.diff tr.changed td { background: #FFF8E6; }
.diff tr.changed td.after { font-weight: 600; color: var(--navy); }
.diff tr.changed th::after { content: '•'; color: var(--warn); margin-inline-start: 4px; }
.diff td { overflow-wrap: anywhere; }

/* requests & approvals */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button {
  border: 0; background: transparent; padding: 10px 12px; color: var(--text-2); font-weight: 600; text-decoration: none; white-space: nowrap;
  border-bottom: 3px solid transparent; font-size: 14.5px;
}
.tabs [aria-selected='true'] { color: var(--blue); border-bottom-color: var(--blue); }
.tabs .n { margin-inline-start: 6px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.req-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: clip; }
.req { border-top: 1px solid var(--line); }
.req:first-child { border-top: 0; }
.req-head { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 13px 14px; border: 0; background: transparent; text-align: start; color: inherit; }
.req-head:hover { background: var(--blue-50); }
.req-title { font-weight: 600; font-size: 15px; }
.req-sub { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-2); }
.req-sub span { display: inline-flex; align-items: center; gap: 5px; }
.req-sub svg { width: 14px; height: 14px; color: var(--text-3); }
.req-body { padding: 0 14px 16px; display: grid; gap: 14px; }
.req-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kind { font-size: 12px; font-weight: 700; color: var(--text-2); }

/* notifications */
.notif { width: 100%; display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 12px 14px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: start; color: inherit; }
.notif:hover { background: var(--blue-50); }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: transparent; }
.notif.unread .dot { background: var(--blue); }
.notif.unread .nt { font-weight: 700; }
.notif .nb { color: var(--text-2); font-size: 13.5px; white-space: pre-line; }
.notif .nw { color: var(--text-3); font-size: 12px; }
.channels { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); padding: 12px 14px; border-top: 1px solid var(--line); background: #F8FAFD; }
.channels div { display: flex; gap: 8px; align-items: center; }
.channels svg { width: 15px; height: 15px; flex: none; }

/* admin tables */
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: clip; }
.row { display: grid; gap: 4px 12px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: center; }
.row:first-child { border-top: 0; }
.row-main { min-width: 0; }
.row-main strong { display: block; }
.member-row { grid-template-columns: 1fr auto; }
.cat-row { grid-template-columns: 44px 1fr 70px auto; }
.color-input { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.hist { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; border-top: 1px solid var(--line); }
.hist:first-child { border-top: 0; }
.hist-who { font-size: 12.5px; color: var(--text-3); }
.hist details { font-size: 13.5px; }
.hist summary { cursor: pointer; color: var(--blue); font-size: 13px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; display: grid; gap: 12px; }
.panel + .panel { margin-top: 14px; }
.panel h3 { font-size: 16px; color: var(--navy); }
.logo-preview { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 8px; }
.logo-preview img { max-height: 56px; max-width: 160px; }
.stack { display: grid; gap: 14px; }
.copy-box { padding: 10px 12px; border-radius: 8px; background: var(--blue-50); white-space: pre-wrap; font-size: 14px; border: 1px solid var(--blue-100); }

/* toasts */
.toasts { position: fixed; z-index: 70; inset-inline: 12px; bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 76px); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; max-width: 520px; width: 100%; background: var(--navy); color: #fff; border-radius: var(--radius-m);
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-float); font-size: 14.5px;
  animation: sheet-in 0.2s ease-out;
}
.toast.error { background: #7A1A12; }
.toast .t-msg { flex: 1; }
.toast button { border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; border-radius: 6px; padding: 6px 10px; font-weight: 600; white-space: nowrap; }
.toast button:hover { background: rgba(255, 255, 255, 0.24); }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--blue-100); border-top-color: var(--blue); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; padding: 30px; }

/* ================= tablet & desktop ================= */
@media (min-width: 720px) {
  .search { flex: 1 1 200px; order: 0; }
  .page { padding: 22px 20px; }
  .cal-head { padding: 22px 20px 12px; }
  .cal-title h2 { font-size: 42px; }
  .cal-tools, .active-filters, .sync-line { padding-inline: 20px; }
  .banner { margin-inline: 20px; }
  .month { border: 1px solid var(--line); border-radius: var(--radius-l); overflow: clip; margin: 0 20px; }
  .day { min-height: 112px; padding: 6px 6px 8px; }
  .dots { display: none; }
  .chips { display: grid; gap: 3px; }
  .hol { font-size: 11.5px; }
  .day .hol { display: block; }
  .day.has-hol .hday { color: var(--text-3); font-weight: 400; }
  .agenda { border: 1px solid var(--line); border-radius: var(--radius-l); overflow: clip; margin: 0 20px; }
  .list-group-head { top: var(--topbar-h); }
  .modal { width: min(600px, calc(100vw - 40px)); max-height: 88vh; border-radius: var(--radius-l); }
  .modal.wide { width: min(760px, calc(100vw - 40px)); }
  .modal.full { height: auto; max-height: 90vh; border-radius: var(--radius-l); }
  .backdrop { align-items: center; padding: 20px; }
  .member-row { grid-template-columns: 1.4fr 1fr auto auto; }
}

@media (min-width: 1024px) {
  .shell { padding-bottom: 0; }
  :root { --topbar-h: 64px; }
  .topbar { padding: 0 24px; gap: 16px; }
  .topbar-title h1 { font-size: 17px; }
  .topbar-nav { display: flex; gap: 2px; margin-inline-start: 18px; }
  .topbar-nav a {
    position: relative; padding: 8px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14.5px;
  }
  .topbar-nav a:hover { background: var(--blue-50); color: var(--blue); }
  .topbar-nav a[aria-current='page'] { color: var(--blue); background: var(--blue-50); }
  .topbar-nav .n { margin-inline-start: 6px; background: var(--warn); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11.5px; }
  .pending-pill { display: inline-flex; }
  .bottom-nav { display: none; }
  .fab { display: none; }
  .toasts { bottom: 24px; }
  .main { padding: 0 8px 32px; }
  .cal-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; padding: 0 20px; gap: 20px; }
  .cal-layout .month, .cal-layout .agenda { margin: 0; }
  .side { display: grid; gap: 14px; position: sticky; top: 80px; }
  .side .agenda { margin: 0; }
  .side .agenda.only-mobile { display: none; }
  .only-mobile { display: none !important; }
  .week { display: block; }
  .week-agenda { display: none; }
  .cal-head { padding: 26px 20px 14px; }
  .cal-title h2 { font-size: 48px; }
}
@media (max-width: 1023.98px) {
  .only-desktop { display: none !important; }
}

/* week time-grid (desktop) */
.week { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
.wk-head, .wk-allday { display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr)); }
.wk-head > div { padding: 8px 6px; border-inline-start: 1px solid var(--line); text-align: center; }
.wk-head > div:first-child { border-inline-start: 0; }
.wk-head .wd { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.wk-head .dn { font-size: 20px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.2; }
.wk-head .today .dn { color: #fff; background: var(--blue); border-radius: 50%; width: 34px; height: 34px; display: inline-grid; place-items: center; }
.wk-head .hd { font-size: 11px; color: var(--text-3); }
.wk-head .hol { white-space: normal; }
.wk-allday { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-strong); }
.wk-allday > div { padding: 4px; border-inline-start: 1px solid var(--line); display: grid; gap: 3px; align-content: start; min-height: 30px; }
.wk-allday > div:first-child { border-inline-start: 0; font-size: 11px; color: var(--text-3); padding-top: 8px; text-align: center; }
.wk-scroll { height: 560px; overflow-y: auto; position: relative; }
.wk-grid { display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr)); position: relative; }
.wk-hours div { height: 48px; font-size: 11.5px; color: var(--text-3); text-align: center; padding-top: 2px; font-variant-numeric: tabular-nums; border-top: 1px solid transparent; }
.wk-col { position: relative; border-inline-start: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% 48px; }
.wk-col.weekend { background-color: var(--weekend); }
.wk-ev {
  position: absolute; border: 0; border-radius: 5px; padding: 3px 6px; text-align: start; overflow: hidden;
  background: #EEF1F6; background: color-mix(in srgb, var(--c) 16%, white); border-inline-start: 3px solid var(--c);
  font-size: 12px; line-height: 1.3; color: var(--text); cursor: pointer;
}
.wk-ev:hover { z-index: 3; box-shadow: 0 2px 10px rgba(10, 37, 87, 0.18); }
.wk-ev .t { font-variant-numeric: tabular-nums; color: var(--text-2); display: block; white-space: nowrap; direction: ltr; text-align: right; }
.wk-ev .n { font-weight: 600; }
.wk-ev.cancelled .n { text-decoration: line-through; color: var(--text-3); }
.wk-now { position: absolute; inset-inline: 0; height: 2px; background: var(--danger); z-index: 2; }
.wk-now::before { content: ''; position: absolute; inset-inline-start: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
