/* Дни рождения клиентов — поверх общих стилей FRBS Labs (base.css из «Графика отпусков») */

/* типы дат: фон, текст, насыщенный цвет — та же схема, что у типов отсутствий */
.ty-bday    { --bg: var(--t-unpaid);   --ink-c: var(--t-unpaid-ink);   --mark: var(--t-unpaid-mark); }
.ty-jubilee { --bg: var(--t-sick);     --ink-c: var(--t-sick-ink);     --mark: var(--t-sick-mark); }
.ty-company { --bg: var(--t-trip);     --ink-c: var(--t-trip-ink);     --mark: var(--t-trip-mark); }
.ty-partner { --bg: var(--t-vacation); --ink-c: var(--t-vacation-ink); --mark: var(--t-vacation-mark); }
.ty-prof    { --bg: var(--t-dayoff);   --ink-c: var(--t-dayoff-ink);   --mark: var(--t-dayoff-mark); }
.ty-custom  { --bg: var(--t-other);    --ink-c: var(--t-other-ink);    --mark: var(--t-other-mark); }

.mock-flag { align-self: center; z-index: 5; font-size: 11px; color: var(--muted); background: var(--surface); border-radius: 8px; padding: 4px 10px; box-shadow: var(--shadow); }

/* ---------- сводка ---------- */
.stat .faces .av { width: 30px; height: 30px; font-size: 11px; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat-sub a { cursor: pointer; }

/* ---------- календарь месяца + повестка дня ---------- */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: 1fr; } }
.cal { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-wd { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.cal-wd div { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.cal-wd div.we { color: #e48b87; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cd { min-height: 112px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; position: relative; min-width: 0; }
.cd:nth-child(7n) { border-right: 0; }
.cd.we { background: var(--weekend); }
.cd.hol { background: var(--holiday); }
.cd.out { background: #fafbfc; }
.cd.out .cd-n, .cd.out .ev { opacity: .45; }
.cd:hover { background: #f4f9fd; }
.cd.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cd-n { font-size: 12px; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 6px; height: 22px; }
.cd.we .cd-n { color: var(--err-ink); }
.cd.today .cd-n b { background: var(--accent); color: #fff; border-radius: 11px; min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.cd-n .hl { font-size: 10px; color: var(--err-ink); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev { display: flex; align-items: center; gap: 5px; padding: 2px 6px 2px 3px; border-radius: 6px; font-size: 11.5px; line-height: 1.3; background: var(--bg); color: var(--ink-c); box-shadow: inset 2px 0 0 var(--mark); white-space: nowrap; overflow: hidden; min-width: 0; }
.ev .av { width: 16px; height: 16px; font-size: 7px; border: 0; }
.ev .t { overflow: hidden; text-overflow: ellipsis; }
.ev.done { opacity: .55; }
.ev.done .t { text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
.ev .em { font-size: 11px; }
.cd-more { font-size: 11px; color: var(--link); padding-left: 4px; }

.agenda { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 14px; }
.agenda-head { display: flex; align-items: baseline; gap: 8px; }
.agenda-head h2 { flex: 1; }
.agenda-empty { padding: 28px 10px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- карточка события (повестка и список) ---------- */
.evc { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.evc:first-child { border-top: 0; padding-top: 2px; }
.evc .av-l { width: 40px; height: 40px; font-size: 13px; }
.evc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.evc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.evc-top b { font-weight: 600; }
.evc-sub { font-size: 12px; color: var(--muted); display: flex; gap: 4px 10px; flex-wrap: wrap; }
.evc-sub a { color: var(--link); text-decoration: none; cursor: pointer; }
.evc-sub a:hover { text-decoration: underline; }
.evc-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.evc-hint { font-size: 12px; color: var(--ink-2); background: var(--chip-bg); border-radius: 8px; padding: 6px 9px; }
.evc-hint b { font-weight: 600; }
.vip { background: #fff1c2; color: #7a5200; }
.tier-b { background: var(--accent-soft); color: var(--info-ink); }
.done-pill { background: var(--ok-bg); color: var(--ok-ink); }
.resp { display: inline-flex; align-items: center; gap: 5px; }
.resp .av { width: 18px; height: 18px; font-size: 7px; }

/* ---------- список «Ближайшие» ---------- */
.up-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .up-wrap { grid-template-columns: 1fr; } }
.up-day { display: flex; flex-direction: column; gap: 6px; }
.up-day h3 { font-size: 13px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; display: flex; gap: 8px; align-items: baseline; }
.up-day h3 small { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.up-day .card { padding: 4px 18px; }
.side-card h3 { margin-bottom: 8px; }
.gift-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.gift-row:first-of-type { border-top: 0; }
.gift-row .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-row small { color: var(--muted); }
.gift-sum { display: flex; justify-content: space-between; font-weight: 600; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; }

/* ---------- окно поздравления ---------- */
.ch-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ch { border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; padding: 7px 12px; font-size: 13px; display: inline-flex; gap: 8px; align-items: center; color: var(--ink-2); text-align: left; }
.ch small { display: block; font-size: 11px; color: var(--muted); }
.ch[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--info-ink); }
.ch[disabled] { opacity: .45; cursor: default; }
.ch .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok-ink); flex: none; }
.ch .dot.off { background: var(--line-strong); }
textarea.input { min-height: 132px; resize: vertical; line-height: 1.5; }
.ai-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ai-chip { border: 1px dashed var(--accent); background: #fff; color: var(--accent-dark); border-radius: 14px; padding: 4px 11px; font-size: 12px; display: inline-flex; gap: 5px; align-items: center; }
.ai-chip:hover { background: var(--accent-soft); }
.hist { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.hist div { display: flex; gap: 10px; padding: 7px 12px; font-size: 13px; border-top: 1px solid var(--line-soft); }
.hist div:first-child { border-top: 0; }
.hist b { font-weight: 600; width: 44px; flex: none; color: var(--ink-2); }
.hist span { color: var(--ink-2); }
.hist small { margin-left: auto; color: var(--muted); white-space: nowrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
.ctx { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ctx b { color: var(--ink); font-weight: 600; }

/* ---------- итоги ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 180px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .meter { height: 10px; border-radius: 5px; }
.bar-row .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 150px; padding-top: 10px; }
.months div { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: 11px; color: var(--muted); }
.months i { display: block; width: 70%; border-radius: 5px 5px 0 0; background: var(--accent); min-height: 2px; }
.months i.part { background: linear-gradient(to top, var(--accent) var(--p), #c9eefb var(--p)); }
.months div.cur { color: var(--ink); font-weight: 600; }

/* ---------- настройки ---------- */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; align-items: start; }
.set-list { display: flex; flex-direction: column; }
.set-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.set-item:first-child { border-top: 0; }
.set-item input[type=checkbox] { margin-top: 3px; accent-color: var(--accent-dark); flex: none; }
.set-item .grow b { font-weight: 500; display: block; }
.set-item .grow small { color: var(--muted); font-size: 12px; display: block; }
.set-item .tag { margin-top: 1px; }
.new-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--danger); border-radius: 5px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }
.inline-s { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); margin-top: 6px; flex-wrap: wrap; }
.inline-s .input { width: auto; }
.kanban-demo { display: flex; flex-direction: column; gap: 6px; background: var(--ground); border-radius: 10px; padding: 10px; }
.kb-card { background: #fff; border-radius: 8px; padding: 8px 10px; box-shadow: var(--shadow); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.kb-card b { font-size: 13px; font-weight: 500; color: var(--link); }
.kb-mark { align-self: flex-start; font-size: 11px; background: var(--t-unpaid); color: var(--t-unpaid-ink); border-radius: 5px; padding: 1px 7px; }

/* ---------- качество данных ---------- */
.fill-list .evc { align-items: center; }
.fill-src { font-size: 12px; color: var(--muted); }
.fill-src b { color: var(--ink-2); font-weight: 500; }

/* ---------- рабочее приложение ---------- */
.menu { position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; background: #fff; border-radius: 10px; box-shadow: 0 8px 28px rgba(20, 24, 30, .18); padding: 4px; min-width: 190px; display: flex; flex-direction: column; }
.menu button { border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.menu button:hover { background: var(--accent-soft); }
.menu-wrap { position: relative; display: inline-flex; }
.evc-top b a { color: inherit; text-decoration: none; cursor: pointer; }
.evc-top b a:hover { color: var(--link); text-decoration: underline; }
.link-btn { border: 0; background: transparent; color: var(--link); font-size: 12px; padding: 0 2px; }
.link-btn:hover { text-decoration: underline; }
.empty-big { padding: 48px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty-big b { color: var(--ink); font-size: 16px; font-weight: 600; }
.set-item select.input-s, .set-item .inline-s .input { width: auto; }
.cd .ev { cursor: pointer; }
.loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
