html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root,
[data-bs-theme=light],
[data-bs-theme=dark] {
  --lt-primary: #1e7d99;
  --lt-primary-hover: #186d87;
  --lt-primary-active: #125e75;
  --lt-primary-focus-rgb: 30, 125, 153;
  --lt-primary-hover-rgb: 24, 109, 135;
  --lt-primary-soft: #d4eef6;
  --lt-primary-soft-border: #a8d8e8;
  --lt-link: #4a5662;
  --lt-link-hover: #36414b;
  --bs-primary: #1e7d99;
  --bs-primary-rgb: 30, 125, 153;
  --bs-link-color: var(--lt-link);
  --bs-link-hover-color: var(--lt-link-hover);
  --tblr-primary: #1e7d99;
  --tblr-primary-fg: #ffffff;
  --tblr-primary-darken: #186d87;
  --tblr-primary-rgb: 30, 125, 153;
  --tblr-primary-text: #186d87;
  --tblr-primary-bg-subtle: #d4eef6;
  --tblr-primary-border-subtle: #a8d8e8;
  --tblr-link-color: var(--lt-link);
  --tblr-link-color-rgb: 74, 86, 98;
  --tblr-link-hover-color: var(--lt-link-hover);
  --tblr-link-hover-color-rgb: 54, 65, 75;

  /* ───────────────────────────────────────────────────────────────
     DESIGN TOKENS - single source of truth (Phase 1 / Foundations).
     Consumed by _Layout, _AuthLayout, marketing, and the shared
     interstitial layout so every surface shares one vocabulary.
     ─────────────────────────────────────────────────────────────── */

  /* Typography */
  --lt-font-sans: "Manrope", "Plus Jakarta Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Neutral ramp + surfaces */
  --lt-text: #1e2b36;
  --lt-muted: #66788a;
  --lt-border: #d6dfe6;
  --lt-surface: #ffffff;
  --lt-bg: #f2f4f6;
  --lt-bg-accent: #e9edf0;

  /* Status colors */
  --lt-success: #2f9e6f;
  --lt-warning: #b8860b;
  --lt-danger: #9f4747;

  /* Radius scale */
  --lt-radius-sm: 6px;
  --lt-radius-md: 10px;
  --lt-radius-lg: 16px;
  --lt-radius-pill: 999px;
  /* Canonical button radius (rounded-rect). The compact teal header
     pills keep --lt-radius-pill by design; everything else uses this. */
  --lt-radius-btn: 10px;

  /* Spacing scale (4px base) */
  --lt-space-1: 4px;
  --lt-space-2: 8px;
  --lt-space-3: 12px;
  --lt-space-4: 16px;
  --lt-space-5: 24px;
  --lt-space-6: 32px;
  --lt-space-7: 48px;

  /* Type scale */
  --lt-text-xs: 0.78rem;
  --lt-text-sm: 0.88rem;
  --lt-text-base: 1rem;
  --lt-text-lg: 1.15rem;
  --lt-text-h3: 1.3rem;
  --lt-text-h2: 1.6rem;
  --lt-text-h1: 2rem;

  /* Container widths */
  --lt-container-narrow: 480px;
  --lt-container-content: 1320px;

  /* Elevation */
  --lt-shadow-sm: 0 8px 24px rgba(16, 30, 45, 0.08);
  --lt-shadow-md: 0 18px 42px rgba(16, 30, 45, 0.14);

  /* Min touch target (mobile) */
  --lt-touch-min: 44px;
}

/* Canonical font stack applied app-wide (single source of truth).
   Layouts that previously hard-coded the same stack now inherit it. */
body {
  font-family: var(--lt-font-sans);
}

/* ── Shared language switcher (_LanguageSwitcher.cshtml) ───────────── */
.lt-lang-switcher .lt-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--lt-border);
  background: #fff;
  color: #355667;
  font-weight: 700;
  border-radius: var(--lt-radius-md);
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  line-height: 1;
  min-height: 38px;
}
.lt-lang-switcher .lt-lang-toggle:hover {
  border-color: #a8d8e8;
  background: #f6fafc;
}
.lt-lang-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.3rem;
  border-radius: var(--lt-radius-pill);
  border: 1px solid #cedce4;
  background: #eef5f8;
  color: #3a5f70;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0 0.35rem;
}
.lt-lang-switcher .dropdown-menu {
  border-radius: var(--lt-radius-md);
  border: 1px solid #d2dce5;
  padding: 0.3rem;
  min-width: 12rem;
}
.lt-lang-switcher .dropdown-item {
  border-radius: var(--lt-radius-sm);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: #355667;
}
.lt-lang-switcher .dropdown-item.active,
.lt-lang-switcher .dropdown-item:active {
  background: #dfeaf0;
  color: #264857;
}

/* ── Phase 3: one button radius scale (token-driven) ───────────────
   Fixes F-005 radius fragmentation for every framework button app-wide
   (Bootstrap btn-sm was 3.2px, Tabler btn-sm 8px). Set directly so it
   wins over both frameworks. Custom buttons (.btn-topbar-*, .auth-submit,
   .mk-topbar-cta) do not carry the .btn class, so they keep their pills.
   Bootstrap .btn-group / .input-group rules are more specific, so grouped
   buttons still get their square inner edges. */
.btn { --bs-btn-border-radius: var(--lt-radius-btn); border-radius: var(--lt-radius-btn); }
.btn-sm, .btn-group-sm > .btn { --bs-btn-border-radius: var(--lt-radius-sm); border-radius: var(--lt-radius-sm); }
.btn-lg, .btn-group-lg > .btn { --bs-btn-border-radius: var(--lt-radius-md); border-radius: var(--lt-radius-md); }

