/* ============================================================================
   tm-components.css — shared UI components for the authenticated shell.

   Phase 1 of PROJECT_UX_JOURNEY.md §9.3: "extract these from the 3 or 4 places
   each is currently reimplemented". Measured before writing this: the toast CSS
   was copy-pasted into 42 views — not 3 — in 22 variants totalling ~85 KB. The
   variants differ only in comment placement, rule order, and one or two optional
   rules, which is the signature of copy-paste drift rather than a deliberate fork.

   Every value here comes from tm-tokens.css. That is what makes the dark-mode
   block disappear: the old copies carried four [data-bs-theme="dark"] overrides
   because they hard-coded #ffffff, #1e1e2d, #181c32 and #92929f. A token already
   flips with the theme, so the override has nothing left to say.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   TOAST
   Replaces the 28-rule block duplicated across 42 views.
   --------------------------------------------------------------------------- */
#kt_toast_container { min-width: 350px; max-width: 450px; }
html[dir="rtl"] #kt_toast_container { left: 1rem !important; right: auto !important; }

.toast-notification {
  position: relative;
  background: var(--tm-pro-bg);
  border-radius: var(--tm-r-lg);
  box-shadow: var(--tm-elev-3);
  margin-bottom: var(--tm-sp-4);
  overflow: hidden;
  opacity: 0;
  transform: translateY(100px);
  transition: all .4s cubic-bezier(.68, -.55, .265, 1.55);
  border-left: 4px solid;
  min-width: 350px;
  max-width: 450px;
}
.toast-notification.show { opacity: 1; transform: translateY(0); }
.toast-notification.hide { opacity: 0; transform: translateY(100px); margin-bottom: 0; }
/* the accent bar follows the reading side, so it is an edge marker in both directions */
html[dir="rtl"] .toast-notification { border-left: none; border-right: 4px solid; }

.toast-content { display: flex; align-items: center; padding: 1.25rem var(--tm-sp-5); gap: var(--tm-sp-4); }
.toast-message { flex: 1; min-width: 0; }

/* The old copies set #181c32 / #5e6278 and then re-set #f1f1f2 / #92929f for dark.
   These two tokens already carry both, measured at 17.85:1 and 7.58:1 on their
   own ground, so one declaration covers what used to take four. */
.toast-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--tm-pro-text);
  margin-bottom: .35rem;
  line-height: 1.4;
  letter-spacing: -.01em;
}
.toast-text { font-size: 1rem; font-weight: 600; color: var(--tm-pro-text-muted); line-height: 1.5; }

.toast-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.toast-icon i { font-size: 2.5rem !important; line-height: 1; }

/* The close control was #a1a5b7, which is 2.40:1 on white — it is an icon button, so
   it needs a contrast its user can actually see. --tm-pro-text-light is the same
   role solved at 4.51. */
.toast-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: var(--tm-sp-2);
  cursor: pointer;
  color: var(--tm-pro-text-light);
  transition: all var(--tm-t-fast);
}
.toast-close:hover { background: var(--tm-pro-bg-sunken); color: var(--tm-pro-text); }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .1));
  /* the bar counts the toast down; without this and the keyframes below it just sits
     there, which is how it would have shipped if the keyframes had been left behind
     in the views they were cut from */
  animation: toast-progress 3s linear forwards;
}
@keyframes toast-progress {
  from { width: 100%; }
  to   { width: 0%; }
}
html[dir="rtl"] .toast-progress { left: auto; right: 0; }

/* State accents. The copies used Metronic's #50cd89 and #f1416c; as a glyph on their
   own 20%-tint those read about 2:1. The measured tokens carry the same meaning and
   are legible on the tint, so the icon stops being decorative-only. */
.toast-success { border-left-color: var(--tm-pro-success); }
.toast-error   { border-left-color: var(--tm-pro-danger); }
html[dir="rtl"] .toast-success { border-right-color: var(--tm-pro-success); }
html[dir="rtl"] .toast-error   { border-right-color: var(--tm-pro-danger); }

