/*
 * ge-ui.css — the UTPANN Soft enterprise UI kit.
 * ------------------------------------------------------------------------------------------
 * Opt-in components for report and dashboard pages: page header, filter panel, KPI cards, stat
 * strip, alert/recovery cards, status badges, buttons, and a DataTables skin. Loaded once from
 * dashboard.php, AFTER style.css / media.css / jquery.dataTables.min.css, so it wins every tie.
 *
 * Nothing here touches a page that has not asked for it: every selector starts from a `ge-`
 * class. The global rules in style.css (the lime `table thead th` override, the Poppins stack,
 * `.panel-view`) are deliberately left alone — other pages still depend on them. A page adopts
 * the kit by wrapping its content in `.ge-ui` and using the classes; see
 * pages/distributor-closing-llp.php for a complete example, and js/ge-ui.js for the DataTables
 * half (geDataTable()).
 *
 * Colour rule: the app's own teal and lime, as LIGHT tints, for structure (filter, panel heads,
 * movement strip, table headings, KPI cards) and solid teal for the one primary action; red / amber /
 * green / blue ONLY where they mean critical / warning / healthy / information. Every text pairing
 * below was computed, not eyeballed — ratios are noted beside the tokens. On a tinted surface meta
 * text uses --ge-muted-tint, because plain --ge-muted fails 4.5:1 on the table-heading tint.
 */