a {
  color: var(--lt-link);
}

a:hover {
  color: var(--lt-link-hover);
}

.btn-link {
  color: var(--lt-link);
}

.btn-link:hover {
  color: var(--lt-link-hover);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem rgba(var(--lt-primary-focus-rgb), 0.35);
}

/* Suppress default browser focus outline on body after page navigation */
body:focus {
  outline: none;
}

/* Suppress mouse-click focus outlines on sidebar elements (keyboard :focus-visible still works) */
.sidebar-brand:focus:not(:focus-visible),
.sidebar .nav-link:focus:not(:focus-visible),
.sidebar .logout-btn:focus:not(:focus-visible),
.sidebar .sidebar-settings-btn:focus:not(:focus-visible),
.sidebar .sidebar-switch-btn:focus:not(:focus-visible) {
  outline: none;
}

/* Secondary outline button — visible but soft neutral hover */
.btn-outline-secondary:hover,
.btn-outline-secondary:active {
  background-color: #dde4eb !important;
  border-color: #9aaebb !important;
  color: #243545 !important;
  box-shadow: 0 1px 4px rgba(16, 30, 45, 0.1) !important;
}

.btn-primary,
.btn-lt-primary {
  --bs-btn-bg: var(--lt-primary);
  --bs-btn-border-color: var(--lt-primary);
  --bs-btn-hover-bg: var(--lt-primary-hover);
  --bs-btn-hover-border-color: var(--lt-primary-hover);
  --bs-btn-active-bg: var(--lt-primary-active);
  --bs-btn-active-border-color: var(--lt-primary-active);
  --bs-btn-focus-shadow-rgb: var(--lt-primary-focus-rgb);
  color: #fff !important;
  background-color: var(--lt-primary) !important;
  border-color: var(--lt-primary) !important;
}

.btn-primary:hover,
.btn-lt-primary:hover,
.btn-primary:focus,
.btn-lt-primary:focus,
.btn-primary:active,
.btn-lt-primary:active {
  background-color: var(--lt-primary-hover) !important;
  border-color: var(--lt-primary-hover) !important;
  color: #fff !important;
}

.btn-outline-primary,
.btn-lt-outline-primary {
  --bs-btn-color: var(--lt-primary);
  --bs-btn-border-color: var(--lt-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--lt-primary);
  --bs-btn-hover-border-color: var(--lt-primary);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--lt-primary-active);
  --bs-btn-active-border-color: var(--lt-primary-active);
  --bs-btn-focus-shadow-rgb: var(--lt-primary-focus-rgb);
  color: var(--lt-primary) !important;
  border-color: var(--lt-primary) !important;
}

.btn-outline-primary:hover,
.btn-lt-outline-primary:hover,
.btn-outline-primary:focus,
.btn-lt-outline-primary:focus,
.btn-outline-primary:active,
.btn-lt-outline-primary:active {
  color: #fff !important;
  background-color: var(--lt-primary) !important;
  border-color: var(--lt-primary) !important;
}

.bg-lt-primary {
  background-color: var(--lt-primary) !important;
}

.text-lt-primary {
  color: var(--lt-primary) !important;
}

.link-lt-primary {
  color: var(--lt-link) !important;
}

.link-lt-primary:hover {
  color: var(--lt-link-hover) !important;
}

.form-check-input:checked {
  background-color: var(--lt-primary);
  border-color: var(--lt-primary);
}

.form-check-input[type=checkbox]:indeterminate {
  background-color: var(--lt-primary);
  border-color: var(--lt-primary);
}

input[type=checkbox],
input[type=radio] {
  accent-color: var(--lt-primary);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(var(--lt-primary-focus-rgb), 0.7);
  box-shadow: 0 0 0 0.25rem rgba(var(--lt-primary-focus-rgb), 0.2);
}

/* Shared admin filter bars (Tenant + Platform pages) */
.content-area .ta-filter-bar {
  /* Clean white card with a soft shadow - replaces the dated flat
     blue-gray fill. Reads as a crisp floating card like the stat
     cards + table around it. */
  background: #ffffff;
  border: 1px solid #e7edf2;
  border-radius: var(--lt-radius-lg);
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 2px rgba(16, 30, 45, 0.04), 0 10px 26px rgba(16, 30, 45, 0.05);
}

.content-area .ta-filter-bar .ta-filter-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155; /* slate-700 - darkened for visibility (was #64748b) */
  margin-bottom: 0.25rem;
}

.content-area .ta-filter-bar .form-control,
.content-area .ta-filter-bar .form-select {
  border-color: #ccd9e0;
}

/* Keep the Filter + Reset actions in the SAME spot on every filter card: bottom-right.
   Forcing the actions to be a right-packed flex group + margin-left:auto handles all
   three markup variants uniformly - a grid column that wraps (Newsletter/Campaigns),
   a full-width block under the form (Analytics), or a dedicated secondary row
   (Links/Click Log/Audit/Archive/Placements + superadmin). gap keeps button spacing
   consistent where the markup didn't already set gap-2. */
.content-area .ta-filter-bar .ta-filter-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.content-area .ta-filter-bar .input-group-text {
  background: #fff;
  border-color: #ccd9e0;
  color: #7b8f9d;
}

.content-area .ta-filter-bar .ta-filter-actions {
  display: flex;
  gap: 0.5rem;
}