.toast-success .toast-icon {
  background: linear-gradient(135deg, rgba(16, 123, 56, .16) 0%, rgba(16, 123, 56, .10) 100%);
  color: var(--tm-pro-success);
  box-shadow: 0 4px 12px rgba(16, 123, 56, .18);
}
.toast-error .toast-icon {
  background: linear-gradient(135deg, rgba(206, 33, 33, .16) 0%, rgba(206, 33, 33, .10) 100%);
  color: var(--tm-pro-danger);
  box-shadow: 0 4px 12px rgba(206, 33, 33, .18);
}
.toast-success .toast-progress { background: linear-gradient(90deg, var(--tm-pro-success), rgba(16, 123, 56, .3)); }
.toast-error   .toast-progress { background: linear-gradient(90deg, var(--tm-pro-danger),  rgba(206, 33, 33, .3)); }

/* NOTE (historical, lifted 2026-09-13 - success toasts show again; see _TmToast.cshtml) — success toasts were switched off app-wide.
   _LayoutCompany.cshtml carries "#kt_toast_container .toast-success,
   .toast-notification.toast-success { display: none !important }" with the comment
   "we use SweetAlert2 globally now". That rule is a deliberate suppression, not one of
   the 42 duplicates, so it stays in the layout and was excluded from the consolidation.
   The .toast-success styling above is therefore inert today; it is kept so the pair
   stays symmetric if the suppression is ever lifted. Delete both together, not one. */

/* ---------------------------------------------------------------------------
   PAGE-HEADER CARD
   The `card shadow-sm mb-4 mt-3` block that opens most list and form pages: a
   gradient card holding an h3 and a subtitle. Measured: defined in 22 views,
   342 rules and 68.7 KB counting its toolbar and search siblings. Eleven copies
   are byte-identical and two more differ by a single `transition`, so thirteen
   are consolidated here. The nine that genuinely differ keep their own CSS —
   a view's <style> comes after this file in document order, so those still win
   and nothing about them changes.

   Token-driven for the same reason as the toast: the copies each carried three
   dark-mode overrides listing `.dark-mode` and `html[data-theme="dark"]`, two
   selectors this app never sets. Tokens flip on their own, so all three go.
   --------------------------------------------------------------------------- */
.card.shadow-sm.mb-4.mt-3 {
  border: none;
  border-radius: var(--tm-r-lg);
  background: linear-gradient(135deg, var(--tm-pro-bg) 0%, var(--tm-pro-bg-alt) 100%);
  transition: all .3s ease;
}
.card.shadow-sm.mb-4.mt-3 .card-body { padding: 1.5rem 1.75rem; }
.card.shadow-sm.mb-4.mt-3 h3 {
  font-size: 1.5rem;
  font-weight: 700;
  /* was #181c32 — the token is the same role, and it flips for dark on its own */
  color: var(--tm-pro-text);
  letter-spacing: -.01em;
  margin-bottom: .35rem;
}
.card.shadow-sm.mb-4.mt-3 p {
  font-size: .95rem;
  font-weight: 600;
  /* was #6c757d, which reads 4.60:1 on this card; the token is 7.58:1 */
  color: var(--tm-pro-text-muted);
  margin: 0;
  transition: color .3s ease;
}
/* Arabic needs the UI face here; the copies all carried this and it stays */
html[dir="rtl"] .card.shadow-sm.mb-4.mt-3 h3,
html[dir="rtl"] .card.shadow-sm.mb-4.mt-3 p { font-family: var(--tm-font-ui); }

/* ---------------------------------------------------------------------------
   LIST-PAGE SEARCH FIELD
   Two rules, defined identically in 18 views: the search input needs room for the
   icon on whichever side the reading direction puts it. The one remaining file
   that matched the class name defines no CSS at all, so this is 18 out of 18.
   --------------------------------------------------------------------------- */
html[dir="ltr"] [data-kt-filter="search"] { padding-left: 3.5rem !important; padding-right: 1rem !important; }
html[dir="rtl"] [data-kt-filter="search"] { padding-right: 3.5rem !important; padding-left: 1rem !important; }

