/* Dashboard Container */
.dashboard-container {
  min-height: 100vh;
  background-color: transparent;
}

/* Hero Section Customization */
.hero.is-white {
  background: transparent;
  border-bottom: 1px solid var(--of-line);
}

.hero.is-white .title {
  color: var(--of-ink);
  font-weight: 600;
}

.hero.is-white .subtitle {
  color: var(--of-muted);
}

/* Task Grid */
.task-grid {
  margin-bottom: 2rem;
}

/* Task Card Styles */
.task-card {
  display: block;
  text-decoration: none;
  transition: all 0.3s ease;
  height: 100%;
}

.task-card .card {
  height: 100%;
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--of-line);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.task-card:hover .card {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--of-line-2);
}

/* Приоритет — тонированный фон, без цветных кантов */
.task-card-urgent .card {
  background: var(--of-danger-soft);
  border-color: color-mix(in srgb, var(--of-danger) 25%, transparent);
}

.task-card-high .card {
  background: var(--of-accent-soft);
  border-color: color-mix(in srgb, var(--of-accent) 25%, transparent);
}

.task-card-medium .card {
  border-color: var(--of-line-2);
}

.task-card-urgent:hover .card {
  border-color: var(--of-danger);
  box-shadow: 0 8px 24px var(--of-danger-soft);
}

.task-card-high:hover .card {
  border-color: var(--of-accent-soft);
  box-shadow: 0 8px 24px var(--of-accent-soft);
}

.task-card-medium:hover .card {
  border-color: var(--of-accent);
  box-shadow: 0 8px 24px var(--of-accent-soft);
}

/* Activity Feed - Table Style */
.activity-feed {
  border-radius: 8px;
  padding: 0;
}

.activity-table {
  border: none;
}

.activity-table tbody tr {
  border: none;
  transition: background-color 0.15s ease;
}

.activity-table tbody tr:hover {
  background-color: var(--of-surface-2);
}

.activity-table tbody td {
  padding: 0.75rem 0.5rem;
  vertical-align: middle;
}

.activity-row {
  position: relative;
}

/* Activity cells */
.activity-icon-cell {
  width: 50px;
  text-align: center;
}

.activity-icon-cell .icon {
  font-size: 1.25rem;
}

.activity-info-cell {
  width: 100%;
}

.activity-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  width: 100%;
}

.activity-title {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--of-ink);
  margin-bottom: 0.25rem;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.activity-meta {
  font-size: 0.8rem;
  color: var(--of-muted);
}

.activity-status-cell {
  width: 140px;
  text-align: right;
  white-space: nowrap;
}

.activity-link:hover .activity-title {
  color: var(--of-accent);
}

/* Metrics Boxes - compact */
.box .heading {
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--of-muted);
  margin-bottom: 0.5rem;
}

.box .title.is-5 {
  margin-bottom: 0.5rem;
}

.box .help {
  margin-top: 0.25rem;
  font-size: 0.8rem;
}

/* Section Titles */
.section .title.is-5 {
  font-weight: 600;
  color: var(--of-ink);
  margin-bottom: 1rem;
}

.section .title.is-5 .icon-text {
  vertical-align: middle;
}

/* Box Customization */
.box {
  border-radius: 8px;
  box-shadow: 0 1px 3px var(--of-line);
  border: 1px solid var(--of-line);
  transition: all 0.2s ease;
}

.box:hover {
  box-shadow: 0 2px 8px var(--of-line);
}

/* Section Links */
.section-links a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.section-links a:hover {
  color: var(--of-accent) !important;
  text-decoration: underline;
}

/* Metric Box Links */
.metric-box-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.metric-box-link:hover .box {
  border-color: var(--of-accent);
  box-shadow: 0 2px 12px var(--of-accent-soft);
}

.metric-box-link .box {
  transition: all 0.2s ease;
}

/* Quick Actions Buttons */
.buttons .button {
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.buttons .button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--of-line-2);
}

.buttons .button .icon {
  font-size: 1rem;
}

