/* ==========================================================================
   App styles — Bootstrap 5 overrides + Teacher Manager components.
   Uses logical properties (inline-start/end) so RTL and LTR both work.
   ========================================================================== */

/* ---------- Bootstrap bridge ---------- */
:root {
  --bs-body-font-family: var(--tm-font);
  --bs-body-bg: var(--tm-bg);
  --bs-body-color: var(--tm-text);
  --bs-secondary-color: var(--tm-text-muted);
  --bs-border-color: var(--tm-border);
  --bs-border-radius: var(--tm-radius-sm);
  --bs-border-radius-lg: var(--tm-radius-md);
  --bs-primary: var(--tm-primary-600);
  --bs-primary-rgb: var(--tm-primary-rgb);
  --bs-link-color: var(--tm-primary-700);
  --bs-link-color-rgb: var(--tm-primary-rgb);
  --bs-link-hover-color: var(--tm-primary-800);
  --bs-focus-ring-color: rgba(var(--tm-primary-rgb), 0.35);
}

body {
  background: var(--tm-bg);
  color: var(--tm-text);
  font-family: var(--tm-font);
  -webkit-font-smoothing: antialiased;
}

.num, .tm-num {
  font-family: var(--tm-font-num);
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 3px solid rgba(var(--tm-primary-rgb), 0.45);
  outline-offset: 2px;
}

.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-padding-y: 0.55rem;
  --bs-btn-padding-x: 1rem;
  min-height: var(--tm-tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tm-space-2);
}
.btn-sm { min-height: 34px; --bs-btn-padding-y: 0.3rem; --bs-btn-padding-x: 0.7rem; }
.btn-lg { min-height: 54px; --bs-btn-font-size: 1.0625rem; border-radius: var(--tm-radius-md); }

.btn-primary {
  --bs-btn-bg: var(--tm-primary-600);
  --bs-btn-border-color: var(--tm-primary-600);
  --bs-btn-hover-bg: var(--tm-primary-700);
  --bs-btn-hover-border-color: var(--tm-primary-700);
  --bs-btn-active-bg: var(--tm-primary-800);
  --bs-btn-active-border-color: var(--tm-primary-800);
  --bs-btn-disabled-bg: var(--tm-primary-300);
  --bs-btn-disabled-border-color: var(--tm-primary-300);
}
.btn-soft {
  --bs-btn-bg: var(--tm-primary-50);
  --bs-btn-color: var(--tm-primary-700);
  --bs-btn-border-color: var(--tm-primary-100);
  --bs-btn-hover-bg: var(--tm-primary-100);
  --bs-btn-hover-color: var(--tm-primary-800);
  --bs-btn-hover-border-color: var(--tm-primary-200);
}
.btn-outline-secondary {
  --bs-btn-color: var(--tm-text);
  --bs-btn-border-color: var(--tm-border-strong);
  --bs-btn-hover-bg: var(--tm-neutral-bg);
  --bs-btn-hover-color: var(--tm-text);
  --bs-btn-hover-border-color: var(--tm-border-strong);
}
.btn-success { --bs-btn-bg: var(--tm-success); --bs-btn-border-color: var(--tm-success); }
.btn-whatsapp {
  --bs-btn-bg: #e9f8ef; --bs-btn-color: #12773d; --bs-btn-border-color: #c9ecd6;
  --bs-btn-hover-bg: #d7f2e1; --bs-btn-hover-color: #0d5c2f; --bs-btn-hover-border-color: #b4e3c6;
}

.form-control, .form-select {
  min-height: var(--tm-tap);
  border-color: var(--tm-border-strong);
  border-radius: var(--tm-radius-sm);
}
.form-control:focus, .form-select:focus {
  border-color: var(--tm-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--tm-primary-rgb), 0.2);
}
.form-control-lg { min-height: 56px; font-size: 1.125rem; border-radius: var(--tm-radius-md); }
.form-label { font-weight: 600; font-size: var(--tm-text-sm); margin-bottom: var(--tm-space-1); }
.form-text { color: var(--tm-text-subtle); }
.phone-input { direction: ltr; text-align: start; font-family: var(--tm-font-num); letter-spacing: 0.04em; }
[dir="rtl"] .phone-input { text-align: right; }

.nav-tabs, .nav-pills { --bs-nav-link-color: var(--tm-text-muted); --bs-nav-link-hover-color: var(--tm-text); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--tm-primary-600); }