/* TomSelect (searchable dropdown) sizing inside filter bars — match form-control-sm */
.content-area .ta-filter-bar .ts-wrapper.form-select-sm .ts-control {
  min-height: calc(1.5em + 0.5rem + 2px);
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
}
.content-area .ta-filter-bar .ts-wrapper.form-select-sm .ts-control > input {
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}
.content-area .ta-filter-bar .ts-wrapper.form-select-sm .ts-control .item {
  line-height: 1.5;
}

/* "Risk signal" checkbox-dropdown filter (Click Log + Analytics dashboard) — a plain
   Bootstrap dropdown + checkboxes replaced an earlier TomSelect multi-select, which
   rendered every option permanently selected due to a TomSelect init bug (2026-07-05). */
.risk-filter .risk-filter-toggle {
  min-height: calc(1.5em + 0.5rem + 2px);
  display: inline-flex;
  align-items: center;
  max-width: 15rem;
}
.risk-filter .risk-filter-toggle-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.risk-filter-menu {
  min-width: 15rem;
  max-height: 20rem;
  overflow-y: auto;
  padding: 0.4rem;
}
.risk-filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #1f3340;
  margin-bottom: 0.05rem;
}
.risk-filter-option:hover {
  background: #f1f5f9;
}
.risk-filter-option input.form-check-input {
  margin: 0;
  flex-shrink: 0;
}
.risk-filter-option-all,
.risk-filter-option-any {
  font-weight: 700;
}