/* Tags */
.tag {
  border-radius: 6px;
  font-weight: 500;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state .title {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
  .hero.is-white .hero-body {
    padding: 1.5rem 1rem;
  }
  
  .hero.is-white .title.is-3 {
    font-size: 1.5rem;
  }
  
  .buttons {
    flex-wrap: wrap;
    width: 100%;
  }
  
  .buttons .button {
    margin-bottom: 0.5rem;
    flex: 1 0 auto;
    min-width: 150px;
  }
  
  .task-table tbody td,
  .activity-table tbody td {
    padding: 0.5rem 0.25rem;
  }
  
  .task-list-title {
    font-size: 0.85rem;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .task-list-action {
    font-size: 0.75rem;
  }
  
  .link-indicator {
    display: none;
  }
  
  .box {
    margin-bottom: 1rem;
  }
  
  .section {
    padding: 1.5rem 0.75rem;
  }
  
  .section-links {
    display: none;
  }
  
  .activity-title {
    font-size: 0.85rem;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .activity-meta {
    font-size: 0.75rem;
  }
  
  .activity-icon-cell {
    width: 40px;
  }
  
  .activity-status-cell {
    width: 100px;
  }
  
  .activity-status-cell .tag {
    font-size: 0.7rem;
  }
}

/* Loading States */
.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  border: 4px solid var(--of-line-2);
  border-top-color: var(--of-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(90deg, var(--of-line) 25%, var(--of-line-2) 50%, var(--of-line) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: 1rem;
}

/* Turbo Frame Transitions */
turbo-frame {
  display: block;
}

turbo-frame.is-loading {
  min-height: 200px;
}

/* Card Content Spacing */
.card-content .level:last-child {
  margin-bottom: 0;
}

/* Icon Sizes */
.icon.is-large {
  width: 2.5rem;
  height: 2.5rem;
}

/* Task List (Table) Styles */
.task-table {
  border: none;
}

.task-table tbody tr {
  border: none;
  transition: background-color 0.15s ease;
}

.task-table tbody tr:hover {
  background-color: var(--of-surface-2);
}

.task-table tbody td {
  padding: 0.75rem 0.5rem;
  vertical-align: middle;
}

.task-row {
  position: relative;
}

.task-row-urgent {
  background: var(--of-danger-soft);
}

.task-row-urgent:hover {
  background: var(--of-danger-soft) !important;
}

.task-title-cell {
  width: 100%;
}

.task-list-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  width: 100%;
}

.task-list-title {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--of-ink);
  margin-bottom: 0.25rem;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-list-action {
  font-size: 0.8rem;
  color: var(--of-muted);
}

.task-list-link:hover .task-list-title {
  color: var(--of-accent);
}

/* Link Indicator */
.link-indicator {
  opacity: 0;
  color: var(--of-accent);
  font-weight: 600;
  margin-left: 0.5rem;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.task-list-link:hover .link-indicator,
.activity-link:hover .link-indicator {
  opacity: 1;
}

/* Table Container */
.table-container {
  overflow-x: auto;
}

/* Utility Classes */
.has-text-weight-medium {
  font-weight: 500 !important;
}

.is-clickable {
  cursor: pointer;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Status-specific styling */
.status-urgent {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}



/* ============================================================
   Сводная панель v2: KPI-строка, очередь задач, сегментные бары
   ============================================================ */

.dash-date { font-size: 12.5px; color: var(--of-faint); }

/* KPI: одна рамка, волосяные разделители */
.dash-kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--of-line);
  border-radius: 10px;
  background: var(--of-surface);
  overflow: hidden;
  margin: 6px 0 22px;
}

.dash-kpi > div { padding: 14px 18px 13px; border-left: 1px solid var(--of-line); }
.dash-kpi > div:first-child { border-left: none; }

.dash-kpi-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--of-faint);
  margin-bottom: 6px;
}

.dash-kpi-value {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--of-ink);
}

.dash-kpi-value small { font-size: 14px; font-weight: 500; color: var(--of-muted); letter-spacing: 0; }