.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 0.8rem 1rem; border-bottom-color: var(--tm-border); }
.table thead th {
  font-size: var(--tm-text-xs); font-weight: 600; color: var(--tm-text-subtle);
  text-transform: uppercase; letter-spacing: 0.03em; background: var(--tm-surface-2);
}

/* ---------- App shell (staff) ---------- */
.tm-shell { min-height: 100vh; display: flex; }

.tm-sidebar {
  width: var(--tm-sidebar-w);
  flex-shrink: 0;
  background: var(--tm-ink);
  color: #efe9e5;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: var(--tm-space-4) var(--tm-space-3);
}
.tm-brand { display: flex; align-items: center; gap: var(--tm-space-3); padding: var(--tm-space-2); margin-bottom: var(--tm-space-4); }
.tm-brand__mark {
  width: 40px; height: 40px; border-radius: var(--tm-radius-md);
  background: var(--tm-primary); color: #fff; font-weight: 700; font-size: 1.1rem;
  display: grid; place-items: center; flex-shrink: 0;
}
.tm-brand__name { font-weight: 700; line-height: 1.2; }
.tm-brand__sub { font-size: var(--tm-text-xs); color: #b9aea7; }

.tm-nav { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.tm-nav__link {
  display: flex; align-items: center; gap: var(--tm-space-3);
  padding: 0.65rem 0.75rem; border-radius: var(--tm-radius-sm);
  color: #d9d0ca; text-decoration: none; font-weight: 500;
}
.tm-nav__link i { font-size: 1.15rem; width: 1.25rem; text-align: center; }
.tm-nav__link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.tm-nav__link.is-active { background: rgba(var(--tm-primary-rgb), 0.22); color: #fff; }
.tm-nav__link.is-active i { color: var(--tm-primary-200); }
.tm-nav__count {
  margin-inline-start: auto; background: var(--tm-primary); color: #fff;
  font-size: var(--tm-text-xs); font-weight: 700; padding: 1px 8px; border-radius: var(--tm-radius-pill);
}
.tm-nav__section { font-size: var(--tm-text-xs); color: #a3978f; padding: var(--tm-space-4) 0.75rem var(--tm-space-1); }

.tm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.tm-topbar {
  height: var(--tm-topbar-h);
  background: var(--tm-surface);
  border-bottom: 1px solid var(--tm-border);
  display: flex; align-items: center; gap: var(--tm-space-3);
  padding: 0 var(--tm-space-5);
  position: sticky; top: 0; z-index: 1020;
}
.tm-topbar__title { font-weight: 700; font-size: var(--tm-text-md); margin: 0; }
.tm-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--tm-primary-100); color: var(--tm-primary-800);
  display: grid; place-items: center; font-weight: 700; font-size: var(--tm-text-sm);
}

.tm-content { padding: var(--tm-space-5); max-width: 1280px; width: 100%; margin-inline: auto; }

.tm-bottomnav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 1030;
  height: calc(var(--tm-bottomnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--tm-surface); border-top: 1px solid var(--tm-border);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.tm-bottomnav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--tm-text-subtle); text-decoration: none; font-size: 0.6875rem; font-weight: 600;
  position: relative;
}
.tm-bottomnav__item i { font-size: 1.3rem; }
.tm-bottomnav__item.is-active { color: var(--tm-primary-700); }
.tm-bottomnav__item.is-active::before {
  content: ""; position: absolute; top: 0; width: 32px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--tm-primary);
}
.tm-bottomnav__dot {
  position: absolute; top: 8px; inset-inline-start: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--tm-danger); color: #fff; font-size: 0.625rem; display: grid; place-items: center;
}

@media (max-width: 991.98px) {
  .tm-sidebar { display: none; }
  .tm-topbar { padding: 0 var(--tm-space-4); }
  .tm-content { padding: var(--tm-space-4); padding-bottom: calc(var(--tm-bottomnav-h) + var(--tm-space-5)); }
}
@media (min-width: 992px) {
  .tm-bottomnav { display: none; }
}