/* ---------------------------------------------------------------------------
   CARD-TOOLBAR BUTTONS
   Seventeen views define this; ten of them in two clusters that differ only in
   that four carry dark-mode overrides for .btn-light-primary and six do not.
   The superset is taken, so those six gain the dark treatment they were missing
   — on a dark card their light-indigo tint had nothing to sit against.

   The gradients already used #4f46e5 / #4338ca, which are the app's accent and
   its hover step, so this is a substitution and not a recolour. Expressed as
   tokens the two dark overrides disappear: the accent channel already flips.
   --------------------------------------------------------------------------- */
.card-toolbar .btn {
  font-weight: 700 !important;
  font-size: 1rem !important;
  font-family: var(--tm-font-ui) !important;
  padding: .75rem 1.25rem !important;
  border-radius: var(--tm-r-md) !important;
  transition: all .3s ease !important;
}
.card-toolbar .btn i { font-size: 1.25rem !important; line-height: 1; }
.card-toolbar .btn span.ms-2 { margin-left: .5rem !important; }
.card-toolbar .btn:active { transform: translateY(0); }
html[dir="rtl"] .card-toolbar .btn { font-family: var(--tm-font-ui) !important; }
html[dir="rtl"] .card-toolbar .btn span.ms-2 { margin-left: 0 !important; margin-right: .5rem !important; }

.card-toolbar .btn-primary {
  background: linear-gradient(135deg, var(--tm-pro-accent-strong) 0%, var(--tm-pro-accent-hover) 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(var(--tm-pro-accent-rgb), .25);
}
.card-toolbar .btn-primary:hover {
  background: linear-gradient(135deg, var(--tm-pro-accent-hover) 0%, #3730a3 100%);
  color: #fff;
  transform: translateY(-1px);
}
.card-toolbar .btn-light-primary {
  background: linear-gradient(135deg, rgba(var(--tm-pro-accent-strong-rgb), .10) 0%, rgba(var(--tm-pro-accent-strong-rgb), .05) 100%);
  color: var(--tm-pro-accent-text);
  border: 1px solid rgba(var(--tm-pro-accent-strong-rgb), .18);
}
.card-toolbar .btn-light-primary:hover {
  background: linear-gradient(135deg, rgba(var(--tm-pro-accent-strong-rgb), .16) 0%, rgba(var(--tm-pro-accent-strong-rgb), .10) 100%);
  color: var(--tm-pro-accent-text);
}

/* ---------------------------------------------------------------------------
   VIEW SWITCH — the segmented control for the report list's three lenses.
   Shared partial: Views/Shared/_TmViewSwitch.cshtml
   --------------------------------------------------------------------------- */
.tm-view-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--tm-pro-bg-sunken);
  border: 1px solid var(--tm-pro-border);
  border-radius: var(--tm-r-pill);
}
.tm-view-switch-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--tm-r-pill);
  font-size: var(--tm-ui-sm);
  font-weight: 600;
  color: var(--tm-pro-text-muted);
  text-decoration: none;
  transition: background var(--tm-t-fast), color var(--tm-t-fast);
  white-space: nowrap;
}
.tm-view-switch-item:hover { color: var(--tm-pro-text); background: var(--tm-pro-bg); }
/* the active lens is a filled surface, so it reads as "where you are" rather than
   "another thing you could click" */
.tm-view-switch-item.is-active {
  background: var(--tm-pro-bg);
  color: var(--tm-pro-accent-text);
  box-shadow: var(--tm-elev-1);
}
.tm-view-switch-item i { font-size: 1rem; line-height: 1; }
.tm-view-switch-item:focus-visible {
  outline: 2px solid rgba(var(--tm-pro-accent-strong-rgb), .55);
  outline-offset: 2px;
}

/* 2026-09-13 — _TmToast.cshtml (Views/Shared) is now the one toast renderer; it emits four kinds.
   success and error existed as page copies, warning and info are new. Colour comes from the
   state tokens so both themes are covered by one declaration each. */
