/* ============================================================================
   TixxHost Design System
   Modern, accessible, and consistent styling used across marketing and app.
   ========================================================================= */

:root {
  --tp-teal-50:   #F0FDFA;
  --tp-teal-100:  #CCFBF1;
  --tp-teal-200:  #99F6E4;
  --tp-teal-300:  #5EEAD4;
  --tp-teal-400:  #2DD4BF;
  --tp-teal-500:  #14B8A6;
  --tp-teal-600:  #0D9488;
  --tp-teal-700:  #0F766E;
  --tp-teal-800:  #115E59;
  --tp-teal-900:  #134E4A;
  --tp-cyan-50:   #ECFEFF;
  --tp-cyan-100:  #CFFAFE;
  --tp-cyan-200:  #A5F3FC;
  --tp-cyan-400:  #22D3EE;
  --tp-cyan-500:  #06B6D4;
  --tp-cyan-600:  #0891B2;
  --tp-cyan-700:  #0E7490;
  --tp-emerald-500: #10B981;
  --tp-amber-500:  #F59E0B;
  --tp-rose-500:   #F43F5E;
  --tp-slate-50:   #F8FAFC;
  --tp-slate-100:  #F1F5F9;
  --tp-slate-200:  #E2E8F0;
  --tp-slate-300:  #CBD5E1;
  --tp-slate-400:  #94A3B8;
  --tp-slate-500:  #64748B;
  --tp-slate-600:  #475569;
  --tp-slate-700:  #334155;
  --tp-slate-800:  #1E293B;
  --tp-slate-900:  #0F172A;

  --tp-bg:         #F6FBFA;
  --tp-bg-elev:    #FFFFFF;
  --tp-text:       #0F172A;
  --tp-muted:      #64748B;
  --tp-border:     #E2E8F0;
  --tp-primary:    var(--tp-teal-600);
  --tp-primary-hover: var(--tp-teal-700);
  --tp-accent:     var(--tp-cyan-600);

  --tp-gradient:   linear-gradient(135deg, var(--tp-teal-500) 0%, var(--tp-cyan-500) 100%);
  --tp-gradient-soft: linear-gradient(135deg, #F0FDFA 0%, #ECFEFF 100%);

  --tp-shadow-sm:  0 1px 2px rgba(15, 23, 42, 0.06);
  --tp-shadow:     0 4px 12px rgba(15, 23, 42, 0.08);
  --tp-shadow-lg:  0 20px 40px -12px rgba(15, 23, 42, 0.18);

  --tp-radius-sm:  6px;
  --tp-radius:     10px;
  --tp-radius-lg:  16px;

  --tp-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Bootstrap 5 variable overrides so .btn, .alert, .form-control, .nav-tabs etc. inherit the teal theme */
  --bs-primary: var(--tp-teal-600);
  --bs-primary-rgb: 13, 148, 136;
  --bs-link-color: var(--tp-teal-700);
  --bs-link-color-rgb: 15, 118, 110;
  --bs-link-hover-color: var(--tp-teal-800);
  --bs-link-hover-color-rgb: 17, 94, 89;
  --bs-body-font-family: var(--tp-font);
  --bs-border-radius: var(--tp-radius);
  --bs-border-radius-sm: var(--tp-radius-sm);
  --bs-border-radius-lg: var(--tp-radius-lg);
  --bs-focus-ring-color: rgba(13, 148, 136, 0.25);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--tp-font);
  color: var(--tp-text);
  background: var(--tp-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--tp-primary); text-decoration: none; }
a:hover { color: var(--tp-primary-hover); text-decoration: underline; }

/* ---------- Layout ---------- */
.tp-container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Topbar (marketing) ---------- */
.tp-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--tp-border);
}
.tp-topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.tp-topbar__links a {
  color: var(--tp-slate-700);
  margin-right: 22px;
  font-weight: 500;
  font-size: 14px;
}
.tp-topbar__links a:hover { color: var(--tp-primary); text-decoration: none; }

