/* sidebar.css — extracted from HomeDashboard.css */

.hdb-pattern-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin: 0 -14px;
  border-radius: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: all 0.2s ease;
  cursor: default;
}

.hdb-pattern-item:last-child { border-bottom: none; }

.hdb-pattern-item:hover {
  background: rgba(255,255,255,0.04);
  transform: translateX(4px);
}

.hdb-pattern-icon-wrap {
  width: 36px; height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.hdb-pattern-icon-wrap.indigo { background: rgba(var(--primary-rgb),0.1); color: var(--primary-color); }

.hdb-pattern-icon-wrap.purple { background: rgba(var(--secondary-rgb),0.1); color: var(--secondary-color); }

.hdb-pattern-icon-wrap.green  { background: rgba(16,185,129,0.1);  color: #34d399; }

.hdb-pattern-icon-wrap .material-symbols-outlined { font-size: 18px; }

.hdb-pattern-title  { 
  font-size: 14px; 
  font-weight: 500; 
  color: #f1f5f9; 
  line-height: 1.5; 
  word-break: break-word; 
  white-space: normal !important; 
}

.hdb-pattern-detail { font-size: 11px; color: #64748b; margin-top: 1px; }

[data-mode="light"] .hdb-cared-text { color: #334155 !important; }

/* ── Карточка «Наша история» ── */

[data-mode="light"] .hdb-story-stat { color: #0f172a !important; }

[data-mode="light"] .hdb-story-stat-label { color: #475569 !important; }

[data-mode="light"] .hdb-story-first-day { color: #475569 !important; }

[data-mode="light"] .hdb-story-milestone { color: #334155 !important; }

[data-mode="light"] .hdb-story-milestones {
  border-top-color: rgba(0, 0, 0, 0.08) !important;
}

/* ── Таймлайн ── */

[data-mode="light"] .hdb-pattern-title { color: #0f172a !important; }

/* ── Виджет Баланс ── */

.hdb-cared-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: rgba(var(--primary-rgb), 0.15);
  color: var(--primary-color);
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  margin-left: 8px;
}

.hdb-cared-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hdb-cared-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 10px;
  transition: background 0.2s;
}

.hdb-cared-item--expandable {
  cursor: pointer;
}

.hdb-cared-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.hdb-cared-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(var(--primary-rgb), 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hdb-cared-icon {
  font-size: 17px;
  color: var(--primary-color);
}

.hdb-cared-body {
  flex: 1;
  min-width: 0;
}

.hdb-cared-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hdb-cared-text {
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 500;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hdb-cared-time-badge {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.hdb-cared-chevron {
  font-size: 16px !important;
  color: #475569;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.hdb-cared-chevron:hover {
  color: var(--primary-color);
}

.hdb-cared-more {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  padding: 4px 0 2px;
  font-weight: 500;
}

/* ── Accordion details panel ── */

.hdb-cared-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease,
              margin-top 0.25s ease;
  margin-top: 0;
}

.hdb-cared-details.open {
  max-height: 300px;
  opacity: 1;
  margin-top: 8px;
}

.hdb-cared-detail-line {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  padding: 3px 0 3px 4px;
  border-left: 2px solid rgba(var(--primary-rgb), 0.2);
  padding-left: 10px;
  margin-bottom: 2px;
  animation: hdb-cared-detail-fadein 0.3s ease forwards;
  opacity: 0;
}

.hdb-cared-details.open .hdb-cared-detail-line {
  opacity: 1;
}

.hdb-cared-details.open .hdb-cared-detail-line:nth-child(1) { animation-delay: 0ms; }

.hdb-cared-details.open .hdb-cared-detail-line:nth-child(2) { animation-delay: 50ms; }

.hdb-cared-details.open .hdb-cared-detail-line:nth-child(3) { animation-delay: 100ms; }

.hdb-cared-details.open .hdb-cared-detail-line:nth-child(4) { animation-delay: 150ms; }

.hdb-cared-details.open .hdb-cared-detail-line:nth-child(5) { animation-delay: 200ms; }

.hdb-cared-details.open .hdb-cared-detail-line:nth-child(n+6) { animation-delay: 250ms; }

.hdb-cared-diary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  background: rgba(var(--primary-rgb), 0.06);
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  border-radius: 12px;
  color: var(--primary-color);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.hdb-cared-diary-btn:hover {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.3);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════════════════════════

.hdb-diary-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 24px;
}

.hdb-diary-modal-backdrop.visible {
  opacity: 1;
}

.hdb-diary-modal-content {
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px 24px 16px 16px;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.5);
  padding: 24px;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hdb-diary-modal-backdrop.visible .hdb-diary-modal-content {
  transform: translateY(0);
}

.hdb-diary-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
}

.hdb-diary-modal-date {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
  text-transform: capitalize;
}

/* ── Diary timeline ── */

.hdb-diary-timeline {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
}

.hdb-diary-item {
  display: flex;
  gap: 0;
  min-height: 60px;
}

.hdb-diary-time-col {
  width: 50px;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding-right: 12px;
  padding-top: 2px;
}

.hdb-diary-time {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

.hdb-diary-time--dot {
  font-size: 18px;
  color: #475569;
}

.hdb-diary-line-col {
  width: 20px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.hdb-diary-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 2px solid rgba(var(--primary-rgb), 0.3);
  flex-shrink: 0;
  margin-top: 5px;
  z-index: 1;
}

.hdb-diary-connector {
  width: 2px;
  flex: 1;
  background: rgba(var(--primary-rgb), 0.12);
  margin-top: 2px;
}

.hdb-diary-item:last-child .hdb-diary-connector {
  display: none;
}

.hdb-diary-content {
  flex: 1;
  min-width: 0;
  padding-bottom: 16px;
  padding-left: 8px;
}

.hdb-diary-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.hdb-diary-icon {
  font-size: 18px;
  color: var(--primary-color);
  flex-shrink: 0;
  margin-top: 1px;
}

.hdb-diary-text {
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
  line-height: 1.4;
}

.hdb-diary-details {
  margin-top: 8px;
  padding-left: 26px;
}

.hdb-diary-detail-line {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  padding: 2px 0 2px 10px;
  border-left: 2px solid rgba(var(--primary-rgb), 0.15);
  margin-bottom: 2px;
}

/* ── Light theme overrides ── */

[data-mode="light"] .hdb-cared-detail-line {
  color: #475569 !important;
  border-left-color: rgba(var(--primary-rgb), 0.3) !important;
}

[data-mode="light"] .hdb-cared-chevron {
  color: #94a3b8 !important;
}

[data-mode="light"] .hdb-cared-item:hover {
  background: rgba(0, 0, 0, 0.03) !important;
}

[data-mode="light"] .hdb-cared-text {
  color: #334155 !important;
}

[data-mode="light"] .hdb-cared-time-badge {
  color: #64748b !important;
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}

[data-mode="light"] .hdb-cared-icon-wrap {
  background: rgba(var(--primary-rgb), 0.1) !important;
}

[data-mode="light"] .hdb-cared-more {
  color: #94a3b8 !important;
}

[data-mode="light"] .hdb-cared-count {
  background: rgba(var(--primary-rgb), 0.12) !important;
}

[data-mode="light"] .hdb-cared-diary-btn {
  color: var(--primary-dark, #1a4a41) !important;
  background: rgba(var(--primary-rgb), 0.06) !important;
  border-color: rgba(var(--primary-rgb), 0.2) !important;
}

[data-mode="light"] .hdb-diary-modal-content {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

[data-mode="light"] .hdb-diary-modal-title { color: #0f172a !important; }

[data-mode="light"] .hdb-diary-text { color: #1e293b !important; }

[data-mode="light"] .hdb-diary-detail-line { color: #475569 !important; }

[data-mode="light"] .hdb-diary-time { color: #64748b !important; }


/* ── "Наша история" card ── */

.hdb-story-stat-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.hdb-story-stat {
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
}

.hdb-story-stat-label {
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
}

.hdb-story-first-day {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 10px;
}

.hdb-story-milestones {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.hdb-story-milestone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cbd5e1;
}

.hdb-story-emoji {
  font-size: 16px;
  flex-shrink: 0;
}

.hdb-story-milestone-text {
  font-weight: 500;
}

.hdb-story-milestone--clickable {
  cursor: pointer;
  transition: opacity 0.15s;
}

.hdb-story-milestone--clickable:hover { opacity: 0.8; }

.hdb-story-milestone-arrow {
  font-size: 16px !important;
  color: #64748b;
  margin-left: auto;
}

/* ── Young relationship variant (< 7 days) ── */

.hdb-story-together {
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 12px;
  line-height: 1.3;
}

.hdb-story-learned {
  margin-bottom: 10px;
}

.hdb-story-learned-title {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hdb-story-fact {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.45;
}

.hdb-story-fact-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
  margin-top: 6px;
}

.hdb-story-first-memory {
  margin-bottom: 10px;
}

.hdb-story-quote {
  font-size: 14px;
  font-weight: 500;
  font-style: italic;
  color: #e2e8f0;
  line-height: 1.5;
  padding: 10px 14px;
  border-left: 3px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.04);
  border-radius: 0 10px 10px 0;
  margin-top: 6px;
}
/* ── Stage & streak meta row ── */

.hdb-story-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.hdb-story-stage {
  font-size: 11px;
  font-weight: 600;
  color: rgba(var(--primary-rgb), 0.8);
  background: rgba(var(--primary-rgb), 0.08);
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.hdb-story-streak {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #f59e0b;
}
/* ── Shared moments (interaction history) ── */

.hdb-story-moments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.hdb-story-moment {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border-left: 3px solid rgba(251, 191, 36, 0.25);
  transition: background 0.15s;
}

.hdb-story-moment:hover {
  background: rgba(255, 255, 255, 0.06);
}

.hdb-story-moment-emoji {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.hdb-story-moment-body {
  flex: 1;
  min-width: 0;
}

.hdb-story-moment-text {
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.4;
  word-break: break-word;
}

.hdb-story-moment-date {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}
/* ── Total interactions counter ── */

.hdb-story-interactions {
  font-size: 11px;
  color: #64748b;
  margin-top: 8px;
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.hdb-story-fact-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.hdb-story-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-size: 13px;
  color: #64748b;
  font-style: italic;
}

/* ── "Требует вашего решения" card ── */

.hdb-decisions-count {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  font-size: 11px;
  font-weight: 800;
  border-radius: 8px;
  padding: 2px 8px;
  margin-left: auto;
}

.hdb-decision-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
  transition: opacity 0.15s;
}

.hdb-decision-item:hover { opacity: 0.8; }

.hdb-decision-item + .hdb-decision-item {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.hdb-decision-icon {
  font-size: 22px;
  color: #f59e0b;
  flex-shrink: 0;
}

.hdb-decision-body {
  flex: 1;
  min-width: 0;
}

.hdb-decision-text {
  font-size: 14px;
  color: #e2e8f0;
  font-weight: 500;
  line-height: 1.4;
}

.hdb-decision-cta {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-color);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s;
}

.hdb-decision-item:hover .hdb-decision-cta { color: #fff; }

/* ── Mobile adjustments for new cards ── */
/* ── Мобильный: увеличиваем кнопки для удобного касания ── */

/* ── Projects widget ── */

.hdb-project-item {
  padding: 10px 0;
  cursor: pointer;
  transition: opacity 0.15s;
}

.hdb-project-item:hover { opacity: 0.8; }

.hdb-project-item + .hdb-project-item {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.hdb-project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.hdb-project-title {
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hdb-project-pct {
  font-size: 12px;
  font-weight: 700;
  color: #8b5cf6;
  flex-shrink: 0;
}

.hdb-project-bar-wrap {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.hdb-project-bar {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  border-radius: 2px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.hdb-project-next {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-mode="light"] .hdb-project-title { color: #1e293b !important; }
[data-mode="light"] .hdb-project-next { color: #64748b !important; }
[data-mode="light"] .hdb-project-bar-wrap { background: rgba(0, 0, 0, 0.06) !important; }
[data-mode="light"] .hdb-project-item + .hdb-project-item { border-top-color: rgba(0, 0, 0, 0.06) !important; }

/* ── Polls widget ── */

.hdb-poll-item {
  padding: 10px 0;
  cursor: pointer;
  transition: opacity 0.15s;
}

.hdb-poll-item:hover { opacity: 0.8; }

.hdb-poll-item + .hdb-poll-item {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.hdb-poll-question {
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
  line-height: 1.4;
  margin-bottom: 4px;
}

.hdb-poll-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

[data-mode="light"] .hdb-poll-question { color: #1e293b !important; }
[data-mode="light"] .hdb-poll-meta { color: #94a3b8 !important; }
[data-mode="light"] .hdb-poll-item + .hdb-poll-item { border-top-color: rgba(0, 0, 0, 0.06) !important; }