.toast-notification.toast-error   { border-color: var(--tm-pro-danger); }
.toast-notification.toast-warning { border-color: var(--tm-pro-warning); }
.toast-notification.toast-info    { border-color: var(--tm-pro-info); }
.toast-error   .toast-icon { color: var(--tm-pro-danger); }
.toast-warning .toast-icon { color: var(--tm-pro-warning); }
.toast-info    .toast-icon { color: var(--tm-pro-info); }
.toast-error   .toast-progress { background: linear-gradient(90deg, var(--tm-pro-danger), rgba(206, 33, 33, .3)); }
.toast-warning .toast-progress { background: linear-gradient(90deg, var(--tm-pro-warning), rgba(160, 88, 4, .3)); }
.toast-info    .toast-progress { background: linear-gradient(90deg, var(--tm-pro-info), rgba(2, 112, 168, .3)); }

/* ============================================================================
   Mobile bottom navigation - PROJECT_UX_JOURNEY.md §11.2 (<480 px only).
   Hidden at every wider width, so nothing about the desktop shell changes.
   ============================================================================ */
.tm-mobile-nav { display: none; }

@media (max-width: 479.98px) {
  .tm-mobile-nav {
    display: flex;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1040;                       /* under modals (1055), over page chrome */
    background: var(--tm-pro-bg);
    border-top: 1px solid var(--tm-pro-border);
    box-shadow: var(--tm-elev-2);
    /* keep clear of the iOS home indicator */
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .tm-mobile-nav__item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 56px;                    /* a comfortable touch target */
    padding: 8px 4px;
    color: var(--tm-pro-text-muted);
    text-decoration: none;
    font-size: var(--tm-ui-xs, 0.8rem);
    font-weight: 600;
    position: relative;
  }
  .tm-mobile-nav__item.is-active { color: var(--tm-pro-accent-text); }
  /* the active marker is a top bar, mirroring the sidebar's left-edge accent */
  .tm-mobile-nav__item.is-active::before {
    content: "";
    position: absolute;
    top: 0; inset-inline: 18%;
    height: 3px; border-radius: 0 0 3px 3px;
    background: var(--tm-pro-accent);
  }
  .tm-mobile-nav__item:focus-visible { outline: 2px solid var(--tm-pro-accent); outline-offset: -2px; }
  .tm-mobile-nav__icon { position: relative; display: inline-flex; font-size: 1.25rem; line-height: 1; }
  .tm-mobile-nav__badge {
    position: absolute; top: -6px; inset-inline-end: -10px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: var(--tm-pro-danger); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  }
  .tm-mobile-nav__label { white-space: nowrap; }

  /* Give the page room so the bar never covers the last row of content. */
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}

/* ============================================================================
   Filing stages band (PROJECT_UX_JOURNEY.md Phase 4)
   Four stages above the nine-step grid, so the report page answers "where am I"
   before it answers "what is left". Values only from tm-tokens.css.
   ============================================================================ */
.tm-filing-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: tm-stage;
}

.tm-filing-stages__item {
  flex: 1 1 11rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--tm-pro-border);
  border-radius: 0.5rem;
  background: var(--tm-pro-bg);
  /* --tm-pro-text-light measures 4.52:1 on white - over WCAG AA but under this
     project's 4.8 floor, so upcoming stages use the darker neutral (7.58:1). */
  color: var(--tm-neutral-700);
}

.tm-filing-stages__item.is-done {
  border-color: var(--tm-pro-success);
  background: var(--tm-pro-success-soft);
  color: var(--tm-pro-text);
}

/* The one stage that still has work gets the only strong border on the row. */
.tm-filing-stages__item.is-current {
  border-color: var(--tm-pro-accent);
  background: var(--tm-pro-accent-soft);
  color: var(--tm-pro-text);
  box-shadow: var(--tm-elev-1);
}

.tm-filing-stages__mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--tm-pro-bg-sunken);
  color: currentColor;
}