/* ---------- Buttons ---------- */
.tp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--tp-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, background-color .15s ease, box-shadow .15s ease, color .15s ease;
  text-decoration: none;
  line-height: 1;
}
.tp-btn:active { transform: translateY(1px); }
.tp-btn--primary {
  background: var(--tp-gradient);
  color: #fff;
  box-shadow: var(--tp-shadow);
}
.tp-btn--primary:hover { filter: brightness(1.05); color: #fff; text-decoration: none; }
.tp-btn--ghost {
  background: transparent;
  color: var(--tp-slate-700);
  border-color: var(--tp-border);
}
.tp-btn--ghost:hover { background: var(--tp-slate-100); color: var(--tp-text); text-decoration: none; }
.tp-btn--danger {
  background: var(--tp-rose-500);
  color: #fff;
}
.tp-btn--danger:hover { background: #e11d48; color: #fff; text-decoration: none; }
.tp-btn--lg { padding: 14px 24px; font-size: 16px; }
.tp-btn--block { width: 100%; }

/* ---------- Hero ---------- */
.tp-hero {
  position: relative;
  padding: 96px 0 72px;
  background: var(--tp-gradient-soft);
  overflow: hidden;
}
.tp-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% -10%;
  height: 60%;
  background: radial-gradient(60% 60% at 50% 0%, rgba(139,92,246,0.18), transparent 70%);
  pointer-events: none;
}
.tp-hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 900px) {
  .tp-hero__grid { grid-template-columns: 1fr; gap: 32px; }
  .tp-hero { padding: 64px 0 48px; }
}
.tp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--tp-teal-100);
  color: var(--tp-teal-700);
  font-size: 13px; font-weight: 600;
  margin-bottom: 20px;
}
.tp-h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -1.2px;
  margin: 0 0 18px;
  font-weight: 800;
}
.tp-h1 .tp-accent {
  background: var(--tp-gradient);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.tp-lead {
  font-size: 18px; line-height: 1.6;
  color: var(--tp-slate-600);
  max-width: 560px;
  margin: 0 0 28px;
}
.tp-hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Hero preview card ---------- */
.tp-preview {
  background: #fff;
  border-radius: var(--tp-radius-lg);
  box-shadow: var(--tp-shadow-lg);
  border: 1px solid var(--tp-border);
  padding: 20px;
  position: relative;
}
.tp-preview__bar {
  display: flex; gap: 6px; margin-bottom: 14px;
}
.tp-preview__bar span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--tp-slate-200);
}
.tp-preview__row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  margin-bottom: 10px;
  background: var(--tp-slate-50);
}
.tp-preview__row i { color: var(--tp-primary); }
.tp-chip {
  font-size: 12px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tp-teal-50);
  color: var(--tp-teal-700);
}
.tp-chip--green { background: #ECFDF5; color: #047857; }
.tp-chip--amber { background: #FFFBEB; color: #B45309; }
.tp-chip--rose  { background: #FFF1F2; color: #BE123C; }

/* ---------- Feature grid ---------- */
.tp-section {
  padding: 80px 0;
}
.tp-section--alt { background: #fff; border-top: 1px solid var(--tp-border); border-bottom: 1px solid var(--tp-border); }
.tp-section__head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}
.tp-section__head h2 {
  font-size: clamp(28px, 3.5vw, 40px);
  letter-spacing: -0.5px;
  margin: 0 0 12px;
  font-weight: 800;
}
.tp-section__head p { color: var(--tp-muted); margin: 0; font-size: 17px; }

.tp-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.tp-feature {
  padding: 24px;
  border-radius: var(--tp-radius-lg);
  background: #fff;
  border: 1px solid var(--tp-border);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tp-feature:hover { transform: translateY(-2px); box-shadow: var(--tp-shadow); border-color: var(--tp-teal-200); }
.tp-feature__icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--tp-teal-50);
  color: var(--tp-teal-600);
  font-size: 20px;
  margin-bottom: 14px;
}
.tp-feature h3 { margin: 0 0 6px; font-size: 17px; }
.tp-feature p  { margin: 0; color: var(--tp-muted); font-size: 14px; line-height: 1.55; }

/* ---------- Product showcase ---------- */
.tp-showcase {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: center;
  margin-bottom: 72px;
}
.tp-showcase:last-child { margin-bottom: 0; }
.tp-showcase--reverse .tp-showcase__copy { order: 2; }
.tp-showcase--reverse .tp-mock { order: 1; }
@media (max-width: 900px) {
  .tp-showcase { grid-template-columns: 1fr; gap: 28px; margin-bottom: 56px; }
  .tp-showcase--reverse .tp-showcase__copy,
  .tp-showcase--reverse .tp-mock { order: initial; }
}
.tp-showcase__copy h3 {
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.4px;
  margin: 0 0 12px;
  font-weight: 800;
}
.tp-showcase__copy > p {
  color: var(--tp-slate-600);
  font-size: 16px; line-height: 1.6;
  margin: 0 0 18px;
  max-width: 480px;
}
.tp-showcase__list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.tp-showcase__list li {
  display: flex; align-items: center; gap: 10px;
  color: var(--tp-slate-700);
  font-size: 14px;
}
.tp-showcase__list i {
  color: var(--tp-teal-600);
  background: var(--tp-teal-50);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px;
}

/* ---------- Mock UI cards ---------- */
.tp-mock {
  background: #fff;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-lg);
  box-shadow: var(--tp-shadow-lg);
  overflow: hidden;
  position: relative;
}
.tp-mock__bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: var(--tp-slate-50);
  border-bottom: 1px solid var(--tp-border);
}
.tp-mock__bar span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--tp-slate-200);
}
.tp-mock__url {
  margin-left: 12px;
  font-size: 12px;
  color: var(--tp-muted);
  background: #fff;
  border: 1px solid var(--tp-border);
  border-radius: 6px;
  padding: 3px 10px;
  flex: 1;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.tp-mock__body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }

