/*
 * Custom dropdown (.cs) + date picker (.dp) — the look/behaviour of the
 * Angular app-filter-dropdown / app-date-picker, used everywhere the old
 * Python templates had native <select> / <input type="date">.
 */
[x-cloak] { display: none !important; }

/* ── Custom dropdown ───────────────────────────────────────────── */
.cs { position: relative; font-family: inherit; }
.cs__trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 38px;
  padding: 0 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff;
  cursor: pointer; font: inherit; font-size: 13px; color: #0f172a; text-align: left;
}
.cs__trigger:hover { border-color: #cbd5e1; }
.cs__trigger.open { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
.cs__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cs__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cs__label.placeholder { color: #94a3b8; font-weight: 500; }
.cs__prefix { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #94a3b8; flex-shrink: 0; margin-right: -2px; transition: color .2s; }
.cs__trigger.has-sel .cs__prefix { color: #818cf8; }
.cs__icon { display: inline-flex; flex-shrink: 0; }
.cs__icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: #94a3b8; }
.cs__clear { color: #cbd5e1; font-size: 12px; padding: 0 2px; line-height: 1; }
.cs__clear:hover { color: #ef4444; }
.cs__chev {
  width: 16px; height: 16px; flex-shrink: 0; color: #94a3b8; fill: none;
  stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .15s;
}
.cs__trigger.open .cs__chev { transform: rotate(180deg); }

.cs__panel {
  position: absolute; z-index: 70; top: calc(100% + 6px); left: 0; min-width: 100%;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .14); padding: 6px;
}
.cs__search { padding: 2px 2px 8px; }
.cs__search input {
  width: 100%; height: 32px; border: 1px solid #e2e8f0; border-radius: 7px;
  padding: 0 10px; font: inherit; font-size: 13px; outline: none; box-sizing: border-box;
}
.cs__search input:focus { border-color: #3b82f6; }
.cs__list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.cs__opt {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px;
  cursor: pointer; font-size: 13px; color: #334155;
}
.cs__opt:hover { background: #f1f5f9; }
.cs__opt.sel { background: #eff6ff; color: #2563eb; font-weight: 600; }
.cs__optdot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
/* Options wrap (long OKR titles were overflowing the panel); the trigger label stays one line. */
.cs__opttext { flex: 1; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.cs__check {
  width: 16px; height: 16px; flex-shrink: 0; color: #2563eb; fill: none;
  stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
.cs__empty { padding: 10px; text-align: center; font-size: 12.5px; color: #94a3b8; }

/* Compact variant for top-bar filters (matches .okr-filter height). */
.cs--compact .cs__trigger { height: 30px; border-radius: 6px; font-size: 12px; }
.cs--compact .cs__label { font-weight: 600; }

/* ── Progress-calc radio cards (KR drawer) + ≥/≤ target toggle ──── */
.calc-cards { display: flex; flex-direction: column; gap: 10px; }
.calc-card { display: flex; align-items: flex-start; gap: 12px; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 14px 16px; cursor: pointer; }
.calc-card:hover { border-color: #cbd5e1; }
.calc-card.selected { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.calc-radio { width: 18px; height: 18px; border: 2px solid #cbd5e1; border-radius: 50%; flex-shrink: 0; margin-top: 1px; position: relative; }
.calc-radio.on { border-color: #3b82f6; }
.calc-radio.on::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #3b82f6; }
.calc-card__title { display: block; font-size: 12px; font-weight: 700; color: #0f172a; letter-spacing: .03em; }
.calc-card__desc { display: block; font-size: 12px; color: #64748b; margin-top: 3px; line-height: 1.4; }

.cond-toggle { display: inline-flex; gap: 0; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; margin-right: 8px; }
.cond-toggle button { width: 34px; height: 38px; border: 0; background: #fff; font-size: 15px; font-weight: 700; color: #64748b; cursor: pointer; }
.cond-toggle button + button { border-left: 1px solid #e2e8f0; }
.cond-toggle button.on { background: #3b82f6; color: #fff; }
.cond-row { display: flex; align-items: stretch; }
.cond-row .field-input { flex: 1; }

/* ── Date picker ───────────────────────────────────────────────── */
.dp { position: relative; font-family: inherit; }
.dp__cal {
  width: 16px; height: 16px; flex-shrink: 0; color: #94a3b8; fill: none;
  stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.dp__panel {
  position: absolute; z-index: 70; top: calc(100% + 6px); left: 0; width: 260px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .14); padding: 12px; box-sizing: border-box;
}
.dp__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp__nav {
  width: 28px; height: 28px; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #475569;
}
.dp__nav:hover { background: #f1f5f9; }
.dp__nav svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dp__title { font-size: 13px; font-weight: 700; color: #0f172a; }
.dp__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp__dow { font-size: 10px; font-weight: 700; color: #94a3b8; text-align: center; padding: 4px 0; text-transform: uppercase; }
.dp__day {
  height: 30px; border: 0; background: none; border-radius: 7px; cursor: pointer;
  font: inherit; font-size: 12.5px; color: #334155;
}
.dp__day:hover { background: #f1f5f9; }
.dp__day.sel { background: #3b82f6; color: #fff; font-weight: 700; }
.dp__day.today { box-shadow: inset 0 0 0 1px #bfdbfe; }
.dp__day.blank { visibility: hidden; cursor: default; }
/* Before the picker's min date (custom_date min_date): greyed, not clickable. A past day
   that is already the value (editing an old meeting) still shows as selected. */
.dp__day.past:not(.sel) { color: #cbd5e1; cursor: not-allowed; background: none; }
.dp__foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid #f1f5f9; }
.dp__foot button { background: none; border: 0; font: inherit; font-size: 12px; cursor: pointer; color: #64748b; padding: 2px 4px; }
.dp__foot button:hover { color: #0f172a; }
.dp__foot .dp__set { color: #2563eb; font-weight: 600; }


/* ── Reusable date filter (Day/Week/Month/Range) — ported from Angular app-date-filter ── */
.df { display: inline-flex; align-items: center; gap: 8px; position: relative; }
.df button, .df select, .df input { font-family: inherit; }

.df-mode { position: relative; display: flex; align-items: center; }
.df-mode__select {
  appearance: none; -webkit-appearance: none; background: #fff;
  border: 1px solid #e2e8f0; color: #0f172a; height: 36px;
  padding: 0 30px 0 14px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.df-mode__select:hover { border-color: #3b82f6; }
.df-mode__select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.2); }
.df-mode__chev { position: absolute; right: 10px; pointer-events: none; color: #94a3b8; display: flex; }
.df-mode__chev svg { width: 12px; height: 12px; }

.df-nav { display: flex; align-items: center; gap: 6px; background: var(--input-bg); padding: 4px; border-radius: 8px; border: 1px solid var(--input-border); height: 36px; }
.df-nav__arrow { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--glass-bg-hover); border: none; color: var(--text-secondary); cursor: pointer; border-radius: 6px; }
.df-nav__arrow:hover { background: var(--glass-bg-hover); color: var(--text-primary); }
.df-nav__arrow svg { width: 14px; height: 14px; }
.df-display { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 26px; padding: 0 12px; cursor: pointer; border-radius: 6px; background: transparent; border: none; user-select: none; }
.df-display__cal { width: 15px; height: 15px; color: #94a3b8; flex-shrink: 0; }
.df-display__label { color: #0f172a; font-size: 13px; font-weight: 600; white-space: nowrap; }
.df-display:hover { background: #f1f5f9; }
.df-display.active { background: rgba(59,130,246,.1); }
.df-display.active .df-display__cal, .df-display.active .df-display__label { color: #3b82f6; }

.df-pop { position: absolute; top: 100%; right: 0; margin-top: 8px; z-index: 1000; min-width: 260px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 16px 40px rgba(15,23,42,.18); overflow: hidden; }
.df-pop--dual { min-width: 640px; }
.df-pop__row { display: flex; }
.df-presets { width: 140px; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; padding: 12px 8px; gap: 4px; }
.df-presets button { padding: 8px 12px; text-align: left; background: transparent; border: none; color: #475569; font-size: 13px; font-weight: 500; cursor: pointer; border-radius: 6px; }
.df-presets button:hover { background: #f1f5f9; color: #0f172a; }
.df-presets button.active { background: rgba(59,130,246,.12); color: #2563eb; font-weight: 700; }
.df-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.df-cals { display: flex; padding: 8px 16px; gap: 16px; }
.df-cals--single { padding: 12px 20px; }

.df-monthgrid { width: 260px; padding: 4px 8px; }
.df-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.df-month { height: 36px; border: none; background: transparent; border-radius: 8px; color: #475569; font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.df-month:hover { background: #f1f5f9; color: #0f172a; }
.df-month.selected { background: #3b82f6; color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(59,130,246,.35); }

.df-cal { width: 258px; }
.df-cal--wk { width: 300px; }
.df-cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; height: 30px; }
.df-cal__label { flex: 1; text-align: center; font-size: 14px; font-weight: 700; color: #0f172a; }
.df-cal__nav { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid #e2e8f0; color: #64748b; cursor: pointer; border-radius: 7px; }
.df-cal__nav:hover { background: #f1f5f9; color: #0f172a; }
.df-cal__nav svg { width: 13px; height: 13px; }
.df-cal__spacer { width: 30px; }
.df-cal__body { display: flex; gap: 12px; }

.df-wkcol { width: 42px; border-right: 1px solid #e2e8f0; padding-right: 6px; }
.df-wkcol__title { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; margin-bottom: 4px; padding: 4px 0; text-align: center; }
.df-wk { height: 36px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #475569; cursor: pointer; border-radius: 6px; border: 1px solid transparent; }
.df-wk:hover { background: #f1f5f9; color: #0f172a; }
.df-wk.selected { background: #3b82f6; color: #fff; border-color: #3b82f6; box-shadow: 0 2px 8px rgba(59,130,246,.35); }

.df-days { flex: 1; }
.df-days__head { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.df-days__head span { text-align: center; font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; padding: 4px 0; }
.df-days__grid { display: flex; flex-direction: column; }
.df-wkrow { display: grid; grid-template-columns: repeat(7, 1fr); border-radius: 8px; }
.df-wkrow--sel { background: #eff6ff; }
.df-day { height: 36px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; color: #334155; cursor: pointer; position: relative; transition: background .12s; }
.df-day:hover { background: rgba(59,130,246,.14); color: #0f172a; border-radius: 8px; }
.df-day--other { opacity: .3; }
.df-day--sel { background: #3b82f6; color: #fff; font-weight: 700; border-radius: 8px; box-shadow: 0 4px 12px rgba(59,130,246,.35); z-index: 3; }
.df-day--sel:hover { background: #2563eb; color: #fff; }
.df-day--in { background: rgba(59,130,246,.12); color: #2563eb; border-radius: 0; }
.df-day--start { background: #3b82f6; color: #fff; border-radius: 8px 0 0 8px; z-index: 3; }
.df-day--end { background: #3b82f6; color: #fff; border-radius: 0 8px 8px 0; z-index: 3; }
.df-day--today::after { content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background: #3b82f6; border-radius: 50%; }
.df-day--sel.df-day--today::after, .df-day--start.df-day--today::after, .df-day--end.df-day--today::after { background: #fff; }

.df-foot { display: flex; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid #f1f5f9; gap: 12px; }
.df-btn { padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.df-btn--cancel { background: #fff; border: 1px solid #e2e8f0; color: #64748b; }
.df-btn--cancel:hover { background: #f8fafc; color: #0f172a; }
.df-btn--apply { background: #3b82f6; border: 1px solid #3b82f6; color: #fff; box-shadow: 0 4px 12px rgba(59,130,246,.3); }
.df-btn--apply:hover { background: #2563eb; }
