/* ============================================================
   Компоненты v2 — поверх main.css
   ============================================================ */

/* ============================================================
   HINT BANNER (без border-left полос — tinted background)
   ============================================================ */
.hint-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--blue-bg);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  animation: hint-slide-down .2s ease-out;
}
.hint-banner .hint-icon {
  font-size: 18px;
  line-height: 1.5;
  flex-shrink: 0;
  opacity: .8;
}
.hint-banner .hint-body { flex: 1; min-width: 0; }
.hint-banner .hint-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  font-size: 13.5px;
  letter-spacing: -.01em;
}
.hint-banner .hint-text {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.55;
}
.hint-banner .hint-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}
.hint-banner .hint-close {
  border: none;
  background: transparent;
  color: var(--text3);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: var(--radius-xs);
  transition: background var(--t-fast), color var(--t-fast);
}
.hint-banner .hint-close:hover {
  background: rgba(37,99,235,.1);
  color: var(--accent);
}
@keyframes hint-slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Кнопка «?» */
.btn-hint {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--t);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-hint:hover {
  background: var(--blue-bg);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   MODAL ANIMATIONS
   ============================================================ */
.modal-overlay .modal { animation: modal-pop .18s cubic-bezier(.34,1.4,.64,1); }
.modal-overlay.modal-anim-out { opacity: 0; transition: opacity .15s ease; }
.modal-overlay.modal-anim-out .modal { transform: scale(.97) translateY(4px); transition: transform .15s ease; }
@keyframes modal-pop {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   TOAST ANIMATIONS
   ============================================================ */
.toast .toast-text { flex: 1; font-size: 13.5px; line-height: 1.4; }

/* ============================================================
   SEARCH OVERLAY (Ctrl+K)
   ============================================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 300;
  padding-top: 10vh;
  animation: overlay-in .15s ease-out;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.search-box {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  animation: modal-pop .18s cubic-bezier(.34,1.4,.64,1);
}
.search-input {
  width: 100%;
  padding: 16px 20px;
  border: none;
  font-size: 16px;
  font-weight: 500;
  outline: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}
.search-input::placeholder { color: var(--text3); font-weight: 400; }
.search-results { max-height: 54vh; overflow-y: auto; padding: 6px; }
.search-hint { padding: 28px; text-align: center; color: var(--text2); font-size: 13px; }
.search-group-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  font-weight: 700;
  padding: 10px 12px 4px;
}
.search-result {
  display: flex;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  transition: background var(--t-fast);
}
.search-result.active,
.search-result:hover { background: var(--surface2); }
.search-result-icon { font-size: 17px; width: 24px; text-align: center; }
.search-result-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.search-result-sub { font-size: 12px; color: var(--text2); }

/* ============================================================
   SPINNER (кнопки в загрузке)
   ============================================================ */
.btn .spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   TASK STATUS BADGES
   ============================================================ */
.badge.tstatus-new       { background: var(--surface2); color: var(--text2); }
.badge.tstatus-in_progress { background: var(--blue-bg); color: var(--blue); }
.badge.tstatus-review    { background: var(--yellow-bg); color: var(--yellow); }
.badge.tstatus-done      { background: var(--green-bg); color: var(--green); }
.badge.tstatus-deferred  { background: var(--purple-bg); color: var(--purple); }

/* ============================================================
   INLINE EDITABLE (двойной клик)
   ============================================================ */
[contenteditable="true"] {
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  margin: -2px -6px;
  outline: none;
  transition: box-shadow var(--t);
}
[contenteditable="true"]:focus {
  box-shadow: 0 0 0 2px var(--accent);
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  height: 5px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .4s ease;
}
.progress-bar-fill.green { background: var(--green); }
.progress-bar-fill.yellow { background: var(--yellow); }
.progress-bar-fill.red { background: var(--red); }

/* ============================================================
   SECTION STAT GRID (мини-статистика внутри страниц)
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-item .stat-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--text);
}
.stat-item .stat-label {
  font-size: 11.5px;
  color: var(--text2);
  font-weight: 500;
}
.stat-item .stat-delta {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}
.stat-item .stat-delta.up   { color: var(--green); }
.stat-item .stat-delta.down { color: var(--red); }

/* ============================================================
   DATEPICKER
   ============================================================ */
.datepicker input[type=date] { width: 100%; }

/* ============================================================
   TABLE row actions (появляются при hover)
   ============================================================ */
.table-row-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity var(--t-fast);
}
tr:hover .table-row-actions { opacity: 1; }

/* ============================================================
   AUTOMATIONS
   ============================================================ */
.auto-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.auto-status-dot.active   { background: var(--green); box-shadow: 0 0 0 3px rgba(5,150,105,.15); }
.auto-status-dot.inactive { background: var(--text3); }
.auto-actions-preview { padding-top: 8px; border-top: 1px solid var(--border); margin-top: 10px; }