.tp-mock__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tp-mock__stat {
  padding: 12px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  background: var(--tp-slate-50);
}
.tp-mock__stat-label { font-size: 11px; color: var(--tp-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.tp-mock__stat-value { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.tp-mock__stat-delta { font-size: 11px; font-weight: 600; color: var(--tp-emerald-500); margin-top: 2px; }

.tp-mock__row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  background: #fff;
}
.tp-mock__row > i { color: var(--tp-primary); font-size: 16px; }
.tp-mock__row-main { flex: 1; min-width: 0; }
.tp-mock__row-title { font-weight: 600; font-size: 14px; }
.tp-mock__row-sub { font-size: 12px; color: var(--tp-muted); margin-top: 2px; }
.tp-mock__progress {
  margin-top: 6px;
  height: 4px;
  background: var(--tp-slate-100);
  border-radius: 999px;
  overflow: hidden;
}
.tp-mock__progress span {
  display: block;
  height: 100%;
  background: var(--tp-gradient);
  border-radius: 999px;
}

.tp-mock__field {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  background: #fff;
}
.tp-mock__field-label {
  font-size: 11px; font-weight: 700;
  color: var(--tp-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 52px;
}
.tp-mock__field-value { font-size: 13px; color: var(--tp-slate-700); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-mock__chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.tp-mock__chip-person {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 3px;
  background: var(--tp-teal-50);
  color: var(--tp-teal-700);
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.tp-mock__avatar {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-size: 10px; font-weight: 700;
}

.tp-mock__email {
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  background: var(--tp-slate-50);
  padding: 14px;
}
.tp-mock__email-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tp-mock__logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--tp-gradient);
  color: #fff; font-weight: 800; font-size: 12px;
  display: grid; place-items: center;
}
.tp-mock__email-body { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.tp-mock__line { height: 7px; background: var(--tp-slate-200); border-radius: 4px; width: 100%; }
.tp-mock__email-cta {
  display: inline-block;
  padding: 7px 14px;
  background: var(--tp-gradient);
  color: #fff;
  border-radius: var(--tp-radius-sm);
  font-size: 12px; font-weight: 700;
}

.tp-mock__chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  height: 128px;
  padding: 10px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  background: var(--tp-slate-50);
}
.tp-mock__bar-col {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  height: 100%;
}
.tp-mock__bar-col span {
  display: block;
  width: 100%;
  background: var(--tp-teal-200);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}
.tp-mock__bar-col--active span { background: var(--tp-gradient); }
.tp-mock__bar-col small { font-size: 10px; color: var(--tp-muted); font-weight: 600; }

.tp-mock__badge,
.tp-mock__ai,
.tp-mock__insight {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--tp-radius);
  background: var(--tp-teal-50);
  color: var(--tp-teal-700);
  font-size: 13px; font-weight: 600;
}
.tp-mock__ai { background: var(--tp-cyan-50); color: var(--tp-cyan-700); align-items: flex-start; }
.tp-mock__insight { background: #ECFDF5; color: #047857; align-items: flex-start; }
.tp-mock__ai strong,
.tp-mock__insight strong { display: block; font-size: 13px; }
.tp-mock__ai-sub { font-size: 12px; font-weight: 500; opacity: 0.85; margin-top: 1px; }

/* ---------- Pulsing dot ---------- */
.tp-pulse-dot {
  position: relative;
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--tp-teal-500);
  flex-shrink: 0;
  margin-top: 4px;
}
.tp-pulse-dot::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: inherit;
  opacity: 0.6;
  animation: tp-pulse 1.8s ease-out infinite;
}
.tp-pulse-dot--cyan { background: var(--tp-cyan-500); }
.tp-pulse-dot--emerald { background: var(--tp-emerald-500); }
@keyframes tp-pulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  80%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tp-pulse-dot::before { animation: none; }
}

