/* Системы поверх оформления CRM (app.css): лента дня, слоты, кружки, строки задач. */

/* счётчик Места Хаоса в меню */
.badge { background: var(--accent-fill); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 0 6px;
  min-width: 18px; line-height: 18px; text-align: center; margin-left: auto; }
.tabs a { position: relative; }
.tabs .badge { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }

/* шапка дня */
.day-head { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; }
.day-head h1 { flex: 1; min-width: 0; }
.day-head h1 small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-top: 2px; }
.navbtn { width: 42px; height: 42px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); color: var(--muted); }
.navbtn:hover { color: var(--accent); }
@media (min-width: 900px) { .navbtn.phone { display: none; } }

.notice.warn-box { background: var(--red-soft); color: var(--red); }
.notice .i { vertical-align: -4px; margin-right: 6px; }
.notice a { text-decoration: underline; }

/* лента дня */
.timeline { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.tl { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: start; }
.tl-time { font-size: 13px; color: var(--muted); text-align: right; padding-top: 14px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.tl-time b { display: block; color: var(--text); font-size: 15px; font-weight: 600; }
.tl .block { margin: 0; }
.tl.past .block { opacity: .72; }
.tl.now .tl-time b { color: var(--accent); }

.slot { padding: 12px 14px; }
.slot-head { display: flex; gap: 10px; align-items: center; }
.slot-head h2 { margin: 0; flex: 1; min-width: 0; font-size: 16px; }
.slot-head h2 a:hover { color: var(--accent); }
.slot.priority { border-left: 3px solid var(--accent-fill); }
.slot.first { border: 1px solid var(--red); }
.slot .state { font-size: 13px; color: var(--muted); }
.slot .state.done { color: var(--accent); font-weight: 600; }
.slot-empty { font-size: 13px; color: var(--warn); margin-top: 6px; }
/* подпись слота: работа в другой программе (Айдолхаус — CRM, пусто — норма) или строки Места Хаоса у разбора */
.slot-note { font-size: 13px; color: var(--muted); margin-top: 6px; }
.slot-note a { color: var(--accent); font-weight: 600; }
.slot-warn { font-size: 13px; color: var(--red); margin-top: 4px; }

.mark { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--accent-fill); flex-shrink: 0; display: inline-flex;
  align-items: center; justify-content: center; color: #fff; background: transparent; cursor: pointer; padding: 0; }
.mark.on { background: linear-gradient(180deg, var(--accent-fill-2), var(--accent-fill)); box-shadow: 0 3px 10px var(--accent-glow); }
.mark .i svg { width: 16px; height: 16px; stroke-width: 2.6; }
.mark:not(.on) .i { display: none; }

.timer { display: inline-flex; gap: 6px; align-items: center; font-variant-numeric: tabular-nums; }
.btn.go { background: linear-gradient(180deg, var(--accent-fill-2), var(--accent-fill)); color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px var(--accent-glow); }
.btn.go:hover { color: #fff; }
.btn.stop { color: var(--red); }
.btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* строки задач */
.task { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
.task:first-child, h2 + .task, .slot-head + .task { border-top: 0; }
.slot .task:first-of-type { margin-top: 4px; }
.chk { width: 24px; height: 24px; border-radius: 50%; border: 1.8px solid var(--muted); background: none; cursor: pointer; flex-shrink: 0;
  margin-top: 1px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.chk:hover { border-color: var(--accent); }
.chk .i svg { width: 14px; height: 14px; stroke-width: 2.6; }
.chk:not(.on) .i { display: none; }
.chk.on { background: var(--accent-fill); border-color: var(--accent-fill); }
.task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-title { overflow-wrap: anywhere; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; margin-top: 1px; }
.task-meta span + span::before { content: "· "; }
.task-meta .red { font-weight: 600; }
.task-meta .flag { color: var(--warn); font-weight: 600; }
.task-note { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-actions { display: flex; gap: 4px; flex-shrink: 0; }
.shift { font: inherit; font-size: 12px; border: 1px solid var(--glass-edge); background: var(--glass-soft); color: var(--muted); border-radius: 10px;
  padding: 4px 8px; cursor: pointer; white-space: nowrap; }
.shift:hover { color: var(--accent); }

.meeting-card { padding: 11px 14px; border-left: 3px solid var(--gold); cursor: pointer; }
.meeting-card .row-sub { color: var(--muted); }
.event-card { padding: 9px 14px; background: var(--glass-soft); border: 1px dashed var(--glass-edge); border-radius: var(--radius); font-size: 14px; }

/* Место Хаоса */
.capture { display: flex; gap: 8px; margin-bottom: 14px; }
.capture input { font-size: 16px; padding: 13px 14px; border-radius: 16px; box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi); }
.capture .btn { border-radius: 16px; }
.inbox-row { display: flex; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.inbox-row:first-child { border-top: 0; }
.inbox-row .task-main { cursor: pointer; }
.src { font-size: 11px; color: var(--muted); background: var(--chip); border-radius: 6px; padding: 0 5px; }

/* кружки Систем */
.circles { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 238px; margin: 10px 0 4px; }
.c { aspect-ratio: 1; border-radius: 50%; display: block; }
.cw { font-size: 10px; color: var(--muted); text-align: center; line-height: 1; }
.c.done { background: linear-gradient(180deg, var(--accent-fill-2), var(--accent-fill)); box-shadow: 0 2px 6px var(--accent-glow); }
.c.skip { border: 2px solid var(--red); background: var(--red-soft); }
.c.excused { border: 2px dashed var(--muted); opacity: .6; }
.c.today { border: 2px solid var(--accent-fill); }
.c.plan { border: 1.5px dashed var(--accent-fill); opacity: .55; }
.c.rest { background: var(--line); transform: scale(.45); }
.legend { font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.legend i.c { width: 10px; height: 10px; display: inline-block; vertical-align: -1px; margin-right: 4px; transform: none; }
.sys-card h2 { font-size: 17px; }
.sys-stats { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0; }
.sys-stats b { font-size: 22px; font-weight: 600; display: block; line-height: 1.2; }
.sys-stats span { font-size: 12px; color: var(--muted); }

/* слоты в настройке Системы */
.slot-grid { display: grid; grid-template-columns: 36px 1fr 1fr; gap: 6px 8px; align-items: center; max-width: 360px; }
.slot-grid input { padding: 7px 9px; min-height: calc(1.45em + 16px); }

/* списки */
.list-card { display: flex; gap: 10px; align-items: center; }
.list-card .grow { flex: 1; min-width: 0; }
.list-card .n { margin-left: 4px; }
.project { border-top: 1px solid var(--line); padding: 10px 0; }
.project:first-of-type { border-top: 0; }
.project-title { font-weight: 600; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.project .task { padding-left: 4px; }

.add-tabs { display: flex; margin-bottom: 12px; }
.modal .grid { margin-top: 8px; }
.modal .row-sub { margin-top: 2px; }
.error-line { color: var(--red); font-weight: 600; margin: 6px 0; }
.quick-days { display: flex; gap: 6px; flex-wrap: wrap; grid-column: 1 / -1; }
/* повтор задачи: дни недели кнопками-переключателями */
.wd-pick { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.wd-pick label { cursor: pointer; position: relative; }
.wd-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wd-pick span { display: inline-block; min-width: 38px; text-align: center; font-size: 13px; padding: 6px 8px; border-radius: 10px;
  border: 1px solid var(--glass-edge); background: var(--glass-soft); color: var(--muted); }
.wd-pick input:checked + span { background: linear-gradient(180deg, var(--accent-fill-2), var(--accent-fill)); color: #fff; border-color: transparent; }
.wd-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
/* дата и время — одной строкой и на телефоне, где форма в одну колонку */
.pair { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; }

/* «потяни вниз — обновить» в иконке на «Домой» (app.js): кольцо под статус-баром, дотянул — зелёное, отпустил — крутится */
.ptr { position: fixed; top: calc(env(safe-area-inset-top) + 6px); left: 50%; width: 36px; height: 36px; margin-left: -18px; z-index: 45;
  border-radius: 50%; background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .15s; }
.ptr span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); border-top-color: transparent; }
.ptr.ready span { border-color: var(--accent); border-top-color: transparent; }
.ptr.go span { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* на широком экране лента дня не растягивается во всю ширину */
@media (min-width: 900px) { main#main { max-width: 980px; } }
