/* «Важные даты» клиента и поздравления (Сабина 09.10.2026, Izi.CRM #4198) — important-dates.js (window.IDT).
   Блок «Важные даты» в «Профиле» карточки клиента и вкладка «Важные даты и праздники» окна «Бот-рассылки»
   (остальное оформление вкладки — общие классы .am-* окна). Цвета — токены темы. */

/* ---------- блок в «Профиле» ---------- */
.profile-card-icon.dates { background: #fce7f3; color: #db2777; }
body[data-theme="dark"] .profile-card-icon.dates { background: rgba(219, 39, 119, .18); color: #f9a8d4; }

#idtCard .idt-whorow { margin: -6px 0 6px; font-size: 13px; color: var(--text-muted); }
#idtCard .idt-who { font-weight: 600; color: var(--text-color); }
#idtCard .idt-row .value { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; text-align: right; }
#idtCard .idt-main { color: var(--text-color); font-weight: 600; font-variant-numeric: tabular-nums; }
#idtCard .idt-dim, .idt-am .idt-dim { color: var(--text-muted); font-weight: 400; }
#idtCard .idt-src { padding: 1px 7px; border-radius: 999px; background: var(--surface-bg); color: var(--text-muted); font-size: 11px; white-space: nowrap; }
#idtCard .idt-src.manual { background: rgba(245, 158, 11, .14); color: #b45309; }
body[data-theme="dark"] #idtCard .idt-src.manual { color: #fbbf24; }
#idtCard .idt-acts { display: inline-flex; align-items: center; gap: 2px; }
#idtCard .idt-ico { opacity: .35; background: none; border: none; cursor: pointer; padding: 3px; color: var(--text-muted); display: inline-flex; }
#idtCard:hover .idt-ico, #idtCard .idt-ico:focus-visible { opacity: 1; }
#idtCard .idt-ico:hover { color: var(--primary-color); }
#idtCard .idt-ico svg { width: 14px; height: 14px; }
#idtCard .idt-edit { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
#idtCard .idt-edit input, #idtCard .idt-edit select {
    padding: 4px 8px; border: 1px solid var(--border-color); border-radius: 7px; background: var(--card-bg); color: var(--text-color); font: inherit; font-size: 13px;
}
.idt-approx { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; margin-right: 3px; border-radius: 4px;
    background: rgba(245, 158, 11, .16); color: #b45309; font-size: 12px; font-weight: 700; cursor: help; }
body[data-theme="dark"] .idt-approx { color: #fbbf24; }
#idtCard .idt-next-title { margin: 12px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted); }
#idtCard .idt-next { display: flex; flex-direction: column; gap: 4px; }
#idtCard .idt-next-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; font-size: 13px; color: var(--text-color); }
#idtCard .idt-next-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
#idtCard .idt-sent { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
#idtCard .idt-sent svg { width: 13px; height: 13px; flex: none; }
#idtCard .idt-foot { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border-light); font-size: 12px; color: var(--text-muted); }
#idtCard .idt-foot .am-link { font-size: 12px; padding: 0; }
.idt-empty { font-size: 13px; color: var(--text-muted); padding: 4px 0; }
.idt-empty.err { color: var(--danger-color); }

/* ---------- вкладка «Важные даты и праздники» окна «Бот-рассылки» ---------- */
.idt-am { display: flex; flex-direction: column; gap: 14px; }
.idt-am .idt-occs { display: flex; flex-direction: column; gap: 8px; }
.idt-am .idt-occ { border: 1px solid var(--border-light); border-radius: 10px; padding: 10px 12px; background: var(--card-bg); transition: border-color .15s; }
.idt-am .idt-occ.on { border-color: rgba(34, 197, 94, .45); background: rgba(34, 197, 94, .05); }
.idt-am .idt-occ-head { display: flex; align-items: center; gap: 12px; }
.idt-am .idt-occ-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.idt-am .idt-occ-name b { font-size: 13.5px; color: var(--text-color); }
.idt-am .idt-occ-name span { font-size: 12px; color: var(--text-muted); }
.idt-am .idt-occ-editor { margin-top: 10px; }
.idt-am .idt-textarea { min-height: 170px; }
.idt-am .idt-count { margin-left: 8px; font-size: 12px; font-weight: 500; }
.idt-am .am-card-title .am-mini { margin-left: auto; }
.idt-am .idt-nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- блок «Праздники» (Сабина 09.10.2026, #4202): строка на праздник, раскрытие — текст, дата айта, получатели ---------- */
.idt-am .idt-hol-note { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: 9px; background: var(--surface-bg); color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.idt-am .idt-hol-note svg { flex: none; margin-top: 2px; color: var(--primary-color); }
.idt-am .idt-hols { display: flex; flex-direction: column; border: 1px solid var(--border-light); border-radius: 11px; overflow: hidden; }
.idt-am .idt-hol { border-bottom: 1px solid var(--border-light); background: var(--card-bg); transition: background .15s, box-shadow .15s; }
.idt-am .idt-hol:last-child { border-bottom: none; }
.idt-am .idt-hol.on { background: rgba(34, 197, 94, .045); box-shadow: inset 3px 0 0 #22c55e; }
.idt-am .idt-hol.open { background: var(--surface-bg); }
.idt-am .idt-hol.on.open { background: rgba(34, 197, 94, .07); }
.idt-am .idt-hol-head { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 7px 10px 7px 14px; }
.idt-am .idt-hol-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 4px 0; border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.idt-am .idt-hol-name { flex: 0 0 220px; display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13.5px; font-weight: 700; color: var(--text-color); }
.idt-am .idt-hol-who { padding: 1px 7px; border-radius: 999px; background: var(--surface-bg); color: var(--text-muted); font-size: 11px; font-weight: 600; }
.idt-am .idt-hol.open .idt-hol-who { background: var(--card-bg); }
.idt-am .idt-hol-main:hover .idt-hol-name { color: var(--primary-color); }
.idt-am .idt-hol-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.idt-am .idt-hol-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-color); font-variant-numeric: tabular-nums; white-space: nowrap; }
.idt-am .idt-hol-date svg { flex: none; color: var(--text-muted); }
.idt-am .idt-hol-when { padding: 1px 8px; border-radius: 999px; background: var(--surface-bg); color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }
.idt-am .idt-hol.open .idt-hol-when { background: var(--card-bg); }
.idt-am .idt-lunar { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: rgba(124, 58, 237, .1); color: #6d28d9; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.idt-am .idt-lunar.moved { background: rgba(245, 158, 11, .15); color: #b45309; }
.idt-am .idt-hol-aud { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-color); white-space: nowrap; font-variant-numeric: tabular-nums; cursor: default; }
.idt-am .idt-hol-aud svg { flex: none; color: var(--text-muted); }
.idt-am .idt-hol-aud.off { color: var(--text-muted); font-weight: 500; }
.idt-am .idt-hol-chev { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; padding: 0; border: 1px solid var(--border-color); border-radius: 8px;
    background: var(--card-bg); color: var(--text-muted); cursor: pointer; transition: color .15s, border-color .15s; }
.idt-am .idt-hol-chev:hover { color: var(--primary-color); border-color: var(--primary-color); }
.idt-am .idt-hol-chev svg { transition: transform .18s; }
.idt-am .idt-hol.open .idt-hol-chev svg { transform: rotate(180deg); }
.idt-am .idt-hol-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 14px 14px 68px; }
.idt-am .idt-hol-body .idt-textarea { min-height: 196px; }
.idt-am .idt-lunar-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid rgba(124, 58, 237, .25); border-radius: 10px; background: rgba(124, 58, 237, .06); }
.idt-am .idt-lunar-ico { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 9px; background: rgba(124, 58, 237, .12); color: #7c3aed; }
.idt-am .idt-lunar-txt { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; line-height: 1.45; color: var(--text-muted); }
.idt-am .idt-lunar-txt b { font-size: 13px; color: var(--text-color); }
.idt-am .idt-lunar-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.idt-am .idt-lunar-ctl input { padding: 6px 9px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--card-bg); color: var(--text-color); font: inherit; font-size: 13px; }
.idt-am .idt-lunar-ctl input:disabled { opacity: .6; }
.idt-am .idt-rec { display: flex; flex-direction: column; gap: 8px; }
.idt-am .idt-rec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.idt-am .idt-rec-title { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-color); }
.idt-am .idt-rec-title svg { color: var(--text-muted); }
.idt-am .idt-rec-pills { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.idt-am .idt-rec-toggle { margin-left: auto; }
.idt-am .idt-rec-wrap { max-height: 260px; background: var(--card-bg); }
/* таблица «Ближайшие 30 дней»: праздник — одной строкой-итогом, по клику — к празднику */
.idt-am .idt-holrow { cursor: pointer; }
.idt-am .idt-holrow:hover td { background: var(--hover-bg); }
.idt-am .idt-holtag { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.idt-am .idt-holtag svg { flex: none; color: #d97706; }
/* полоса «Сохранить» прилипает к низу окна, пока есть несохранённые изменения */
.idt-am .idt-savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px;
    border: 1px solid var(--border-color); border-radius: 12px; background: var(--card-bg); box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
    font-size: 13px; color: var(--text-color); animation: idtBarIn .18s ease-out; }
.idt-am .idt-savebar[hidden] { display: none; }
.idt-am .idt-savebar > span { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-weight: 600; color: var(--warning-color); }
.idt-am .idt-savebar .btn-primary, .idt-am .idt-savebar .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }
@keyframes idtBarIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body[data-theme="dark"] .idt-am .idt-lunar { background: rgba(196, 181, 253, .14); color: #c4b5fd; }
body[data-theme="dark"] .idt-am .idt-lunar.moved { background: rgba(251, 191, 36, .14); color: #fbbf24; }
body[data-theme="dark"] .idt-am .idt-lunar-box { border-color: rgba(196, 181, 253, .25); background: rgba(196, 181, 253, .07); }
body[data-theme="dark"] .idt-am .idt-lunar-ico { background: rgba(196, 181, 253, .14); color: #c4b5fd; }
body[data-theme="dark"] .idt-am .idt-hol.on { background: rgba(34, 197, 94, .07); }
body[data-theme="dark"] .idt-am .idt-holtag svg { color: #fcd34d; }
body[data-theme="dark"] .idt-am .idt-savebar { box-shadow: 0 12px 32px rgba(0, 0, 0, .55); }
@media (prefers-reduced-motion: reduce) { .idt-am .idt-savebar { animation: none; } .idt-am .idt-hol-chev svg { transition: none; } }

@media (max-width: 900px) {
    .idt-am .idt-occ-head { flex-wrap: wrap; }
    #idtCard .idt-next-row { grid-template-columns: minmax(0, 1fr); }
    .idt-am .idt-hol-main { flex-direction: column; align-items: flex-start; gap: 4px; }
    .idt-am .idt-hol-name { flex: none; }
    .idt-am .idt-hol-body { padding-left: 14px; }
}