/* ---------- Page header ---------- */
.tm-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--tm-space-3); margin-bottom: var(--tm-space-5); }
.tm-page-head h1 { font-size: var(--tm-text-xl); font-weight: 700; margin: 0; }
.tm-page-head p { margin: var(--tm-space-1) 0 0; color: var(--tm-text-muted); }
.tm-eyebrow { font-size: var(--tm-text-xs); font-weight: 600; color: var(--tm-text-subtle); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Card ---------- */
.tm-card {
  background: var(--tm-surface); border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-lg); box-shadow: var(--tm-shadow-1);
}
.tm-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--tm-space-3);
  padding: var(--tm-space-4) var(--tm-space-5); border-bottom: 1px solid var(--tm-border);
}
.tm-card__title { font-size: var(--tm-text-md); font-weight: 700; margin: 0; }
.tm-card__body { padding: var(--tm-space-5); }
.tm-card__body--flush { padding: 0; }
@media (max-width: 575.98px) {
  .tm-card__head, .tm-card__body { padding-inline: var(--tm-space-4); }
}

/* ---------- KPI tile ---------- */
.tm-kpi { padding: var(--tm-space-4) var(--tm-space-5); height: 100%; }
.tm-kpi__label { font-size: var(--tm-text-sm); color: var(--tm-text-muted); display: flex; align-items: center; gap: var(--tm-space-2); }
.tm-kpi__icon {
  width: 32px; height: 32px; border-radius: var(--tm-radius-sm);
  background: var(--tm-primary-50); color: var(--tm-primary-700); display: grid; place-items: center;
}
.tm-kpi__value { font-family: var(--tm-font-num); font-size: 1.75rem; font-weight: 700; margin-top: var(--tm-space-2); line-height: 1.1; }
.tm-kpi__unit { font-family: var(--tm-font); font-size: var(--tm-text-sm); font-weight: 500; color: var(--tm-text-muted); }
.tm-kpi__meta { font-size: var(--tm-text-xs); color: var(--tm-text-subtle); margin-top: var(--tm-space-1); }
.tm-kpi--alert .tm-kpi__icon { background: var(--tm-danger-bg); color: var(--tm-danger); }
.tm-kpi--warn .tm-kpi__icon { background: var(--tm-warning-bg); color: var(--tm-warning); }
.tm-kpi--ok .tm-kpi__icon { background: var(--tm-success-bg); color: var(--tm-success); }

/* ---------- Status badge ---------- */
.tm-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--tm-radius-pill);
  font-size: var(--tm-text-xs); font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.tm-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tm-badge--paid, .tm-badge--present, .tm-badge--confirmed, .tm-badge--open { background: var(--tm-success-bg); color: var(--tm-success); }
.tm-badge--unpaid, .tm-badge--absent, .tm-badge--rejected { background: var(--tm-danger-bg); color: var(--tm-danger); }
.tm-badge--pending, .tm-badge--uncovered, .tm-badge--renew { background: var(--tm-warning-bg); color: var(--tm-warning); }
.tm-badge--info, .tm-badge--upcoming { background: var(--tm-info-bg); color: var(--tm-info); }
.tm-badge--muted, .tm-badge--closed, .tm-badge--left, .tm-badge--cancelled { background: var(--tm-neutral-bg); color: var(--tm-text-muted); }

/* Billing type chip (not a status: no dot) */
.tm-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: var(--tm-radius-sm); background: var(--tm-neutral-bg); color: var(--tm-text-muted);
  font-size: var(--tm-text-xs); font-weight: 600;
}