/* ---------- Pricing ---------- */
.tp-pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
}
.tp-price-card {
  display: flex; flex-direction: column;
  padding: 28px;
  border-radius: var(--tp-radius-lg);
  background: #fff;
  border: 1px solid var(--tp-border);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  position: relative;
}
.tp-price-card:hover { transform: translateY(-2px); box-shadow: var(--tp-shadow); }
.tp-price-card--highlight {
  border-color: var(--tp-teal-400);
  box-shadow: var(--tp-shadow);
}
.tp-price-card--highlight::before {
  content: "Most popular";
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--tp-gradient);
  color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
  letter-spacing: 0.02em;
}
.tp-price-card__name { font-size: 14px; font-weight: 700; color: var(--tp-teal-700); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }
.tp-price-card__price { font-size: 40px; font-weight: 800; letter-spacing: -1px; margin-bottom: 4px; }
.tp-price-card__price small { font-size: 15px; color: var(--tp-muted); font-weight: 500; margin-left: 4px; }
.tp-price-card__tagline { color: var(--tp-muted); font-size: 14px; margin-bottom: 20px; }
.tp-price-card__list { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.tp-price-card__list li {
  padding: 8px 0;
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; color: var(--tp-slate-700);
  border-bottom: 1px solid var(--tp-slate-100);
}
.tp-price-card__list li::before {
  content: ""; flex-shrink: 0;
  width: 18px; height: 18px; margin-top: 1px;
  background: var(--tp-teal-50) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%230D9488' d='M6.2 11.2 3.4 8.4l1-1 1.8 1.8 4.4-4.4 1 1z'/></svg>") center/12px no-repeat;
  border-radius: 50%;
}
.tp-price-card__list li:last-child { border-bottom: 0; }
.tp-price-card .tp-btn { width: 100%; }

/* ---------- Plan picker (signup) ---------- */
.tp-plan-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.tp-plan-option {
  position: relative;
  display: block;
  padding: 12px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  cursor: pointer;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tp-plan-option:hover { border-color: var(--tp-teal-400); }
.tp-plan-option input { position: absolute; opacity: 0; pointer-events: none; }
.tp-plan-option.is-selected,
.tp-plan-option:has(input:checked) {
  border-color: var(--tp-teal-500);
  box-shadow: 0 0 0 3px var(--tp-teal-50);
}
.tp-plan-option__name { font-weight: 700; font-size: 14px; }
.tp-plan-option__price { color: var(--tp-muted); font-size: 13px; }
.tp-plan-option__price span { font-size: 11px; margin-left: 2px; }

/* ---------- CTA band ---------- */
.tp-cta-band {
  background: var(--tp-gradient);
  color: #fff;
  padding: 56px 0;
  text-align: center;
}
.tp-cta-band h2 { margin: 0 0 10px; font-size: 32px; letter-spacing: -0.5px; }
.tp-cta-band p  { margin: 0 0 22px; opacity: .9; }
.tp-cta-band .tp-btn--primary {
  background: #fff;
  color: var(--tp-teal-700);
  box-shadow: none;
}
.tp-cta-band .tp-btn--primary:hover { background: var(--tp-slate-100); color: var(--tp-teal-700); }

/* ---------- Footer ---------- */
.tp-footer {
  padding: 32px 0;
  color: var(--tp-muted);
  font-size: 14px;
  text-align: center;
  border-top: 1px solid var(--tp-border);
  background: #fff;
}

/* ---------- Auth (login / signup) ---------- */
.tp-auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--tp-bg);
}
@media (max-width: 900px) { .tp-auth-wrap { grid-template-columns: 1fr; } }