.tm-filing-stages__item.is-done .tm-filing-stages__mark { background: var(--tm-pro-success); color: #fff; }
.tm-filing-stages__item.is-current .tm-filing-stages__mark { background: var(--tm-pro-accent); color: #fff; }

.tm-filing-stages__text { min-width: 0; line-height: 1.25; }

/* No truncation: the Arabic labels are longer than the English ones and were clipping to
   «الاعتماد والإي…». A stage name the reader cannot finish is worse than a second line. */
.tm-filing-stages__title {
  display: block;
  font-family: var(--tm-font-ui);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tm-filing-stages__count {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Under ~560px four side-by-side stages shrink past readability; stack instead. */
@media (max-width: 559.98px) {
  .tm-filing-stages__item { flex: 1 1 100%; }
}

/* ---------------------------------------------------------------------------
   CALM PAGES (the owner, 2026-11-24: «نقلل الكلام في الصفحات … الرسائل عنوان والتفاصيل
   تفتح بالضغط … الصفحة تبان رايقة»). Shared by every report page.
   --------------------------------------------------------------------------- */

/* Messages folded to their titles (_TmMessageList). */
.tm-msgs { display: flex; flex-direction: column; gap: 6px; }
.tm-msg {
  --tm-msg-c: var(--tm-pro-warning);
  --tm-msg-soft: var(--tm-pro-warning-soft);
  border: 1px solid var(--tm-pro-border);
  border-radius: var(--tm-r-md);
  background: var(--tm-pro-bg);
  font-size: 0.875rem;
  color: var(--tm-pro-text);
}
.tm-msgs-danger .tm-msg, .tm-msg.tm-msg-danger { --tm-msg-c: var(--tm-pro-danger); --tm-msg-soft: var(--tm-pro-danger-soft); }
.tm-msgs-success .tm-msg, .tm-msg.tm-msg-success { --tm-msg-c: var(--tm-pro-success); --tm-msg-soft: var(--tm-pro-success-soft); }
.tm-msgs-info .tm-msg, .tm-msg.tm-msg-info { --tm-msg-c: var(--tm-pro-info); --tm-msg-soft: var(--tm-pro-info-soft); }
.tm-msg > summary, .tm-msg-flat {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  list-style: none;
  min-height: 38px;
}
.tm-msg > summary { cursor: pointer; border-radius: var(--tm-r-md); }
.tm-msg > summary::-webkit-details-marker { display: none; }
.tm-msg > summary:hover { background: var(--tm-pro-bg-alt); }
.tm-msg > summary:focus-visible { outline: 2px solid var(--tm-msg-c); outline-offset: 1px; }
.tm-msg[open] > summary { border-bottom: 1px dashed var(--tm-pro-border); border-radius: var(--tm-r-md) var(--tm-r-md) 0 0; }
.tm-msg-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--tm-msg-c); }
.tm-msg-title { flex: 1 1 auto; min-width: 0; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.tm-msg-tag {
  flex: 0 0 auto; font-size: 0.72rem; font-weight: 600; color: var(--tm-pro-text-muted);
  background: var(--tm-pro-bg-alt); border: 1px solid var(--tm-pro-border);
  border-radius: var(--tm-r-pill); padding: 1px 8px; white-space: nowrap;
}
.tm-msg-count {
  flex: 0 0 auto; font-size: 0.72rem; font-weight: 700; color: var(--tm-msg-c);
  background: var(--tm-msg-soft); border-radius: var(--tm-r-pill); padding: 1px 8px;
}
.tm-msg-chev {
  flex: 0 0 auto; width: 8px; height: 8px;
  border-right: 2px solid var(--tm-pro-text-muted); border-bottom: 2px solid var(--tm-pro-text-muted);
  transform: rotate(45deg); margin-top: -3px; transition: transform .15s ease;
}
.tm-msg[open] .tm-msg-chev { transform: rotate(-135deg); margin-top: 3px; }
.tm-msg-body { padding: 10px 14px 12px 30px; color: var(--tm-pro-text-muted); line-height: 1.7; overflow-wrap: anywhere; }
html[dir="rtl"] .tm-msg-body { padding: 10px 30px 12px 14px; }
.tm-msg-sub { margin: 6px 0 0; padding-inline-start: 18px; font-size: 0.8125rem; }
.tm-msg-sub li { margin-bottom: 2px; }
.tm-msg-fix {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px;
  font-size: 0.8125rem; font-weight: 700; color: var(--tm-pro-accent-text); text-decoration: none;
}
.tm-msg-fix:hover { text-decoration: underline; }
.tm-msg-fix-inline { margin-top: 0; flex: 0 0 auto; }
.tm-msg-more { font-size: 0.8125rem; color: var(--tm-pro-text-muted); padding: 2px 4px; }
.tm-msg-more a { font-weight: 700; color: var(--tm-pro-accent-text); text-decoration: none; }

/* The readiness verdict: one line, three counts, a short note. */
.tm-verdict { border: 1px solid var(--tm-pro-border); border-inline-start: 4px solid var(--tm-pro-border-strong); box-shadow: var(--tm-sh-1); }
.tm-verdict-danger { border-inline-start-color: var(--tm-pro-danger); }
.tm-verdict-success { border-inline-start-color: var(--tm-pro-success); }
.tm-verdict > .card-body { padding: 16px 20px; }
.tm-verdict-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.tm-verdict-k { font-size: 0.75rem; font-weight: 600; color: var(--tm-pro-text-muted); margin-bottom: 2px; }
.tm-verdict-h { font-size: 1.2rem; font-weight: 800; line-height: 1.3; }
.tm-verdict-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-verdict-note { margin-top: 8px; font-size: 0.8125rem; color: var(--tm-pro-text-muted); }
.tm-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600; white-space: nowrap;
  padding: 3px 10px; border-radius: var(--tm-r-pill);
  background: var(--tm-pro-bg-alt); color: var(--tm-pro-text-muted); border: 1px solid var(--tm-pro-border);
}
.tm-pill b { font-weight: 800; }
.tm-pill-danger { background: var(--tm-pro-danger-soft); color: var(--tm-pro-danger); border-color: transparent; }
.tm-pill-warning { background: var(--tm-pro-warning-soft); color: var(--tm-badge-warning-text, var(--tm-pro-warning)); border-color: transparent; }
.tm-pill-success { background: var(--tm-pro-success-soft); color: var(--tm-pro-success); border-color: transparent; }

/* The report's steps as a stepper: numbered marks joined by a line, a tick for what is done, the
   step of this page filled; the group's companies in one menu at the end. */
.tm-stepper { margin-bottom: 14px; }
.tm-stepper-in {
  display: flex; align-items: center; gap: 16px;
  background: var(--tm-pro-bg); border: 1px solid var(--tm-pro-border);
  border-radius: var(--tm-r-lg); padding: 8px 14px; box-shadow: var(--tm-sh-1);
}
.tm-stepper-list {
  display: flex; align-items: flex-start; flex: 1 1 auto; min-width: 0;
  list-style: none; margin: 0; padding: 0;
}
/* Each step a mark on the line with its name under it (the names do not fit on one line beside
   the marks: 1,040px for seven against ~550px on a laptop). */
.tm-step { position: relative; flex: 1 1 0; min-width: 0; display: flex; justify-content: center; }
.tm-step + .tm-step::before {
  content: ""; position: absolute; top: 17px; height: 2px; border-radius: 2px;
  inset-inline-start: calc(-50% + 18px); inset-inline-end: calc(50% + 18px);
  background: var(--tm-pro-border);
}
.tm-step.is-done + .tm-step::before { background: var(--tm-pro-success); opacity: .5; }
.tm-step > a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 4px 4px 2px; border-radius: var(--tm-r-md); max-width: 100%;
  text-align: center; text-decoration: none;
  font-size: 0.75rem; font-weight: 600; line-height: 1.3; color: var(--tm-pro-text-muted);
}
.tm-step > a:hover { color: var(--tm-pro-text); }
.tm-step > a:hover .tm-step-mark { border-color: var(--tm-pro-accent); }
.tm-step-label { display: block; overflow-wrap: anywhere; }
.tm-step-mark {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 0.75rem; font-weight: 800; font-family: var(--tm-font-ui);
  border: 1.5px solid var(--tm-pro-border-strong); color: var(--tm-pro-text-muted); background: var(--tm-pro-bg);
  transition: border-color .15s ease;
}
.tm-step.is-done > a { color: var(--tm-pro-text); }
.tm-step.is-done .tm-step-mark { background: var(--tm-pro-success-soft); border-color: transparent; color: var(--tm-pro-success); }
.tm-step.is-active > a { color: var(--tm-pro-accent-text); font-weight: 700; }
.tm-step.is-active .tm-step-mark {
  background: var(--tm-pro-accent); border-color: var(--tm-pro-accent); color: #fff;
  box-shadow: 0 0 0 4px rgba(var(--tm-pro-accent-rgb), .14);
}
.tm-step-note {
  display: inline-block; margin-inline-start: 4px; padding: 0 6px; border-radius: var(--tm-r-pill);
  font-size: 0.7rem; font-weight: 700; color: var(--tm-pro-text-muted); background: var(--tm-pro-bg-alt);
}
.tm-step.is-done .tm-step-note { color: var(--tm-pro-success); background: var(--tm-pro-success-soft); }
.tm-steps-entities { flex: 0 0 auto; }
.tm-steps-ent-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 12px; border-radius: var(--tm-r-pill);
  border: 1px solid var(--tm-pro-border); background: var(--tm-pro-bg-alt); color: var(--tm-pro-text);
  font-size: 0.8125rem; font-weight: 600; white-space: nowrap;
}
.tm-steps-ent-btn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tm-pro-warning); }
.tm-steps-ent-btn.is-done::before { background: var(--tm-pro-success); }
.tm-steps-ent-btn:hover { border-color: var(--tm-pro-border-strong); }
.tm-steps-menu { min-width: 300px; max-height: 60vh; overflow-y: auto; padding: 6px; border-radius: var(--tm-r-md); box-shadow: var(--tm-elev-3); }
.tm-steps-ent { display: flex !important; align-items: center; gap: 10px; border-radius: var(--tm-r-sm); padding: 7px 10px; font-size: 0.8125rem; }
.tm-steps-ent bdi { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-steps-ent-state { flex: 0 0 auto; font-size: 0.72rem; color: var(--tm-pro-text-muted); }
.tm-stepper-home {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--tm-r-pill); white-space: nowrap; text-decoration: none;
  background: var(--tm-pro-accent-soft); color: var(--tm-pro-accent-text);
  font-size: 0.8125rem; font-weight: 700;
}
.tm-stepper-home i { color: inherit; }
.tm-stepper-home:hover { color: var(--tm-pro-accent-text); box-shadow: inset 0 0 0 1px rgba(var(--tm-pro-accent-rgb), .35); }
.tm-stepper-home.is-active { background: var(--tm-pro-accent); color: #fff; }
.tm-stepper-home.is-active i { color: #fff; }
/* Narrow screens: the marks, and the label of this page's step only. */
@media (max-width: 767.98px) {
  .tm-stepper-in { flex-wrap: wrap; gap: 8px 10px; }
  .tm-stepper-list { order: -1; flex: 1 1 100%; }
  .tm-step-label { display: none; }
  .tm-steps-entities { margin-inline-start: auto; }
}

/* A short hint that opens on a click (_TmHint). */
.tm-hint { font-size: 0.8125rem; color: var(--tm-pro-text-muted); }
.tm-hint > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-weight: 600; color: var(--tm-pro-text-muted); }
.tm-hint > summary::-webkit-details-marker { display: none; }
.tm-hint > summary::before {
  content: "i"; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid currentColor; font-size: 10px; font-weight: 800; font-family: var(--tm-font-ui);
}
.tm-hint > summary:hover { color: var(--tm-pro-text); }
.tm-hint[open] > div { margin-top: 6px; padding: 10px 12px; background: var(--tm-pro-bg-alt); border-radius: var(--tm-r-md); line-height: 1.7; }

/* A section that folds whole (long lists of what is already fine). */
.tm-fold > summary { cursor: pointer; list-style: none; }
.tm-fold > summary::-webkit-details-marker { display: none; }
.tm-fold > summary .tm-msg-chev { display: inline-block; margin-inline-start: 6px; }
.tm-fold[open] > summary .tm-msg-chev { transform: rotate(-135deg); margin-top: 3px; }

/* ---------------------------------------------------------------------------
   ONE TITLE PER PAGE. A page with its own header (.tm-page-header) no longer repeats its
   title and breadcrumb in the layout's toolbar above it, and the header sits on the page
   itself rather than in a box: the page reads header → step bar → content.
   --------------------------------------------------------------------------- */
#kt_app_main:has(.tm-page-header) #kt_app_toolbar .page-title { display: none !important; }
#kt_app_main:has(.tm-page-header) #kt_app_toolbar:not(:has(#kt_app_toolbar_container > :nth-child(2))) { display: none !important; }
.tm-page-header {
  background: transparent; border: 0; box-shadow: none; border-radius: 0;
  padding: 0; margin: 6px 0 18px;
}
.tm-page-header-eyebrow { text-transform: none; letter-spacing: 0; font-size: 0.8rem; margin-bottom: 4px; }
.tm-page-header-title { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 4px; }
.tm-page-header-subtitle { font-size: 0.875rem; }
.tm-page-header-actions .btn-light { background: var(--tm-pro-bg); border: 1px solid var(--tm-pro-border); }
.tm-page-header-actions .btn-light:hover { border-color: var(--tm-pro-border-strong); }

/* A page's secondary actions in one menu (.tm-menu). */
.tm-menu { min-width: 230px; padding: 6px; border: 1px solid var(--tm-pro-border); border-radius: var(--tm-r-md); box-shadow: var(--tm-elev-3); }
.tm-menu .dropdown-item { border-radius: var(--tm-r-sm); padding: 7px 12px; font-size: 0.8125rem; font-weight: 500; }
.tm-menu .dropdown-header { padding: 8px 12px 2px; font-size: 0.7rem; font-weight: 700; color: var(--tm-pro-text-muted); }
.tm-menu .dropdown-divider { margin: 4px 0; }
.tm-menu form { margin: 0; }
.tm-menu button.dropdown-item { width: 100%; text-align: start; }

/* A section's title with its count (.tm-section-title), the same on every page. */
.tm-section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1rem; font-weight: 700; color: var(--tm-pro-text); }
.tm-section-title .tm-pill { font-size: 0.72rem; }
.tm-section-sub { margin: -8px 0 12px; font-size: 0.8125rem; color: var(--tm-pro-text-muted); }
/* A calm card: a hairline border, no coloured frame. */
.tm-card { background: var(--tm-pro-bg); border: 1px solid var(--tm-pro-border); border-radius: var(--tm-r-lg); box-shadow: var(--tm-sh-1); }
.tm-card > .tm-card-body { padding: 16px 20px; }
/* The older section headers (tm-report-flow.css .tm-section-header) keep their title flush. */
.tm-section-header .tm-section-title, #xbrlActionsModal .tm-section-title { margin: 0; }
/* The number strip (tm-report-flow.css .tm-metric-strip): white tiles on the grey page, not grey on grey. */
.tm-metric-strip { margin-bottom: 16px; }
.tm-metric { background: var(--tm-pro-bg); border: 1px solid var(--tm-pro-border); border-radius: var(--tm-r-lg); box-shadow: var(--tm-sh-1); padding: 12px 16px; }
.tm-metric-value { font-size: 1.35rem; font-weight: 800; }

/* Tables' «أظهر [10] مدخلات»: one line. The theme's form-select is a full-width block, so the label broke into three
   lines under every list (2026-11-24). */
.dt-container .dt-toolbar label { display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; margin: 0; }
.dt-container .dt-toolbar label select { width: auto; display: inline-block; }
/* The English theme sheet has .fs-7 at 1.5rem — larger than .fs-4 (1.25rem) — so every small line of the English UI read
   as a heading (19.5px). Back to the theme's own size; the Arabic sheet's 1.2rem stays (2026-11-24). */
html:not([dir="rtl"]) .fs-7 { font-size: 0.95rem !important; }

/* A concept code in a table — up to 100 letters without a space (cma_AccumulatedDepreciationBalanceOfInvestmentInRealEstate)
   — breaks instead of widening its table past the page into a sideways scrollbar (2026-11-25: the report comparison,
   the formula rules, the taxonomy mapping). */
.table td code,
.table td .tm-code-wrap,
.table td.tm-code-wrap { overflow-wrap: anywhere; }
