/*
 * AppTriage — Brand Overrides
 *
 * Loaded after Tabler CSS in base.html.
 * Provides consistent typography, form styling, and button treatment
 * across all surfaces (dashboard, auth, onboarding, public).
 *
 * Keep minimal. Only override what Tabler can't do natively.
 */


/* ── Alpine.js x-cloak ── */
[x-cloak] { display: none !important; }

/* ── Brand Variables ── */

:root {
  --tblr-font-sans-serif: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --tblr-primary: #2c77e7;
  --tblr-primary-rgb: 44, 119, 231;
  --at-blue: #2c77e7;
  --at-blue-hover: #2269d8;
  --at-slate: #121317;
  --at-slate-mid: #18191D;
  --at-muted: #45474D;
  --at-border: #E1E6EC;
  --at-surface: #F8F9FC;
  --at-shell-bg: #f4f7fb;
}


/* ── Global Typography ── */

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  color: var(--at-slate);
  background:
    radial-gradient(circle at top left, rgba(0,84,166,0.05), transparent 24%),
    linear-gradient(180deg, #f7f9fc 0%, #f3f6fa 100%);
}

.page-body,
.page-center {
  color: var(--at-slate);
}

.page-body h1,
.page-body h2,
.page-body h3,
.page-body h4,
.page-center h1,
.page-center h2,
.page-center h3,
.page-center h4 {
  color: var(--at-slate);
  letter-spacing: -0.04em;
}

.page-body h1,
.page-body h2,
.page-center h1,
.page-center h2 {
  font-weight: 650;
  line-height: 1.04;
}

.page-body h3,
.page-body h4,
.page-center h3,
.page-center h4 {
  font-weight: 600;
  line-height: 1.12;
}

.page-body .text-secondary,
.page-center .text-secondary,
.page > .navbar .text-secondary {
  color: #667180 !important;
}


/* ── Form Controls ── */

.form-control,
.form-select {
  border-radius: 8px;
  border-color: var(--at-border);
  font-size: .875rem;
  letter-spacing: -0.005em;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--at-slate);
  box-shadow: 0 0 0 2px rgba(18, 19, 23, 0.08);
}

.input-group-flat .form-control {
  border-radius: 8px 0 0 8px;
}

.input-group-flat .input-group-text {
  border-radius: 0 8px 8px 0;
  border-color: var(--at-border);
}


/* ── Form Labels ── */

.form-label {
  font-weight: 500;
  font-size: .8125rem;
  letter-spacing: -0.005em;
  color: var(--at-muted);
}

.form-hint {
  color: var(--at-muted);
  letter-spacing: -0.005em;
}


/* ── Primary Buttons ──
 * Scoped to .page (dashboard + auth) and .modal contexts.
 */

.page .btn-primary,
.modal .btn-primary {
  min-height: 2.5rem;
  background: var(--at-blue);
  border-color: var(--at-blue);
  border-radius: 8px;
  font-weight: 600;
  font-size: .875rem;
  letter-spacing: 0;
  box-shadow: 0 1px 2px rgba(20, 91, 198, 0.18);
}

.page .btn-primary:hover,
.page .btn-primary:focus,
.modal .btn-primary:hover,
.modal .btn-primary:focus {
  background: var(--at-blue-hover);
  border-color: var(--at-blue-hover);
  box-shadow: 0 8px 20px rgba(44, 119, 231, 0.20);
}

.page .btn-ghost-secondary,
.page .btn-ghost-primary,
.page .btn-outline-secondary,
.page .btn-outline-primary {
  border-radius: 10px;
}


/* ── Inbox Filter Tabs ── */

