/*
 * Titan Lock — admin.css (platform and reseller management, view-as banner). Owner: WS5-M6.
 * Registered on every panel by the S0 seam (ConfiguresTitanPanel). Styles only
 * this module's own .tl-* classes (plain CSS, no Tailwind build). After an edit
 * run `php artisan filament:assets` — the panels serve the published copy in
 * public/css/app/. Light only (tokens.css has no dark variants).
 */

/* ── "View as" banner (BODY_START on admin pages; crimson outline, always visible) ── */
.tl-viewas-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.625rem 1rem;
  background: var(--tl-lock-bg);
  color: var(--tl-lock-fg);
  border: 2px solid var(--tl-lock-solid);
  font-size: 0.875rem;
  line-height: 1.4;
}
.tl-viewas-banner__icon svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}
.tl-viewas-banner__text {
  flex: 1 1 16rem;
  min-width: 0;
}
.tl-viewas-banner__form {
  margin: 0;
}
.tl-viewas-banner__exit {
  padding: 0.3rem 0.875rem;
  border: 1.5px solid var(--tl-lock-solid);
  border-radius: var(--tl-radius-pill);
  background: var(--tl-white);
  color: var(--tl-lock-solid);
  font-weight: 700;
  cursor: pointer;
}
.tl-viewas-banner__exit:hover,
.tl-viewas-banner__exit:focus-visible {
  background: var(--tl-lock-solid);
  color: var(--tl-white);
}

/* ── Page layout atoms ── */
.tl-admin-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.tl-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.25rem;
  align-items: start;
}
.tl-admin-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
}
.tl-admin-lead {
  font-weight: 600;
  color: var(--tl-ink-900);
}
.tl-admin-muted {
  color: var(--tl-steel-500);
  font-size: 0.875rem;
}
.tl-admin-caption {
  margin-top: 0.75rem;
  color: var(--tl-steel-500);
  font-size: 0.8125rem;
}
.tl-admin-figure {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--tl-ink-900);
  line-height: 1.1;
}
.tl-admin-warn-text {
  color: var(--tl-lock-fg);
  font-size: 0.875rem;
  font-weight: 600;
}
.tl-admin-link {
  color: var(--tl-orange-700);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tl-admin-list {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
  list-style: disc;
  font-size: 0.875rem;
  color: var(--tl-ink-800);
}
.tl-admin-list li + li {
  margin-top: 0.25rem;
}
.tl-admin-list--mono {
  font-family: var(--tl-font-code);
  font-size: 0.8125rem;
}
.tl-admin-inline-form {
  margin-top: 0.75rem;
}
.tl-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Banners (page notes) ── */
.tl-admin-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: var(--tl-radius-md);
  font-size: 0.875rem;
  font-weight: 500;
}
.tl-admin-banner__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}
.tl-admin-banner--warn { background: var(--tl-warn-bg); color: var(--tl-warn-fg); }
.tl-admin-banner--ok { background: var(--tl-green-50); color: var(--tl-green-800); }
.tl-admin-banner--danger { background: var(--tl-lock-bg); color: var(--tl-lock-fg); }

/* ── Simple tables in custom Blade ── */
.tl-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.tl-admin-table th,
.tl-admin-table td {
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid var(--tl-steel-100);
  text-align: left;
  vertical-align: middle;
}
.tl-admin-table thead th {
  color: var(--tl-steel-500);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tl-admin-table__num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}
.tl-admin-table__bar-col {
  width: 40%;
}

/* ── Ladder stages bar (no chart library; every stage also has icon + label in the table) ── */
.tl-ladder-bar {
  display: flex;
  height: 0.875rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  border-radius: var(--tl-radius-pill);
  background: var(--tl-steel-100);
}
.tl-ladder-bar__seg { display: block; height: 100%; }
.tl-ladder-bar__seg--normal { background: var(--tl-normal-mark); }
.tl-ladder-bar__seg--remind { background: var(--tl-remind-mark); }
.tl-ladder-bar__seg--warn { background: var(--tl-warn-mark); }
.tl-ladder-bar__seg--restrict { background: var(--tl-restrict-mark); }
.tl-ladder-bar__seg--lock { background: var(--tl-lock-mark); }

.tl-forecast-bar {
  display: block;
  height: 0.5rem;
  min-width: 2px;
  border-radius: var(--tl-radius-pill);
  background: var(--tl-lock-mark);
}

/* ── "Needs attention" rows ── */
.tl-attention {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tl-attention__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.625rem 0.25rem;
  border-bottom: 1px solid var(--tl-steel-100);
  font-size: 0.875rem;
}
.tl-attention__row:last-child { border-bottom: 0; }
.tl-attention__icon svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}
.tl-attention__text { flex: 1 1 14rem; min-width: 0; }
.tl-attention__count {
  min-width: 2rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--tl-radius-pill);
  background: var(--tl-steel-100);
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.tl-attention__row--danger .tl-attention__icon,
.tl-attention__row--lock .tl-attention__icon { color: var(--tl-lock-solid); }
.tl-attention__row--danger .tl-attention__text { color: var(--tl-lock-fg); font-weight: 600; }
.tl-attention__row--warn .tl-attention__icon { color: var(--tl-restrict-solid); }
.tl-attention__row--info .tl-attention__icon { color: var(--tl-remind-solid); }
.tl-attention__row--key .tl-attention__icon { color: var(--tl-gold-600); }
.tl-attention__row--key .tl-attention__count { background: var(--tl-gold-50); color: var(--tl-gold-700); }

/* ── Portal Settings hub (admin-more.html) ── */
.tl-settings-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tl-settings-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--tl-steel-100);
}
.tl-settings-row:last-child { border-bottom: 0; }
.tl-settings-row__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  color: var(--tl-steel-500);
}
.tl-settings-row__body { min-width: 0; }
.tl-settings-row__title { font-weight: 600; color: var(--tl-ink-900); }
.tl-settings-row__links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.25rem; }
.tl-settings-subhead {
  margin: 1.25rem 0 0.5rem;
  font-weight: 600;
  color: var(--tl-ink-800);
}
.tl-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr));
  gap: 0.75rem;
}
.tl-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 0.5rem;
  border: 1px solid var(--tl-steel-200);
  border-radius: var(--tl-radius-md);
  background: var(--tl-white);
  color: var(--tl-ink-900);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
}
a.tl-tool:hover,
a.tl-tool:focus-visible {
  border-color: var(--tl-orange-600);
}
.tl-tool__icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--tl-orange-700);
}
.tl-tool--disabled {
  background: var(--tl-steel-50);
  color: var(--tl-steel-500);
  cursor: not-allowed;
}
.tl-tool--disabled .tl-tool__icon { color: var(--tl-steel-400); }
