/* =========================================================================
   Tú Produce Console — the real console's own pieces.
   Everything else (tokens, rail, top bar, cards, tables, forms, both
   themes) is the demo's assets/base.css + dashboard.css, served from the
   same files so the two cannot drift apart.
   ========================================================================= */

.pagebody { display: grid; gap: 20px; }
.pagebody > .card, .pagebody > div > .card { grid-column: auto; }
.pagebody > div:empty { display: none; }
.pagebody > div { display: grid; gap: 20px; }
.pagetools { display: flex; justify-content: flex-end; }

/* Headline figures */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg, 14px);
  padding: 16px 18px;
  box-shadow: var(--shadow-1);
}
.tile__value {
  font-family: var(--display);
  font-size: 28px; font-weight: 700; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.tile__value small { font-size: 14px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.tile__label { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

/* Tables */
table.data--full { width: 100%; }
table.data td.where { white-space: normal; min-width: 170px; }
/* Name on one line, role and organisation on the next, both cut short
   rather than run past the rail. */
.railuser__meta { display: grid; min-width: 0; }
.railuser__name, .railuser__role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data td.notes { white-space: normal; min-width: 180px; max-width: 320px; }
table.data td.empty { text-align: center; color: var(--ink-3); padding: 26px 10px; white-space: normal; }
table.data td.actions { text-align: right; width: 1%; }

.sub { color: var(--ink-3); font-size: 12px; font-weight: 400; }
.sub.block { display: block; margin-top: 2px; }
.mono.sub, .sub.mono { font-family: var(--mono); }
.btnrow { display: inline-flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
table.data td.wrap { white-space: normal; min-width: 120px; }
/* Narrower screens (iPad portrait): row buttons show their icon only and
   the least-needed columns step aside, so a row fits without scrolling. */
@media (max-width: 1280px) {
  .rowbtn { width: 34px; padding: 0; justify-content: center; }
  .rowbtn__label { display: none; }
  table.data .opt { display: none; }
}
.pills { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.indent[data-depth="1"] { display: inline-block; width: 22px; }
.indent[data-depth="2"] { display: inline-block; width: 44px; }
.indent[data-depth="3"] { display: inline-block; width: 66px; }
.card .hint { margin-top: 12px; }
.card .filters { margin-bottom: 14px; }
.card .exportbar { margin-bottom: 10px; }
.field--actions { align-self: end; }

/* Notices (auth.css holds the sign-in page's copy) */
.notice {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 15px;
  border-radius: var(--r-md);
  font-size: 13.5px; line-height: 1.5;
  background: var(--wash-2);
  border: 1px solid var(--wash);
  color: var(--ink-2);
}
.notice svg { flex: none; width: 17px; height: 17px; margin-top: 1px; color: var(--canopy); }
.notice--error { background: rgba(208,59,59,.09); border-color: rgba(208,59,59,.26); color: var(--critical-ink); }
.notice--error svg { color: var(--critical); }
.notice--warn { background: rgba(250,178,25,.12); border-color: rgba(250,178,25,.34); color: var(--warn-ink); }
.notice--warn svg { color: var(--warn-ink); }
.notice[hidden] { display: none; }
.notice a { font-weight: 600; }

/* Profile */
.kvlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
@media (max-width: 700px) { .kvlist { grid-template-columns: 1fr; } }
.kvlist dt { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.kvlist dd { margin: 0; font-weight: 600; }
.pwform { display: grid; gap: 15px; max-width: 420px; }

/* Dialogs */
.dlg {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-3);
}
.dlg::backdrop { background: rgba(8, 12, 6, .55); }
.dlg__form { display: grid; gap: 16px; padding: 22px; }
.dlg__title { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.dlg__body { display: grid; gap: 15px; }
.dlg__error {
  margin: 0; padding: 10px 12px; border-radius: var(--r-md);
  background: rgba(208,59,59,.09); color: var(--critical-ink); font-size: 13.5px;
}
.dlg__error[hidden] { display: none; }
.dlg__actions { display: flex; justify-content: flex-end; gap: 10px; }
.dlg .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field[hidden] { display: none; }
.checks { display: grid; gap: 8px; max-height: 240px; overflow-y: auto; }
.checkrow { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.checkrow input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--canopy); flex: none; }
.btn--danger { background: var(--critical); color: #fff; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink); color: var(--plane);
  padding: 11px 16px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-2);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
  max-width: calc(100vw - 32px);
}
.toast[data-show="true"] { opacity: 1; transform: translate(-50%, 0); }

.fatal { display: grid; place-items: center; gap: 16px; min-height: 60vh; text-align: center; padding: 24px; }
