/*
 * Titan Lock — collections.css (EMI exports; the ONLY 80-mm receipt print CSS). Owner: WS6-M1.
 * Registered on every panel by the S0 seam (ConfiguresTitanPanel). Styles only
 * this module's own .tl-* classes: the offline code (.tl-code, the host
 * trait's code modal .tl-emi-code), the receipt (.tl-receipt, <x-titan.receipt>),
 * the delivery tracker (.tl-delivery) and the embedded EMI tables
 * (.tl-emi-table). Plain CSS (no Tailwind build). After an edit run
 * `php artisan filament:assets` — the panels serve the published copy in
 * public/css/app/. A state is never shown by colour alone (icon + label).
 */

/* ── The offline code ─────────────────────────────────────────────────────── */
.tl-code {
  display: grid;
  gap: 0.5rem;
}
.tl-code__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tl-steel-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tl-code__digits {
  font-family: var(--tl-font-code), ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  /* 14 digits as XXXX XXXX XXXX XX stay on ONE line down to a 375px phone. */
  font-size: clamp(1rem, 5.6vw, 1.75rem);
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--tl-ink-900);
  word-spacing: 0.35em;
  user-select: all;
}
.tl-code__sms {
  font-family: var(--tl-font-code), ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--tl-steel-300);
  border-radius: var(--tl-radius-sm);
  background: var(--tl-steel-50);
  user-select: all;
}
.tl-code__hint,
.tl-code__hidden {
  font-size: 0.875rem;
  color: var(--tl-steel-600);
}
.tl-code__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tl-code__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--tl-steel-300);
  border-radius: var(--tl-radius-md);
  background: var(--tl-white);
  color: var(--tl-ink-900);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.tl-code__btn:hover {
  background: var(--tl-steel-50);
}
.tl-code__icon {
  width: 1.1rem;
  height: 1.1rem;
}
.tl-emi-code {
  padding: 0.25rem 0;
}

/* ── Receipt (<x-titan.receipt>) ─────────────────────────────────────────── */
.tl-receipt {
  display: grid;
  gap: 1rem;
  max-width: 40rem;
  color: var(--tl-ink-900);
}
.tl-receipt__banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--tl-radius-md);
  background: var(--tl-normal-bg);
  color: var(--tl-normal-fg);
  font-weight: 700;
}
.tl-receipt__banner--voided {
  background: var(--tl-steel-100);
  color: var(--tl-steel-600);
}
.tl-receipt__banner-icon,
.tl-receipt__warn-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}
.tl-receipt__meta,
.tl-receipt__standing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.5rem 1.25rem;
  margin: 0;
}
.tl-receipt__meta dt,
.tl-receipt__standing dt {
  font-size: 0.75rem;
  color: var(--tl-steel-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tl-receipt__meta dd,
.tl-receipt__standing dd {
  margin: 0;
  font-weight: 600;
}
.tl-receipt__mono {
  font-family: var(--tl-font-code), ui-monospace, Menlo, Consolas, monospace;
}
.tl-receipt__alloc {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.tl-receipt__alloc th,
.tl-receipt__alloc td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--tl-steel-200);
  text-align: left;
}
.tl-receipt__alloc th {
  color: var(--tl-steel-600);
  font-weight: 600;
}
.tl-receipt__paid-off dd {
  color: var(--tl-normal-fg);
}
.tl-receipt__warn {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--tl-radius-md);
  background: var(--tl-warn-bg);
  color: var(--tl-warn-fg);
  font-weight: 600;
}
.tl-receipt__code {
  padding: 0.85rem 1rem;
  border: 1px solid var(--tl-steel-200);
  border-radius: var(--tl-radius-md);
  background: var(--tl-white);
}
.tl-receipt__code-note {
  font-size: 0.9rem;
  color: var(--tl-steel-600);
}

/* ── Delivery tracker ─────────────────────────────────────────────────────── */
.tl-delivery__steps {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tl-delivery__step {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.tl-delivery__step--done {
  color: var(--tl-normal-fg);
  font-weight: 600;
}
.tl-delivery__step--muted {
  color: var(--tl-steel-600);
}
.tl-delivery__icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
}
.tl-delivery__refresh {
  margin-top: 0.5rem;
  border: 0;
  background: none;
  color: var(--tl-orange-700);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ── Embedded EMI tables ─────────────────────────────────────────────────── */
.tl-emi-table {
  width: 100%;
}

/* ── 80-mm receipt printer (the ONLY receipt print rules) ─────────────────── */
@media print {
  @page {
    size: 80mm auto;
    margin: 3mm;
  }
  .fi-sidebar,
  .fi-topbar,
  .fi-header-actions,
  .fi-page-header-actions,
  .fi-breadcrumbs,
  .fi-modal-footer,
  .fi-no-print,
  .tl-no-print,
  .tl-code__actions,
  .tl-delivery__refresh {
    display: none !important;
  }
  .fi-main,
  .fi-page,
  .fi-modal-window {
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    max-width: none !important;
  }
  .tl-receipt {
    max-width: 74mm;
    gap: 2.5mm;
    font-size: 9pt;
    color: #000;
  }
  .tl-receipt__banner {
    padding: 1.5mm 0;
    background: none;
    color: #000;
    border-bottom: 1px solid #000;
    border-radius: 0;
  }
  .tl-receipt__meta,
  .tl-receipt__standing {
    grid-template-columns: 1fr;
    gap: 0.6mm;
  }
  .tl-receipt__warn {
    background: none;
    color: #000;
    border: 1px solid #000;
  }
  .tl-receipt__code {
    border: 1px dashed #000;
  }
  .tl-code__digits {
    font-size: 14pt;
    color: #000;
  }
}
