/*
 * Titan Lock — counter-flows.css (counter customer flows R8–R11 and the counter receipt page). Owner: WS5-M5.
 * Registered on every panel by the S0 seam (ConfiguresTitanPanel). Styles only this module's own
 * .tl-cf-* classes (phone-first: one column at 375 px, ≥ 44-px tap targets, no horizontal scroll).
 * The 80-mm receipt print rules are WS6-M1's (collections.css); the one print rule here hides the
 * counter's own chrome on the counter receipt page. Plain CSS (no Tailwind build). After an edit run
 * `php artisan filament:assets` — the panels serve the published copy in public/css/app/.
 */

/* ── Shared atoms ── */
.tl-cf-stack {
  display: grid;
  gap: 0.875rem;
  min-width: 0;
}
.tl-cf-tone--danger { color: var(--tl-lock-fg); }
.tl-cf-tone--success { color: var(--tl-green-700); }
.tl-cf-tone--gray { color: var(--tl-ink-900); }

.tl-cf-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--tl-radius-pill);
  background: var(--tl-steel-100);
  color: var(--tl-ink-800);
  font-weight: 700;
  font-size: 0.875rem;
}

.tl-cf-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  padding: 0.625rem 0.75rem;
  border-radius: var(--tl-radius-sm);
  background: var(--tl-steel-50);
  color: var(--tl-steel-600);
  font-size: 0.8125rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.tl-cf-note--warn { background: var(--tl-lock-bg); color: var(--tl-lock-fg); }
.tl-cf-note--info { background: var(--tl-remind-bg); color: var(--tl-remind-fg); }
.tl-cf-note__icon { width: 1.125rem; height: 1.125rem; flex: none; }

.tl-cf-empty {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  border: 1px dashed var(--tl-steel-300);
  border-radius: var(--tl-radius-md);
  text-align: center;
}
.tl-cf-empty__icon { width: 1.75rem; height: 1.75rem; color: var(--tl-steel-400); }
.tl-cf-empty__text { margin: 0; color: var(--tl-ink-800); font-size: 0.9375rem; }

.tl-cf-inline-action { margin: 0; }

