/* Budget usage and progress bars, legend, Gantt, the monthly cost chart, photos and documents. */
@layer components {
  .usage { position: relative; height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; display: flex; min-width: 80px; }
  .usage__fact { background: var(--primary); }
  .usage__committed { background: var(--primary-muted); }
  .usage--over { outline: 2px solid var(--bad); outline-offset: 1px; }
  .usage--over .usage__fact { background: var(--bad); }

  .progress { position: relative; height: 8px; border-radius: 4px; background: var(--line-2); min-width: 80px; }
  .progress__value { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--ok); }
  .progress__plan { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; }

  .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
  .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

  .gantt { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); border-top: 1px solid var(--line-2); }
  .gantt__name, .gantt__track { border-bottom: 1px solid var(--line-2); padding: 10px 12px; min-height: 52px; }
  .gantt__name { display: flex; flex-direction: column; justify-content: center; gap: 2px; border-right: 1px solid var(--line-2); }
  .gantt__name small { color: var(--ink-3); }
  .gantt__track { position: relative; padding: 0; }
  .gantt__scale { position: relative; height: 30px; font-size: 11px; color: var(--ink-3); }
  .gantt__month { position: absolute; top: 8px; transform: translateX(4px); white-space: nowrap; }
  .gantt__grid { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--line); }
  .gantt__bar { position: absolute; top: 14px; height: 24px; border-radius: 6px; background: var(--primary-soft); overflow: hidden; }
  .gantt__bar span { display: block; height: 100%; background: var(--primary); }
  .gantt__bar--done span { background: var(--ok); }
  .gantt__bar--overdue { background: var(--bad-soft); }
  .gantt__bar--overdue span { background: var(--bad); }
  .gantt__bar--behind span { background: var(--warn); }
  .gantt__today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 2; }
  .gantt__pct { position: absolute; top: 17px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }

  .chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding: 10px 4px 0; }
  .chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
  .chart__bar { width: 100%; max-width: 44px; background: linear-gradient(180deg, var(--primary-muted), var(--primary)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
  .chart__val { font-size: 11px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
  .chart__label { font-size: 11.5px; color: var(--ink-3); }

  .photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); display: block; }
  .doc-tile { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }

  @media (max-width: 860px) {
    .gantt { grid-template-columns: 130px minmax(0, 1fr); }
  }
}