.tp-auth-brand {
  background: var(--tp-gradient);
  color: #fff;
  padding: 48px;
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
@media (max-width: 900px) { .tp-auth-brand { display: none; } }
.tp-auth-brand::before {
  content: "";
  position: absolute;
  inset: -20% -20% auto auto;
  width: 420px; height: 420px;
  background: radial-gradient(closest-side, rgba(255,255,255,0.22), transparent 70%);
  pointer-events: none;
}
.tp-auth-brand h2 { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; margin: 0 0 12px; max-width: 420px; }
.tp-auth-brand p  { opacity: .9; max-width: 420px; line-height: 1.55; }
.tp-auth-brand__footer { font-size: 13px; opacity: .8; }

.tp-auth-panel {
  display: grid; place-items: center;
  padding: 32px;
}
.tp-auth-card {
  width: 100%;
  max-width: 420px;
}
.tp-auth-card h1 {
  font-size: 28px; letter-spacing: -0.5px; margin: 24px 0 6px; font-weight: 800;
}
.tp-auth-card p.tp-auth-sub { color: var(--tp-muted); margin: 0 0 24px; }

/* ---------- Forms ---------- */
.tp-field { margin-bottom: 16px; }
.tp-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--tp-slate-700);
  margin-bottom: 6px;
}
.tp-input, .tp-select, .tp-textarea {
  width: 100%;
  font: inherit;
  padding: 11px 14px;
  border-radius: var(--tp-radius);
  border: 1px solid var(--tp-border);
  background: #fff;
  color: var(--tp-text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tp-input:focus, .tp-select:focus, .tp-textarea:focus {
  outline: none;
  border-color: var(--tp-teal-400);
  box-shadow: 0 0 0 4px var(--tp-teal-50);
}
.tp-helper { font-size: 12px; color: var(--tp-muted); margin-top: 6px; }

.tp-alert {
  padding: 12px 14px;
  border-radius: var(--tp-radius);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.tp-alert--error   { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.tp-alert--success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.tp-alert--info    { background: var(--tp-teal-50); color: var(--tp-teal-700); border-color: var(--tp-teal-200); }

/* ---------- App shell (dashboard) ---------- */
.tp-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
@media (max-width: 900px) { .tp-app { grid-template-columns: 1fr; } }

.tp-side {
  background: var(--tp-slate-900);
  color: #E2E8F0;
  padding: 20px 14px;
  display: flex; flex-direction: column;
  gap: 6px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}

/* Mobile drawer: sidebar slides over the main content. */
.tp-side-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 45;
}
.tp-side-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--tp-border);
  color: var(--tp-slate-700);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.tp-side-toggle:hover { background: var(--tp-slate-100); }

@media (max-width: 900px) {
  .tp-side {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 82vw; max-width: 320px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 50;
    box-shadow: var(--tp-shadow-lg);
  }
  .tp-side.is-open { transform: translateX(0); }
  .tp-side-backdrop.is-open { display: block; }
  .tp-side-toggle { display: inline-flex; align-items: center; justify-content: center; }
}

.tp-side__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
}
.tp-side__brand strong { font-size: 17px; letter-spacing: -0.2px; color: #fff; }

.tp-side__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #CBD5E1;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
}
.tp-side__item:hover, .tp-side__item.is-active {
  background: rgba(99, 102, 241, 0.18);
  color: #fff;
  text-decoration: none;
}
.tp-side__item i { width: 18px; text-align: center; opacity: .85; }

.tp-side__footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: #94A3B8;
}