/* ---------- List rows (mobile-first tables) ---------- */
.tm-list { list-style: none; margin: 0; padding: 0; }
.tm-row {
  display: flex; align-items: center; gap: var(--tm-space-3);
  padding: var(--tm-space-3) var(--tm-space-5); border-bottom: 1px solid var(--tm-border);
  min-height: 64px;
}
.tm-row:last-child { border-bottom: 0; }
.tm-row__main { flex: 1; min-width: 0; }
.tm-row__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-row__sub { font-size: var(--tm-text-sm); color: var(--tm-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-row__end { display: flex; align-items: center; gap: var(--tm-space-2); flex-shrink: 0; }
a.tm-row { color: inherit; text-decoration: none; }
a.tm-row:hover { background: var(--tm-surface-2); }
@media (max-width: 575.98px) { .tm-row { padding-inline: var(--tm-space-4); } }

.tm-initials {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--tm-primary-50); color: var(--tm-primary-700);
  display: grid; place-items: center; font-weight: 700;
}

/* ---------- Pending payment row ---------- */
.tm-pending-row .tm-amount { font-family: var(--tm-font-num); font-weight: 700; }
.tm-icon-btn {
  width: var(--tm-tap); height: var(--tm-tap); border-radius: var(--tm-radius-md);
  display: grid; place-items: center; border: 1px solid var(--tm-border-strong);
  background: var(--tm-surface); font-size: 1.25rem; padding: 0;
}
.tm-icon-btn--confirm { background: var(--tm-success); border-color: var(--tm-success); color: #fff; }
.tm-icon-btn--confirm:hover { background: #18623f; color: #fff; }
.tm-icon-btn--reject { color: var(--tm-danger); }
.tm-icon-btn--reject:hover { background: var(--tm-danger-bg); }

/* ---------- Lesson card (Today) ---------- */
.tm-lesson { display: flex; gap: var(--tm-space-4); padding: var(--tm-space-4) var(--tm-space-5); border-bottom: 1px solid var(--tm-border); }
.tm-lesson:last-child { border-bottom: 0; }
.tm-lesson__time { width: 64px; flex-shrink: 0; text-align: center; font-family: var(--tm-font-num); }
.tm-lesson__time strong { display: block; font-size: var(--tm-text-lg); }
.tm-lesson__time span { font-size: var(--tm-text-xs); color: var(--tm-text-subtle); }
.tm-lesson__body { flex: 1; min-width: 0; }
.tm-lesson.is-live { background: linear-gradient(90deg, var(--tm-primary-50), transparent 60%); }
[dir="rtl"] .tm-lesson.is-live { background: linear-gradient(-90deg, var(--tm-primary-50), transparent 60%); }

/* ---------- Progress ---------- */
.tm-progress { height: 8px; background: var(--tm-neutral-bg); border-radius: var(--tm-radius-pill); overflow: hidden; }
.tm-progress__bar { height: 100%; background: var(--tm-primary); border-radius: inherit; transition: width 0.3s ease; }
.tm-progress--success .tm-progress__bar { background: var(--tm-success); }

/* ---------- Quick actions ---------- */
.tm-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--tm-space-3); }
.tm-action {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--tm-space-2);
  padding: var(--tm-space-4) var(--tm-space-2); text-align: center;
  background: var(--tm-surface); border: 1px solid var(--tm-border); border-radius: var(--tm-radius-lg);
  color: var(--tm-text); text-decoration: none; font-weight: 600; font-size: var(--tm-text-sm);
  box-shadow: var(--tm-shadow-1); min-height: 104px;
}
.tm-action i { font-size: 1.6rem; color: var(--tm-primary-600); }
.tm-action:hover { border-color: var(--tm-primary-200); background: var(--tm-primary-50); color: var(--tm-text); }