/* ── Customer list rows (one card per agreement; no phone or IMEI) ── */
.tl-cf-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  width: 100%;
  min-height: 44px;
}
.tl-cf-row__who {
  flex: 1 1 auto;
  min-width: 0;
}
.tl-cf-row__name {
  margin: 0;
  font-weight: 600;
  color: var(--tl-ink-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-cf-row__line {
  margin: 0.125rem 0 0;
  color: var(--tl-steel-500);
  font-size: 0.8125rem;
  overflow-wrap: anywhere; /* wraps on a phone, so the installment k/n stays visible */
}
.tl-cf-row__state {
  flex: 0 1 auto;
  display: grid;
  justify-items: end;
  gap: 0.25rem;
  min-width: 0;
  max-width: 50%;
  text-align: right;
}
.tl-cf-row__amount {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tl-cf-row__chip {
  max-width: 100%;
  white-space: normal; /* "Expected: Restricted" wraps inside the card instead of spilling over its edge */
  text-align: left;
}
.tl-cf-row__chip span:last-child { overflow-wrap: anywhere; }
.tl-cf-row__late {
  margin: 0;
  color: var(--tl-lock-fg);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Customer strip (pay / code pages) ── */
.tl-cf-who {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--tl-steel-200);
  border-radius: var(--tl-radius-md);
  background: var(--tl-white, #FFFFFF);
  min-width: 0;
}
.tl-cf-who__text { min-width: 0; flex: 1 1 auto; }
.tl-cf-who__name { margin: 0; font-weight: 700; color: var(--tl-ink-900); }
.tl-cf-who__name a { color: inherit; text-decoration: none; }
.tl-cf-who__meta { margin: 0.125rem 0 0; color: var(--tl-steel-500); font-size: 0.8125rem; overflow-wrap: anywhere; }
.tl-cf-who__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.625rem;
  margin-top: 0.5rem;
}
.tl-cf-who__due { font-weight: 700; font-size: 0.875rem; font-variant-numeric: tabular-nums; }

/* ── R9 customer card (under the console header) ── */
.tl-cf-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--tl-steel-200);
  border-radius: var(--tl-radius-md);
  background: var(--tl-white, #FFFFFF);
  min-width: 0;
}
.tl-cf-card__main { min-width: 0; flex: 1 1 auto; }
.tl-cf-card__due { margin: 0; font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-cf-card__meta { margin: 0.25rem 0 0; color: var(--tl-steel-600); font-size: 0.8125rem; overflow-wrap: anywhere; }
.tl-cf-card__seen {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0.375rem 0 0;
  color: var(--tl-steel-500);
  font-size: 0.75rem;
}
.tl-cf-card__seen-icon { width: 0.875rem; height: 0.875rem; flex: none; }
.tl-cf-call {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0.375rem 0.625rem;
  border-radius: var(--tl-radius-md);
  background: var(--tl-normal-bg);
  color: var(--tl-normal-fg);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}
.tl-cf-call__icon { width: 1.25rem; height: 1.25rem; }

/* ── Action rows (R9) and code choices (R11) ── */
.tl-cf-actions { display: grid; gap: 1rem; margin-bottom: 1rem; }
.tl-cf-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--tl-steel-200);
  border-radius: var(--tl-radius-md);
  background: var(--tl-white, #FFFFFF);
  overflow: hidden;
}
.tl-cf-list > li + li { border-top: 1px solid var(--tl-steel-100); }
.tl-cf-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 56px;
  padding: 0.75rem 1rem;
  border: 0;
  background: transparent;
  color: var(--tl-ink-900);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.tl-cf-action:hover,
.tl-cf-action:focus-visible { background: var(--tl-steel-50); }
.tl-cf-action__icon {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  padding: 0.5rem;
  border-radius: var(--tl-radius-sm);
  background: var(--tl-steel-100);
  color: var(--tl-ink-800);
}
.tl-cf-action--primary .tl-cf-action__icon { background: var(--tl-normal-bg); color: var(--tl-normal-fg); }
.tl-cf-action--danger .tl-cf-action__icon { background: var(--tl-lock-bg); color: var(--tl-lock-fg); }
.tl-cf-action__text { display: grid; gap: 0.125rem; min-width: 0; flex: 1 1 auto; }
.tl-cf-action__title { font-weight: 600; }
.tl-cf-action__hint { color: var(--tl-steel-500); font-size: 0.8125rem; line-height: 1.35; overflow-wrap: anywhere; }
.tl-cf-action__chevron { width: 1.125rem; height: 1.125rem; flex: none; color: var(--tl-steel-400); }
.tl-cf-action--disabled { cursor: not-allowed; opacity: 0.75; }
.tl-cf-action--disabled:hover { background: transparent; }
.tl-cf-action--disabled .tl-cf-action__hint { color: var(--tl-lock-fg); }

.tl-cf-caution { display: grid; gap: 0.5rem; }
.tl-cf-caution__title {
  margin: 0;
  color: var(--tl-steel-500);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── R9 stacked sections ── */
.tl-cf-section { margin-bottom: 0.75rem; }
.tl-cf-section .tl-console-panel { min-width: 0; }
.tl-cf-table { min-width: 0; overflow-x: auto; }
.tl-cf-print { margin: 0.75rem 0 0; }
.tl-cf-screen { display: grid; justify-items: center; }

/* ── Take payment: the amount-labelled submit spans the form ── */
.tl-cf-submit { min-height: 48px; }

/* ── Counter receipt ── */
.tl-cf-receipt { display: grid; gap: 0.875rem; min-width: 0; }
.tl-cf-delivery {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  color: var(--tl-steel-600);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
.tl-cf-delivery__icon { width: 1rem; height: 1rem; flex: none; margin-top: 0.125rem; }
.tl-cf-receipt__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tl-cf-receipt__buttons > * { flex: 1 1 10rem; }
.tl-cf-receipt__buttons .fi-btn { width: 100%; justify-content: center; white-space: normal; }
.tl-cf-sms { display: flex; }

/* Phones: the list, cards and rows stay inside 375 px. */
@media (max-width: 479.98px) {
  .tl-cf-row__state { max-width: 45%; }
  .tl-cf-card__due { font-size: 1.25rem; }
  .tl-cf-receipt__buttons > * { flex-basis: 100%; }
}

/* Printing the counter receipt: only the receipt (WS6's 80-mm rules do the rest), not the counter's bottom nav. */
@media print {
  body:has(.tl-cf-receipt) .tl-bottom-nav,
  .tl-cf-receipt .tl-delivery__refresh {
    display: none !important;
  }
}
