/**
 * Burnline dashboard shell. Requires tokens.css, components.css, product-extras.css.
 * Only burnline-dashboard.html loads this file.
 */

body.ls .wrap,
body.ls .ls-wrap--app {
  max-width: var(--ls-wrap-wide);
  margin: 0 auto;
  padding: 40px 24px calc(48px + var(--ls-safe-bottom));
}

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0 0 8px; font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -1px; }
.page-head .sub { margin: 0 0 12px; color: var(--ls-muted); font-size: 15px; max-width: 40rem; }
.page-head .ls-badge-row { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ls-wrap--app code { font-family: var(--ls-font-mono); font-size: 0.88em; color: var(--ls-code); background: var(--ls-bg-elevated); padding: 1px 5px; border-radius: 4px; }
.ls-wrap--app .bar-meta code, .ls-wrap--app td code { background: none; padding: 0; }

.btn-file { position: relative; overflow: hidden; }
.btn-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn-file:focus-within { outline: 2px solid var(--ls-link); outline-offset: 2px; }

.drop {
  border: 1px dashed var(--ls-border-strong);
  border-radius: var(--ls-radius);
  background: var(--ls-card);
  padding: 14px 16px;
  margin-bottom: 16px;
  transition: border-color var(--ls-duration) var(--ls-ease), background var(--ls-duration) var(--ls-ease);
}
.drop.drag { border-color: var(--ls-link); background: var(--ls-bg-elevated); }
.drop p { margin: 0; color: var(--ls-muted); font-size: 14px; }
.drop strong { color: var(--ls-text); font-weight: 500; }
.status-line { margin: 8px 0 0; font-size: 13px; color: var(--ls-muted); font-variant-numeric: tabular-nums; }
.status-line.err { color: var(--ls-danger); }
.status-line.ok { color: var(--ls-text); }

.toolbar { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 16px; }
@media (min-width: 800px) { .toolbar { grid-template-columns: auto 1fr; align-items: end; } }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--ls-muted); margin-bottom: 6px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: var(--ls-bg-elevated); border-radius: var(--ls-radius-sm); }
.seg button {
  appearance: none; border: 0; cursor: pointer;
  background: transparent; color: var(--ls-muted);
  font: 500 14px var(--ls-font);
  padding: 0 12px; height: 32px; border-radius: 4px;
}
.seg button:hover { color: var(--ls-text); }
.seg button[aria-pressed="true"] { background: var(--ls-card); color: var(--ls-text); box-shadow: var(--ls-ring); }
.cap-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cap-row .status-line { margin: 0; }
.cap-row input[type="number"] {
  width: 110px; height: 36px; padding: 0 10px;
  background: var(--ls-card); color: var(--ls-text);
  border: 0; border-radius: var(--ls-radius-sm); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  font: 400 15px var(--ls-font-mono); font-variant-numeric: tabular-nums;
}

.kpis { display: grid; gap: 1px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; background: var(--ls-border); border-radius: var(--ls-radius); overflow: hidden; box-shadow: var(--ls-ring); }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--ls-card); padding: 16px 18px; min-width: 0; }
.kpi .label { font-size: 13px; color: var(--ls-muted); }
.kpi .value { margin-top: 6px; font: 500 24px/1.2 var(--ls-font-mono); letter-spacing: -0.6px; font-variant-numeric: tabular-nums; color: var(--ls-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi .hint { margin-top: 4px; font-size: 13px; color: var(--ls-faint); }
.kpi.over .value { color: var(--ls-danger); }
.kpi.warn .value { color: var(--ls-warn); }

.budget-card, .panel { background: var(--ls-card); border-radius: var(--ls-radius); box-shadow: var(--ls-lift); padding: 16px 18px; min-width: 0; }
.budget-card { margin-bottom: 16px; }
.budget-card .top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; color: var(--ls-muted); }
.budget-card .top strong { color: var(--ls-text); font-weight: 500; font-variant-numeric: tabular-nums; }
.track { height: 8px; border-radius: var(--ls-radius-pill); background: var(--ls-bg-elevated); overflow: hidden; }
.fill { height: 100%; width: 0%; border-radius: var(--ls-radius-pill); background: var(--ls-text); transition: width 0.25s var(--ls-ease); }
.fill.warn { background: var(--ls-warn); }
.fill.over { background: var(--ls-danger); }

.panels { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.panel h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; letter-spacing: -0.2px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.panel h2 span { font-size: 13px; font-weight: 400; color: var(--ls-faint); }

.bar-list { display: grid; gap: 12px; }
.bar-row { min-width: 0; }
.bar-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 4px; }
.bar-meta .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 13px var(--ls-font-mono); color: var(--ls-code); }
.bar-meta .amt { flex: none; font: 400 13px var(--ls-font-mono); font-variant-numeric: tabular-nums; color: var(--ls-text); }
.bar-track { height: 6px; border-radius: var(--ls-radius-pill); background: var(--ls-bg-elevated); overflow: hidden; }
.bar-fill { height: 100%; min-width: 2px; border-radius: var(--ls-radius-pill); background: var(--ls-text); }
.bar-fill.day { background: var(--ls-border-strong); }
.empty { color: var(--ls-faint); font-size: 14px; padding: 16px 4px; }

.table-panel { margin-top: 16px; }
.table-panel .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-panel table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table-panel th, .table-panel td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--ls-border); color: var(--ls-muted); white-space: nowrap; }
.table-panel tr:last-child td { border-bottom: 0; }
.table-panel th { color: var(--ls-faint); font-size: 13px; font-weight: 500; }
.table-panel td.n, .table-panel th.n { text-align: right; font-variant-numeric: tabular-nums; }
.table-panel td.usd { color: var(--ls-text); font-weight: 500; }

.toast {
  position: fixed; bottom: calc(16px + var(--ls-safe-bottom)); left: 50%; z-index: var(--ls-z-sticky);
  transform: translateX(-50%) translateY(160%);
  max-width: min(92vw, 420px); padding: 10px 14px; border-radius: var(--ls-radius-sm);
  background: var(--ls-text); color: var(--ls-accent-ink); font-size: 14px; font-weight: 500; text-align: center;
  transition: transform 0.2s var(--ls-ease);
}
.toast:empty { display: none; }
.toast.show { transform: translateX(-50%) translateY(0); }

.ls-wrap--app .ls-foot { margin-top: 56px; padding: 24px 0 0; background: transparent; }

@media (max-width: 720px) {
  body.ls .wrap, body.ls .ls-wrap--app { padding: 28px 16px calc(40px + var(--ls-safe-bottom)); }
  .page-head h1 { font-size: 24px; line-height: 32px; }
}