/* ---------- Live session (projector) ---------- */
.tm-live { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--tm-space-5); }
@media (max-width: 991.98px) { .tm-live { grid-template-columns: 1fr; } }
.tm-qr-panel {
  background: var(--tm-ink); color: #fff; border-radius: var(--tm-radius-lg);
  padding: var(--tm-space-6); text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--tm-space-4);
}
.tm-qr-panel__code { background: #fff; border-radius: var(--tm-radius-lg); padding: var(--tm-space-3); width: min(100%, 340px); }
.tm-qr-panel__code svg { width: 100%; height: auto; display: block; }
.tm-qr-panel__title { font-size: var(--tm-text-xl); font-weight: 700; margin: 0; }
.tm-qr-panel__meta { color: #cfc5bf; }
.tm-qr-panel__price { font-family: var(--tm-font-num); font-size: var(--tm-text-2xl); font-weight: 700; color: var(--tm-primary-200); }
.tm-counter { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--tm-space-3); width: 100%; }
.tm-counter__cell { background: rgba(255, 255, 255, 0.06); border-radius: var(--tm-radius-md); padding: var(--tm-space-3); }
.tm-counter__value { font-family: var(--tm-font-num); font-size: var(--tm-text-xl); font-weight: 700; }
.tm-counter__label { font-size: var(--tm-text-xs); color: #b9aea7; }
.tm-countdown { font-family: var(--tm-font-num); font-variant-numeric: tabular-nums; }
.tm-countdown.is-ending { color: #ffb4a8; }

/* ---------- Empty state ---------- */
.tm-empty { text-align: center; padding: var(--tm-space-7) var(--tm-space-5); color: var(--tm-text-muted); }
.tm-empty__icon {
  width: 64px; height: 64px; margin: 0 auto var(--tm-space-4); border-radius: 50%;
  background: var(--tm-primary-50); color: var(--tm-primary-600); display: grid; place-items: center; font-size: 1.75rem;
}
.tm-empty__title { color: var(--tm-text); font-weight: 700; font-size: var(--tm-text-md); margin-bottom: var(--tm-space-1); }

/* ---------- Toasts ---------- */
.tm-toasts { position: fixed; z-index: 1090; inset-inline-end: var(--tm-space-4); top: calc(var(--tm-topbar-h) + var(--tm-space-3)); display: grid; gap: var(--tm-space-2); }
.tm-toast {
  background: var(--tm-ink); color: #fff; border-radius: var(--tm-radius-md); box-shadow: var(--tm-shadow-2);
  padding: var(--tm-space-3) var(--tm-space-4); display: flex; gap: var(--tm-space-3); align-items: center; min-width: 260px;
  animation: tm-in 0.2s ease-out;
}
.tm-toast--success i { color: #7fd6a8; }
.tm-toast--error i { color: #ffb4a8; }
@keyframes tm-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Bar chart (CSS only, for the monthly trend) ---------- */
.tm-bars { display: flex; align-items: flex-end; gap: var(--tm-space-3); height: 180px; padding-top: var(--tm-space-4); }
.tm-bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--tm-space-2); height: 100%; justify-content: flex-end; }
.tm-bars__bar { width: 100%; max-width: 44px; background: var(--tm-primary-200); border-radius: 6px 6px 2px 2px; }
.tm-bars__col.is-current .tm-bars__bar { background: var(--tm-primary); }
.tm-bars__label { font-size: var(--tm-text-xs); color: var(--tm-text-subtle); }
.tm-bars__value { font-size: var(--tm-text-xs); font-family: var(--tm-font-num); color: var(--tm-text-muted); }

/* ==========================================================================
   Public (student) pages — phone-first, one step per screen
   ========================================================================== */
.tm-public { background: var(--tm-bg); min-height: 100vh; }
.tm-public__wrap { max-width: 440px; margin: 0 auto; padding: var(--tm-space-4); min-height: 100vh; display: flex; flex-direction: column; }
.tm-public__head { display: flex; align-items: center; gap: var(--tm-space-3); padding: var(--tm-space-2) 0 var(--tm-space-4); }
.tm-public__card { background: var(--tm-surface); border-radius: var(--tm-radius-lg); box-shadow: var(--tm-shadow-1); border: 1px solid var(--tm-border); padding: var(--tm-space-5); }
.tm-public__foot { margin-top: auto; padding-top: var(--tm-space-5); text-align: center; font-size: var(--tm-text-xs); color: var(--tm-text-subtle); }

.tm-context {
  background: var(--tm-primary-50); border: 1px solid var(--tm-primary-100); border-radius: var(--tm-radius-md);
  padding: var(--tm-space-3) var(--tm-space-4); display: flex; justify-content: space-between; align-items: center; gap: var(--tm-space-3);
  margin-bottom: var(--tm-space-5);
}
.tm-context__group { font-weight: 700; }
.tm-context__sub { font-size: var(--tm-text-sm); color: var(--tm-text-muted); }
.tm-context__price { font-family: var(--tm-font-num); font-weight: 700; font-size: var(--tm-text-lg); color: var(--tm-primary-700); white-space: nowrap; }

.tm-steps { display: flex; gap: 6px; margin-bottom: var(--tm-space-4); }
.tm-steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--tm-border); }
.tm-steps span.is-done { background: var(--tm-primary); }

/* Payment method picker: big radio cards */
.tm-methods { display: grid; gap: var(--tm-space-2); }
.tm-method { position: relative; }
.tm-method input { position: absolute; opacity: 0; pointer-events: none; }
.tm-method label {
  display: flex; align-items: center; gap: var(--tm-space-3);
  padding: var(--tm-space-3) var(--tm-space-4); min-height: 60px;
  border: 1.5px solid var(--tm-border-strong); border-radius: var(--tm-radius-md);
  cursor: pointer; font-weight: 600; background: var(--tm-surface);
}
.tm-method__icon { width: 36px; height: 36px; border-radius: var(--tm-radius-sm); display: grid; place-items: center; font-size: 1.2rem; background: var(--tm-neutral-bg); }
.tm-method__hint { font-size: var(--tm-text-xs); color: var(--tm-text-subtle); font-weight: 500; }
.tm-method label::after {
  content: ""; margin-inline-start: auto; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--tm-border-strong); flex-shrink: 0;
}
.tm-method input:checked + label { border-color: var(--tm-primary); background: var(--tm-primary-50); }
.tm-method input:checked + label::after { border-color: var(--tm-primary); background: radial-gradient(circle, var(--tm-primary) 45%, transparent 50%); }
.tm-method input:focus-visible + label { outline: 3px solid rgba(var(--tm-primary-rgb), 0.45); outline-offset: 2px; }