.at-tab,
.at-tab-active {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
/* Fix status-dot vertical alignment inside tabs */
.at-tab .status-dot,
.at-tab-active .status-dot {
  vertical-align: middle;
  position: relative;
  top: 0;
}

.at-tab {
  color: #64748b;
}

.at-tab:hover {
  background: #f1f5f9;
  color: #334155;
  text-decoration: none;
}

.at-tab-active {
  background: #e2e8f0;
  color: #1e293b;
  font-weight: 600;
}

.at-tab-active:hover {
  background: #cbd5e1;
  color: #1e293b;
  text-decoration: none;
}

/* Dark mode tabs */
[data-bs-theme="dark"] .at-tab {
  color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .at-tab:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff !important;
}

[data-bs-theme="dark"] .at-tab-active {
  background: rgba(255, 255, 255, .18);
  color: #fff !important;
  font-weight: 600;
}

[data-bs-theme="dark"] .at-tab-active:hover {
  background: rgba(255, 255, 255, .24);
  color: #fff !important;
}

/* ── Demo Data Indicator ── */

.at-demo {
  border: 1px dashed #ef4444;
  border-radius: 8px;
  padding: 12px 16px;
}

.at-demo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.at-demo-ic {
  color: #94a3b8;
  flex-shrink: 0;
}

.at-demo-msg {
  font-size: .875rem;
  color: #64748b;
  flex: 1;
  min-width: 0;
}

.at-demo-msg strong {
  color: #334155;
  font-weight: 600;
}

.at-demo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Dark mode */
[data-bs-theme="dark"] .at-demo {
  border-color: #ef4444;
}

[data-bs-theme="dark"] .at-demo-ic {
  color: #64748b;
}

[data-bs-theme="dark"] .at-demo-msg {
  color: #94a3b8;
}

[data-bs-theme="dark"] .at-demo-msg strong {
  color: #e2e8f0;
}

/* ── Dashboard Light Navbar ── */

.page > .navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255,255,255,0.82);
  border-bottom: 1px solid rgba(225, 230, 236, 0.9);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 12px 30px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.page > .navbar .container-xl {
  min-height: 72px;
}

.page > .navbar .nav-link {
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: #4f5a67;
  border-radius: 12px;
  padding: .6rem .85rem;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.page > .navbar .nav-link:hover {
  color: var(--at-slate);
  background: rgba(18, 19, 23, 0.04);
}

.page > .navbar .nav-item.active .nav-link {
  font-weight: 650;
  color: var(--at-slate);
  background: rgba(32, 107, 196, 0.14);
  box-shadow: inset 0 0 0 1px rgba(32, 107, 196, 0.10);
}

.page > .navbar .nav-link-icon {
  color: #6b7280;
}

.page > .navbar .nav-item.active .nav-link-icon,
.page > .navbar .nav-link:hover .nav-link-icon {
  color: var(--tblr-primary);
}

.page > .navbar .dropdown-menu {
  border-radius: 16px;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.10);
  padding: .5rem;
}

.page > .navbar .dropdown-item {
  border-radius: 10px;
}

.page > .navbar .dropdown-item:hover {
  background: rgba(15, 23, 42, 0.04);
}

.app-navbar-brand {
  gap: .7rem;
}

.app-navbar-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(243,246,250,0.96));
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.app-navbar-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.app-navbar-brand-kicker {
  font-size: .625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #7b8390;
  margin-bottom: .15rem;
}

.app-navbar-meta {
  gap: .4rem;
}

.app-shell-frame {
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
}

.app-shell-shortcuts {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.76);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}


/* ── Dashboard Product Shell ── */

.app-dashboard {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(44, 119, 231, 0.045), transparent 28rem),
    linear-gradient(180deg, #f8fafc 0%, #f4f7fb 100%);
}

.app-dashboard-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.app-dashboard .page-wrapper {
  flex: 1 1 auto;
}

.app-sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 284px;
  width: 284px;
  height: 100vh;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow-y: auto;
}

.app-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-height: 100%;
}

.app-sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  min-height: 48px;
  padding: .35rem .35rem .7rem;
  color: var(--at-slate);
  text-decoration: none;
}

.app-sidebar-brand:hover {
  color: var(--at-slate);
  text-decoration: none;
}

.app-sidebar-brand-mark,
.app-navbar-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  flex-shrink: 0;
}

.app-sidebar-brand-mark img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.app-sidebar-brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.05;
}

.app-sidebar-brand-kicker,
.app-topbar-eyebrow {
  color: #7b8390;
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.app-sidebar-brand-name {
  margin-top: .2rem;
  color: var(--at-slate);
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.app-sidebar-section {
  display: grid;
  gap: .28rem;
}

.app-sidebar-section-label {
  padding: 0 .55rem .25rem;
  color: #8a94a3;
  font-size: .66rem;
  font-weight: 750;
  letter-spacing: .1em;
  line-height: 1;
  text-transform: uppercase;
}

.app-sidebar-link {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: .56rem;
  min-height: 48px;
  padding: .5rem .55rem;
  color: #4f5a67;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.app-sidebar-link:hover {
  color: var(--at-slate);
  text-decoration: none;
  background: rgba(15, 23, 42, 0.04);
}

.app-sidebar-link.is-active {
  color: #0f172a;
  background: rgba(44, 119, 231, 0.10);
  border-color: rgba(44, 119, 231, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68);
}

.app-sidebar-link.is-active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 999px;
  background: var(--at-blue);
}

.app-sidebar-link--subtle .app-sidebar-link-copy {
  color: #8a94a3;
}

.app-sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #64748b;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.app-sidebar-link.is-active .app-sidebar-icon {
  color: var(--at-blue);
  background: #fff;
  border-color: rgba(44, 119, 231, 0.18);
}