/* app body wrapper */
.tp-main { display: flex; flex-direction: column; min-width: 0; }
.tp-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--tp-border);
  position: sticky; top: 0; z-index: 5;
  padding-top: max(14px, env(safe-area-inset-top));
}
.tp-header__title { font-weight: 700; font-size: 18px; letter-spacing: -0.3px; }
.tp-header__right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tp-header__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tp-header__left .tp-header__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 700px) {
  .tp-header { padding: 10px 14px; gap: 8px; }
  .tp-header__title { font-size: 15px; }
  .tp-header .tp-tenant-badge { display: none; }
  .tp-header .tp-user-pill span:not(.tp-user-pill__avatar) { display: none; }
  .tp-header .tp-user-pill { padding: 4px; }
  .tp-header__right .tp-btn { padding: 8px 12px; font-size: 13px; }
  .tp-header__right .tp-btn i + span,
  .tp-header__right .tp-btn > span:not(:first-child) { display: none; }
}

.tp-tenant-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: var(--tp-teal-50);
  color: var(--tp-teal-700);
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.tp-user-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--tp-border);
  border-radius: 999px;
  color: var(--tp-slate-700);
  font-size: 13px;
}
.tp-user-pill__avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--tp-gradient); color: #fff;
  font-weight: 700; font-size: 12px;
  display: grid; place-items: center;
}

.tp-page { padding: 24px; }
.tp-card {
  background: #fff;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-lg);
  padding: 20px;
  box-shadow: var(--tp-shadow-sm);
}
.tp-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

.tp-stat { padding: 16px 18px; }
.tp-stat__label { font-size: 13px; color: var(--tp-muted); margin-bottom: 4px; }
.tp-stat__value { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.tp-stat__delta { font-size: 12px; font-weight: 600; color: var(--tp-emerald-500); }

/* ---------- Accessibility helpers ---------- */
.tp-skip-link {
  position: absolute;
  top: -48px; left: 12px;
  background: var(--tp-slate-900);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--tp-radius);
  font-size: 14px; font-weight: 600;
  z-index: 100;
  transition: top .15s ease;
}
.tp-skip-link:focus {
  top: 12px;
  outline: 3px solid var(--tp-teal-400);
  outline-offset: 2px;
  color: #fff;
  text-decoration: none;
}

*:focus-visible {
  outline: 2px solid var(--tp-teal-500);
  outline-offset: 2px;
}

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

