/* ════════════════════════════════════════════════════════════════════════════
   TechFlow — mobile app skin + PWA components + modern auth screens
   Layout language: floating gradient pill nav, glass cards, bottom sheets.
   Mobile mode is everything below the Argon sidenav breakpoint (<1200px).
   ════════════════════════════════════════════════════════════════════════════ */

:root {
  --tf-bg1: #dfe8ff;
  --tf-bg2: #eef2ff;
  --tf-bg3: #f6f1ff;
  --tf-ink: #1f2340;
  --tf-muted: #6b7194;
  --tf-line: #e4e8f7;
  --tf-p1: #4a6cf7;
  --tf-p2: #8b5cf6;
  --tf-grad: linear-gradient(135deg, #4a6cf7 0%, #6b63f0 50%, #8b5cf6 100%);
  --tf-grad-h: linear-gradient(90deg, #4a6cf7 0%, #6f60f3 55%, #8b5cf6 100%);
  --tf-card: rgba(255, 255, 255, .86);
  --tf-radius: 22px;
  --tf-shadow: 0 16px 36px -20px rgba(60, 72, 190, .38);
  --tf-appbar-h: 64px;
  --tf-nav-h: 68px;
  --tf-safe-t: env(safe-area-inset-top, 0px);
  --tf-safe-b: env(safe-area-inset-bottom, 0px);
}

.tf-mobile-only { display: none; }

/* ───────────────────────── Buttons shared by sheets / install ───────────────────────── */
.tf-btn-grad,
.tf-btn-soft {
  display: flex; align-items: center; justify-content: center; gap: .55rem;
  width: 100%; min-height: 52px; padding: 0 20px; border: 0; border-radius: 18px;
  font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease;
}
.tf-btn-grad { color: #fff; background: var(--tf-grad); box-shadow: 0 16px 28px -14px rgba(94, 114, 228, .95); }
.tf-btn-grad:active, .tf-btn-soft:active { transform: scale(.98); }
.tf-btn-soft { color: var(--tf-p1); background: #eef1ff; }
.tf-btn-soft--danger { color: #e5484d; background: #fdecec; }

/* ───────────────────────── Install banner ───────────────────────── */
.tf-install {
  position: fixed; left: 14px; right: 14px; bottom: calc(14px + var(--tf-safe-b)); z-index: 1045;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .95); border-radius: 22px;
  box-shadow: 0 24px 50px -18px rgba(50, 60, 170, .55);
  transform: translateY(24px); opacity: 0; transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .3s;
  max-width: 460px; margin-inline: auto;
}
.tf-install[hidden] { display: none; }
.tf-install.show { transform: none; opacity: 1; }
.tf-install img { border-radius: 14px; flex-shrink: 0; }
.tf-install__txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.tf-install__txt strong { font-size: .95rem; color: var(--tf-ink); }
.tf-install__txt span { font-size: .74rem; color: var(--tf-muted); }
.tf-install__btn {
  border: 0; border-radius: 14px; padding: 10px 18px; font-weight: 700; font-size: .85rem; color: #fff;
  background: var(--tf-grad); box-shadow: 0 10px 20px -10px rgba(94, 114, 228, .9); flex-shrink: 0;
}
.tf-install__x { border: 0; background: transparent; color: #9aa0bf; width: 28px; height: 28px; flex-shrink: 0; }
.tf-has-nav .tf-install { bottom: calc(var(--tf-nav-h) + 30px + var(--tf-safe-b)); }

/* ───────────────────────── Rotate guard (phones, landscape) ───────────────────────── */
.tf-rotate-lock {
  display: none; position: fixed; inset: 0; z-index: 99999; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 24px; color: var(--tf-ink);
  background: linear-gradient(160deg, var(--tf-bg1), var(--tf-bg2) 50%, var(--tf-bg3));
}
.tf-rotate-lock img { border-radius: 20px; box-shadow: 0 12px 28px -10px rgba(70, 80, 200, .5); }
.tf-rotate-lock span { color: var(--tf-muted); font-size: .9rem; }
@media (orientation: landscape) and (max-height: 520px) and (max-width: 950px) {
  .tf-rotate-lock { display: flex; }
}

/* ───────────────────────── Bottom sheets ───────────────────────── */
.tf-sheet { position: fixed; inset: 0; z-index: 1060; display: flex; align-items: flex-end; justify-content: center; }
.tf-sheet[hidden] { display: none; }
.tf-sheet__backdrop {
  position: absolute; inset: 0; z-index: 0; background: rgba(31, 35, 64, .45);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .28s;
}
.tf-sheet.show .tf-sheet__backdrop { opacity: 1; }
.tf-sheet__panel {
  position: relative; z-index: 1; width: 100%; max-width: 560px; max-height: 88dvh; overflow: hidden;
  display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .97); border-radius: 30px 30px 0 0;
  box-shadow: 0 -20px 60px -20px rgba(40, 50, 160, .45);
  padding: 10px 18px calc(18px + var(--tf-safe-b));
  transform: translateY(100%); transition: transform .38s cubic-bezier(.2, .85, .2, 1);
}
.tf-sheet.show .tf-sheet__panel { transform: none; }
.tf-sheet.dragging .tf-sheet__panel { transition: none; }
.tf-sheet__grab { display: block; width: 44px; height: 5px; border-radius: 5px; background: #d6dbf0; margin: 4px auto 12px; flex-shrink: 0; touch-action: none; }
.tf-sheet__body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.tf-sheet__title { font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: #9aa0bf; margin: 14px 4px 10px; }
.tf-sheet__title:first-child { margin-top: 4px; }
.tf-sheet__icon { display: block; margin: 0 auto 8px; border-radius: 16px; }
.tf-sheet--ios .tf-sheet__panel { text-align: center; }
.tf-sheet--ios h3 { font-size: 1.2rem; font-weight: 800; color: var(--tf-ink); margin-bottom: 14px; }
.tf-ios-steps { list-style: none; margin: 0 0 18px; padding: 0; text-align: left; display: grid; gap: 10px; }
.tf-ios-steps li { display: flex; align-items: center; gap: 12px; font-size: .92rem; color: var(--tf-ink); background: #f3f5ff; border-radius: 16px; padding: 12px 14px; }
.tf-ios-steps li span { width: 36px; height: 36px; border-radius: 12px; background: #fff; color: var(--tf-p1); display: grid; place-items: center; box-shadow: 0 6px 14px -8px rgba(60, 72, 190, .5); flex-shrink: 0; }

/* Menu tiles inside the "More" sheet */
.tf-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.tf-tile-form { display: contents; }
.tf-tile {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 6px 2px;
  background: none; border: 0; text-decoration: none; color: var(--tf-ink); font: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tf-tile__ic {
  width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; font-size: 1.15rem;
  color: var(--tf-p1); background: linear-gradient(145deg, #f0f3ff, #e6eaff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 8px 16px -12px rgba(60, 72, 190, .6);
  transition: transform .15s ease;
}
.tf-tile:active .tf-tile__ic { transform: scale(.92); }
.tf-tile__tx { font-size: .72rem; font-weight: 600; text-align: center; line-height: 1.15; color: #3d4268; max-width: 76px; }
.tf-tile.is-active .tf-tile__ic { color: #fff; background: var(--tf-grad); box-shadow: 0 12px 20px -10px rgba(94, 114, 228, .9); }
.tf-tile--danger .tf-tile__ic { color: #e5484d; background: linear-gradient(145deg, #fff0f0, #fde3e3); }
.tf-tile--danger .tf-tile__tx { color: #c93a3f; }
.tf-tile[hidden] { display: none; }

/* Profile sheet */
.tf-me { display: flex; align-items: center; gap: 14px; padding: 6px 4px 16px; }
.tf-me img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; box-shadow: 0 10px 20px -10px rgba(60, 72, 190, .6); border: 3px solid #fff; }
.tf-me div { display: flex; flex-direction: column; min-width: 0; }
.tf-me strong { font-size: 1.05rem; color: var(--tf-ink); }
.tf-me span { font-size: .8rem; color: var(--tf-muted); overflow: hidden; text-overflow: ellipsis; }
.tf-me em { font-style: normal; font-size: .72rem; font-weight: 700; color: #b7791f; margin-top: 4px; }
.tf-list { display: grid; gap: 8px; margin-bottom: 14px; }
.tf-list a, .tf-list button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-radius: 18px;
  background: #f4f6ff; color: var(--tf-ink); font: inherit; font-weight: 600; font-size: .92rem; text-decoration: none; text-align: left;
}
.tf-list a > i:first-child, .tf-list button > i:first-child { width: 22px; text-align: center; color: var(--tf-p1); }
.tf-list a > i:last-child, .tf-list button > i:last-child { margin-left: auto; font-size: .7rem; color: #b3b8d3; }
.tf-list [hidden] { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE APP MODE  (< 1200px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1199.98px) {

  html { background: var(--tf-bg1); overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; }
  body { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  body.g-sidenav-show.bg-gray-100,
  body.bg-gray-100 {
    background: linear-gradient(165deg, var(--tf-bg1) 0%, var(--tf-bg2) 38%, var(--tf-bg3) 100%) fixed !important;
  }
  body.g-sidenav-show.bg-gray-100::before {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
      radial-gradient(240px 240px at 92% 6%,  rgba(139, 92, 246, .20), transparent 70%),
      radial-gradient(300px 300px at -4% 38%, rgba(74, 108, 247, .17), transparent 70%),
      radial-gradient(280px 280px at 104% 82%, rgba(56, 189, 248, .15), transparent 70%);
  }
  .min-h-screen.bg-gray-100 { background: transparent !important; }

  /* hide the desktop chrome */
  #sidenav-main, #navbarBlur, .fixed-plugin, .min-height-300.bg-dark, footer.footer, #iconNavbarSidenav { display: none !important; }
  .tf-mobile-only { display: block; }
  .tf-appbar.tf-mobile-only, .tf-nav.tf-mobile-only, .tf-sheet.tf-mobile-only { display: flex; }
  .tf-sheet[hidden] { display: none !important; }

  .main-content {
    position: relative; z-index: 1; margin: 0 !important; border-radius: 0 !important;
    padding: calc(var(--tf-appbar-h) + var(--tf-safe-t) + 10px) 14px calc(var(--tf-nav-h) + 44px + var(--tf-safe-b)) !important;
    min-height: 100dvh;
  }
  .main-content > .container-fluid, .main-content .container-fluid { padding-left: 0 !important; padding-right: 0 !important; }
  .main-content .row { --bs-gutter-x: 12px; }

  /* ── Impersonation strip ── */
  .tf-imp { position: fixed; top: var(--tf-safe-t); left: 0; right: 0; z-index: 1041; margin: 0; }
  .tf-imp button { width: 100%; border: 0; padding: 7px 12px; font-size: .72rem; font-weight: 700; color: #fff; background: linear-gradient(90deg, #fb8c00, #f4511e); }

  /* ── App bar ── */
  .tf-appbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1040;
    height: calc(var(--tf-appbar-h) + var(--tf-safe-t)); padding: var(--tf-safe-t) 14px 0;
    align-items: center; justify-content: space-between; gap: 10px;
    background: var(--tf-bg1);
  }
  .tf-appbar__biz { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
  .tf-appbar__biz img { width: 40px; height: 40px; border-radius: 14px; background: #fff; padding: 3px; box-shadow: 0 8px 18px -10px rgba(60, 72, 190, .6); flex-shrink: 0; }
  .tf-appbar__name { font-size: 1.12rem; font-weight: 800; color: var(--tf-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
  .tf-appbar__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
  .tf-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: #fff;
    font-size: .72rem; font-weight: 800; color: var(--tf-ink); text-decoration: none;
    box-shadow: 0 8px 18px -12px rgba(60, 72, 190, .6);
  }
  .tf-chip i { color: #f5b301; font-size: .72rem; }
  .tf-avatar { width: 40px; height: 40px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: #fff; overflow: hidden; box-shadow: 0 8px 18px -10px rgba(60, 72, 190, .6); }
  .tf-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

  /* ── Floating gradient pill navigation ── */
  .tf-nav {
    position: fixed; left: 14px; right: 14px; bottom: calc(14px + var(--tf-safe-b)); z-index: 1035;
    height: var(--tf-nav-h); padding: 0 8px; align-items: center; justify-content: space-around;
    max-width: 560px; margin-inline: auto;
    background: var(--tf-grad-h); border-radius: 28px;
    box-shadow: 0 22px 40px -14px rgba(74, 108, 247, .7), inset 0 1px 0 rgba(255, 255, 255, .38);
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  }
  .tf-nav__item {
    position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: rgba(255, 255, 255, .74); text-decoration: none; font: inherit; padding: 0;
    transition: color .2s ease, transform .2s ease;
  }
  .tf-nav__item i { font-size: 1.12rem; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
  .tf-nav__item span { font-size: .66rem; font-weight: 700; letter-spacing: .01em; }
  .tf-nav__item:active { transform: scale(.94); }
  .tf-nav__item.is-active { color: #fff; }
  .tf-nav__item.is-active i { transform: translateY(-2px) scale(1.12); }
  .tf-nav__item.is-active::before {
    content: ''; position: absolute; top: 9px; width: 46px; height: 32px; border-radius: 14px; background: rgba(255, 255, 255, .18);
  }
  .tf-nav__item.is-active::after {
    content: ''; position: absolute; bottom: 7px; width: 4px; height: 4px; border-radius: 50%; background: #fff;
  }
  .tf-nav__item i, .tf-nav__item span { position: relative; z-index: 1; }

  /* ── Page chrome ── */
  .main-content h6, .main-content .h6 { color: var(--tf-ink); }
  .main-content p.text-secondary, .main-content .text-secondary { color: var(--tf-muted) !important; }

  /* ── Cards: glass, no borders ── */
  .main-content .card {
    border: 0 !important; border-radius: var(--tf-radius) !important; background: var(--tf-card) !important;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--tf-shadow) !important; margin-bottom: 14px;
  }
  .main-content .card-header { background: transparent !important; border: 0 !important; padding: 18px 18px 8px !important; }
  .main-content .card-body { padding: 14px 18px 18px; }
  .main-content .card-body.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
  .main-content .card.border-0.shadow-sm { box-shadow: var(--tf-shadow) !important; }
  .main-content .card-header .d-flex.flex-wrap { gap: 12px !important; }
  .main-content .card-header .d-flex.flex-grow-1 { max-width: 100% !important; width: 100%; flex-wrap: wrap; }
  .main-content .card-header .input-group { max-width: 100% !important; flex: 1 1 100%; }
  .main-content .card-header [style*="min-width: 130px"] { flex: 1 1 40%; }
  .main-content .card-header .btn { flex: 1 1 auto; }

  /* ── Buttons ── */
  .main-content .btn { border-radius: 14px; font-weight: 700; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; letter-spacing: 0; text-transform: none; }
  .main-content .btn-sm { min-height: 38px; font-size: .8rem; padding: 0 14px; }
  .main-content .btn.bg-gradient-primary,
  .main-content .btn-primary,
  .main-content .btn.bg-gradient-info {
    background-image: var(--tf-grad) !important; background-color: #6b63f0 !important; border: 0 !important; color: #fff !important;
    box-shadow: 0 14px 22px -12px rgba(94, 114, 228, .9) !important;
  }
  .main-content .btn-outline-primary { background: #eef1ff !important; border: 0 !important; color: var(--tf-p1) !important; }
  .main-content .btn-outline-danger { background: #fdecec !important; border: 0 !important; color: #e5484d !important; }
  .main-content .btn-outline-secondary, .main-content .btn-light { background: #f1f3fb !important; border: 0 !important; color: #4a5078 !important; }
  .main-content .btn-secondary { background: #e9ecf8 !important; border: 0 !important; color: #3d4268 !important; box-shadow: none !important; }
  .main-content .btn:active { transform: scale(.97); }
  .main-content .bg-gradient-primary:not(.btn) { background-image: var(--tf-grad) !important; }

  /* ── Forms ── */
  .main-content .form-control,
  .main-content .form-select,
  .main-content select.form-control,
  .main-content textarea.form-control {
    font-size: 16px !important; min-height: 48px; border-radius: 14px; border: 1.5px solid var(--tf-line); background: #fff; color: var(--tf-ink);
    padding: 10px 14px; box-shadow: none;
  }
  .main-content textarea.form-control { min-height: 96px; }
  .main-content .form-select-sm, .main-content .form-control-sm { min-height: 42px; font-size: 16px !important; border-radius: 12px; }
  .main-content .form-control:focus, .main-content .form-select:focus {
    border-color: var(--tf-p1); box-shadow: 0 0 0 4px rgba(74, 108, 247, .14);
  }
  .main-content .input-group { flex-wrap: nowrap; }
  .main-content .input-group .input-group-text { border: 1.5px solid var(--tf-line); background: #f6f7ff; border-radius: 14px 0 0 14px; }
  .main-content .input-group .form-control { border-radius: 0 14px 14px 0; }
  .main-content .input-group .btn { border-radius: 0 14px 14px 0; }
  .main-content label, .main-content .form-label { font-size: .7rem; font-weight: 800; color: #6b7194; letter-spacing: .04em; }
  .main-content .form-check-input { width: 2.4em; height: 1.3em; }

  /* ── Badges / alerts / progress ── */
  .main-content .badge { border-radius: 999px; padding: .5em .95em; font-weight: 700; letter-spacing: .02em; text-transform: none; }
  .main-content .alert { border: 0; border-radius: 18px; padding: 14px 16px; }
  .main-content .progress { border-radius: 99px; overflow: hidden; }

  /* ── Tabs / pills → scrollable segmented control ── */
  .main-content .nav-pills, .main-content .nav-tabs {
    flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 5px; border: 0; background: rgba(255, 255, 255, .75);
    border-radius: 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .main-content .nav-pills::-webkit-scrollbar, .main-content .nav-tabs::-webkit-scrollbar { display: none; }
  .main-content .nav-pills .nav-link, .main-content .nav-tabs .nav-link {
    border: 0; border-radius: 14px; white-space: nowrap; padding: 9px 16px; font-weight: 700; font-size: .82rem; color: #5b6180;
  }
  .main-content .nav-pills .nav-link.active, .main-content .nav-tabs .nav-link.active {
    background: #fff !important; background-image: none !important; color: var(--tf-p1) !important; box-shadow: 0 8px 16px -10px rgba(60, 72, 190, .6);
  }

  /* ── Dropdowns ── */
  .main-content .dropdown-menu { border: 0; border-radius: 18px; padding: 8px; box-shadow: 0 24px 48px -16px rgba(40, 50, 160, .45); }
  .main-content .dropdown-item { border-radius: 12px; padding: 11px 14px; font-weight: 600; }

  /* ── Pagination ── */
  .main-content .pagination { gap: 6px; justify-content: center; flex-wrap: wrap; }
  .main-content .page-link { border: 0; border-radius: 12px !important; min-width: 40px; min-height: 40px; display: grid; place-items: center; font-weight: 700; color: #4a5078; background: #f1f3fb; }
  .main-content .page-item.active .page-link { background: var(--tf-grad); color: #fff; }

  /* ── Modals → bottom sheets (all widths < 1200 keeps a consistent app feel) ── */
  .modal.show, .modal.show.d-block { display: flex !important; align-items: flex-end; padding: 0 !important; background-color: rgba(31, 35, 64, .5) !important; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
  .modal-dialog, .modal-dialog.modal-dialog-centered, .modal-dialog.modal-lg, .modal-dialog.modal-xl {
    margin: 0 auto !important; width: 100%; max-width: 640px !important; min-height: 0 !important; align-items: flex-end !important;
  }
  .modal-content {
    border: 0 !important; border-radius: 30px 30px 0 0 !important; max-height: 92dvh; overflow: hidden; display: flex; flex-direction: column;
    animation: tf-sheet-up .36s cubic-bezier(.2, .85, .2, 1);
  }
  .modal-content > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
  .modal-header { border: 0 !important; padding: 18px 20px !important; border-radius: 30px 30px 0 0; }
  .modal-header.bg-gradient-primary { background-image: var(--tf-grad) !important; }
  .modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 20px !important; }
  .modal-footer { border: 0 !important; padding: 12px 20px calc(16px + var(--tf-safe-b)) !important; gap: 10px; background: #fff; }
  .modal-footer .btn { flex: 1 1 0; margin: 0 !important; }
  .modal .row.g-3 > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  .modal .row.g-3 > .col-4, .modal .row.g-3 > .col-6 { flex: 0 0 50%; max-width: 50%; }
  .modal .row.g-3 > .col-12 { flex: 0 0 100%; max-width: 100%; }

  /* ── Tables: horizontal scroll on tablets ── */
  .main-content .table-responsive { border-radius: 0 0 var(--tf-radius) var(--tf-radius); -webkit-overflow-scrolling: touch; }
  .main-content table.table thead th { background: rgba(244, 246, 255, .8); border: 0 !important; }
  .main-content table.table td { border-color: #eef0fa; }
}

@keyframes tf-sheet-up { from { transform: translateY(70px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ───────────────────────── Phones: tables become cards ───────────────────────── */
@media (max-width: 767.98px) {
  .main-content .table-responsive { overflow: visible; padding: 0 12px 6px !important; }
  table.tf-stack, table.tf-stack tbody { display: block; width: 100%; background: transparent; }
  table.tf-stack thead { display: none; }
  table.tf-stack tr {
    display: block; position: relative; background: #fff; border-radius: 20px; margin: 0 0 12px; padding: 4px 16px 6px;
    box-shadow: 0 12px 26px -18px rgba(60, 72, 190, .45);
  }
  table.tf-stack td {
    display: flex !important; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
    padding: 11px 0 !important; border: 0 !important; border-bottom: 1px dashed #edf0fb !important;
    text-align: right !important; min-height: 0; background: transparent !important;
  }
  table.tf-stack td:last-child { border-bottom: 0 !important; }
  table.tf-stack td::before {
    content: attr(data-label); flex-shrink: 0; max-width: 42%; font-size: .66rem; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: #9aa0bf; text-align: left;
  }
  table.tf-stack td[data-label=""]::before,
  table.tf-stack td.tf-first::before,
  table.tf-stack td[colspan]::before { display: none; }
  table.tf-stack td.tf-first { display: block !important; text-align: left !important; padding-top: 14px !important; }
  table.tf-stack td.tf-first > div { padding: 0 !important; }
  table.tf-stack td.tf-first h6 { font-size: 1rem; }
  table.tf-stack td.tf-act { justify-content: flex-end; gap: 8px; padding-bottom: 12px !important; }
  table.tf-stack td.tf-act .btn { min-height: 38px; padding: 0 16px; }
  table.tf-stack td[colspan] { display: block !important; text-align: center !important; padding: 28px 8px !important; }
  table.tf-stack td input, table.tf-stack td select, table.tf-stack td .form-control { width: 100%; min-width: 0; }
  table.tf-stack td > div { max-width: 100%; }
  table.tf-stack td .d-flex.px-3 { padding-left: 0 !important; padding-right: 0 !important; }
}

/* ───────────────────────── Owner dashboard — mobile blocks ───────────────────────── */
.tf-dash-m { display: none; }
@media (max-width: 1199.98px) {
  .tf-dash-m { display: block; }
  .tf-desktop-only { display: none !important; }

  .tf-plan {
    display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; margin-bottom: 14px; border-radius: 22px; color: #fff;
    background: var(--tf-grad-h); box-shadow: 0 18px 32px -16px rgba(74, 108, 247, .8); text-decoration: none;
  }
  .tf-plan__ic { font-size: 1.6rem; color: #ffd75e; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .2)); }
  .tf-plan__tx { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
  .tf-plan__tx strong { font-size: .95rem; color: #fff; }
  .tf-plan__tx span { font-size: .72rem; opacity: .85; color: #fff; }
  .tf-plan__btn { background: #fff; color: var(--tf-p1); font-weight: 800; font-size: .8rem; padding: 10px 16px; border-radius: 14px; }

  .tf-kpi-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; margin-bottom: 18px; }
  .tf-kpi-main { padding: 18px 16px; border-radius: 24px; background: linear-gradient(160deg, #e6eaff, #eef0ff); box-shadow: var(--tf-shadow); display: flex; flex-direction: column; gap: 14px; text-decoration: none; }
  .tf-kpi-main label { display: block; font-size: .72rem; font-weight: 700; color: #6b7194; letter-spacing: 0; text-transform: none; margin: 0 0 2px; }
  .tf-kpi-main strong { display: block; font-size: 1.28rem; font-weight: 800; color: var(--tf-ink); letter-spacing: -.01em; line-height: 1.15; }
  .tf-kpi-alerts { display: grid; gap: 12px; }
  .tf-kpi-alert { padding: 14px 16px; border-radius: 22px; background: linear-gradient(160deg, #fde8e8, #fdeeee); box-shadow: var(--tf-shadow); text-decoration: none; display: flex; flex-direction: column; justify-content: center; position: relative; }
  .tf-kpi-alert strong { font-size: 1.1rem; font-weight: 800; color: var(--tf-ink); line-height: 1.15; }
  .tf-kpi-alert span { font-size: .74rem; font-weight: 600; color: #6b7194; margin-top: 2px; }
  .tf-kpi-alert i { position: absolute; top: 14px; right: 14px; font-size: .7rem; color: #8a90b0; }

  .tf-sec-title { display: flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 800; color: var(--tf-ink); margin: 4px 2px 12px; }
  .tf-sec-title i { color: var(--tf-p1); }
  .tf-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; padding: 16px 10px 12px; background: var(--tf-card); border-radius: 24px; box-shadow: var(--tf-shadow); }
  .tf-quick a { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--tf-ink); font-size: .74rem; font-weight: 700; }
  .tf-quick a span { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; color: var(--tf-p1); font-size: 1.15rem; background: linear-gradient(145deg, #f3f5ff, #e8ecff); box-shadow: inset 0 1px 0 #fff, 0 8px 16px -12px rgba(60, 72, 190, .6); transition: transform .15s; }
  .tf-quick a:active span { transform: scale(.92); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH SCREENS  (login · sign-up · password flows) — all screen sizes
   ═══════════════════════════════════════════════════════════════════════════ */
body.tf-auth {
  min-height: 100dvh; margin: 0; color: var(--tf-ink); position: relative; overflow-x: hidden;
  background: linear-gradient(160deg, var(--tf-bg1) 0%, var(--tf-bg2) 45%, var(--tf-bg3) 100%) fixed;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
body.tf-auth::before, body.tf-auth::after {
  content: ''; position: fixed; z-index: 0; border-radius: 50%; pointer-events: none; filter: blur(2px);
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .95) 0 6%, rgba(160, 190, 255, .55) 28%, rgba(180, 150, 255, .35) 62%, rgba(255, 255, 255, .15) 100%);
  box-shadow: inset 0 0 40px rgba(255, 255, 255, .7), 0 20px 50px -20px rgba(100, 100, 255, .35);
  animation: tf-float 14s ease-in-out infinite;
}
body.tf-auth::before { width: 230px; height: 230px; top: -70px; left: -60px; }
body.tf-auth::after  { width: 170px; height: 170px; bottom: 6%; right: -50px; animation-delay: -6s; }
@keyframes tf-float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(14px, -22px, 0); } }

.tf-auth-top {
  position: absolute; z-index: 5; top: calc(14px + var(--tf-safe-t)); left: 0; right: 0; padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.tf-auth-top img { height: 34px; width: auto; }
.tf-auth-install {
  border: 0; border-radius: 999px; padding: 9px 16px; font-size: .78rem; font-weight: 800; color: var(--tf-p1); background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px); box-shadow: 0 10px 22px -14px rgba(60, 72, 190, .7); display: inline-flex; align-items: center; gap: 7px;
}
.tf-auth-install[hidden] { display: none; }

body.tf-auth main.main-content { position: relative; z-index: 2; margin: 0; }
body.tf-auth .page-header { min-height: 100dvh; padding: calc(70px + var(--tf-safe-t)) 0 calc(32px + var(--tf-safe-b)); display: flex; align-items: center; background: none !important; }
body.tf-auth .page-header .container { max-width: 1180px; }

/* the form card */
body.tf-auth .card.card-plain {
  background: rgba(255, 255, 255, .78); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, .95); border-radius: 30px; padding: 30px 26px 22px;
  box-shadow: 0 30px 70px -30px rgba(50, 60, 180, .45), inset 0 1px 0 #fff;
  animation: tf-rise .6s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes tf-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
body.tf-auth .card-plain .card-header { padding: 0 0 6px !important; background: transparent; }
body.tf-auth .card-plain .card-header h4 { font-size: 1.65rem; font-weight: 800; color: var(--tf-ink); letter-spacing: -.02em; }
body.tf-auth .card-plain .card-header p { color: var(--tf-muted); font-size: .9rem; line-height: 1.5; }
body.tf-auth .card-plain .card-body { padding: 18px 0 4px; }
body.tf-auth .card-plain .card-footer { background: transparent; border: 0; padding: 4px 0 0 !important; }
body.tf-auth .card-plain .card-footer p { color: var(--tf-muted); }
body.tf-auth .text-primary.text-gradient, body.tf-auth a.text-primary { background: var(--tf-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800 !important; }

/* inputs */
body.tf-auth .form-control, body.tf-auth select.form-control {
  height: 54px; border-radius: 16px; border: 1.5px solid var(--tf-line); background: rgba(255, 255, 255, .95); font-size: 16px !important; padding: 0 16px; color: var(--tf-ink); box-shadow: none;
}
body.tf-auth .form-control:focus { border-color: var(--tf-p1); box-shadow: 0 0 0 4px rgba(74, 108, 247, .15); background: #fff; }
body.tf-auth .form-control::placeholder { color: #a3a9c6; }
body.tf-auth .form-check-input:checked { background-color: var(--tf-p1); border-color: var(--tf-p1); }
body.tf-auth .form-check-label { color: var(--tf-muted); font-size: .85rem; }

.tf-field { position: relative; margin-bottom: 14px; }
.tf-field > i.tf-field__ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #9aa3d0; font-size: .95rem; pointer-events: none; z-index: 2; transition: color .2s; }
body.tf-auth .tf-field .form-control { padding-left: 48px; }
.tf-field:focus-within > i.tf-field__ic { color: var(--tf-p1); }
.tf-field__eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: transparent; color: #9aa3d0; z-index: 2; border-radius: 12px; }
.tf-field__eye:active { background: #eef1ff; }
body.tf-auth .tf-field--pw .form-control { padding-right: 52px; }
body.tf-auth .tf-field--sel .form-control { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%239aa3d0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }

/* primary button */
body.tf-auth .btn-primary.btn-lg, body.tf-auth .tf-btn-auth {
  min-height: 56px; border-radius: 18px; border: 0 !important; font-weight: 800; font-size: 1.02rem; letter-spacing: .01em; text-transform: none; color: #fff !important;
  background-image: var(--tf-grad) !important; background-color: #6b63f0 !important; box-shadow: 0 20px 32px -16px rgba(94, 114, 228, .95) !important;
  transition: transform .15s ease, box-shadow .2s ease;
}
body.tf-auth .btn-primary.btn-lg:hover { transform: translateY(-1px); }
body.tf-auth .btn-primary.btn-lg:active { transform: scale(.985); }
body.tf-auth .alert { border: 0; border-radius: 16px; }

/* right-hand hero panel (desktop) */
body.tf-auth .col-6.d-lg-flex { z-index: 1; }
body.tf-auth .col-6.d-lg-flex > .position-relative {
  margin: 22px 22px 22px 0 !important; border-radius: 34px !important; overflow: hidden;
  background: linear-gradient(150deg, #2f4bd0 0%, #5b57e6 48%, #8b5cf6 100%) !important;
  box-shadow: 0 40px 80px -30px rgba(60, 60, 200, .6);
}
body.tf-auth .col-6.d-lg-flex > .position-relative .mask { display: none; }
body.tf-auth .col-6.d-lg-flex > .position-relative::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(260px 260px at 82% 14%, rgba(255, 255, 255, .28), transparent 70%),
    radial-gradient(340px 340px at 8% 92%, rgba(255, 255, 255, .16), transparent 70%);
}
body.tf-auth .col-6.d-lg-flex > .position-relative::after {
  content: ''; position: absolute; width: 190px; height: 190px; border-radius: 50%; top: 11%; right: 9%;
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .9) 0 6%, rgba(255, 255, 255, .28) 36%, rgba(255, 255, 255, .08) 70%);
  box-shadow: inset 0 0 36px rgba(255, 255, 255, .45); animation: tf-float 12s ease-in-out infinite;
}
body.tf-auth .col-6.d-lg-flex h2 { font-size: 2rem !important; font-weight: 800; line-height: 1.2 !important; letter-spacing: -.02em; }
body.tf-auth .col-6.d-lg-flex p { font-size: 1rem !important; line-height: 1.6; }

.tf-hero-feats { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; position: relative; z-index: 2; }
.tf-hero-feats li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; color: #fff; font-weight: 600; font-size: .9rem; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(8px); }
.tf-hero-feats li i { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .22); font-size: .8rem; }

/* Desktop: the form sits centred in the left half, with space on BOTH sides (it used to hug the purple panel) */
@media (min-width: 992px) {
  body.tf-auth .page-header .container { max-width: none; padding-left: 0; padding-right: 0; }
  body.tf-auth .page-header .container > .row { margin-left: 0; margin-right: 0; }
  body.tf-auth .page-header .container > .row > .col-xl-4:first-child,
  body.tf-auth .page-header .container > .row > .col-xl-6:first-child {
    flex: 0 0 50%; width: 50%; max-width: 50%; margin: 0 !important;
    padding: 0 clamp(32px, 5vw, 88px); align-items: center;
  }
  body.tf-auth .page-header .container > .row > .col-xl-4:first-child > .card-plain { width: 100%; max-width: 440px; }
  body.tf-auth .page-header .container > .row > .col-xl-6:first-child > .card-plain { width: 100%; max-width: 580px; }
}

@media (max-width: 991.98px) {
  body.tf-auth .page-header { align-items: flex-start; padding-top: calc(76px + var(--tf-safe-t)); }
  body.tf-auth .card.card-plain { padding: 26px 20px 18px; border-radius: 28px; }
  body.tf-auth .card-plain .card-header h4 { font-size: 1.5rem; }
}
@media (max-width: 575.98px) {
  body.tf-auth .page-header .container { padding-left: 14px; padding-right: 14px; }
  .tf-auth-top img { height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

body.tf-auth .tf-field--sel .form-control { padding-left: 48px; padding-right: 40px; }
body.tf-auth .signup-section-label { color: #7b82a8 !important; }
@media (max-width: 575.98px) {
  body.tf-auth form .row > .col-6 { flex: 0 0 100%; max-width: 100%; }
}
@media (max-width: 1199.98px) {
  .main-content .card-header .input-group .btn { flex: 0 0 auto; padding: 0 18px; }
  .main-content .card-header .input-group .form-control { min-width: 0; }
}

/* Card header: [title ........ + Add]  then filters full-width below */
@media (max-width: 1199.98px) {
  .main-content .tf-hd-row { display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 12px !important; }
  .main-content .tf-hd-row > .tf-hd-ctl { display: contents !important; }
  .main-content .tf-hd-row > .tf-hd-title { order: 1; flex: 1 1 0 !important; min-width: 0; margin: 0 !important; }
  .main-content .tf-hd-act { order: 2; flex: 0 0 auto !important; width: auto !important; white-space: nowrap; margin: 0 !important; padding: 0 18px !important; }
  .main-content .tf-hd-ctl > :not(.tf-hd-act):not(.tf-hd-ctl),
  .main-content .tf-hd-row > .tf-hd-ctl > * { order: 3; }
  .main-content .tf-hd-row > .tf-hd-ctl > :not(.tf-hd-act):not(.tf-hd-ctl) { flex: 1 1 100% !important; max-width: 100% !important; min-width: 0 !important; width: 100%; }
  .main-content .tf-hd-ctl .tf-hd-ctl { display: contents !important; }
}
@media (max-width: 1199.98px) {
  .main-content .tf-hd-row .tf-hd-act, .main-content .tf-hd-row > .tf-hd-ctl > .tf-hd-act { order: 2; }
}
@media (max-width: 1199.98px) {
  .main-content .tf-hd-act { padding: 0 14px !important; font-size: .78rem; min-height: 40px; }
}

/* Filter bars (search / selects) — one control per row on phones, same look everywhere */
@media (max-width: 767.98px) {
  .main-content .card .d-flex.flex-wrap:has(> select, > .input-group, > input, > div > select, > .input-group) { padding-left: 14px; padding-right: 14px; gap: 10px !important; }
  .main-content .card .d-flex.flex-wrap:has(> select, > .input-group, > input) > :not(.btn):not(.dropdown):not(.badge) {
    flex: 1 1 100% !important; max-width: 100% !important; width: 100% !important; min-width: 0 !important;
  }
  .main-content .card .d-flex.flex-wrap:has(> select, > .input-group, > input) > .btn { flex: 1 1 auto; }
  .main-content .card .d-flex.flex-wrap > .d-flex:has(> select) { width: 100%; }
  .main-content .leads-filter-bar > div:has(select), .main-content .leads-filter-bar > .input-group { flex: 1 1 100%; }
  .main-content .leads-filter-bar select { width: 100%; }
  .main-content .card-body > .px-4 { padding-left: 14px !important; padding-right: 14px !important; }
}

/* Small stat cards: two per row on phones; tool buttons share a row */
@media (max-width: 575.98px) {
  .main-content .row > .col-xl-3.col-sm-6, .main-content .row > .col-xl-3.col-md-6 { flex: 0 0 50%; max-width: 50%; padding-right: 6px; padding-left: 6px; }
  .main-content .col-xl-3 > .card .card-body.d-flex { flex-direction: column; align-items: flex-start !important; gap: 8px; padding: 14px !important; }
  .main-content .col-xl-3 > .card .icon-shape { margin: 0 !important; }
  .main-content .tf-hd-row > .tf-hd-ctl > .btn:not(.tf-hd-act) { flex: 1 1 calc(50% - 6px) !important; width: auto !important; }
  .main-content .leads-filter-bar .filter-divider { display: none; }
}
@media (max-width: 1199.98px) {
  .main-content .tf-hd-row > .tf-hd-title { min-width: 45% !important; }
}

/* Leads / contacts / companies filter bar — same boxed look as every other page */
@media (max-width: 1199.98px) {
  .main-content .btn-brand { background-image: var(--tf-grad) !important; background-color: #6b63f0 !important; border: 0 !important; color: #fff !important; box-shadow: 0 14px 22px -12px rgba(94, 114, 228, .9) !important; }
  .main-content .leads-filter-bar { background: none !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; gap: 10px !important; }
  .main-content .leads-filter-bar > div { display: block !important; width: 100%; }
  .main-content .leads-filter-bar > div > i { display: none; }
  .main-content .leads-filter-bar > div:has(input) { display: flex !important; gap: 8px; }
  .main-content .leads-filter-bar .filter-control { width: 100%; border: 1.5px solid var(--tf-line) !important; border-radius: 14px !important; min-height: 48px; background: #fff !important; padding: 10px 14px !important; font-size: 16px !important; box-shadow: none !important; }
  .main-content .leads-filter-bar .btn { flex: 0 0 auto; padding: 0 18px; }
  .main-content .leads-filter-bar > .btn { width: 100%; }
}
@media (max-width: 1199.98px) {
  .main-content .leads-filter-bar > .filter-divider { display: none !important; }
  .main-content .leads-filter-bar > div:has(input) .filter-control { flex: 1 1 0; width: auto; min-width: 0; }
  .main-content .leads-filter-bar > div:has(input) .btn { min-height: 48px; }
}
@media (max-width: 575.98px) {
  .main-content .row > [class*="col-"]:has(> .card > .card-body.d-flex .icon-shape) { flex: 0 0 50%; max-width: 50%; padding-right: 6px; padding-left: 6px; }
  .main-content .row > [class*="col-"]:has(> .card > .card-body.d-flex .icon-shape) > .card .card-body.d-flex { flex-direction: column; align-items: flex-start !important; gap: 8px; padding: 14px !important; }
  .main-content .row > [class*="col-"]:has(> .card > .card-body.d-flex .icon-shape) .icon-shape { margin: 0 !important; }
}

@media (max-width: 575.98px) {
  .main-content .row > .tf-stat-col { flex: 0 0 50% !important; max-width: 50% !important; padding-left: 6px !important; padding-right: 6px !important; }
  .main-content .tf-stat-col > .card, .main-content .tf-stat-col .card { height: calc(100% - 12px); margin-bottom: 12px !important; }
  .main-content .tf-stat-col .card-body { padding: 14px !important; }
  .main-content .tf-stat-col .card-body.d-flex { flex-direction: column; align-items: flex-start !important; gap: 8px; }
  .main-content .tf-stat-col .icon-shape { margin: 0 !important; }
  .main-content .tf-stat-col h3, .main-content .tf-stat-col h4, .main-content .tf-stat-col h5 { font-size: 1.05rem; word-break: break-word; }
  .main-content .tf-stat-col p { font-size: .72rem; line-height: 1.3; }
}

@media (max-width: 1199.98px) {
  .tf-avatar--ic { display: grid; place-items: center; color: var(--tf-p1); font-size: 1rem; }
  .tf-tenant-list form { display: contents; }
  .tf-tenant-list [hidden] { display: none !important; }
}
@media (max-width: 575.98px) { .main-content .tf-stat-col .d-flex.justify-content-between { gap: 8px; } }

/* ═══ Auth — native-app feel on phones: gradient hero + bottom sheet form ═══ */
.tf-auth-hero { display: none; }
@media (max-width: 991.98px) {
  body.tf-auth {
    display: flex; flex-direction: column; min-height: 100dvh;
    background: linear-gradient(165deg, #4a6cf7 0%, #6b63f0 52%, #8b5cf6 100%) fixed;
  }
  body.tf-auth::before, body.tf-auth::after { opacity: .35; }
  body.tf-auth .tf-auth-top { display: none; }
  .tf-auth-hero {
    position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; color: #fff;
    padding: calc(34px + var(--tf-safe-t)) 24px 30px; flex: 0 0 auto;
  }
  .tf-auth-hero img { width: 72px; height: 72px; border-radius: 22px; background: #fff; padding: 4px; box-shadow: 0 18px 34px -14px rgba(20, 20, 90, .6); margin-bottom: 14px; animation: tf-pop .6s cubic-bezier(.2, .9, .3, 1.3) both; }
  .tf-auth-hero strong { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
  .tf-auth-hero span { font-size: .85rem; opacity: .85; margin-top: 2px; }
  .tf-auth-hero .tf-auth-install { position: absolute; top: calc(14px + var(--tf-safe-t)); right: 16px; }
  @keyframes tf-pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

  body.tf-auth main.main-content { flex: 1 1 auto; display: flex; flex-direction: column; }
  body.tf-auth .page-header { min-height: 0; flex: 1 1 auto; align-items: flex-end; padding: 0 !important; }
  body.tf-auth .page-header > .container, body.tf-auth .page-header .container { padding: 0 !important; max-width: none; width: 100%; }
  body.tf-auth .page-header .row { margin: 0; }
  body.tf-auth .page-header .row > [class*="col-"]:first-child { width: 100%; max-width: 100%; flex: 0 0 100%; padding: 0; margin: 0 !important; }
  body.tf-auth .card.card-plain {
    background: #fff; backdrop-filter: none; border: 0; border-radius: 32px 32px 0 0; margin: 0;
    padding: 28px 22px calc(22px + var(--tf-safe-b)); min-height: 58dvh;
    box-shadow: 0 -24px 60px -20px rgba(20, 20, 100, .45);
    animation: tf-sheet-in .55s cubic-bezier(.2, .85, .2, 1) both;
  }
  @keyframes tf-sheet-in { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
  body.tf-auth .card.card-plain::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 5px; background: #dfe3f5; margin: -14px auto 18px; }
  body.tf-auth .card-plain .card-header h4 { font-size: 1.6rem; }
  body.tf-auth .form-control, body.tf-auth select.form-control { background: #f4f6ff; border-color: transparent; }
  body.tf-auth .form-control:focus { background: #fff; }
  body.tf-auth .btn-primary.btn-lg { min-height: 58px; border-radius: 20px; }
  body.tf-auth .card-plain .card-footer { padding-top: 10px !important; }
}
@media (max-width: 1199.98px) {
  body.tf-auth main.main-content { padding: 0 !important; margin: 0 !important; min-height: 0 !important; }
  body.tf-auth .main-content .card.card-plain { background: #fff !important; backdrop-filter: none !important; border-radius: 32px 32px 0 0 !important; margin-bottom: 0 !important; box-shadow: 0 -24px 60px -20px rgba(20, 20, 100, .45) !important; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  body.tf-auth .main-content .card.card-plain { border-radius: 30px !important; background: rgba(255,255,255,.86) !important; }
}
@media (max-width: 991.98px) {
  body.tf-auth .main-content .card.card-plain { min-height: calc(100dvh - 215px); }
  body.tf-auth .card-plain .card-footer { margin-top: auto; }
  body.tf-auth .card-plain { display: flex; flex-direction: column; }
}
body.tf-auth form .row { --bs-gutter-x: 0; --bs-gutter-y: 0; margin-left: 0; margin-right: 0; }
body.tf-auth form .row > * { padding-left: 0; padding-right: 0; margin-top: 0; }
@media (min-width: 576px) { body.tf-auth form .row > .col-6 { padding-left: 0; padding-right: 0; } body.tf-auth form .row > .col-6:first-child { padding-right: 6px; } body.tf-auth form .row > .col-6:last-child { padding-left: 6px; } }

/* A notice that belongs to the page (payment / subscription screens): shown in place, never as a floating pop-up */
.alert.alert-inline { position: static !important; inset: auto !important; transform: none !important; width: auto !important; max-width: none !important; animation: none !important; box-shadow: none; }

/* Onboarding hero (plans + payment pages): the sign-in screen's gradient with slowly floating bubbles */
.tf-hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(165deg, #4a6cf7 0%, #6b63f0 52%, #8b5cf6 100%);
}
.tf-hero > * { position: relative; z-index: 2; }
.tf-hero::before, .tf-hero::after {
  content: ''; position: absolute; z-index: 1; border-radius: 50%; pointer-events: none; filter: blur(1px);
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .85) 0 6%, rgba(190, 205, 255, .38) 30%, rgba(200, 175, 255, .22) 64%, rgba(255, 255, 255, .06) 100%);
  box-shadow: inset 0 0 40px rgba(255, 255, 255, .45), 0 20px 50px -20px rgba(40, 40, 160, .35);
  animation: tf-float 14s ease-in-out infinite;
}
.tf-hero::before { width: 150px; height: 150px; top: -70px; left: 3%; opacity: .8; }
.tf-hero::after  { width: 110px; height: 110px; bottom: -48px; right: 4%; opacity: .8; animation-delay: -6s; }
.tf-hero .tf-hero-bubble {
  position: absolute; z-index: 1; width: 64px; height: 64px; top: 26%; right: 27%; border-radius: 50%; pointer-events: none; opacity: .85;
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .8) 0 8%, rgba(190, 205, 255, .3) 40%, rgba(255, 255, 255, .05) 100%);
  box-shadow: inset 0 0 24px rgba(255, 255, 255, .4); animation: tf-float 11s ease-in-out infinite; animation-delay: -3s;
}
/* the TechFlow name in the corner sits on the dark hero: white */
body.tf-auth:has(.tf-hero) .tf-auth-top strong { color: #fff !important; }
@media (prefers-reduced-motion: reduce) { .tf-hero::before, .tf-hero::after, .tf-hero .tf-hero-bubble { animation: none; } }

/* A short message after an action or a blocked page: a corner toast that slides in and goes away by itself */
.alert.tf-toast {
  position: fixed !important; inset: auto 24px 22px auto !important; z-index: 1085; width: auto !important; max-width: min(440px, calc(100vw - 32px));
  margin: 0 !important; padding: 12px 40px 12px 16px; border-radius: 14px; font-size: .85rem; line-height: 1.45;
  box-shadow: 0 18px 40px -16px rgba(30, 30, 90, .55); animation: tf-toast-in .45s cubic-bezier(.2, .85, .2, 1) both;
}
.alert.tf-toast.is-leaving { animation: tf-toast-out .35s ease forwards; }
.alert.tf-toast .tf-toast-x { position: absolute; top: 6px; right: 8px; border: 0; background: transparent; color: inherit; opacity: .8; font-size: 1.15rem; line-height: 1; padding: 4px 6px; cursor: pointer; }
.alert.tf-toast .tf-toast-x:hover { opacity: 1; }
@keyframes tf-toast-in  { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes tf-toast-out { to { opacity: 0; transform: translateY(12px); } }
@media (max-width: 575.98px) { .alert.tf-toast { inset: auto 12px 14px 12px !important; max-width: none; } }

/* Plans + payment pages carry their own header: skip the large sign-in logo block on narrower windows and keep the slim top bar */
@media (max-width: 991.98px) {
  body.tf-auth:has(.tf-hero) .tf-auth-hero { display: none; }
  body.tf-auth:has(.tf-hero) .tf-auth-top { display: flex; }
}

/* ═══ Email-verification banner (every authenticated page; not dismissible until verified) ═══ */
.tf-verify-wrap:empty { display: none; }
.tf-verify {
  display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; padding: 11px 16px;
  border-radius: 12px; background: #fff8e6; border: 1px solid #f5c542; color: #6b4a00;
  position: relative; z-index: 2; box-shadow: 0 6px 16px -10px rgba(120, 80, 0, .5);
}
.tf-verify > i { font-size: 1.15rem; color: #d99a00; flex-shrink: 0; }
.tf-verify__text { flex: 1; min-width: 0; font-size: .86rem; line-height: 1.35; display: flex; flex-wrap: wrap; column-gap: 6px; }
.tf-verify__text strong { color: #5a3d00; }
.tf-verify__addr { font-weight: 700; word-break: break-all; }
.tf-verify__btn {
  flex-shrink: 0; border: 0; border-radius: 10px; padding: 8px 16px; min-height: 36px;
  font-size: .82rem; font-weight: 700; color: #fff; background: #5e72e4; cursor: pointer;
}
.tf-verify__btn:hover { background: #4a5dc9; }
.tf-verify__btn:focus-visible { outline: 3px solid rgba(94, 114, 228, .45); outline-offset: 2px; }
.tf-verify__btn[disabled] { opacity: .7; cursor: progress; }
.tf-verify--ok { background: #ecfdf3; border-color: #7ddba3; color: #0d5c2f; }
.tf-verify--ok > i { color: #1aae6f; }
.tf-verify__fb { margin: 6px 2px 0; font-size: .8rem; font-weight: 600; position: relative; z-index: 2; }
.tf-verify__fb--success { color: #0d7a43; }
.tf-verify__fb--warning { color: #9a6700; }
.tf-verify__fb--danger  { color: #c62828; }
@media (max-width: 1199.98px) {
  /* mobile app shell: the banner sits right under the fixed app bar (main-content already clears it), compact */
  .tf-verify { margin: 0 0 10px; padding: 8px 10px; gap: 8px; border-radius: 14px; }
  .tf-verify > i { font-size: 1rem; }
  .tf-verify__text { font-size: .74rem; }
  .tf-verify__sub { display: none; }
  .tf-verify__btn { padding: 7px 12px; font-size: .74rem; min-height: 34px; }
}