.app-sidebar-link-main {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  min-width: 0;
}

.app-sidebar-link-title {
  color: inherit;
  font-size: .875rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.app-sidebar-link-copy {
  color: #717d8c;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 .45rem;
  border-radius: 999px;
  background: var(--at-blue);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
}

.app-dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(225, 230, 236, 0.92);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.app-dashboard-topbar-container {
  min-height: 64px;
  padding-inline: 1.5rem;
  gap: 1rem;
}

.app-topbar-context {
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

.app-topbar-context-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.05;
}

.app-topbar-context-copy strong {
  margin-top: .2rem;
  max-width: 34rem;
  color: var(--at-slate);
  font-size: .95rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-topbar-plan {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: .25rem .58rem;
  border-radius: 8px;
  color: #4b647f;
  background: rgba(44, 119, 231, 0.08);
  border: 1px solid rgba(44, 119, 231, 0.12);
  font-size: .74rem;
  font-weight: 700;
  text-decoration: none;
}

.app-topbar-plan:hover {
  color: var(--at-blue);
  text-decoration: none;
  border-color: rgba(44, 119, 231, 0.22);
}

.app-navbar-tools {
  gap: .35rem;
}

.app-dashboard-topbar .nav-link {
  border-radius: 10px;
}

.app-menu-icon {
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  color: #111827;
}

.app-menu-icon--open {
  display: inline-flex;
}

.app-menu-icon--close {
  display: none;
}

.app-topbar-menu-button[aria-expanded="true"] .app-menu-icon--open {
  display: none;
}

.app-topbar-menu-button[aria-expanded="true"] .app-menu-icon--close {
  display: inline-flex;
}

.app-user-trigger {
  min-height: 40px;
  border-radius: 10px;
}

.app-mobile-nav-collapse {
  flex-basis: 100%;
}

.app-mobile-nav-panel {
  display: grid;
  gap: .8rem;
  width: 100%;
  padding: .85rem 0 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.app-mobile-nav-section {
  display: grid;
  gap: .3rem;
}

.app-mobile-nav-label {
  color: #8a94a3;
  font-size: .66rem;
  font-weight: 750;
  letter-spacing: .1em;
  line-height: 1;
  text-transform: uppercase;
}

.app-mobile-nav-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  min-height: 52px;
  padding: .54rem .64rem;
  color: #4f5a67;
  border-radius: 10px;
  text-decoration: none;
}

.app-mobile-nav-link:hover,
.app-mobile-nav-link.is-active {
  color: var(--at-slate);
  background: rgba(44, 119, 231, 0.10);
  text-decoration: none;
}

.app-mobile-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #65748a;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.94);
}

.app-mobile-nav-link.is-active .app-mobile-nav-icon {
  color: var(--at-blue);
  background: #fff;
  border-color: rgba(44, 119, 231, 0.18);
}

.app-mobile-nav-copy {
  display: flex;
  flex-direction: column;
  gap: .08rem;
  min-width: 0;
}

.app-mobile-nav-copy strong {
  color: inherit;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.12;
}

.app-mobile-nav-copy small {
  color: #778294;
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.24;
}

@media (min-width: 992px) {
  .app-dashboard .app-shell-frame {
    padding-top: 1.5rem;
  }

  .app-dashboard .navbar-brand,
  .app-dashboard .navbar-toggler,
  .app-dashboard .app-mobile-nav-collapse {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  .app-dashboard {
    display: block;
  }

  .app-dashboard-topbar {
    background: rgba(255, 255, 255, 0.92);
  }

  .app-dashboard-topbar-container {
    min-height: 68px;
    padding-inline: 1rem;
    flex-wrap: nowrap;
  }

  .app-topbar-menu-button {
    order: 10;
    margin-left: auto;
    border: 0;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.04);
  }

  .app-navbar-meta {
    display: none !important;
  }

  .app-mobile-nav-collapse {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    z-index: 1029;
    max-height: calc(100svh - 68px);
    padding: .75rem 1rem 1rem;
    overflow-y: auto;
    background:
      linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(244, 247, 251, 0.96));
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 22px 45px rgba(15, 23, 42, 0.14);
  }

  .app-mobile-nav-panel {
    max-width: 560px;
    margin: 0 auto;
    padding: .75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .app-mobile-nav-section + .app-mobile-nav-section {
    padding-top: .72rem;
    border-top: 1px solid rgba(15, 23, 42, 0.07);
  }

  .app-mobile-nav-label {
    padding-inline: .2rem;
  }

  .app-dashboard .app-shell-frame {
    padding-top: 1rem;
  }
}

[data-bs-theme="dark"] .app-dashboard {
  background:
    radial-gradient(circle at top left, rgba(44, 119, 231, 0.12), transparent 28rem),
    linear-gradient(180deg, #0f141b 0%, #111820 100%);
}

[data-bs-theme="dark"] .app-sidebar,
[data-bs-theme="dark"] .app-dashboard-topbar,
[data-bs-theme="dark"] .app-mobile-nav-panel {
  background: rgba(18, 24, 33, 0.92);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: none;
}

[data-bs-theme="dark"] .app-mobile-nav-collapse {
  background: rgba(11, 16, 23, 0.96);
  border-color: rgba(148, 163, 184, 0.14);
}

[data-bs-theme="dark"] .app-sidebar-brand-mark,
[data-bs-theme="dark"] .app-navbar-brand-mark,
[data-bs-theme="dark"] .app-sidebar-icon,
[data-bs-theme="dark"] .app-mobile-nav-icon {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.18);
}

[data-bs-theme="dark"] .app-sidebar-brand-name,
[data-bs-theme="dark"] .app-topbar-context-copy strong,
[data-bs-theme="dark"] .navbar-brand-text-inner,
[data-bs-theme="dark"] .app-menu-icon,
[data-bs-theme="dark"] .app-sidebar-link:hover,
[data-bs-theme="dark"] .app-mobile-nav-link:hover,
[data-bs-theme="dark"] .app-mobile-nav-link.is-active {
  color: #f8fafc;
}

[data-bs-theme="dark"] .app-sidebar-link,
[data-bs-theme="dark"] .app-mobile-nav-link {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .app-sidebar-link.is-active,
[data-bs-theme="dark"] .app-mobile-nav-link.is-active {
  background: rgba(44, 119, 231, 0.18);
  border-color: rgba(44, 119, 231, 0.28);
}


/* ── Navbar Brand Wordmark ── */

.navbar-brand-text-inner {
  font-weight: 600;
  color: var(--at-slate);
  letter-spacing: -0.02em;
}


/* ── Card Borders ── */

.page-body .card,
.page-center .card {
  border-color: rgba(15, 23, 42, 0.09);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 42px rgba(15, 23, 42, 0.07);
  background: linear-gradient(180deg, rgba(255,255,255,0.995), rgba(248,250,252,0.97));
}

.page-center .card-md {
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 24px 52px rgba(15, 23, 42, 0.08);
}

.page-body .card-header,
.page-center .card-header {
  background: transparent;
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

.page-body .card-body,
.page-center .card-body {
  color: var(--at-slate);
}


/* ── Card Titles ── */

.card-title {
  font-weight: 600;
  letter-spacing: -0.03em;
}

.card-subtitle {
  letter-spacing: -0.005em;
}


/* ── Tabs (inside cards) ── */

.nav-tabs .nav-link.active {
  font-weight: 600;
  color: var(--at-slate);
  border-bottom-color: var(--at-slate);
}

.nav-tabs .nav-link {
  font-size: .875rem;
  letter-spacing: -0.005em;
}


/* ── Textareas ── */

textarea.form-control {
  line-height: 1.6;
}


/* ── Alerts ── */

.alert {
  border-radius: 10px;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.app-flash,
.app-upgrade-banner {
  border-radius: 18px;
}

.app-upgrade-banner {
  background: linear-gradient(180deg, rgba(255,251,235,0.96), rgba(255,247,220,0.96));
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.app-flash.alert-info,
.app-flash.alert-success,
.app-flash.alert-warning,
.app-flash.alert-danger {
  background-image: none;
}


/* ── Brand Logo (shared by auth + onboarding) ── */

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
}

.auth-brand-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-brand-text {
  font-weight: 560;
  font-size: 1.125rem;
  color: var(--at-slate);
  letter-spacing: -0.02em;
}

.auth-brand:hover .auth-brand-text {
  color: var(--at-slate);
}


/* ── Links ── */

.page-body a:not(.btn):not(.nav-link):not(.list-group-item):not(.dropdown-item):not(.page-link),
.page-center a:not(.btn):not(.nav-link):not(.list-group-item):not(.dropdown-item) {
  color: #0054a6;
}


/* ── Form label description (e.g., "Forgot password?") ── */

.form-label-description a {
  font-weight: 500;
  font-size: .8125rem;
}


/* ── HTMX Loading States ── */

.htmx-request .htmx-indicator {
  display: inline-block !important;
}

.htmx-indicator {
  display: none;
}

/* Subtle opacity transition for HTMX-swapped content */
.htmx-added {
  animation: htmxFadeIn 0.2s ease-out;
}

@keyframes htmxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Content area dims slightly while loading */
.htmx-request.htmx-settling {
  opacity: 0.7;
  transition: opacity 0.15s ease;
}


/* ── Empty State Illustrations ── */

.empty-state-illustration {
  max-width: 180px;
  height: auto;
}


/* ── Dark Mode Fallbacks ── */

[data-bs-theme="dark"] .page > .navbar {
  background: rgba(18, 24, 33, 0.85);
  border-bottom-color: var(--tblr-border-color);
  box-shadow: none;
}

[data-bs-theme="dark"] body {
  background: linear-gradient(180deg, #0f1720 0%, #111b26 100%);
}

[data-bs-theme="dark"] .navbar-brand-text-inner {
  color: #fff;
}

[data-bs-theme="dark"] .app-navbar-brand-mark,
[data-bs-theme="dark"] .page-body .card,
[data-bs-theme="dark"] .page-center .card,
[data-bs-theme="dark"] .app-shell-shortcuts {
  background: rgba(20, 26, 35, 0.92);
  border-color: var(--tblr-border-color);
  box-shadow: none;
}

[data-bs-theme="dark"] .app-navbar-brand-mark img {
  filter: invert(1);
}

[data-bs-theme="dark"] .page > .navbar .nav-link {
  color: #c2c8d0;
}

[data-bs-theme="dark"] .page > .navbar .nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

[data-bs-theme="dark"] .page > .navbar .nav-item.active .nav-link {
  background: rgba(32, 107, 196, 0.18);
  color: #fff;
}

[data-bs-theme="dark"] .app-navbar-brand-kicker {
  color: #8b96a8;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  border-color: var(--tblr-border-color);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  border-color: var(--tblr-primary);
  box-shadow: 0 0 0 2px rgba(32, 107, 196, 0.15);
}

[data-bs-theme="dark"] .form-label {
  color: var(--tblr-secondary-color);
}

[data-bs-theme="dark"] .auth-brand-text {
  color: #fff;
}

[data-bs-theme="dark"] .page-body .card,
[data-bs-theme="dark"] .page-center .card {
  border-color: var(--tblr-border-color);
}

[data-bs-theme="dark"] .app-upgrade-banner {
  background: rgba(84, 52, 12, 0.52);
  border-color: rgba(245, 158, 11, 0.22);
}

/* Dark mode: Tabler handles btn-primary natively — no override needed */

/* ── Over-limit blur (plan limit enforcement) ─── */
.feedback-blurred {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

.over-limit-overlay {
  position: relative;
}

.over-limit-lock {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  white-space: nowrap;
}

/* ── Credential / config boxes ────────────────── */
.credentials-box {
  background: var(--at-surface);
  border-radius: 10px;
  padding: 1.25rem;
}

[data-bs-theme="dark"] .credentials-box {
  background: var(--tblr-bg-surface);
}

/* ── AI classification badges ─────────────────── */
.badge-dashed {
  border: 1px dashed currentColor;
}

[data-bs-theme="dark"] .subheader {
  color: var(--tblr-secondary-color);
}


/* ── Inbox Filter Tab Scroll ── */

@media (max-width: 767.98px) {
  .at-tabs-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .at-tabs-scroll::-webkit-scrollbar { display: none; }
}


/* ── Delete Button: muted by default, red on hover ── */
.btn-delete-muted {
  color: #94a3b8 !important;
}
.btn-delete-muted:hover {
  color: var(--tblr-danger) !important;
  background: rgba(var(--tblr-danger-rgb), .06) !important;
}

/* ── Project Card Links ── */
.at-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 1rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s, color .15s;
  min-height: 44px;
}
.at-card-link:hover {
  background: #f1f5f9;
  color: #1e293b;
  text-decoration: none;
}
.at-card-link-primary {
  color: var(--tblr-primary);
}
.at-card-link-primary:hover {
  background: rgba(var(--tblr-primary-rgb), .08);
  color: var(--tblr-primary);
}

/* ── Inbox Row Hover ── */

.list-group-item-action:hover {
  background-color: rgba(var(--tblr-primary-rgb), .04) !important;
}