/*------- Tokens -------*/
:root {
  /* Brand — taken from style.css so there is still one source for the teal. */
  --ge-brand: var(--primary, #0f766e);            /* white on it 5.47:1, it on white 5.47:1 */
  --ge-brand-strong: var(--primary-hover, #115e59); /* white on it 7.58:1 */
  --ge-brand-soft: #f0fdfa;                        /* brand text on it 5.25:1 */
  --ge-brand-line: #9fd3cb;                        /* decorative edge of outline buttons */

  /* Neutrals */
  --ge-ink: #0f172a;          /* 17.85:1 — figures, names, headings */
  --ge-ink-2: #334155;        /* 10.35:1 — table headers, strong labels */
  --ge-text: #475569;         /*  7.58:1 — secondary text */
  --ge-muted: #64748b;        /*  4.76:1 on white, 4.55:1 on --ge-surface-2 — meta text */
  --ge-line: #e2e8f0;         /* decorative dividers only */
  --ge-line-soft: #edf1f5;    /* row rules */
  --ge-line-strong: #838da0;  /*  3.34:1 — input and select borders (WCAG 1.4.11) */
  --ge-surface: #ffffff;
  --ge-surface-2: #f8fafc;    /* table header, zebra, footers */
  --ge-surface-3: #f1f5f9;    /* totals, neutral badge */
  --ge-hover: #eef8f5;        /* row hover — a light wash of the brand teal */
  --ge-zebra: #f9fcfb;        /* alternate rows — the faintest trace of the brand */

  /* Theme tints — light surfaces in the app's own teal (--primary) and lime (--accent), so kit
     pages read as part of the teal header and navy sidebar around them rather than as grey paper.
     STRUCTURE only: filter panel, panel heads, the movement strip, table headings, KPI cards.
     Red / amber / green stay reserved for what they mean. */
  --ge-tint: #f4faf9;         /* panel heads, filter, stat strip — ink-2 9.81:1, text 7.18:1 */
  --ge-tint-2: #e6f3f0;       /* table heading row — --ge-head-ink 8.32:1 */
  --ge-tint-line: #d3e8e4;    /* decorative edge of a tinted surface */
  --ge-tint-line-strong: #b9dad3; /* heading-row rule */
  --ge-head-ink: #134e4a;     /* table headings — deep teal, 8.32:1 on --ge-tint-2 */
  --ge-muted-tint: #56657a;   /* meta text on ANY tint here, ≥ 5.21:1 (plain --ge-muted drops to 4.18:1) */
  --ge-brand-2: #14b8a6;      /* lighter teal — bars only, never text (2.49:1) */
  --ge-accent: var(--accent, #8bc34a);  /* the app's lime — bars and dots only, never text (2.10:1) */
  --ge-accent-soft: #f6faef;
  --ge-accent-ink: #3f6212;   /* lime text, 6.69:1 on --ge-accent-soft */

  /* KPI card tints; --ge-muted-tint on each ≥ 5.48:1, --ge-ink ≥ 16.8:1 */
  --ge-kpi-brand: #eef8f6;   --ge-kpi-brand-line: #cbe6e0;
  --ge-kpi-teal: #f3faf8;    --ge-kpi-teal-line: #d6ece7;
  --ge-kpi-danger: #fff5f5;  --ge-kpi-danger-line: #f3d3d3;
  --ge-kpi-lime: #f6faef;    --ge-kpi-lime-line: #dcebc6;

  /* Status — text on tint, all ≥ 5.6:1 */
  --ge-danger: #991b1b;  --ge-danger-bg: #fbeaea;  --ge-danger-line: #f1c4c4;  --ge-danger-accent: #dc2626;
  --ge-warning: #92400e; --ge-warning-bg: #fdf1e3; --ge-warning-line: #f3d6ad; --ge-warning-accent: #d97706;
  --ge-success: #15672a; --ge-success-bg: #e6f4ea; --ge-success-line: #bfe0c8;
  --ge-info: #1b5fa8;    --ge-info-bg: #e8f1fb;    --ge-info-line: #c3d9f2;
  --ge-neutral: #334155; --ge-neutral-bg: #f1f5f9; --ge-neutral-line: #dbe2ea;

  /* Shape and depth */
  --ge-radius-sm: 6px;
  --ge-radius: 8px;
  --ge-radius-lg: 12px;
  --ge-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --ge-shadow-md: 0 4px 12px rgba(16, 24, 40, .10);
  --ge-focus: 0 0 0 3px rgba(15, 118, 110, .28);

  /* Spacing — 4px base, used in 8px steps */
  --ge-1: 4px; --ge-2: 8px; --ge-3: 12px; --ge-4: 16px; --ge-5: 24px; --ge-6: 32px;

  --ge-control-h: 36px;
  --ge-control-h-sm: 30px;
  --ge-font: "Segoe UI", Inter, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/*------- Scope -------*/
.ge-ui {
  color: var(--ge-text);
  font-family: var(--ge-font);
  font-size: 13px;
  letter-spacing: normal;   /* html carries 0.3px for Poppins; wrong for Segoe UI at 13px */
  line-height: 1.5;
  padding: var(--ge-4) var(--ge-5) var(--ge-6);
}

/* Every size in this kit is a real on-screen pixel. The app-wide zoom: 80% this used to undo (with
   .ge-ui { zoom: 1.25 }) was removed on 22/09/2026, so nothing here compensates for anything. */

.ge-ui h1, .ge-ui h2, .ge-ui h3, .ge-ui h4, .ge-ui h5, .ge-ui h6 {
  font-family: var(--ge-font);
  letter-spacing: normal;
}

/* style.css removes the outline from every a / .btn on focus; a keyboard user gets it back here. */
.ge-ui a:focus-visible,
.ge-ui button:focus-visible,
.ge-ui summary:focus-visible,
.ge-ui [tabindex]:focus-visible,
.ge-modal a:focus-visible,
.ge-modal button:focus-visible {
  box-shadow: var(--ge-focus) !important;
  outline: 2px solid var(--ge-brand) !important;
  outline-offset: 1px;
}

.ge-num,
.ge-ui .ge-money {
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.ge-sr {
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  white-space: nowrap !important;
  width: 1px !important;
}

.ge-muted { color: var(--ge-muted); }
.ge-strong { color: var(--ge-ink); font-weight: 600; }
.ge-text-danger { color: var(--ge-danger); }

/*------- Page header -------*/
.ge-page-head {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ge-3) var(--ge-5);
  justify-content: space-between;
  margin-bottom: var(--ge-4);
}

.ge-eyebrow {
  color: var(--ge-brand);     /* 5.25:1 on the app's #f8fafc page */
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  margin: 0 0 2px;
  text-transform: uppercase;
}

.ge-ui .ge-page-title {
  color: var(--ge-ink);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.ge-page-sub {
  color: var(--ge-text);
  font-size: 13px;
  margin: 2px 0 0;
}

.ge-page-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ge-2);
}

.ge-chip {
  align-items: center;
  background: var(--ge-brand-soft);
  border: 1px solid var(--ge-tint-line);
  border-radius: 999px;
  color: var(--ge-brand-strong);   /* 7.4:1 on --ge-brand-soft */
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  gap: 6px;
  line-height: 1;
  padding: 7px 12px;
}

.ge-chip > i { color: var(--ge-brand); }

/*------- Section heading (between panels) -------*/
.ge-section { margin-bottom: var(--ge-5); }

.ge-section__head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ge-2) var(--ge-4);
  justify-content: space-between;
  margin-bottom: var(--ge-3);
}

.ge-ui .ge-section__title {
  border-left: 3px solid var(--ge-brand);   /* the header's teal, carried down the page */
  color: var(--ge-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  padding-left: var(--ge-2);
}

.ge-section__note {
  color: var(--ge-muted);
  font-size: 12px;
  margin: 0;
}

/*------- Panel -------*/
.ge-panel {
  background: var(--ge-surface);
  border: 1px solid var(--ge-line);
  border-radius: var(--ge-radius);
  box-shadow: var(--ge-shadow-sm);
  margin-bottom: var(--ge-5);
}

.ge-panel__head {
  --ge-muted: var(--ge-muted-tint);
  align-items: flex-start;
  background: var(--ge-tint);
  border-bottom: 1px solid var(--ge-tint-line);
  border-radius: var(--ge-radius) var(--ge-radius) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ge-2) var(--ge-4);
  justify-content: space-between;
  padding: var(--ge-3) var(--ge-4);
}

.ge-ui .ge-panel__title {
  align-items: center;
  color: var(--ge-ink);
  display: flex;
  font-size: 15px;
  font-weight: 600;
  gap: var(--ge-2);
  line-height: 1.35;
  margin: 0;
}

.ge-panel__sub {
  color: var(--ge-muted);
  font-size: 12px;
  margin: 2px 0 0;
}

.ge-panel__body { padding: var(--ge-4); }
.ge-panel__body--flush { padding: 0; }

/* Small square that carries a section's meaning next to its title. */
.ge-title-icon {
  align-items: center;
  background: #d9f2ec;
  border-radius: var(--ge-radius-sm);
  color: var(--ge-brand-strong);
  display: inline-flex;
  flex: none;
  font-size: 13px;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.ge-title-icon--danger { background: var(--ge-danger-bg); color: var(--ge-danger); }

/*------- Alerts (flash messages) -------*/
.ge-alert {
  align-items: flex-start;
  background: var(--ge-surface);
  border: 1px solid var(--ge-line);
  border-left: 4px solid var(--ge-neutral);
  border-radius: var(--ge-radius);
  color: var(--ge-ink-2);
  display: flex;
  font-size: 13px;
  gap: var(--ge-2);
  margin-bottom: var(--ge-4);
  padding: 10px var(--ge-4);
}

.ge-alert > i { margin-top: 3px; }
.ge-alert--success { background: var(--ge-success-bg); border-color: var(--ge-success-line); border-left-color: var(--ge-success); color: var(--ge-success); }
.ge-alert--danger  { background: var(--ge-danger-bg);  border-color: var(--ge-danger-line);  border-left-color: var(--ge-danger);  color: var(--ge-danger); }
.ge-alert--warning { background: var(--ge-warning-bg); border-color: var(--ge-warning-line); border-left-color: var(--ge-warning); color: var(--ge-warning); }
.ge-alert--info    { background: var(--ge-info-bg);    border-color: var(--ge-info-line);    border-left-color: var(--ge-info);    color: var(--ge-info); }

/*------- Filter panel -------*/
.ge-filter {
  --ge-muted: var(--ge-muted-tint);
  background: var(--ge-tint);
  border-color: var(--ge-tint-line);
  padding: var(--ge-3) var(--ge-4) var(--ge-4);
}

.ge-filter__grid {
  align-items: end;
  display: grid;
  gap: var(--ge-3) var(--ge-4);
  grid-template-columns: minmax(140px, .8fr) minmax(220px, 2fr) minmax(150px, 1fr) minmax(200px, 1.4fr) auto;
}

.ge-field { min-width: 0; }

.ge-ui .ge-label,
.ge-modal .ge-label {
  color: var(--ge-ink-2);
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 6px;
}

.ge-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: var(--ge-surface);
  border: 1px solid var(--ge-line-strong);
  border-radius: var(--ge-radius-sm);
  box-shadow: none;
  color: var(--ge-ink);
  display: block;
  font: 13px/1.3 var(--ge-font);
  height: var(--ge-control-h);
  letter-spacing: normal;
  padding: 0 var(--ge-3);
  transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%;
}

textarea.ge-control {
  height: auto;
  line-height: 1.5;
  min-height: 88px;
  padding: var(--ge-2) var(--ge-3);
  resize: vertical;
}

select.ge-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23475569' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  cursor: pointer;
  padding-right: 32px;
  text-overflow: ellipsis;
}