/* Shared summary-chip stat card (used on Analytics, Newsletter, etc.) */
.analytics-summary-chip {
  border: 1px solid #c3d0da;
  border-radius: .8rem;
  background: #fff;
  padding: .75rem .9rem;
  height: 100%;
  box-shadow: 0 4px 12px rgba(16, 30, 45, 0.09), 0 1px 3px rgba(16, 30, 45, 0.05);
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.analytics-summary-chip:hover {
  box-shadow: 0 8px 22px rgba(16, 30, 45, 0.14), 0 2px 6px rgba(16, 30, 45, 0.07);
  transform: translateY(-2px);
  border-color: #a8bbc9;
}

.analytics-summary-chip .icon {
  width: 2rem;
  height: 2rem;
  border-radius: .6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.analytics-summary-chip .label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6f8595;
  font-weight: 700;
}

.analytics-summary-chip .value {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1f3340;
  line-height: 1.1;
  margin-top: .2rem;
}

/* Global pagination theme: always use LinkTrack green, never Bootstrap blue */
.pagination {
  --tblr-pagination-color: var(--lt-primary);
  --tblr-pagination-bg: #ffffff;
  --tblr-pagination-border-color: #d0dce5;
  --tblr-pagination-hover-color: var(--lt-primary-hover);
  --tblr-pagination-hover-bg: #edf5f0;
  --tblr-pagination-hover-border-color: #c7d8ce;
  --tblr-pagination-focus-color: var(--lt-primary-hover);
  --tblr-pagination-focus-bg: #edf5f0;
  --tblr-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(var(--lt-primary-focus-rgb), 0.25);
  --tblr-pagination-active-color: #ffffff;
  --tblr-pagination-active-bg: var(--lt-primary);
  --tblr-pagination-active-border-color: var(--lt-primary);
  --tblr-pagination-disabled-color: #9eb0bc;
  --tblr-pagination-disabled-bg: #ffffff;
  --tblr-pagination-disabled-border-color: #d0dce5;
  --bs-pagination-color: var(--lt-primary);
  --bs-pagination-bg: #ffffff;
  --bs-pagination-border-color: #d0dce5;
  --bs-pagination-hover-color: var(--lt-primary-hover);
  --bs-pagination-hover-bg: #edf5f0;
  --bs-pagination-hover-border-color: #c7d8ce;
  --bs-pagination-focus-color: var(--lt-primary-hover);
  --bs-pagination-focus-bg: #edf5f0;
  --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(var(--lt-primary-focus-rgb), 0.25);
  --bs-pagination-active-color: #ffffff;
  --bs-pagination-active-bg: var(--lt-primary);
  --bs-pagination-active-border-color: var(--lt-primary);
  --bs-pagination-disabled-color: #9eb0bc;
  --bs-pagination-disabled-bg: #ffffff;
  --bs-pagination-disabled-border-color: #d0dce5;
}

.pagination .page-link {
  border-radius: 0.45rem;
}

.pagination .page-item.active .page-link {
  background-color: var(--lt-primary) !important;
  border-color: var(--lt-primary) !important;
  color: #fff !important;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
}


/* ═══════════════════════════════════════════════════════
   Modern Modals
   ═══════════════════════════════════════════════════════ */

/* Backdrop — barely there. Modal dialogs float above a nearly-untouched page;
   the modal's own shadow provides enough visual separation. */
.modal-backdrop {
    background-color: rgba(18, 32, 46, 0.15);
}
.modal-backdrop.show { opacity: 1; }

/* Dialog shell */
.modal-content {
    border: none;
    border-radius: 1.15rem;
    box-shadow: 0 28px 70px rgba(12, 24, 36, 0.22), 0 4px 16px rgba(12, 24, 36, 0.1);
    overflow: hidden;
    background: #fff;
}

/* Header */
.modal-header {
    border-bottom: 1px solid #eef2f6;
    padding: 1.2rem 1.5rem 1.05rem;
    background: #fff;
    gap: 0.75rem;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1a2b36;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.modal-header .btn-close {
    /* Anchor to the top-right corner of the modal-content so it doesn't
       depend on the header's padding. Modal-content has border-radius: 1rem
       in our designs, so 12px inset clears the rounded edge nicely. */
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;

    /* Round red pill */
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: #fde8e8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23c0392b'%3E%3Cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3E%3C/svg%3E");
    background-size: 0.6em;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 1;
    transition: background-color 0.15s;
    z-index: 1;
}

.modal-header .btn-close:hover {
    background-color: #facaca;
    opacity: 1;
}

/* Body */
.modal-body {
    padding: 1.35rem 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #1e2b36;
}

/* Small helper label style used in detail rows */
.modal-body .small.text-muted {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7a93a4 !important;
    margin-bottom: 0.2rem;
}

/* Footer */
.modal-footer {
    border-top: 1px solid #eef2f6;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    gap: 0.5rem;
}

/* Buttons in modals */
.modal-footer .btn,
.modal-body .btn {
    border-radius: 0.65rem;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.48rem 1rem;
    transition: all 0.15s ease;
}

.modal-footer .btn-primary,
.modal-body .btn-primary {
    background: var(--lt-primary);
    border-color: var(--lt-primary);
    box-shadow: 0 3px 10px rgba(var(--lt-primary-focus-rgb), 0.25);
}

.modal-footer .btn-primary:hover,
.modal-body .btn-primary:hover {
    background: var(--lt-primary-hover);
    border-color: var(--lt-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(var(--lt-primary-focus-rgb), 0.3);
}

.modal-footer .btn-secondary,
.modal-body .btn-secondary {
    background: #fff;
    border-color: #d6dfe6;
    color: #445c6c;
    box-shadow: 0 1px 4px rgba(16, 30, 45, 0.07);
}

.modal-footer .btn-secondary:hover,
.modal-body .btn-secondary:hover {
    background: #f2f5f8;
    border-color: #c2cdd6;
    color: #2a3f4e;
}

.modal-footer .btn-danger,
.modal-body .btn-danger {
    background: #b83a3a;
    border-color: #b83a3a;
    box-shadow: 0 3px 10px rgba(140, 40, 40, 0.22);
}

.modal-footer .btn-danger:hover,
.modal-body .btn-danger:hover {
    background: #952e2e;
    border-color: #952e2e;
    transform: translateY(-1px);
}

.modal-footer .btn-outline-secondary,
.modal-body .btn-outline-secondary {
    border-color: #d0dce6;
    color: #4a6578;
    background: #fff;
}

.modal-footer .btn-outline-secondary:hover,
.modal-body .btn-outline-secondary:hover {
    background: #eef3f7;
    border-color: #b8c9d6;
    color: #2f4a5a;
}

/* Input group inside modal (copy link input) */
.modal-body .input-group .form-control {
    border-radius: 0.65rem 0 0 0.65rem;
    border-color: #d6dfe6;
    font-size: 0.875rem;
    padding: 0.5rem 0.85rem;
}

.modal-body .input-group .btn {
    border-radius: 0 0.65rem 0.65rem 0;
}

/* Animate modal in */
.modal.fade .modal-dialog {
    transform: translateY(-10px) scale(0.98);
    transition: transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.18s ease;
}

.modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}


/* ═══════════════════════════════════════════════════════
   Modern Admin Tables
   Scoped to .content-area — applies to all app tables,
   never touches landing pages or auth pages.
   ═══════════════════════════════════════════════════════ */

/* Card shell */
.content-area .card {
    border: 1px solid #e7edf2;
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(16, 30, 45, 0.04), 0 10px 26px rgba(16, 30, 45, 0.05);
    overflow: hidden;
    background: #fff;
}

.content-area .card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e6ecf1;
    padding: 0.9rem 1.2rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e2b36;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.content-area .card-body {
    padding: 1.25rem;
}

/* Table base — override Bootstrap defaults */
.content-area .table {
    margin: 0;
    width: 100%;
    font-size: 0.875rem;
    color: #1e2b36;
    border-collapse: collapse;
}

/* Remove Bootstrap's default cell borders and shadows */
.content-area .table > :not(caption) > * > * {
    border-bottom-width: 0;
    box-shadow: none;
    padding: 0;
}

/* ── Header ── */
.content-area .table thead {
    background: #f1f5f9;
    border-bottom: 1px solid #dfe6ee;
}

.content-area .table thead th {
    padding: 0.8rem 1.15rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    /* !important to beat Tabler's table-color variable on plain header cells. */
    color: #334155 !important;
    white-space: nowrap;
    border: none;
}

/* Sortable header links must read as strongly as plain header cells -
   the markup's Bootstrap .text-muted (forced to #7a92a4 with !important in the
   in-table override) otherwise washes them out, so match that with !important. */
.content-area .table thead th a,
.content-area .table thead th a.text-muted {
    color: #334155 !important;
    transition: color 0.12s ease;
}
.content-area .table thead th a:hover,
.content-area .table thead th a.text-muted:hover {
    color: #1e7d99 !important;
}
/* Sort-arrow icon: subtle, so it doesn't compete with the label. */
.content-area .table thead th .bi {
    color: #94a3b8;
}

/* ── Body rows ── */
.content-area .table tbody tr {
    border-bottom: 1px solid #eef2f6;
    transition: background 0.12s ease;
}

.content-area .table tbody tr:last-child {
    border-bottom: none;
}

.content-area .table tbody tr:hover {
    background: #eff6fb;
}

.content-area .table td {
    padding: 0.85rem 1.15rem;
    vertical-align: middle;
    border: none;
    color: #1e2b36;
    line-height: 1.45;
}

/* ── Code chips ── */
.content-area .table code {
    background: #edf2f7;
    color: #2f4f62;
    padding: 0.18rem 0.48rem;
    border-radius: 0.38rem;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    border: 1px solid #dce8f0;
}

/* ── Muted secondary text in cells ── */
.content-area .table .text-muted,
.content-area .table td.text-muted {
    color: #7a92a4 !important;
}

/* ── Empty state row ── */
.content-area .table td[colspan] {
    color: #7a92a4;
    font-size: 0.9rem;
}

/* ── Action column ── */
.content-area .table td.text-end {
    white-space: nowrap;
}

/* Tighten up action buttons inside tables */
.content-area .table .btn-sm {
    font-size: 0.775rem;
    padding: 0.3rem 0.65rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

/* ── Badges in tables ── */
.content-area .table .badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3em 0.65em;
    border-radius: 0.45rem;
    letter-spacing: 0.03em;
}

/* ── table-responsive: no extra border ── */
.content-area .table-responsive {
    border: none;
}

/* ── Phase 5 (F-009): wide data tables must SCROLL on narrow screens,
   not crush. Without a min-width, .table-responsive compresses columns
   until cells wrap one character per line (superadmin Companies/Users/
   Subscriptions were unreadable on mobile). A min-width forces the
   wrapper to scroll horizontally instead - the behavior the tenant
   Links table already had. ── */
.content-area .table-responsive > .table,
.content-area .table-responsive > table {
    min-width: 640px;
}

/* ── Phase 5 (F-014): ensure primary tap targets meet the ~44px
   minimum on touch screens. Scoped to action buttons + the language
   toggle; dense table-row icon buttons (.btn-sm) are intentionally
   excluded so data tables stay compact. ── */
@media (max-width: 575.98px) {
  .btn-topbar-primary,
  .btn-topbar-secondary,
  .btn-topbar-outline,
  .auth-submit,
  .lt-lang-switcher .lt-lang-toggle,
  .btn:not(.btn-sm):not(.btn-close) {
    min-height: var(--lt-touch-min);
  }
}

/* ── Section headings above cards ── */
.content-area h2 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #1a2b36;
}

.content-area h5, .content-area h6 {
    font-weight: 700;
    color: #1a2b36;
}


/* ═══════════════════════════════════════════════════════
   Compact page topbar — mirrors analytics overview style
   ═══════════════════════════════════════════════════════ */

.content-area .page-topbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.content-area .page-topbar-title {
    font-size: 1.5rem;
    font-weight: 750;
    letter-spacing: -0.01em;
    margin: 0;
    color: #1f2a37;
}

.content-area .page-topbar-subtitle {
    color: #64748b;
    margin-top: 0.15rem;
    font-size: 0.9rem;
}


/* ═══════════════════════════════════════════════════════
   Topbar action buttons — polished pill-style
   .btn-topbar-primary   = main CTA (gradient, lift)
   .btn-topbar-secondary = secondary action (soft fill)
   .btn-topbar-outline   = outline teal (back/edit links)
   ═══════════════════════════════════════════════════════ */

.btn-topbar-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.48rem 1.1rem;
    border-radius: 50rem;
    font-size: 0.85rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    background: linear-gradient(145deg, #2693b5 0%, #156a87 100%);
    color: #fff !important;
    border: none;
    box-shadow: 0 3px 10px rgba(30, 125, 153, 0.32), inset 0 1px 0 rgba(255,255,255,0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
}
.btn-topbar-primary:hover {
    background: linear-gradient(145deg, #2da5ca 0%, #1b7d9e 100%);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(30, 125, 153, 0.38), inset 0 1px 0 rgba(255,255,255,0.18);
    text-decoration: none !important;
}
.btn-topbar-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(30, 125, 153, 0.25);
}
.btn-topbar-primary:disabled,
.btn-topbar-primary.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.btn-topbar-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.48rem 1rem;
    border-radius: 50rem;
    font-size: 0.85rem;
    font-weight: 550;
    background: #f0f4f8;
    color: #3d5166 !important;
    border: 1px solid #d4dde8;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
}
.btn-topbar-secondary:hover {
    background: #e3ecf4;
    border-color: #b8c8d8;
    color: #24394e !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}
.btn-topbar-secondary:active {
    transform: translateY(0);
    background: #d8e5f0;
}

@media (max-width: 575.98px) {
    .btn-mobile-icon-only { padding: 0.55rem 0.7rem; gap: 0; }
    .btn-mobile-icon-only .btn-label { display: none; }
    .btn-mobile-icon-only i { font-size: 1.05rem; }
}

@media (max-width: 767.98px) {
    /* Right-edge fade signalling the table scrolls horizontally. */
    .content-area .table-responsive {
        position: relative;
        background-image: linear-gradient(to right, rgba(255,255,255,0) calc(100% - 38px), rgba(20,40,60,0.18) 100%);
        background-repeat: no-repeat;
        background-attachment: scroll;
    }
}

.btn-topbar-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.48rem 1rem;
    border-radius: 50rem;
    font-size: 0.85rem;
    font-weight: 550;
    background: transparent;
    color: var(--lt-primary) !important;
    border: 1.5px solid var(--lt-primary);
    transition: background 0.15s ease, transform 0.15s ease;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
}
.btn-topbar-outline:hover {
    background: rgba(30, 120, 80, 0.07);
    color: var(--lt-primary-hover) !important;
    border-color: var(--lt-primary-hover);
    transform: translateY(-1px);
    text-decoration: none !important;
}
.btn-topbar-outline:active {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════
   Standard Pagination Footer — Prev/Next with showing text
   Used on all paginated tables (card-footer variant)
   ═══════════════════════════════════════════════════════ */

.content-area .page-nav-footer {
    background: #fff;
    border-top: 1px solid #e8eef3;
    padding: 0.6rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.content-area .page-nav-footer .showing-label {
    font-size: 0.8rem;
    color: #7a92a4;
}

/* ── Mobile column priority (audit V-010): on phones the Links table keeps
   Title/Status/Clicks/Actions reachable by hiding the Organisation column;
   campaign/placement are still editable from the link's Edit page. ── */
@media (max-width: 767.98px) {
    .links-table .li-col-org { display: none; }
}

/* ── Tablet stat chips (audit V-012): between 576-991px the quota pills grow
   to fill the row (2x2 instead of a 3+1 orphan wrap). ── */
@media (min-width: 576px) and (max-width: 991.98px) {
    .quota-strip .quota-pill { flex: 1 1 40%; }
}

/* ── Flatpickr alt inputs are readonly by design (calendar opens on click) -
   without this they render disabled-gray next to white inputs (audit V-009). ── */
.content-area .flatpickr-input + .form-control[readonly] {
    background-color: #fff;
    cursor: pointer;
}

/* ── Footer social icons (URLs set in superadmin Platform Settings; an icon
   only renders when its URL is set - see _SocialFooterIcons.cshtml) ── */
.lt-social-icons {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    justify-content: center;
}
.lt-social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.15s ease;
}
.lt-social-icons--dark a {
    color: #cfe1ea;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
}
.lt-social-icons--dark a:hover {
    color: #fff;
    background: #1e7d99;
    border-color: #1e7d99;
    transform: translateY(-1px);
}
.lt-social-icons--light a {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.lt-social-icons--light a:hover {
    color: #fff;
    background: #1e7d99;
    border-color: #1e7d99;
}
.auth-footer .lt-social-icons { margin: 1rem 0 1.1rem; }


/* ═══════════════════════════════════════════════════════
   Flatpickr — green theme override (matches app accent)
   ═══════════════════════════════════════════════════════ */

.flatpickr-calendar {
    border-radius: 10px;
    border: 1px solid #d8e4ea;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    font-family: inherit;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: #1e7d99;
    color: #fff;
    border-radius: 10px 10px 0 0;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: #fff;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: rgba(255,255,255,0.8);
    fill: rgba(255,255,255,0.8);
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: #fff;
    fill: #fff;
}

.flatpickr-weekdays {
    background: #1e7d99;
}

span.flatpickr-weekday {
    background: #1e7d99;
    color: rgba(255,255,255,0.75);
    font-weight: 600;
    font-size: 0.75rem;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange,
.flatpickr-day.endRange:hover {
    background: #1e7d99;
    border-color: #1e7d99;
    color: #fff;
}

.flatpickr-day.today {
    border-color: #1e7d99;
}

.flatpickr-day.today:hover {
    background: #e8f2ee;
    border-color: #1e7d99;
    color: #1e7d99;
}

.flatpickr-day:hover {
    background: #e8f2ee;
}

.flatpickr-time input:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time .flatpickr-am-pm:focus {
    background: #e8f2ee;
}

.flatpickr-time .numInputWrapper span.arrowUp:after {
    border-bottom-color: #1e7d99;
}

.flatpickr-time .numInputWrapper span.arrowDown:after {
    border-top-color: #1e7d99;
}

/* Alt input — keep it visually consistent when Flatpickr is open */
.flatpickr-input.active + .form-control,
input.flatpickr-input[readonly] + .form-control {
    border-color: #1e7d99;
    box-shadow: 0 0 0 0.2rem rgba(30,125,153,0.15);
}

/* ═══════════════════════════════════════════════════════
   Quota Strip & Pills — shared across all TenantAdmin pages
   ═══════════════════════════════════════════════════════ */
.quota-strip {
    display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: stretch;
}
.quota-pill {
    display: flex; flex-direction: column; justify-content: space-between;
    border: 1px solid #c3d0da; border-radius: 0.7rem;
    background: #fff; padding: 0.6rem 0.8rem;
    min-width: 185px;
    box-shadow: 0 4px 12px rgba(16, 30, 45, 0.09), 0 1px 3px rgba(16, 30, 45, 0.05);
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
@media (max-width: 575.98px) {
    /* One stat card per row on mobile so labels and values never wrap. */
    .quota-strip { justify-content: stretch; gap: 0.45rem; }
    .quota-pill { flex: 1 1 100%; min-width: 0; width: 100%; padding: 0.6rem 0.9rem; }
    .quota-pill .quota-pill-label { font-size: 0.62rem; margin-bottom: 0.2rem; }
    .quota-pill .quota-pill-value { font-size: 0.95rem; }
    .quota-pill .quota-pill-icon { width: 26px; height: 26px; font-size: 0.85rem; }
}
.quota-pill:hover {
    box-shadow: 0 8px 22px rgba(16, 30, 45, 0.14), 0 2px 6px rgba(16, 30, 45, 0.07);
    transform: translateY(-2px);
    border-color: #a8bbc9;
}
.quota-pill--danger { border-color: #fca5a5; background: #fff8f8; }
.quota-pill-icon {
    width: 30px; height: 30px; border-radius: 0.45rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
}
.quota-pill-icon--violet { background: #ede9fe; color: #7c3aed; }
.quota-pill-icon--blue   { background: #dbeafe; color: #1d4ed8; }
.quota-pill-icon--green  { background: #dcfce7; color: #16a34a; }
.quota-pill-icon--amber  { background: #fef3c7; color: #d97706; }
.quota-pill-icon--danger { background: #fee2e2; color: #b91c1c; }
.quota-pill-label {
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; color: #334155; line-height: 1; margin-bottom: 0.25rem;
}
.quota-pill-value {
    font-size: 0.85rem; font-weight: 800; color: #162535; line-height: 1.2;
}
.quota-pill-value--danger { color: #b91c1c; }
.quota-pill-bar {
    height: 4px; border-radius: 2px; background: #e8eef3; overflow: hidden; margin-top: 0.5rem;
}
.quota-pill-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.quota-pill-upgrade {
    margin-top: 0.3rem; font-size: 0.7rem;
}
.quota-pill-upgrade a {
    color: #b91c1c; text-decoration: none; font-weight: 600;
}
.quota-pill-upgrade a:hover { text-decoration: underline; }
.quota-click-warning {
    font-size: 0.78rem; font-weight: 500; padding: 0.35rem 0.6rem;
    border-radius: 0.4rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.15rem;
}
.quota-click-warning--amber { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.quota-click-warning--danger { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.quota-click-upgrade-btn {
    display: inline-block; padding: 0.15rem 0.5rem; border-radius: 0.3rem;
    font-size: 0.72rem; font-weight: 700; text-decoration: none; white-space: nowrap;
    background: #1e7d99; color: #fff;
}
.quota-click-upgrade-btn:hover { background: #186d87; color: #fff; text-decoration: none; }

/* ── Contextual help icons ───────────────────────────────────────────── */
.help-icon { font-size: 0.62rem; color: #adc4d2; cursor: pointer; vertical-align: middle; }
.help-icon:hover { color: #4a7a95; }

/* ── Forms: tighter vertical rhythm ─────────────────────────────────── */
form .mb-3 { margin-bottom: 0.5rem !important; }
form .mb-4 { margin-bottom: 0.75rem !important; }
form .form-label { margin-bottom: 0.22rem !important; }

/* ── Forms: validation & helper text ────────────────────────────────── */
span[data-valmsg-for] {
    display: block;
    min-height: 1.4em;
    margin-top: 0.15rem;
    font-size: 0.82rem;
    line-height: 1.4;
}
.form-hint {
    font-size: 0.82rem;
    color: #6c757d;
    margin-top: 0.15rem;
}
/* ── Required-field asterisk: keep inline with label text ───────────── */
.form-label .text-danger { display: inline; }
.validation-summary-valid {
    display: none;
}

/* ═══════════════════════════════════════════════════════
   Password toggle — hide native browser reveal button
   ═══════════════════════════════════════════════════════ */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

/* ═══════════════════════════════════════════════════════
   Max-width constraint for large screens
   ═══════════════════════════════════════════════════════ */
@media (min-width: 1600px) {
    .content-area > *:not(.modal):not(.modal-backdrop):not(.toast-container) {
        max-width: 1440px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ═══════════════════════════════════════════════════════
   Subtle badges: add a tinted border so status pills like
   Active / Paused / Expired / Pending are clearly visible
   on white backgrounds. Without the border the pale fills
   blend into the page. One global rule covers every
   .badge.bg-*-subtle in the app.
   ═══════════════════════════════════════════════════════ */
.badge.bg-success-subtle   { border: 1px solid #a8d8b9; }
.badge.bg-warning-subtle   { border: 1px solid #e0c47a; }
.badge.bg-danger-subtle    { border: 1px solid #e8b0b0; }
.badge.bg-info-subtle      { border: 1px solid #a8cee0; }
.badge.bg-primary-subtle   { border: 1px solid #aac6e0; }
.badge.bg-secondary-subtle { border: 1px solid #c2cdd6; }
.badge.bg-light            { border: 1px solid #d4dde4; }

/* Assign modal — allow Tom Select dropdown to overflow the modal bounds */
#assignModal .modal-content {
    overflow: visible;
}
/* Re-apply border-radius to header/footer since modal-content no longer clips them */
#assignModal .modal-header {
    border-radius: calc(1.15rem - 1px) calc(1.15rem - 1px) 0 0;
}
#assignModal .modal-footer {
    border-radius: 0 0 calc(1.15rem - 1px) calc(1.15rem - 1px);
}

/* Prevent the search input from causing double-height in these selects */
#assignModal .ts-control {
    flex-wrap: nowrap !important;
}
#assignModal .ts-control > input {
    min-width: 0 !important;
}

/* ── Feature gate overlay (blur + lock) ───────────────────────── */
.feature-gate-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 0 0 .6rem .6rem;
    min-height: 165px;
}
.feature-gate-content {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
    opacity: .65;
}
.feature-gate-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(246, 250, 253, 0.82);
    backdrop-filter: blur(2px);
    text-align: center;
    padding: 1.5rem;
    gap: .4rem;
}
.feature-gate-overlay .fgo-icon {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background: #e8eeff;
    color: #3352b0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: .3rem;
}
.feature-gate-overlay .fgo-title {
    font-weight: 700;
    font-size: .92rem;
    color: #1a2b36;
}
.feature-gate-overlay .fgo-desc {
    font-size: .8rem;
    color: #5a7a8e;
    max-width: 280px;
    line-height: 1.45;
}

/* ── Locked sidebar nav items ─────────────────────────────────── */
.nav-link-locked {
    opacity: 0.5;
    pointer-events: auto;
}
.nav-link-locked:hover {
    opacity: 0.75 !important;
}
.nav-link-locked .nav-link-lock {
    margin-left: auto;
    font-size: .6rem;
    color: #8fa5b5;
}
/* "Coming soon" chip — used when a feature isn't available in the current release. */
.nav-link .nav-link-soon {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(234, 241, 246, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

/* ── Topbar action buttons ────────────────────────────────────── */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    height: 34px;
    padding: 0 .75rem;
    border-radius: 999px;
    border: 1.5px solid #dce5ec;
    background: #f4f8fb;
    color: #4a5a6a;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
    text-decoration: none;
}
.topbar-btn i {
    font-size: .95rem;
    line-height: 1;
}
.topbar-btn:hover {
    background: #e6f0f6;
    border-color: #b8cdd8;
    color: #1e3a4a;
    box-shadow: 0 1px 6px rgba(16,30,45,.09);
}
.topbar-btn:active {
    background: #d4e7f2;
    border-color: #a3c0d0;
}

/* Icon-only variant (tutorial ?) */
.topbar-btn:not(.topbar-btn-lang):not(.topbar-btn-logout) {
    width: 34px;
    padding: 0;
    justify-content: center;
}

/* Language: flag + code */
.topbar-lang-badge {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .03em;
}
/* Hide dropdown arrow Bootstrap adds */
.topbar-btn-lang.dropdown-toggle::after { display: none; }

/* Logout: subtle red tint on hover */
.topbar-btn-logout:hover {
    background: #fff0f0;
    border-color: #f5b8b8;
    color: #c0392b;
}

/* Tutorial active state — keep existing glow but pill-shaped */
.topbar-btn.tutorial-btn-active {
    background: var(--tut-dot-color) !important;
    border-color: var(--tut-dot-color) !important;
    color: #fff !important;
}

/* ── Shared filter bar secondary row ── */
.lf-sort-row {
    border-top: 1px solid #edf0f4;
    padding-top: 0.5rem;
}
.lf-sort-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #334155; /* slate-700 - matches .ta-filter-label exactly, so every filter field
                        (row 1 or row 2) reads as one consistent style */
    white-space: nowrap;
}
.lf-sort-select {
    width: auto !important;
    min-width: 7rem;
    font-size: 0.8rem;
}
.lf-pagesize-select {
    min-width: 4.5rem;
}

/* Date range control (2026-07-06) - a native <input type="date"> needs real room to show
   "mm/dd/yyyy" plus the calendar-picker icon without clipping; grouped under one "Date range"
   label (same lf-sort-group/lf-sort-controls pattern as Sort+Direction) so it wraps as a single
   unit on narrow screens instead of the two inputs splitting apart mid-row. */
.lf-date-range-controls {
    flex-wrap: wrap;
}
.lf-date-input {
    width: auto !important;
    min-width: 9.5rem;
    font-size: 0.8rem;
}
.lf-date-range-sep {
    font-size: 0.76rem;
    color: #64748b;
    white-space: nowrap;
}
@media (max-width: 575.98px) {
    .lf-date-input {
        min-width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════
   Mobile UI audit fixes - 2026-05-21
   Touch-target and consistency fixes from audit/REPORT.md
   ═══════════════════════════════════════════════════════ */

/* M6 - keep a filter label and its control together when the row wraps.
   Label-above-control, to match .ta-filter-label's row-1 layout - every filter field in a
   .ta-filter-bar now looks the same regardless of which row it's in (2026-07-05 consistency pass). */
.lf-sort-group {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}
/* Groups with more than one control (e.g. Sort + Direction) keep those controls side by
   side under their single shared label. */
.lf-sort-group .lf-sort-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* H2 - enlarge the "?" popover help trigger to a real tap target.
   The glyph keeps its context size (proportional to the label it sits
   next to); the invisible ::after provides the 40x40 tap area. */
[data-bs-toggle="popover"] {
    cursor: pointer;
}
i[data-bs-toggle="popover"] {
    position: relative;
}
i[data-bs-toggle="popover"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
}

/* M9 - enlarge the modal close button tap area to 44x44 (kept; the parent's
   `position: absolute` at line 357 still establishes the positioning context). */
.modal-header .btn-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
}

/* L6 - make the whole password-toggle box clickable, min 44x44 */
.input-group-text .js-password-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -0.375rem -0.75rem;
    padding: 0.375rem 0.75rem;
    min-width: 44px;
    min-height: 44px;
}

@media (max-width: 767.98px) {
    /* L7 - UTM parameter inputs match the rest of the form */
    input[data-utm] {
        min-height: 44px;
    }

    /* M1 - filter-bar controls reach the 44px touch-target minimum */
    .content-area .ta-filter-bar .form-control,
    .content-area .ta-filter-bar .form-select,
    .content-area .ta-filter-bar .btn {
        min-height: 44px;
    }
    .content-area .ta-filter-bar .ta-filter-actions .btn {
        min-width: 44px;
    }

    /* H3 - table row action buttons reach 44x44 */
    .content-area .table-responsive .btn-sm {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    /* M3 - top-bar buttons and language menu items reach 44px */
    .topbar-btn {
        height: 44px;
    }
    .topbar-btn:not(.topbar-btn-lang):not(.topbar-btn-logout) {
        width: 44px;
    }
    .navbar-actions .dropdown-menu .dropdown-item {
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* M4 - 2x2 stat cards share a height so the grid stays even */
    .quota-pill {
        min-height: 84px;
    }

    /* L5 - icon-only download button reaches 44x44 */
    .btn-mobile-icon-only {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