/* ---------- Mobile responsive refinements ---------- */
@media (max-width: 700px) {
  .tp-container { padding-inline: 16px; }
  .tp-page { padding: 16px; }
  .tp-card { padding: 16px; border-radius: var(--tp-radius); }
  .tp-h1 { letter-spacing: -0.5px; }
  .tp-section { padding: 56px 0; }
  .tp-cta-band { padding: 40px 0; }
  .tp-cta-band h2 { font-size: 24px; }

  /* Topbar (marketing) collapses links to keep actions visible. */
  .tp-topbar__inner { height: 56px; gap: 8px; }
  .tp-topbar__links { display: none; }
  .tp-topbar .tp-btn--ghost { display: none; }

  /* Tables become horizontally scrollable with min-width content. */
  .table-responsive, .grid-table { -webkit-overflow-scrolling: touch; }
  table { font-size: 14px; }

  /* Keep Bootstrap offcanvas drawers full-width on phones. */
  .offcanvas.offcanvas-end { width: 100% !important; max-width: 100%; }

  /* Modals breathe on small screens. */
  .modal-dialog.modal-xl { margin: 8px; }

  /* Touch targets: buttons should meet 44x44 minimum. */
  .tp-btn, .btn, .tp-side__item, .tp-side-toggle {
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .tp-h1 { font-size: 32px; }
  .tp-hero { padding: 48px 0 36px; }
  .tp-hero__cta .tp-btn { width: 100%; justify-content: center; }
}

/* Safe-area padding for notched phones. */
@supports (padding: max(0px)) {
  .tp-side { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .tp-page { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}

/* ---------- Utility ---------- */
.tp-mt-0 { margin-top: 0 !important; }
.tp-mt-2 { margin-top: 12px; }
.tp-mt-4 { margin-top: 24px; }
.tp-mb-2 { margin-bottom: 12px; }
.tp-mb-4 { margin-bottom: 24px; }
.tp-flex { display: flex; }
.tp-items-center { align-items: center; }
.tp-justify-between { justify-content: space-between; }
.tp-gap-2 { gap: 8px; }
.tp-gap-3 { gap: 12px; }
.tp-text-muted { color: var(--tp-muted); }
.tp-text-center { text-align: center; }
.tp-hidden { display: none !important; }

/* Bootstrap overrides for the dashboard so ticket_manager.js looks modern */
body.tp-dashboard { background: var(--tp-bg); }
body.tp-dashboard .btn-primary {
  background: var(--tp-primary);
  border-color: var(--tp-primary);
}
body.tp-dashboard .btn-primary:hover {
  background: var(--tp-primary-hover);
  border-color: var(--tp-primary-hover);
}
body.tp-dashboard .nav-tabs .nav-link.active {
  color: var(--tp-primary);
  border-bottom: 2px solid var(--tp-primary);
}

/* ---------------------------------------------------------------------------
   Loading indicators
   - .tp-topbar-loader  : fixed top-of-viewport progress bar (fetch-driven)
   - .tp-inline-loader  : centered spinner + label for container placeholders
   --------------------------------------------------------------------------*/
.tp-topbar-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 2000;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}
.tp-topbar-loader.is-active { opacity: 1; }
.tp-topbar-loader__bar {
  height: 100%;
  width: 28%;
  background: linear-gradient(90deg, transparent, var(--tp-primary, #0D9488) 40%, var(--tp-primary, #0D9488) 60%, transparent);
  animation: tp-topbar-slide 1.1s linear infinite;
}
@keyframes tp-topbar-slide {
  0%   { transform: translateX(-40%); }
  100% { transform: translateX(360%); }
}
@media (prefers-reduced-motion: reduce) {
  .tp-topbar-loader__bar { animation: none; width: 100%; opacity: .4; }
}

.tp-inline-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 16px;
  color: #64748B;
  font-size: 14px;
}
.tp-inline-loader--compact { padding: 12px 8px; font-size: 13px; }
.tp-inline-loader__spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(13, 148, 136, .2);
  border-top-color: var(--tp-primary, #0D9488);
  animation: tp-spin 0.8s linear infinite;
}
@keyframes tp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .tp-inline-loader__spinner { animation: none; }
}