.dash-kpi-note { font-size: 12px; color: var(--of-muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.dash-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dash-dot.is-bad { background: var(--of-danger); }
.dash-dot.is-ok { background: var(--of-good); }
.dash-dot.is-mid { background: var(--of-faint); }
.dash-dot.is-track { background: var(--of-surface-2); border: 1px solid var(--of-line-2); }

.dash-bad-text { color: var(--of-danger); font-weight: 500; }
.dash-warn-text { color: var(--of-accent-strong); font-weight: 500; }

/* Колонки */
.dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }

@media (max-width: 1100px) {
  .dash-cols { grid-template-columns: 1fr; }
  .dash-kpi { grid-template-columns: 1fr 1fr; }
  .dash-kpi > div { border-top: 1px solid var(--of-line); }
  .dash-kpi > div:nth-child(-n+2) { border-top: none; }
  .dash-kpi > div:nth-child(odd) { border-left: none; }
}

/* Карточки-панели */
.dash-card { border: 1px solid var(--of-line); border-radius: 10px; background: var(--of-surface); margin-bottom: 20px; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 18px; }
.dash-card-head h2 { font-size: 13.5px; font-weight: 650; margin: 0; }
.dash-card-body { padding: 4px 18px 16px; }
.cabinet-main .dash-card a.dash-more { font-size: 12px; color: var(--of-muted); text-decoration: none; }
.cabinet-main .dash-card a.dash-more:hover { color: var(--of-ink); }

/* Очередь задач */
.dash-grp { border-top: 1px solid var(--of-line); }
.dash-grp summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 18px; user-select: none; }
.dash-grp summary::-webkit-details-marker { display: none; }
.dash-chev { color: var(--of-faint); font-size: 9px; transition: transform 0.15s; width: 10px; flex-shrink: 0; }
.dash-grp[open] .dash-chev { transform: rotate(90deg); }
.dash-grp-name { font-size: 13px; font-weight: 600; color: var(--of-ink); }
.dash-grp-agg { font-size: 12px; color: var(--of-faint); margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.dash-grp summary:hover { background: color-mix(in srgb, var(--of-surface-2) 45%, transparent); }

.dash-count { font-size: 11px; font-weight: 600; color: var(--of-muted); background: var(--of-surface-2); border-radius: 99px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.dash-count.is-bad { color: var(--of-danger); background: var(--of-danger-soft); }

.cabinet-main .dash-card a.dash-task { display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 38px; font-size: 13px; text-decoration: none; color: var(--of-ink); }
.cabinet-main .dash-card a.dash-task:hover { background: color-mix(in srgb, var(--of-surface-2) 45%, transparent); color: var(--of-ink); }
.dash-task-t { color: var(--of-ink); min-width: 0; }
.dash-task-meta { margin-left: auto; color: var(--of-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-task-go { color: var(--of-faint); font-size: 12.5px; white-space: nowrap; }
.cabinet-main .dash-card a.dash-task:hover .dash-task-go { color: var(--of-accent-strong); }

.dash-clear { display: flex; align-items: center; gap: 10px; padding: 14px 18px; color: var(--of-muted); font-size: 13.5px; }

/* Сегментные бары */
.dash-segbar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; margin: 10px 0 12px; }
.dash-segbar i,
.dash-segbar .of-icon { display: block; height: 100%; border-radius: 2px; min-width: 4px; }
.dash-segbar .is-bad { background: var(--of-danger); }
.dash-segbar .is-ok { background: var(--of-good); }
.dash-segbar .is-mid { background: var(--of-faint); }
.dash-segbar .is-track { background: color-mix(in srgb, var(--of-surface-2) 70%, var(--of-line)); }

.dash-legend { display: flex; flex-direction: column; gap: 6px; }
.dash-legend > div { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--of-muted); }
.dash-legend > div b { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--of-ink); }
.dash-legend > div b.dash-bad-text { color: var(--of-danger); }
.dash-legend .dash-dot { position: relative; top: -1px; }

.dash-deadline { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; color: var(--of-accent-strong); background: var(--of-accent-soft); border-radius: 99px; padding: 2px 10px; white-space: nowrap; }

.dash-cta { margin-top: 14px; }

/* Проекты: строки с этапами */
.cabinet-main .dash-card a.dash-proj { display: flex; align-items: center; gap: 16px; padding: 11px 18px; border-top: 1px solid var(--of-line); text-decoration: none; color: var(--of-ink); }
.cabinet-main .dash-card a.dash-proj:hover { background: color-mix(in srgb, var(--of-surface-2) 45%, transparent); color: var(--of-ink); }
.dash-proj-col { min-width: 0; flex: 1; }
.dash-proj-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-proj-who { font-size: 11.5px; color: var(--of-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-stage { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.dash-stage-segs { display: flex; gap: 2px; }
.dash-stage-segs i,
.dash-stage-segs .of-icon { width: 17px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--of-surface-2) 70%, var(--of-line)); }
.dash-stage-segs i.is-done { background: var(--of-ink); }
.dash-stage-segs i.is-current { background: var(--of-accent); }
.dash-stage-word { font-size: 11.5px; color: var(--of-muted); white-space: nowrap; width: 110px; }
.dash-proj-sum { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 700px) {
  .dash-stage { display: none; }
}

/* Недавнее: пульс + лента */
.dash-spark { display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; height: 32px; margin: 8px 0 4px; }
.dash-spark i,
.dash-spark .of-icon { flex: 1; max-width: 20px; background: color-mix(in srgb, var(--of-accent) 26%, var(--of-surface-2)); border-radius: 2px 2px 0 0; min-height: 2px; }
.dash-spark i.is-hot { background: var(--of-accent); }
.dash-spark-cap { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--of-faint); }

.dash-feed { list-style: none; margin: 12px 0 0; padding: 0; }
.dash-feed li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--of-line); font-size: 12.5px; }
.dash-feed li:first-child { border-top: none; }
.dash-feed-when { color: var(--of-faint); font-size: 11.5px; width: 42px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.dash-feed-what { color: var(--of-muted); min-width: 0; }
.cabinet-main .dash-card .dash-feed-what a { color: var(--of-ink); font-weight: 550; text-decoration: none; }
.cabinet-main .dash-card .dash-feed-what a:hover { color: var(--of-accent-strong); }
