/* Доп. задачи (views/tasks.ejs, views/task_new.ejs). Все правила под .tk:
   (0,2,0) перебивает общие body button {…} из style.css. */
.content-area.tk-wide { max-width: 1500px; }
.tk { --tk-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace; }
.tk .mono { font-family: var(--tk-mono); font-variant-numeric: tabular-nums; }
.tk .tk-mu { color: var(--text-muted); }
.tk .tk-fa { color: var(--text-faint); }
.tk .tk-sm { font-size: 12px; }
.tk .tk-sp { flex: 1; }
.tk .tk-row { display: flex; align-items: center; gap: 10px; }
.tk .tk-lbl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.tk .tk-hr { height: 1px; background: var(--glass-border); margin: 18px 0; border: 0; }
.tk .tk-card { background: var(--glass-bg); backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px); border: 1px solid var(--glass-border); border-radius: 16px; }

.tk .tk-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.tk .tk-head h1 { font-size: 28px; font-weight: 700; color: #fff; letter-spacing: -0.01em; line-height: 1.15; margin: 0; }
.tk .tk-kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.tk .tk-head-r { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tk .tk-seg { display: inline-flex; border: 1px solid var(--glass-border); border-radius: 10px; padding: 3px; background: rgba(255,255,255,.03); gap: 2px; flex-wrap: wrap; }
.tk .tk-seg a, .tk .tk-seg label { padding: 6px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); text-decoration: none; cursor: pointer; }
.tk .tk-seg a:hover, .tk .tk-seg label:hover { color: var(--text-primary); }
.tk .tk-seg .on, .tk .tk-seg label:has(input:checked) { background: var(--accent-soft); color: var(--text-primary); box-shadow: inset 0 0 0 1px rgba(59,130,246,.45); }
.tk .tk-seg input { position: absolute; opacity: 0; pointer-events: none; }

.tk .tk-banner { padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 13.5px; }
.tk .tk-banner.ok { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.4); color: #bbf7d0; }
.tk .tk-banner.err { background: rgba(244,63,94,.1); border: 1px solid rgba(244,63,94,.4); color: #fecdd3; }

.tk .tk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 13px; border: 1px solid var(--glass-border); background: rgba(255,255,255,.05); color: var(--text-primary); box-shadow: none; transform: none; white-space: nowrap; text-decoration: none; cursor: pointer; }
.tk .tk-btn:hover { border-color: var(--glass-border-hover); box-shadow: none; transform: none; }
.tk .tk-btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.tk .tk-btn.pri { background: var(--accent); border-color: var(--accent-bright); color: #fff; box-shadow: 0 6px 20px rgba(37,99,235,.35); }
.tk .tk-btn.big { height: 42px; padding: 0 20px; font-size: 14px; }
.tk .tk-btn.dng { background: rgba(244,63,94,.12); border-color: rgba(244,63,94,.45); color: #fda4af; }

/* ---- конструктор ---- */
.tk .tk-new-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); gap: 18px; align-items: start; }
.tk .tk-form { padding: 20px 22px; }
.tk .tk-fld { margin-bottom: 14px; }
.tk input[type=time] { color-scheme: dark; width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(255,255,255,.03); color: var(--text-primary); font: inherit; }
.tk input[type=time]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tk input[type=date] { color-scheme: dark; }
.tk .tk-fld input[type=text], .tk .tk-fld input[type=date], .tk .tk-fld input[type=time], .tk .tk-fld select, .tk .tk-fld textarea { width: 100%; }
.tk .tk-fld textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.tk .tk-title-inp { font-weight: 600; font-size: 15px; }
.tk .tk-3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
.tk .tk-dt { display: grid; grid-template-columns: 1fr 92px; gap: 6px; }
.tk .tk-hint { font-size: 12.5px; color: var(--text-faint); margin-top: 8px; line-height: 1.5; }
.tk .tk-hint b { color: #c4b5fd; font-weight: 600; }

.tk .tk-fcs { display: flex; flex-wrap: wrap; gap: 6px; }
.tk .tk-fc { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--glass-border); background: rgba(255,255,255,.04); font-family: var(--tk-mono); font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; user-select: none; }
.tk .tk-fc input { position: absolute; opacity: 0; pointer-events: none; }
.tk .tk-fc:has(input:checked) { border-color: rgba(59,130,246,.7); background: var(--accent-soft); color: #fff; }
.tk .tk-fc .n { font-family: inherit; font-size: 11px; color: var(--text-faint); font-weight: 500; }
.tk .tk-cb { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid rgba(255,255,255,.3); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tk :checked + .tk-cb { background: #3b82f6; border-color: #3b82f6; }
.tk :checked + .tk-cb::after { content: ''; width: 4px; height: 8px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg) translate(-1px, -1px); }

.tk .tk-step { display: inline-flex; align-items: center; border: 1px solid var(--glass-border); border-radius: 10px; overflow: hidden; height: 34px; }
.tk .tk-step button { all: unset; cursor: pointer; padding: 0 11px; height: 100%; display: flex; align-items: center; color: var(--text-muted); }
.tk .tk-step button:hover { color: #fff; background: rgba(255,255,255,.06); }
.tk .tk-step input { all: unset; width: 34px; text-align: center; font-family: var(--tk-mono); font-size: 15px; }

/* выбор людей */
.tk .tk-picker { border: 1px solid var(--glass-border); border-radius: 12px; overflow: hidden; margin-top: 10px; }
.tk .tk-picker-top { padding: 10px 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid rgba(255,255,255,.06); }
.tk .tk-picker-top input[type=search] { flex: 1; min-width: 160px; height: 32px; padding: 0 10px; }
.tk .tk-chip { all: unset; display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--glass-border); font-size: 12px; color: var(--text-muted); cursor: pointer; }
.tk .tk-chip.on { border-color: rgba(59,130,246,.6); background: var(--accent-soft); color: #fff; }
.tk .tk-people { max-height: 320px; overflow-y: auto; }
.tk .tk-person { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid rgba(255,255,255,.05); cursor: pointer; }
.tk .tk-person:first-child { border-top: 0; }
.tk .tk-person:hover { background: rgba(255,255,255,.03); }
.tk .tk-person:has(input:checked) { background: rgba(37,99,235,.09); }
.tk .tk-person input { position: absolute; opacity: 0; pointer-events: none; }
.tk .tk-person[hidden] { display: none; }
.tk .tk-person .nm { font-weight: 600; font-size: 13.5px; }
.tk .tk-person .busy { font-size: 11.5px; color: #fde047; }
.tk .tk-picked { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.06); min-height: 44px; align-items: center; }
.tk .tk-fx { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 6px; font-family: var(--tk-mono); font-size: 11px; font-weight: 600; border: 1px solid var(--glass-border); color: var(--text-primary); background: rgba(255,255,255,.05); }
.tk .tk-av { border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid rgba(255,255,255,.15); }
.tk .tk-av-ph { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #475569, #1e293b); color: #fff; font-weight: 700; }

/* переключатель */
.tk .tk-tg { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.tk .tk-tg input { position: absolute; opacity: 0; pointer-events: none; }
.tk .tk-tg i { width: 34px; height: 20px; border-radius: 999px; background: rgba(255,255,255,.14); position: relative; flex-shrink: 0; transition: background .15s; }
.tk .tk-tg i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #cbd5e1; transition: left .15s; }
.tk .tk-tg input:checked + i { background: #2563eb; }
.tk .tk-tg input:checked + i::after { left: 17px; background: #fff; }

.tk details.tk-more { margin-top: 10px; border: 1px solid var(--glass-border); border-radius: 12px; }
.tk details.tk-more summary { cursor: pointer; padding: 10px 12px; font-size: 12.5px; color: var(--text-muted); list-style: none; display: flex; align-items: center; gap: 8px; }
.tk details.tk-more summary::-webkit-details-marker { display: none; }
.tk details.tk-more summary::before { content: '▸'; font-size: 11px; }
.tk details.tk-more[open] summary::before { content: '▾'; }
.tk .tk-frow { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid rgba(255,255,255,.06); font-size: 13px; }
.tk .tk-frow select { width: 150px; height: 30px; padding: 0 8px; font-size: 12.5px; }
.tk [data-off] { opacity: .45; pointer-events: none; }

/* предпросмотр в стиле Discord */
.tk .tk-side { position: sticky; top: 16px; display: grid; gap: 14px; }
.tk .dc { background: #313338; border-radius: 12px; font-family: 'gg sans', 'Noto Sans', system-ui, sans-serif; color: #dbdee1; font-size: 14.5px; line-height: 1.375; padding: 14px 16px; }
.tk .dc .top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #949ba4; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid #3f4147; }
.tk .dc .msg { display: flex; gap: 14px; }
.tk .dc .bav { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: linear-gradient(135deg, #2563eb, #22d3ee); }
.tk .dc .nm { color: #f2f3f5; font-weight: 600; }
.tk .dc .bt { background: #5865f2; color: #fff; font-size: 10px; padding: 1px 4px; border-radius: 3px; font-weight: 700; margin-left: 4px; vertical-align: 2px; }
.tk .dc .tm { color: #949ba4; font-size: 11.5px; margin-left: 6px; }
.tk .dc .men { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.tk .dc .cv2 { margin-top: 6px; background: #2b2d31; border: 1px solid #3a3c42; border-radius: 8px; display: flex; overflow: hidden; }
.tk .dc .cv2 .acc { width: 4px; flex-shrink: 0; background: #5865f2; }
.tk .dc .cv2 .in { padding: 12px 14px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tk .dc h2 { font-size: 20px; font-weight: 700; color: #f2f3f5; margin: 0 0 2px; line-height: 1.25; }
.tk .dc .sub { font-size: 12px; color: #949ba4; }
.tk .dc .sep { height: 1px; background: #3f4147; margin: 10px 0; }
.tk .dc .body { white-space: pre-wrap; font-size: 14px; }
.tk .dc .dbtn { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: #fff; margin: 0 6px 6px 0; background: #4e5058; }
.tk .dc .dbtn.g { background: #248046; }
.tk .tk-sum { padding: 14px 16px; display: grid; gap: 9px; font-size: 12.5px; }
.tk .tk-sum .tk-row { align-items: flex-start; }
.tk .tk-sum svg { flex-shrink: 0; margin-top: 1px; }

/* ---- список ---- */
.tk .tk-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.tk .tk-tile { padding: 14px 16px; }
.tk .tk-tile b { font-family: var(--tk-mono); font-size: 24px; }
.tk .tk-list-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); gap: 16px; align-items: start; }
.tk table.tk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tk .tk-table th { text-align: left; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); padding: 10px 12px; border-bottom: 1px solid var(--glass-border); font-weight: 700; }
.tk .tk-table td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: middle; }
.tk .tk-table tr.on td { background: var(--accent-soft); }
.tk .tk-table tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tk .tk-table tr[data-href] { cursor: pointer; }
.tk .tk-table tr[data-href]:hover td { background: rgba(255,255,255,.03); }
.tk .tk-table a.t { color: var(--text-primary); text-decoration: none; font-weight: 700; font-size: 13.5px; }
.tk .tk-ppl { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tk .tk-ppl span { display: inline-flex; align-items: center; gap: 5px; }
.tk .s { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tk .s.free, .tk .s.refused { color: var(--text-faint); border: 1px dashed rgba(255,255,255,.22); }
.tk .s.working { color: #93c5fd; background: rgba(59,130,246,.14); }
.tk .s.sent { color: #fde047; background: rgba(234,179,8,.13); }
.tk .s.approved, .tk .s.done { color: #86efac; background: rgba(34,197,94,.14); }
.tk .s.rejected { color: #fda4af; background: rgba(244,63,94,.15); }
.tk .tk-bar { height: 6px; width: 70px; border-radius: 9px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 4px; }
.tk .tk-bar i { display: block; height: 100%; background: #22c55e; }
.tk .dl-soon { color: #fde047; }
.tk .dl-late { color: #fda4af; }
.tk .tk-detail { padding: 18px 20px; position: sticky; top: 16px; }
.tk .tk-detail h3 { font-size: 18px; font-weight: 700; margin: 10px 0 4px; line-height: 1.3; }
.tk .tk-body { white-space: pre-wrap; font-size: 13px; line-height: 1.55; color: #d4d4d8; background: rgba(255,255,255,.03); border-radius: 10px; padding: 10px 12px; }
.tk .tk-person-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.tk .tk-person-row form { margin: 0; }
.tk .tk-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: #c4b5fd; border: 1px solid rgba(102,58,243,.4); background: rgba(102,58,243,.14); }
.tk .tk-inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tk .tk-inline input[type=date] { width: 150px; height: 30px; padding: 0 8px; }
.tk .tk-inline input[type=time] { width: 92px; height: 30px; padding: 0 8px; }
.tk .tk-empty { padding: 22px; color: var(--text-muted); }

@media (max-width: 1100px) {
  .tk .tk-new-grid, .tk .tk-list-grid { grid-template-columns: minmax(0, 1fr); }
  .tk .tk-side, .tk .tk-detail { position: static; }
}
@media (max-width: 700px) {
  .tk .tk-3 { grid-template-columns: 1fr; }
  .tk .tk-tiles { grid-template-columns: repeat(2, 1fr); }
  .tk .tk-table th:nth-child(3), .tk .tk-table td:nth-child(3) { display: none; }
}