.ge-control:hover { border-color: var(--ge-text); }

.ge-control:focus {
  border-color: var(--ge-brand);
  box-shadow: var(--ge-focus);
  outline: none;
}

.ge-control[readonly] {
  background: var(--ge-surface-2);
  color: var(--ge-ink);
  font-weight: 600;
}

.ge-filter__actions {
  display: flex;
  gap: var(--ge-2);
}

/*------- Buttons -------*/
/* Primary: the one main action in a view (Search, Save). Outline: the main action inside a row
   or card (View statement). Secondary: a supporting action (Reminder). Ghost: the least (+ Plan). */
.ge-btn {
  -webkit-appearance: none;
  align-items: center;
  background: var(--ge-surface);
  border: 1px solid var(--ge-line);
  border-radius: var(--ge-radius-sm);
  box-shadow: none;
  color: var(--ge-ink-2);
  cursor: pointer;
  display: inline-flex;
  font: 600 13px/1 var(--ge-font);
  gap: 6px;
  height: var(--ge-control-h);
  justify-content: center;
  letter-spacing: normal;
  min-width: 0;
  padding: 0 14px;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}

.ge-btn:hover,
.ge-btn:focus { text-decoration: none; }
.ge-btn > i { font-size: 12px; }

.ge-btn--primary { background: var(--ge-brand); border-color: var(--ge-brand); color: #fff; }
.ge-btn--primary:hover,
.ge-btn--primary:focus { background: var(--ge-brand-strong); border-color: var(--ge-brand-strong); color: #fff; }

.ge-btn--outline { background: var(--ge-surface); border-color: var(--ge-brand-line); color: var(--ge-brand); }
.ge-btn--outline:hover,
.ge-btn--outline:focus { background: var(--ge-brand-soft); border-color: var(--ge-brand); color: var(--ge-brand-strong); }

.ge-btn--secondary { background: var(--ge-surface); border-color: #cfd6df; color: var(--ge-ink-2); }
.ge-btn--secondary:hover,
.ge-btn--secondary:focus { background: var(--ge-surface-2); border-color: var(--ge-line-strong); color: var(--ge-ink); }

.ge-btn--ghost { background: transparent; border-color: transparent; color: var(--ge-brand); }
.ge-btn--ghost:hover,
.ge-btn--ghost:focus { background: var(--ge-brand-soft); color: var(--ge-brand-strong); }

.ge-btn--sm { font-size: 12px; height: var(--ge-control-h-sm); padding: 0 10px; }
.ge-btn--block { width: 100%; }

/* WhatsApp glyph keeps a trace of its own colour, the one place green is decoration, because it
   tells the user which app the button opens. The label still says "Reminder". */
.ge-btn .fa-whatsapp { color: #15803d; font-size: 13px; }

/* A row or card's action group: main action on its own line, the two lesser ones side by side. */
.ge-actions {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 1fr;
  min-width: 176px;
}

.ge-actions > .ge-actions__main { grid-column: 1 / -1; }

/*------- Badges -------*/
.ge-badge {
  align-items: center;
  background: var(--ge-neutral-bg);
  border: 1px solid var(--ge-neutral-line);
  border-radius: 999px;
  color: var(--ge-neutral);
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  gap: 5px;
  line-height: 1;
  padding: 4px 9px;
  vertical-align: middle;
  white-space: nowrap;
}

/* The dot is decoration; the word beside it carries the meaning. */
.ge-badge::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  flex: none;
  height: 6px;
  width: 6px;
}

.ge-badge--plain::before { content: none; }
.ge-badge > i { font-size: 11px; }
.ge-badge--danger  { background: var(--ge-danger-bg);  border-color: var(--ge-danger-line);  color: var(--ge-danger); }
.ge-badge--warning { background: var(--ge-warning-bg); border-color: var(--ge-warning-line); color: var(--ge-warning); }
.ge-badge--success { background: var(--ge-success-bg); border-color: var(--ge-success-line); color: var(--ge-success); }
.ge-badge--info    { background: var(--ge-info-bg);    border-color: var(--ge-info-line);    color: var(--ge-info); }

/*------- KPI cards -------*/
.ge-kpi-grid {
  display: grid;
  gap: var(--ge-3);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

/* Exactly four cards: 4 across, then 2 × 2 — never three and an orphan. */
.ge-kpi-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1024px) {
  .ge-kpi-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.ge-kpi {
  background: var(--ge-surface);
  border: 1px solid var(--ge-line);
  border-radius: var(--ge-radius);
  box-shadow: var(--ge-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 104px;
  min-width: 0;
  padding: 14px var(--ge-4);
  position: relative;
}

/* Each tone is a light wash of its colour, a matching edge and a 3px bar across the top. The
   washes are the theme's teal and lime; red is kept for the one card that means "overdue". */
.ge-kpi--primary,
.ge-kpi--teal,
.ge-kpi--lime,
.ge-kpi--danger { --ge-muted: var(--ge-muted-tint); }

.ge-kpi--primary { background: var(--ge-kpi-brand);  border-color: var(--ge-kpi-brand-line);  box-shadow: inset 0 3px 0 var(--ge-brand), var(--ge-shadow-sm); }
.ge-kpi--teal    { background: var(--ge-kpi-teal);   border-color: var(--ge-kpi-teal-line);   box-shadow: inset 0 3px 0 var(--ge-brand-2), var(--ge-shadow-sm); }
.ge-kpi--lime    { background: var(--ge-kpi-lime);   border-color: var(--ge-kpi-lime-line);   box-shadow: inset 0 3px 0 var(--ge-accent), var(--ge-shadow-sm); }
.ge-kpi--danger  { background: var(--ge-kpi-danger); border-color: var(--ge-kpi-danger-line); box-shadow: inset 0 3px 0 var(--ge-danger-accent), var(--ge-shadow-sm); }

/* Label on the left, a small tinted icon square on the right. The icon is decoration — the label
   says what the figure is. */
.ge-kpi__head {
  align-items: flex-start;
  display: flex;
  gap: var(--ge-2);
  justify-content: space-between;
}

.ge-kpi__icon {
  align-items: center;
  background: #d9f2ec;
  border-radius: var(--ge-radius-sm);
  color: var(--ge-brand-strong);
  display: inline-flex;
  flex: none;
  font-size: 14px;
  height: 30px;
  justify-content: center;
  margin: -4px -2px 0 0;
  width: 30px;
}

.ge-kpi--teal .ge-kpi__icon   { background: #dcf3ee; color: var(--ge-brand); }
.ge-kpi--lime .ge-kpi__icon   { background: #e6f1d3; color: var(--ge-accent-ink); }
.ge-kpi--danger .ge-kpi__icon { background: #fbe3e3; color: var(--ge-danger); }

.ge-kpi__label {
  color: var(--ge-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  line-height: 1.3;
  margin: 0;
  text-transform: uppercase;
}

.ge-kpi__value {
  color: var(--ge-ink);
  font-size: 22px;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
}

.ge-kpi__cur {
  color: var(--ge-muted);
  font-size: .68em;
  font-weight: 500;
  margin-right: 3px;
  vertical-align: .12em;
}

.ge-kpi__dec {
  color: var(--ge-muted);
  font-size: .68em;
  font-weight: 500;
}

.ge-kpi__meta {
  align-items: center;
  color: var(--ge-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 6px;
  margin: auto 0 0;
}

/*------- Stat strip — related figures read left to right, one panel, hairline dividers -------*/
.ge-stat-strip {
  --ge-muted: var(--ge-muted-tint);
  background: var(--ge-tint);
  border: 1px solid var(--ge-tint-line);
  border-radius: var(--ge-radius);
  box-shadow: var(--ge-shadow-sm);
  overflow: hidden;
}

/* The negative margins hide the leading divider of whichever cell starts a row, so the strip wraps
   cleanly at any width without a media query. */
.ge-stat-strip__cells {
  display: flex;
  flex-wrap: wrap;
  margin: -1px 0 0 -1px;
}

.ge-stat {
  border-left: 1px solid var(--ge-tint-line);
  border-top: 1px solid var(--ge-tint-line);
  flex: 1 1 150px;
  min-width: 0;
  padding: var(--ge-3) var(--ge-4);
}

.ge-stat__label {
  align-items: center;
  color: var(--ge-muted);
  display: flex;
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
  letter-spacing: .05em;
  line-height: 1.3;
  margin: 0 0 4px;
  text-transform: uppercase;
}

/* The +/− shows the figure's part in the closing-balance sum. */
/* + in teal (4.66:1), − in slate (8.72:1): the two sides of the sum, told apart by the sign itself. */
.ge-stat__op {
  background: #e7ecf2;
  border-radius: 4px;
  color: var(--ge-ink-2);
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  width: 16px;
}

.ge-stat__value {
  color: var(--ge-ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  white-space: nowrap;
}

.ge-stat__op--plus { background: #d9f2ec; color: var(--ge-brand); }

.ge-stat-strip__foot {
  background: var(--ge-surface);
  border-top: 1px solid var(--ge-tint-line);
  color: var(--ge-muted);
  font-size: 12px;
  padding: 8px var(--ge-4);
}

/*------- Recovery targets -------*/
.ge-rgrid {
  display: grid;
  gap: var(--ge-3);
  grid-template-columns: repeat(auto-fit, minmax(208px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

/* A fixed-length list (a "top 5") keeps its slots at full width, so two cards stay card-sized. */
@media (min-width: 1200px) {
  .ge-rgrid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.ge-rcard {
  background: var(--ge-surface);
  border: 1px solid var(--ge-line);
  border-radius: var(--ge-radius);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: var(--ge-3) 14px 14px;
}

/* The card's risk, as a bar across its top — the badge inside still says it in words. */
.ge-rcard--danger  { border-top: 3px solid var(--ge-danger-accent); }
.ge-rcard--warning { border-top: 3px solid var(--ge-warning-accent); }
.ge-rcard--success { border-top: 3px solid #16a34a; }

.ge-rcard__top {
  align-items: center;
  display: flex;
  gap: var(--ge-2);
  justify-content: space-between;
}

.ge-rcard__rank {
  color: var(--ge-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: .04em;
}

.ge-ui .ge-rcard__name {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--ge-ink);
  display: -webkit-box;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  overflow: hidden;
}

.ge-rcard__loc {
  color: var(--ge-muted);
  font-size: 12px;
  margin: 2px 0 0;
}

.ge-rcard__amount {
  --ge-muted: var(--ge-muted-tint);
  background: var(--ge-tint);
  border: 1px solid var(--ge-tint-line);
  border-radius: var(--ge-radius-sm);
  padding: var(--ge-2) 10px;
}

.ge-rcard__amount-label {
  color: var(--ge-muted);
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.ge-rcard__amount-value {
  color: var(--ge-ink);
  font-size: 19px;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.ge-facts {
  display: grid;
  gap: 6px;
  margin: 0;
}

.ge-facts > div {
  align-items: center;
  display: flex;
  gap: var(--ge-2);
  justify-content: space-between;
  min-height: 22px;
}

.ge-facts dt {
  color: var(--ge-muted);
  font-size: 12px;
  font-weight: 400;
}

.ge-facts dd {
  color: var(--ge-ink);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.ge-rcard .ge-actions { margin-top: auto; min-width: 0; }

.ge-empty {
  align-items: center;
  color: var(--ge-text);
  display: flex;
  font-size: 13px;
  gap: var(--ge-2);
  padding: var(--ge-4);
}

.ge-empty > i { color: var(--ge-success); }

/*------- Disclosure (e.g. "How risk is graded") -------*/
.ge-disclosure { font-size: 12px; position: relative; }

.ge-disclosure > summary {
  align-items: center;
  border-radius: var(--ge-radius-sm);
  color: var(--ge-brand);
  cursor: pointer;
  display: inline-flex;
  font-weight: 600;
  gap: 6px;
  list-style: none;
  padding: 6px 8px;
}

.ge-disclosure > summary::-webkit-details-marker { display: none; }
.ge-disclosure > summary:hover { background: var(--ge-brand-soft); }

.ge-disclosure__body {
  background: var(--ge-surface);
  border: 1px solid var(--ge-line);
  border-radius: var(--ge-radius);
  box-shadow: var(--ge-shadow-md);
  color: var(--ge-text);
  line-height: 1.55;
  margin-top: 6px;
  max-width: 420px;
  padding: var(--ge-3) 14px;
  position: absolute;
  right: 0;
  width: max-content;
  z-index: 20;
}

.ge-disclosure__body p { margin: 0 0 8px; }
.ge-disclosure__body p:last-child { margin: 0; }

/*------- Tables -------*/
/* The scroll box. DataTables pages get it from geDataTable()'s `dom`; a plain table is wrapped in
   <div class="ge-scroll" tabindex="0" role="region" aria-label="…"> by hand. */
.ge-scroll,
.ge-dt-scroll {
  -webkit-overflow-scrolling: touch;
  overflow: auto;
  position: relative;
}

@media (min-width: 768px) {
  /* Tall tables scroll inside the panel so the column headings stay in view. */
  .ge-dt-scroll { max-height: calc(100vh - 170px); max-height: max(420px, calc(100vh - 170px)); }
}

table.ge-table {
  background: var(--ge-surface);
  border: 0 !important;
  border-collapse: separate !important;   /* sticky headers and columns need the separate model */
  border-spacing: 0;
  color: var(--ge-ink);
  font-family: var(--ge-font);
  font-size: 13px;
  letter-spacing: normal;
  margin: 0 !important;
  min-width: 100%;
  width: 100%;
}

table.ge-table th,
table.ge-table td {
  box-sizing: border-box;
}

/* Header. The !important beats style.css's global `table thead th { background: lime !important }`. */
table.ge-table > thead > tr > th {
  background: var(--ge-tint-2) !important;
  border-bottom: 1px solid var(--ge-tint-line-strong) !important;
  border-right: 1px solid var(--ge-tint-line);
  color: var(--ge-head-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.35;
  padding: 10px 12px !important;
  position: sticky;
  text-align: left;
  text-transform: uppercase;
  top: 0;
  vertical-align: bottom;
  white-space: nowrap;
  z-index: 2;
}

table.ge-table > thead > tr > th:last-child { border-right: 0; }

/* Sort indicator: two small carets, drawn in CSS instead of the DataTables PNGs. */
table.ge-table.dataTable > thead > tr > th.sorting,
table.ge-table.dataTable > thead > tr > th.sorting_asc,
table.ge-table.dataTable > thead > tr > th.sorting_desc {
  background-image: none !important;
  cursor: pointer;
  padding-right: 26px !important;
}

table.ge-table.dataTable > thead > tr > th.sorting::before,
table.ge-table.dataTable > thead > tr > th.sorting::after,
table.ge-table.dataTable > thead > tr > th.sorting_asc::before,
table.ge-table.dataTable > thead > tr > th.sorting_asc::after,
table.ge-table.dataTable > thead > tr > th.sorting_desc::before,
table.ge-table.dataTable > thead > tr > th.sorting_desc::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  content: "";
  opacity: .35;
  position: absolute;
  right: 11px;
}

table.ge-table.dataTable > thead > tr > th::before { border-bottom: 4px solid var(--ge-head-ink); bottom: 17px; }
table.ge-table.dataTable > thead > tr > th::after  { border-top: 4px solid var(--ge-head-ink); bottom: 11px; }

table.ge-table.dataTable > thead > tr > th.sorting_asc::before,
table.ge-table.dataTable > thead > tr > th.sorting_desc::after { border-bottom-color: var(--ge-brand); border-top-color: var(--ge-brand); opacity: 1; }
table.ge-table.dataTable > thead > tr > th.sorting_asc::after,
table.ge-table.dataTable > thead > tr > th.sorting_desc::before { opacity: .12; }

table.ge-table.dataTable > thead > tr > th.sorting_asc,
table.ge-table.dataTable > thead > tr > th.sorting_desc { color: var(--ge-brand-strong); }

table.ge-table.dataTable > thead > tr > th:hover { background: #d9eeea !important; }

/* Right-aligned (numeric) headings put the caret on the LEFT, so the heading text ends exactly
   where the figures below it end. */
/* A money column should be as wide as its figures, not as its heading: "TOTAL SALES RETURN" on one
   line is twice the width of "1,79,254.29". So numeric headings wrap, bottom-aligned, and the
   minimum stops a short heading ("TCS") from pinching the column. */
table.ge-table > thead > tr > th.ge-num { min-width: 92px; text-align: right; white-space: normal; }
table.ge-table.dataTable > thead > tr > th.ge-num.sorting,
table.ge-table.dataTable > thead > tr > th.ge-num.sorting_asc,
table.ge-table.dataTable > thead > tr > th.ge-num.sorting_desc { padding-left: 24px !important; padding-right: 12px !important; }
table.ge-table.dataTable > thead > tr > th.ge-num::before,
table.ge-table.dataTable > thead > tr > th.ge-num::after { left: 9px; right: auto; }

/* Body */
table.ge-table > tbody > tr > td {
  background: var(--ge-surface);
  border-bottom: 1px solid var(--ge-line-soft);
  border-top: 0;
  color: var(--ge-text);
  line-height: 1.45;
  padding: 12px !important;
  text-align: left;
  vertical-align: top;
}

table.ge-table > tbody > tr:nth-child(even) > td { background: var(--ge-zebra); }
table.ge-table > tbody > tr:hover > td { background: var(--ge-hover); }
table.ge-table > tbody > tr:last-child > td { border-bottom: 0; }

table.ge-table > tbody > tr > td.ge-num {
  color: var(--ge-ink);
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
  white-space: nowrap;
}

table.ge-table td.ge-center,
table.ge-table th.ge-center { text-align: center; }
table.ge-table td.ge-nowrap { white-space: nowrap; }
table.ge-table td.ge-emph { font-weight: 600; }

table.ge-table td.ge-id {
  color: var(--ge-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

table.ge-table .dataTables_empty {
  color: var(--ge-muted);
  padding: var(--ge-6) var(--ge-4) !important;
  text-align: center !important;
}

/* Totals — tfoot, slightly heavier, never a dark slab. */
table.ge-table > tfoot > tr > th,
table.ge-table > tfoot > tr > td {
  background: var(--ge-tint-2);
  border-top: 1px solid var(--ge-tint-line-strong) !important;
  color: var(--ge-ink);
  font-weight: 700;
  padding: 11px 12px !important;
  text-align: left;
}

table.ge-table > tfoot > tr > .ge-num {
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
  white-space: nowrap;
}

table.ge-table--compact > tbody > tr > td { padding: 9px 12px !important; vertical-align: middle; }

/* Pinned identity columns. The second column's offset is measured by js/ge-ui.js; 56px is the
   fallback for the usual narrow id column. */
table.ge-table .ge-pin-1,
table.ge-table .ge-pin-2 { position: sticky; z-index: 1; }
table.ge-table .ge-pin-1 { left: 0; }
table.ge-table .ge-pin-2 { left: var(--ge-pin-offset, 56px); }
table.ge-table > thead > tr > th.ge-pin-1,
table.ge-table > thead > tr > th.ge-pin-2 { z-index: 3; }
table.ge-table .ge-pin-last { border-right: 1px solid var(--ge-line) !important; }

.ge-scroll.is-scrolled-x table.ge-table .ge-pin-last,
.ge-dt-scroll.is-scrolled-x table.ge-table .ge-pin-last { box-shadow: 6px 0 8px -6px rgba(15, 23, 42, .22); }

/* Row actions pinned to the right edge, so Reminder / Plan never need a sideways scroll to reach.
   The shadow shows only while more columns sit underneath it. Unpinned on a phone (below). */
table.ge-table .ge-pin-end { border-left: 1px solid var(--ge-line) !important; position: sticky; right: 0; z-index: 1; }
table.ge-table > thead > tr > th.ge-pin-end { z-index: 3; }
.ge-scroll.has-more-x table.ge-table .ge-pin-end,
.ge-dt-scroll.has-more-x table.ge-table .ge-pin-end { box-shadow: -6px 0 8px -6px rgba(15, 23, 42, .22); }
.ge-dt-scroll.is-scrolled-y table.ge-table > thead > tr > th { box-shadow: 0 1px 0 var(--ge-line), 0 3px 6px -3px rgba(15, 23, 42, .12); }

/* Cell furniture for a "name + context" first column */
.ge-cell-title {
  color: var(--ge-ink);
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}

.ge-cell-meta {
  align-items: center;
  color: var(--ge-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 4px 8px;
  line-height: 1.4;
  margin-top: 6px;
}

/* The wide identity column (name + status + ageing). `width` on a cell is the floor an auto-layout
   table keeps; min-width alone is not honoured on table cells everywhere. */
table.ge-table .ge-col-primary { min-width: 320px; width: 320px; }

/* Ageing strip: label over figure, one short column per bucket, wraps on a narrow screen. */
.ge-aging {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 8px 0 0;
}

.ge-aging dt {
  color: var(--ge-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
}

.ge-aging dd {
  color: var(--ge-ink-2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  white-space: nowrap;
}

.ge-aging .is-danger dt,
.ge-aging .is-danger dd { color: var(--ge-danger); }
.ge-aging .is-warning dt,
.ge-aging .is-warning dd { color: var(--ge-warning); }   /* 31–90 days — the same band the Warning grade covers */

/* Collection-plan status beside the risk badge — text, not a second coloured pill. */
.ge-plan {
  align-items: center;
  color: var(--ge-muted);
  display: inline-flex;
  font-size: 12px;
  gap: 5px;
  white-space: nowrap;
}

.ge-plan.is-set { color: var(--ge-success); font-weight: 600; }

.ge-person {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

/* The support person's own colour from their master record, kept as a small swatch so people who
   learned the old coloured rows still find their distributors. Their name sits beside it. */
.ge-swatch {
  border: 1px solid rgba(15, 23, 42, .18);
  border-radius: 50%;
  display: inline-block;
  flex: none;
  height: 9px;
  width: 9px;
}

/*------- DataTables controls (wrapper gets .ge-dt from geDataTable()) -------*/
.dataTables_wrapper.ge-dt { font-family: var(--ge-font); }

.dataTables_wrapper.ge-dt .ge-dt-toolbar,
.dataTables_wrapper.ge-dt .ge-dt-foot {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ge-2) var(--ge-4);
  justify-content: space-between;
  padding: 10px var(--ge-4);
}

.dataTables_wrapper.ge-dt .ge-dt-toolbar { border-bottom: 1px solid var(--ge-line); }
.dataTables_wrapper.ge-dt .ge-dt-foot { --ge-muted: var(--ge-muted-tint); background: var(--ge-tint); border-radius: 0 0 var(--ge-radius) var(--ge-radius); border-top: 1px solid var(--ge-tint-line); }

.dataTables_wrapper.ge-dt .dataTables_length,
.dataTables_wrapper.ge-dt .dataTables_filter,
.dataTables_wrapper.ge-dt .dataTables_info,
.dataTables_wrapper.ge-dt .dataTables_paginate {
  color: var(--ge-text);
  float: none;
  font-size: 12.5px;
  margin: 0;
  padding: 0;
  text-align: left;
}

.dataTables_wrapper.ge-dt .dataTables_length label,
.dataTables_wrapper.ge-dt .dataTables_filter label {
  align-items: center;
  display: inline-flex;
  font-weight: 400;
  gap: var(--ge-2);
  margin: 0;
}

.dataTables_wrapper.ge-dt .dataTables_length select,
.dataTables_wrapper.ge-dt .dataTables_filter input {
  background-color: var(--ge-surface);
  border: 1px solid var(--ge-line-strong);
  border-radius: var(--ge-radius-sm);
  color: var(--ge-ink);
  font: 13px/1.3 var(--ge-font);
  height: 32px;
  margin: 0;
}

.dataTables_wrapper.ge-dt .dataTables_length select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23475569' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 9px center;
  background-repeat: no-repeat;
  padding: 0 26px 0 10px;
}

.dataTables_wrapper.ge-dt .dataTables_filter input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-position: 10px center;
  background-repeat: no-repeat;
  padding: 0 10px 0 32px;
  width: 280px;
}

.dataTables_wrapper.ge-dt .dataTables_length select:focus,
.dataTables_wrapper.ge-dt .dataTables_filter input:focus {
  border-color: var(--ge-brand);
  box-shadow: var(--ge-focus);
  outline: none;
}

.dataTables_wrapper.ge-dt .dataTables_filter input::placeholder { color: var(--ge-muted); opacity: 1; }

.dataTables_wrapper.ge-dt .dataTables_paginate {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dataTables_wrapper.ge-dt .dataTables_paginate > span { display: inline-flex; gap: 4px; }

.dataTables_wrapper.ge-dt .dataTables_paginate .paginate_button {
  align-items: center;
  background: var(--ge-surface) !important;
  border: 1px solid var(--ge-line) !important;
  border-radius: var(--ge-radius-sm);
  box-shadow: none !important;
  color: var(--ge-ink-2) !important;
  display: inline-flex;
  font-size: 12.5px;
  font-weight: 600;
  height: 32px;
  justify-content: center;
  margin: 0;
  min-width: 32px;
  padding: 0 10px;
}

.dataTables_wrapper.ge-dt .dataTables_paginate .paginate_button:hover {
  background: var(--ge-surface-3) !important;
  border-color: var(--ge-line-strong) !important;
  color: var(--ge-ink) !important;
}

.dataTables_wrapper.ge-dt .dataTables_paginate .paginate_button.current,
.dataTables_wrapper.ge-dt .dataTables_paginate .paginate_button.current:hover {
  background: var(--ge-brand) !important;
  border-color: var(--ge-brand) !important;
  color: #fff !important;
}

.dataTables_wrapper.ge-dt .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper.ge-dt .dataTables_paginate .paginate_button.disabled:hover {
  background: transparent !important;
  border-color: transparent !important;
  color: #94a3b8 !important;
  cursor: default;
}

.dataTables_wrapper.ge-dt .dataTables_paginate .ellipsis { color: var(--ge-muted); padding: 0 4px; }

.dataTables_wrapper.ge-dt .dataTables_paginate .paginate_button:focus-visible {
  box-shadow: var(--ge-focus) !important;
  outline: 2px solid var(--ge-brand);
  outline-offset: 1px;
}

/*------- Modal (Bootstrap 3 .modal-dialog.ge-modal) -------*/
.ge-modal { font-family: var(--ge-font); letter-spacing: normal; }

.ge-modal .modal-content {
  border: 1px solid var(--ge-line);
  border-radius: var(--ge-radius-lg);
  box-shadow: 0 12px 32px rgba(16, 24, 40, .16);
  overflow: hidden;
}

.ge-modal .modal-header {
  align-items: flex-start;
  background: var(--ge-tint);
  border-bottom: 1px solid var(--ge-tint-line);
  display: flex;
  gap: var(--ge-3);
  justify-content: space-between;
  padding: var(--ge-4) var(--ge-5);
}

.ge-modal .modal-header::before,
.ge-modal .modal-header::after { content: none; }

.ge-modal .modal-title {
  color: var(--ge-ink);
  font: 600 16px/1.35 var(--ge-font);
  margin: 0;
}

.ge-modal .ge-modal__sub { color: var(--ge-muted); font-size: 12.5px; margin: 2px 0 0; }

.ge-modal .close {
  color: var(--ge-text);
  float: none;
  font-size: 22px;
  line-height: 1;
  margin: -2px -6px 0 0;
  opacity: 1;
  padding: 2px 8px;
  text-shadow: none;
}

.ge-modal .close:hover { background: var(--ge-surface-3); border-radius: var(--ge-radius-sm); color: var(--ge-ink); }
.ge-modal .modal-body { padding: var(--ge-5); }
.ge-modal .modal-body .ge-field + .ge-field { margin-top: var(--ge-4); }
.ge-modal .ge-field-row { display: grid; gap: var(--ge-4); grid-template-columns: 1fr 1fr; }
.ge-modal .ge-field-row + .ge-field { margin-top: var(--ge-4); }
.ge-modal .ge-field + .ge-field-row { margin-top: var(--ge-4); }

.ge-modal .modal-footer {
  background: var(--ge-tint);
  border-top: 1px solid var(--ge-tint-line);
  display: flex;
  gap: var(--ge-2);
  justify-content: flex-end;
  padding: var(--ge-3) var(--ge-5);
}

.ge-modal .modal-footer::before,
.ge-modal .modal-footer::after { content: none; }

/*------- Page loader -------*/
.ge-loader {
  align-items: center;
  background: rgba(248, 250, 252, .92);
  display: flex;
  height: 100%;
  justify-content: center;
  left: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 9999;
}

.ge-loader__spin {
  animation: ge-spin .9s linear infinite;
  border: 3px solid var(--ge-line);
  border-radius: 50%;
  border-top-color: var(--ge-brand);
  height: 40px;
  width: 40px;
}

@keyframes ge-spin { to { transform: rotate(360deg); } }

/*------- Narrow-screen table: fewer columns, the rest behind a per-row expand -------*/
/* A wide table on a small screen keeps its identity column and the few figures people compare down
   the page, and folds the rest into "All figures" inside the identity cell (references/responsive.md:
   reduce columns by priority rather than shrinking them all; never card-stack a comparison table).
   ge-col-opt hides below 1024px, ge-col-sm below 768px. Both the expander and the phone copy of the
   row actions are display:none above those widths, so a screen reader never meets them twice. */
.ge-more,
.ge-actions--inline,
.ge-more__list > .ge-more__sm { display: none; }

.ge-more > summary {
  align-items: center;
  border-radius: var(--ge-radius-sm);
  color: var(--ge-brand);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
  list-style: none;
  min-height: 32px;
  padding: 0 6px 0 2px;
}

.ge-more > summary::-webkit-details-marker { display: none; }
.ge-more > summary:hover { background: var(--ge-brand-soft); }

/* A chevron drawn in CSS: points right when closed, down when open. */
.ge-more > summary::before {
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  content: "";
  height: 6px;
  margin: 0 3px;
  transform: rotate(-45deg);
  transition: transform .15s ease;
  width: 6px;
}

.ge-more[open] > summary::before { transform: rotate(45deg); }

.ge-more__list {
  --ge-muted: var(--ge-muted-tint);
  background: var(--ge-tint);
  border: 1px solid var(--ge-tint-line);
  border-radius: var(--ge-radius-sm);
  display: grid;
  gap: 5px;
  margin: 4px 0 0;
  padding: var(--ge-2) 10px;
}

.ge-more__list > div {
  align-items: baseline;
  display: flex;
  gap: var(--ge-2);
  justify-content: space-between;
}

.ge-more__list dt { color: var(--ge-muted); font-size: 12px; font-weight: 400; }

.ge-more__list dd {
  color: var(--ge-ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

/*------- Laptop / tablet -------*/
@media (max-width: 1199px) {
  .ge-filter__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ge-filter__actions { justify-content: flex-start; }
}

/*------- Tablet — below --bp-desktop the rarely-read columns fold into the row -------*/
@media (max-width: 1023px) {
  table.ge-table .ge-col-opt { display: none; }
  .ge-more { display: block; margin-top: 6px; }
  table.ge-table .ge-col-primary { min-width: 232px; width: 232px; }
}

/*------- Phone — 767px is the house breakpoint (css/media.css) -------*/
@media (max-width: 767px) {
  .ge-ui { padding: var(--ge-3) var(--ge-3) var(--ge-5); }
  .ge-ui .ge-page-title { font-size: 19px; }
  .ge-panel { margin-bottom: var(--ge-4); }
  .ge-panel__head { padding: var(--ge-3); }
  .ge-filter { padding: var(--ge-3); }
  .ge-filter__grid { grid-template-columns: 1fr; }
  .ge-filter__actions .ge-btn { flex: 1; height: 40px; }
  .ge-control { height: 40px; }

  .ge-kpi-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--ge-2); }
  .ge-kpi { min-height: 0; padding: var(--ge-3); }
  .ge-kpi__value { font-size: 18px; }
  .ge-stat { flex-basis: 50%; padding: 10px var(--ge-3); }
  .ge-stat__value { font-size: 15px; }

  /* Recovery cards become one swipeable row instead of five screens of scrolling. */
  .ge-rgrid {
    grid-auto-columns: minmax(240px, 80%);
    grid-auto-flow: column;
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }
  .ge-rcard { scroll-snap-align: start; }

  .ge-disclosure__body { left: 0; max-width: calc(100vw - 48px); right: auto; }

  .dataTables_wrapper.ge-dt .ge-dt-toolbar,
  .dataTables_wrapper.ge-dt .ge-dt-foot { padding: 10px var(--ge-3); }
  .dataTables_wrapper.ge-dt .dataTables_filter,
  .dataTables_wrapper.ge-dt .dataTables_filter label,
  .dataTables_wrapper.ge-dt .dataTables_filter input { width: 100%; }
  .dataTables_wrapper.ge-dt .dataTables_filter input { height: 40px; }
  .dataTables_wrapper.ge-dt .dataTables_info { text-align: center; width: 100%; }
  .dataTables_wrapper.ge-dt .dataTables_paginate { justify-content: center; width: 100%; }
  .dataTables_wrapper.ge-dt .dataTables_paginate .paginate_button { height: 36px; min-width: 36px; }

  /* media.css makes every table border-collapse: collapse at this width; sticky needs separate. */
  table.ge-table { border-collapse: separate !important; }
  /* jquery.dataTables.css right-aligns every body cell on a phone; text columns stay left. */
  table.ge-table.dataTable > tbody > tr > td:not(.ge-num) { text-align: left; }
  table.ge-table.dataTable > tbody > tr > td.ge-center { text-align: center; }

  /* Only the name column stays pinned — two pinned columns would fill a 360px screen. */
  table.ge-table .ge-pin-1:not(.ge-pin-last) { left: auto; position: static; }
  table.ge-table .ge-pin-end { border-left: 0 !important; box-shadow: none !important; position: static; }
  /* The due list on a phone is three columns — Firm, Due Balance, Due % — which fit a 360px screen
     with no sideways scroll. Closing Balance joins "All figures", and the row's buttons move under
     the firm name (the Action column is ge-col-sm). The name column takes whatever is left. */
  table.ge-table .ge-col-sm { display: none; }
  .ge-more__list > .ge-more__sm { display: flex; }
  table.ge-table .ge-pin-2,
  table.ge-table .ge-col-primary { left: 0; max-width: none; min-width: 0; width: auto; }
  table.ge-table > thead > tr > th.ge-num { min-width: 0; }
  table.ge-table > thead > tr > th,
  table.ge-table > tbody > tr > td { padding-left: 8px !important; padding-right: 8px !important; }
  table.ge-table.dataTable > thead > tr > th.ge-num.sorting,
  table.ge-table.dataTable > thead > tr > th.ge-num.sorting_asc,
  table.ge-table.dataTable > thead > tr > th.ge-num.sorting_desc { padding-left: 20px !important; padding-right: 8px !important; }
  table.ge-table.dataTable > thead > tr > th.ge-num::before,
  table.ge-table.dataTable > thead > tr > th.ge-num::after { left: 6px; }
  .ge-aging { column-gap: 10px; }
  table.ge-table .ge-actions { grid-template-columns: 1fr; min-width: 140px; }
  table.ge-table .ge-actions--inline { display: grid; grid-template-columns: 1fr 1fr; margin-top: 10px; min-width: 0; }
  table.ge-table .ge-actions .ge-plan { white-space: normal; }
  /* A finger, not a cursor: row buttons grow to 36px. */
  .ge-ui .ge-btn--sm { height: 36px; }

  .ge-modal .ge-field-row { grid-template-columns: 1fr; }
  .ge-modal .modal-body { padding: var(--ge-4); }
}

@media (prefers-reduced-motion: reduce) {
  .ge-loader__spin { animation-duration: 2.5s; }
  .ge-btn, .ge-control { transition: none; }
}