.tm-upload {
  display: flex; flex-direction: column; align-items: center; gap: var(--tm-space-2); text-align: center;
  border: 2px dashed var(--tm-border-strong); border-radius: var(--tm-radius-md); padding: var(--tm-space-5);
  color: var(--tm-text-muted); cursor: pointer; background: var(--tm-surface-2);
}
.tm-upload i { font-size: 1.75rem; color: var(--tm-primary-600); }
.tm-upload:hover { border-color: var(--tm-primary-300); }

/* Confirmation summary */
.tm-summary { list-style: none; padding: 0; margin: 0 0 var(--tm-space-5); }
.tm-summary li { display: flex; justify-content: space-between; gap: var(--tm-space-3); padding: var(--tm-space-3) 0; border-bottom: 1px dashed var(--tm-border); }
.tm-summary li:last-child { border-bottom: 0; }
.tm-summary dt, .tm-summary .k { color: var(--tm-text-muted); }
.tm-summary .v { font-weight: 600; text-align: end; }
.tm-summary .total .v { font-family: var(--tm-font-num); font-size: var(--tm-text-xl); color: var(--tm-primary-700); }

/* Result screens */
.tm-result { text-align: center; padding: var(--tm-space-4) 0; }
.tm-result__icon { width: 88px; height: 88px; margin: 0 auto var(--tm-space-4); border-radius: 50%; display: grid; place-items: center; font-size: 2.5rem; }
.tm-result--success .tm-result__icon { background: var(--tm-success-bg); color: var(--tm-success); }
.tm-result--pending .tm-result__icon { background: var(--tm-warning-bg); color: var(--tm-warning); }
.tm-result--error .tm-result__icon { background: var(--tm-danger-bg); color: var(--tm-danger); }
.tm-result h1 { font-size: var(--tm-text-xl); font-weight: 700; }
.tm-ref {
  display: inline-block; margin-top: var(--tm-space-3); padding: var(--tm-space-2) var(--tm-space-4);
  border-radius: var(--tm-radius-md); background: var(--tm-neutral-bg); font-family: var(--tm-font-num); font-weight: 700; letter-spacing: 0.08em;
}
.tm-callout {
  display: flex; gap: var(--tm-space-3); align-items: flex-start; text-align: start;
  background: var(--tm-warning-bg); color: #6b4000; border-radius: var(--tm-radius-md); padding: var(--tm-space-3) var(--tm-space-4);
}

/* ---------- Gallery (/ui/) ---------- */
.tm-swatch { border-radius: var(--tm-radius-md); height: 64px; border: 1px solid var(--tm-border); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Icons drawn for RTL (back = arrow-right, forward = chevron-left) mirror in LTR */
.tm-flip { display: inline-block; }
[dir="ltr"] .tm-flip { transform: scaleX(-1); }


/* ---------- Added with the real screens ---------- */
.tm-inline-form { display: contents; }
.tm-contents { display: contents; }
.tm-qr-panel__code.is-closed { opacity: .25; }
[data-poll-guard] .tm-row.is-pressed { background: var(--tm-surface-2, rgba(0,0,0,.03)); }
.tm-qr-panel__link { color: rgba(255,255,255,.75); font-size: var(--tm-text-xs); max-width: 100%; overflow-wrap: anywhere; text-align: center; text-decoration: underline; text-underline-offset: 3px; }
.tm-qr-panel__link:hover { color: #fff; }
/* On phones the group + month of a pending payment matters: let it wrap instead of cutting it off */
@media (max-width: 575.98px) { .tm-pending-row .tm-row__sub { white-space: normal; } }
