/* CenDesk — main stylesheet (vanilla CSS, no build step) */
:root {
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --text: #1e293b;
  --text-muted: #64748b;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --border: #e2e8f0;
  --card: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.8);
  --shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.08), 0 2px 8px -2px rgba(15, 23, 42, 0.04);
  --glow: 0 0 40px -8px rgba(59, 130, 246, 0.35);
  --radius: 1rem;
  --radius-sm: 0.75rem;
  --font: Inter, system-ui, -apple-system, sans-serif;
  --surface: #0f172a;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

html.dark {
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --bg: #020617;
  --bg-soft: #0f172a;
  --border: #1e293b;
  --card: #0f172a;
  --header-bg: rgba(15, 23, 42, 0.85);
  --shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s, color 0.25s;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.container { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: 1.25rem; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--brand-600);
  color: #fff;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.skip-link:focus { left: 0.5rem; }

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}
.header-inner {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}
.logo-mark { width: 2rem; height: 2rem; flex-shrink: 0; }
.logo-mark.sm { width: 1.75rem; height: 1.75rem; }
.nav-main {
  display: none;
  align-items: center;
  gap: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}
.nav-main a:hover, .nav-main a.is-active { color: var(--brand-600); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.header-actions .btn { white-space: nowrap; flex-shrink: 0; }
/* must come before the desktop override, and be !important, because .btn (later in this file) sets display too */
.hide-sm { display: none !important; }
@media (min-width: 768px) {
  .nav-main { display: flex; }
  .hide-sm { display: inline-flex !important; }
}

/* Mobile nav: hamburger on the left, the menu slides in from the left */
.nav-drawer-head, .nav-drawer-actions, .nav-backdrop { display: none; }
@media (min-width: 768px) {
  .btn-icon.nav-toggle { display: none; }
}
@media (max-width: 767px) {
  /* a blurred header would trap the fixed slide-in panel inside the 4rem bar, so it is solid on phones */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .header-inner { justify-content: flex-start; gap: 0.5rem; }
  .header-actions { margin-left: auto; gap: 0.35rem; }
  .header-actions .btn-primary { padding: 0.4rem 0.8rem; font-size: 0.8125rem; border-radius: 0.6rem; }
  .header-inner > .logo { font-size: 1.05rem; }
  .header-inner > .logo .logo-mark { width: 1.75rem; height: 1.75rem; }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(2, 6, 23, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0s linear 0.28s;
  }
  .nav-backdrop.is-open { opacity: 1; visibility: visible; transition: opacity 0.28s ease; }

  .nav-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    width: min(19rem, 86vw);
    padding: 0 1.25rem 1.25rem;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    box-shadow: 8px 0 32px rgba(2, 6, 23, 0.25);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.28s ease, visibility 0s linear 0.28s;
  }
  .nav-main.is-open { transform: translateX(0); visibility: visible; transition: transform 0.28s ease; }
  .nav-main > a {
    padding: 0.9rem 0.25rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  }
  .nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
  }
  .nav-drawer-actions { display: grid; gap: 0.6rem; margin-top: auto; padding-top: 1.5rem; }
  .nav-drawer-actions .btn { width: 100%; padding: 0.7rem 1rem; }
}
html.nav-open { overflow: hidden; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--brand-600);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--brand-700); }
.btn-secondary {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover { border-color: #cbd5e1; }
html.dark .btn-secondary:hover { border-color: #475569; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding-inline: 0.75rem;
}
.btn-ghost:hover { color: var(--brand-600); }
.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-icon:hover {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--text);
}
html.dark .icon-moon { display: none; }
html:not(.dark) .icon-sun { display: none; }

/* Hero */
.hero {
  padding: 7rem 0 4rem;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(59, 130, 246, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(99, 102, 241, 0.12), transparent);
}
html.dark .hero {
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(59, 130, 246, 0.22), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(99, 102, 241, 0.15), transparent);
}
.hero-inner { max-width: 48rem; margin-inline: auto; text-align: center; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand-700);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
html.dark .badge {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}
.badge-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--brand-500);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--brand-600), #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  margin: 1.25rem auto 0;
  max-width: 36rem;
  font-size: 1.125rem;
  color: var(--text-muted);
}
.hero-cta {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.hero-note {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Sections */
.section { padding: 4rem 0; }
.section-alt { background: var(--bg-soft); border-block: 1px solid var(--border); }
.section-dark {
  background: var(--surface);
  color: #e2e8f0;
  padding: 4rem 0;
}
.section-title {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}
.section-sub {
  margin: 0.75rem auto 0;
  max-width: 36rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
}
.section-dark .section-sub { color: #94a3b8; }

/* Feature grid */
.grid-3 {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
}
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand-500) 40%, var(--border));
  box-shadow: var(--glow);
}
.card-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  background: var(--brand-50);
}
html.dark .card-icon { background: rgba(37, 99, 235, 0.2); }
.card h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.card p { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* Channel cards on dark */
.channel-grid { display: grid; gap: 1.25rem; margin-top: 2rem; }
@media (min-width: 768px) { .channel-grid { grid-template-columns: repeat(3, 1fr); } }
.channel-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  padding: 1.5rem;
}
.channel-card h3 { margin: 0.5rem 0 0; font-size: 1.1rem; color: #fff; }
.channel-card p { margin: 0.5rem 0 0; font-size: 0.875rem; color: #94a3b8; line-height: 1.6; }

/* Pricing */
.pricing-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2.5rem;
  align-items: start;
}
@media (min-width: 768px) {
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
  .pricing-card.featured { transform: scale(1.03); }
}
.pricing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: var(--shadow);
  position: relative;
}
.pricing-card.featured {
  border: 2px solid var(--brand-500);
  box-shadow: var(--glow);
}
.plan-badge {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-600);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}
.plan-name {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.pricing-card.featured .plan-name { color: var(--brand-600); }
.plan-price {
  margin: 0.75rem 0 0;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.plan-price span { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.plan-desc { margin: 0.5rem 0 0; font-size: 0.875rem; color: var(--text-muted); }
.plan-features {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
  font-size: 0.875rem;
}
.plan-features li { display: flex; gap: 0.5rem; }
.plan-features .yes { color: var(--success); font-weight: 700; }
.plan-features .no { color: var(--text-muted); }
.pricing-card .btn { width: 100%; margin-top: 1.75rem; }

/* FAQ */
.faq-list { max-width: 40rem; margin: 2rem auto 0; display: grid; gap: 1rem; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.faq-item dt { font-weight: 600; margin: 0; }
.faq-item dd { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* CTA band */
.cta-band {
  margin: 2rem auto 4rem;
  max-width: 56rem;
  padding: 2.5rem 2rem;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, var(--brand-600), #4f46e5);
  color: #fff;
  text-align: center;
  box-shadow: var(--glow);
}
.cta-band h2 { margin: 0; font-size: 1.75rem; font-weight: 700; }
.cta-band p { margin: 0.75rem auto 0; max-width: 28rem; opacity: 0.9; }
.cta-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.cta-band .btn-white {
  background: #fff;
  color: var(--brand-700);
}
.cta-band .btn-outline-white {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.cta-band .btn-outline-white:hover { background: rgba(255, 255, 255, 0.1); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}
@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text);
}
.footer-nav { display: flex; gap: 1.25rem; }
.footer-nav a:hover { color: var(--brand-600); }

/* Page title block */
.page-hero {
  padding: 7rem 0 2rem;
  text-align: center;
}
.page-hero .eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-600);
  margin: 0 0 0.75rem;
}
.page-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.page-hero p {
  margin: 1rem auto 0;
  max-width: 36rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.legal { max-width: 46rem; }
.legal h2 { font-size: 1.15rem; margin: 2rem 0 .5rem; }
.legal p, .legal li { color: var(--text-muted); line-height: 1.7; }
.legal ul, .legal ol { padding-left: 1.25rem; }
.legal a { color: var(--brand-600); text-decoration: underline; }
.footer-nav { flex-wrap: wrap; }

/* ========== Admin workstation ========== */
body.page-admin {
  height: 100vh;
  overflow: hidden;
  background: var(--bg-soft);
}
.admin-shell {
  display: flex;
  height: 100vh;
}
.admin-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.admin-sidebar.collapsed { width: 72px; }
.admin-sidebar.collapsed .nav-label,
.admin-sidebar.collapsed .section-label,
.admin-sidebar.collapsed .logo-text,
.admin-sidebar.collapsed .user-meta,
.admin-sidebar.collapsed .badge-count,
.admin-sidebar.collapsed .user-actions {
  display: none;
}
.admin-sidebar.collapsed .sidebar-link { justify-content: center; padding-inline: 0; }
.admin-sidebar.collapsed .logo-row { justify-content: center; }
.admin-sidebar.collapsed #collapse-btn svg { transform: rotate(180deg); }

.logo-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem;
  min-height: 64px;
}
.logo-row .logo-text strong {
  display: block;
  color: #fff;
  font-size: 0.95rem;
}
.logo-row .logo-text small {
  color: #64748b;
  font-size: 0.7rem;
}
#collapse-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#collapse-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
#collapse-btn svg { transition: transform 0.25s; }

.admin-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.65rem;
}
.section-label {
  padding: 0.75rem 0.75rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}
.sidebar-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.sidebar-link:hover { background: rgba(255, 255, 255, 0.06); }
.sidebar-link.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
.sidebar-link .icon { width: 1.25rem; text-align: center; flex-shrink: 0; }
.badge-count {
  margin-left: auto;
  background: var(--brand-600);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
}

.user-box {
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.user-row { display: flex; align-items: center; gap: 0.75rem; }
.avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.user-meta strong { display: block; color: #fff; font-size: 0.85rem; }
.user-meta span { font-size: 0.7rem; color: #64748b; }
.user-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.user-actions a, .user-actions button {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.45rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: none;
  cursor: pointer;
}
.user-actions a:hover, .user-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.admin-topbar {
  height: 3.5rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 85%, transparent);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 1.5rem;
}
.admin-topbar h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.demo-pill {
  margin-left: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
}
.admin-topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.search-wrap { position: relative; display: none; }
@media (min-width: 768px) { .search-wrap { display: block; } }
.search-wrap input {
  width: 16rem;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.875rem;
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.search-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}
.admin-view { display: none; max-width: 72rem; margin-inline: auto; }
.admin-view.active { display: block; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.stat-card .label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.stat-card .value {
  margin-top: 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
}
.stat-card .hint { margin-top: 0.25rem; font-size: 0.75rem; color: var(--text-muted); }
.stat-card .hint.up { color: var(--success); }
.stat-card .hint.warn { color: var(--warning); }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 1.25rem;
}
.panel-head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.95rem;
}
.panel-body { padding: 0; }
.list-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  font-size: 0.875rem;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--bg-soft); }

.tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tab {
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}
.tab:hover { background: var(--bg-soft); }
.tab.active {
  background: var(--brand-600);
  color: #fff;
}

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.data th {
  text-align: left;
  padding: 0.75rem 1.25rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
table.data td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
table.data tr { cursor: pointer; }
table.data tr:hover td { background: var(--bg-soft); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.pill-green { background: #ecfdf5; color: #047857; }
.pill-blue { background: #eff6ff; color: #1d4ed8; }
.pill-violet { background: #f5f3ff; color: #6d28d9; }
.pill-slate { background: var(--bg-soft); color: var(--text-muted); }
html.dark .pill-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
html.dark .pill-blue { background: rgba(37, 99, 235, 0.2); color: #93c5fd; }
html.dark .pill-violet { background: rgba(109, 40, 217, 0.2); color: #c4b5fd; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

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


/* ========== Live chat widget ========== */
.chat-widget {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  font-family: var(--font);
}
.chat-launcher {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: var(--brand-600);
  color: #fff;
  box-shadow: var(--glow), 0 8px 24px rgba(15, 23, 42, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}
.chat-launcher:hover {
  background: var(--brand-700);
  transform: scale(1.05);
}
.chat-launcher[aria-expanded="true"] {
  background: var(--surface);
}
.chat-launcher svg { width: 1.5rem; height: 1.5rem; }
.chat-launcher .icon-close { display: none; }
.chat-launcher[aria-expanded="true"] .icon-chat { display: none; }
.chat-launcher[aria-expanded="true"] .icon-close { display: block; }

.chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(3.5rem + 0.75rem);
  width: min(22.5rem, calc(100vw - 2rem));
  height: min(28rem, calc(100vh - 7rem));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  box-shadow: var(--shadow), 0 16px 48px rgba(15, 23, 42, 0.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chat-panel.is-open {
  display: flex;
  animation: chatIn 0.2s ease;
}
@keyframes chatIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, var(--brand-600), #4f46e5);
  color: #fff;
}
.chat-panel-header .avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.chat-panel-header strong { display: block; font-size: 0.9rem; }
.chat-panel-header span { font-size: 0.7rem; opacity: 0.85; }
.chat-status-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #34d399;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-soft);
}
.chat-bubble {
  max-width: 85%;
  padding: 0.65rem 0.85rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
}
.chat-bubble.agent {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-top-left-radius: 0.25rem;
  color: var(--text);
}
.chat-bubble.user {
  align-self: flex-end;
  background: var(--brand-600);
  color: #fff;
  border-top-right-radius: 0.25rem;
}
.chat-bubble .meta {
  display: block;
  font-size: 0.65rem;
  opacity: 0.7;
  margin-bottom: 0.2rem;
}
.chat-typing {
  align-self: flex-start;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  display: none;
}
.chat-typing.is-visible { display: block; }

.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.chat-form input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.875rem;
}
.chat-form input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.chat-form button {
  border: none;
  border-radius: 0.75rem;
  background: var(--brand-600);
  color: #fff;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}
.chat-form button:hover { background: var(--brand-700); }
.chat-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .chat-widget { right: 0.75rem; bottom: 0.75rem; }
  .chat-panel {
    width: calc(100vw - 1.5rem);
    height: min(70vh, 28rem);
  }
}


/* Live agent notification UI */
.chat-launcher {
  position: relative;
}
.chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
  display: none;
}
.chat-badge.is-visible {
  display: block;
  animation: badgePop 0.3s ease;
}
@keyframes badgePop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.chat-launcher.has-unread {
  animation: chatPulse 1.6s ease-in-out infinite;
}
@keyframes chatPulse {
  0%, 100% { box-shadow: var(--glow), 0 8px 24px rgba(15, 23, 42, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.25), 0 8px 24px rgba(15, 23, 42, 0.2); }
}
.chat-toast {
  position: absolute;
  right: 0;
  bottom: calc(3.5rem + 0.75rem);
  width: min(18rem, calc(100vw - 2rem));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  box-shadow: var(--shadow);
  padding: 0.75rem 0.9rem;
  font-size: 0.8rem;
  color: var(--text);
  display: none;
  cursor: pointer;
  z-index: 1;
}
.chat-toast.is-visible {
  display: block;
  animation: chatIn 0.2s ease;
}
.chat-toast strong {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
  color: var(--brand-600);
}
.chat-panel.is-open ~ .chat-toast {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ========== Admin: auth, forms, tickets (database-backed) ========== */
.muted-sm { font-size: 0.8rem; color: var(--text-muted); }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 0.5rem;
  color: var(--brand-600);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.panel-head .link-btn { margin-bottom: 0; }
.empty { margin: 0; padding: 1.5rem 1.25rem; text-align: center; color: var(--text-muted); font-size: 0.875rem; }
.ticket-link:hover strong { color: var(--brand-600); }

.prio { font-weight: 600; }
.prio-urgent { color: var(--danger); }
.prio-high { color: #ea580c; }
.prio-medium { color: var(--brand-600); }
.prio-low { color: var(--text-muted); }
.sla-warn { color: var(--warning); }
.sla-over { color: var(--danger); }

.flash {
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  border: 1px solid transparent;
}
.flash-ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.flash-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
html.dark .flash-ok { background: rgba(16, 185, 129, 0.12); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
html.dark .flash-error { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }

.field { display: grid; gap: 0.35rem; font-size: 0.8rem; font-weight: 600; color: var(--text); }
.field small { font-weight: 400; color: var(--text-muted); }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="tel"],
.field select, .field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--card);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 400;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--brand-500);
  outline-offset: 1px;
}
.field-check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }

.form-panel { padding: 1.25rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.field-wide { grid-column: 1 / -1; }
.form-actions { margin-top: 1rem; display: flex; justify-content: flex-end; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.75rem; }
.inline-form { display: flex; gap: 0.4rem; }

.detail-title { margin: 0 0 0.25rem; font-size: 1.25rem; }
.detail-sub { margin: 0 0 1rem; }
.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }

.convo { padding: 1.25rem; display: grid; gap: 1rem; }
.msg-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.msg-meta strong { color: var(--text); }
.msg-body {
  display: inline-block;
  max-width: 100%;
  background: var(--bg-soft);
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border-top-left-radius: 0.25rem;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.msg-agent { text-align: right; }
.msg-agent .msg-body {
  text-align: left;
  background: var(--brand-50);
  border-top-left-radius: 1rem;
  border-top-right-radius: 0.25rem;
}
html.dark .msg-agent .msg-body { background: rgba(37, 99, 235, 0.2); }

.user-actions form { flex: 1; display: flex; margin: 0; }
.user-actions form button { flex: 1; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg-soft);
}
.auth-card {
  width: 100%;
  max-width: 24rem;
  display: grid;
  gap: 1rem;
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0; font-size: 1.4rem; }
.auth-sub { margin: -0.5rem 0 0; color: var(--text-muted); font-size: 0.875rem; }
.auth-card .flash { margin: 0; }
.auth-submit { width: 100%; justify-content: center; text-align: center; }
.auth-foot { margin: 0; text-align: center; font-size: 0.8rem; color: var(--text-muted); }
.auth-foot a { color: var(--brand-600); font-weight: 600; }


/* ========== Customer auth + dashboard ========== */
.data-static tr { cursor: default; }
.inline-link { color: var(--brand-600); font-weight: 600; }

.auth-wrap-site { min-height: calc(100vh - 8rem); padding-block: 3rem; }
.auth-card-wide { max-width: 34rem; }
.auth-divider {
  display: flex; align-items: center; gap: 0.75rem; margin: 0;
  color: var(--text-muted); font-size: 0.75rem;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.btn-social {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 0.65rem 1rem; border: 1px solid var(--border); border-radius: 0.75rem;
  background: var(--card); color: var(--text); font-weight: 600; font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.btn-social:hover { border-color: #cbd5e1; box-shadow: var(--shadow); }
.btn-social svg { flex: none; }

.plan-picker { border: 0; margin: 0; padding: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(3, 1fr); }
.plan-option { cursor: pointer; position: relative; }
.plan-option input { position: absolute; opacity: 0; pointer-events: none; }
.plan-option-body {
  display: grid; gap: 0.15rem; text-align: center; padding: 0.75rem 0.5rem;
  border: 1.5px solid var(--border); border-radius: 0.75rem; background: var(--card);
  transition: border-color 0.15s, background 0.15s;
}
.plan-option-body strong { font-size: 0.9rem; }
.plan-option-price { font-size: 0.8rem; color: var(--text-muted); }
.plan-option-price small { font-size: 0.7rem; }
.plan-option input:checked + .plan-option-body { border-color: var(--brand-600); background: var(--brand-50); }
.plan-option input:checked + .plan-option-body strong { color: var(--brand-700); }
.plan-option input:focus-visible + .plan-option-body { outline: 2px solid var(--brand-500); outline-offset: 2px; }
html.dark .plan-option input:checked + .plan-option-body { background: rgba(37, 99, 235, 0.18); }
html.dark .plan-option input:checked + .plan-option-body strong { color: #93c5fd; }
@media (max-width: 30rem) { .plan-picker { grid-template-columns: 1fr; } }

/* Portal shell */
.portal { min-height: 100vh; background: var(--bg-soft); }
.portal-bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--header-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.portal-bar-inner {
  max-width: 72rem; margin-inline: auto; padding: 0.75rem 1.25rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.portal-nav { display: flex; gap: 0.25rem; flex: 1; }
.portal-link {
  padding: 0.45rem 0.85rem; border-radius: 0.6rem; font-size: 0.875rem; font-weight: 500;
  color: var(--text-muted);
}
.portal-link:hover { background: var(--bg-soft); color: var(--text); }
.portal-link.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
html.dark .portal-link.is-active { background: rgba(37, 99, 235, 0.2); color: #93c5fd; }
.portal-user { display: flex; align-items: center; gap: 0.6rem; }
.portal-user form { margin: 0; }
.portal-user .avatar {
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #60a5fa, #6366f1); color: #fff; font-size: 0.8rem; font-weight: 700;
}
.portal-user-name { font-size: 0.85rem; font-weight: 600; }
@media (max-width: 52rem) {
  .portal-user-name { display: none; }
  .portal-bar-inner { flex-wrap: wrap; gap: 0.75rem; }
  .portal-nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .portal-user { margin-left: auto; }
}
.portal-main { max-width: 72rem; margin-inline: auto; padding: 1.75rem 1.25rem 3rem; }
.portal-main > .flash { margin-bottom: 1.25rem; }

.portal-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.75rem; border-radius: 1.25rem; color: #fff;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 45%, #6366f1 100%);
  box-shadow: 0 12px 32px -12px rgba(37, 99, 235, 0.55);
}
.portal-hero h1 { margin: 0 0 0.35rem; font-size: 1.6rem; letter-spacing: -0.01em; }
.portal-hero p { margin: 0; opacity: 0.92; font-size: 0.95rem; }
.plan-chip {
  display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.35);
}

.portal-kpis {
  display: grid; gap: 1rem; margin-top: 1.25rem;
  grid-template-columns: 2fr 1fr 1fr 1fr;
}
@media (max-width: 62rem) { .portal-kpis { grid-template-columns: 1fr 1fr; } .kpi-main { grid-column: 1 / -1; } }
@media (max-width: 30rem) { .portal-kpis { grid-template-columns: 1fr; } }
.kpi {
  background: var(--card); border: 1px solid var(--border); border-radius: 1rem;
  padding: 1.25rem; box-shadow: var(--shadow);
}
.kpi-main { display: flex; align-items: center; gap: 1.5rem; }
.kpi-label { margin: 0; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.kpi-value { margin: 0.2rem 0 0; font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.kpi-main .kpi-value { font-size: 3.25rem; color: var(--brand-600); }
.kpi-hint { margin: 0.25rem 0 0; font-size: 0.8rem; color: var(--text-muted); }
.kpi-ring {
  --pct: 0;
  flex: none; width: 5.5rem; height: 5.5rem; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--success) calc(var(--pct) * 1%), var(--border) 0);
  position: relative;
}
.kpi-ring::before { content: ""; position: absolute; inset: 0.55rem; border-radius: 50%; background: var(--card); }
.kpi-ring span { position: relative; font-weight: 800; font-size: 1.05rem; }

.portal-grid { display: grid; gap: 1rem; margin-top: 1.25rem; grid-template-columns: 2fr 1fr; }
@media (max-width: 52rem) { .portal-grid { grid-template-columns: 1fr; } }
.card-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 1rem;
  padding: 1.25rem; box-shadow: var(--shadow);
}
.portal-main > .card-panel { margin-top: 1.25rem; }
.portal-main > .portal-title + .card-panel { margin-top: 0; }
.card-panel h2 { margin: 0 0 1rem; font-size: 0.95rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.card-head h2 { margin: 0; }
.card-head .link-btn { margin: 0; }
.table-card { padding: 1.25rem 0 0; overflow: hidden; }
.table-card .card-head { padding: 0 1.25rem; }
.table-card .empty { padding-bottom: 1.5rem; }

.bars { display: flex; align-items: flex-end; gap: 0.75rem; height: 11rem; padding-top: 1rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.35rem; height: 100%; }
.bar { width: 100%; max-width: 2.75rem; border-radius: 0.5rem 0.5rem 0.2rem 0.2rem; background: linear-gradient(180deg, #60a5fa, #2563eb); min-height: 0.25rem; }
.bar-val { font-size: 0.75rem; font-weight: 700; color: var(--text); }
.bar-label { font-size: 0.7rem; color: var(--text-muted); }

.plan-panel { display: flex; flex-direction: column; }
.plan-panel-name { margin: 0; font-size: 1.15rem; font-weight: 800; }
.plan-panel-price { margin: 0.15rem 0 0.9rem; font-size: 1.6rem; font-weight: 800; color: var(--brand-600); }
.plan-panel-price span { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.plan-panel-list { list-style: none; margin: 0 0 1.1rem; padding: 0; display: grid; gap: 0.45rem; font-size: 0.85rem; flex: 1; }
.plan-panel-list .yes { color: var(--success); font-weight: 700; margin-right: 0.25rem; }
.plan-panel .btn { align-self: flex-start; }

.portal-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.portal-title h1 { margin: 0; font-size: 1.5rem; }
.portal-title p { margin: 0.2rem 0 0; }
.portal-main .form-card { margin-top: 1rem; }
.portal-main .convo { padding: 0.25rem; }

.company-prompt { display: flex; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.company-prompt .field { flex: 1; min-width: 14rem; }

.assign-box { padding: 0.5rem 1.25rem 0.9rem 4rem; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); font-size: 0.8rem; }
.assign-box summary { cursor: pointer; color: var(--text-muted); }
.assign-box form { margin-top: 0.75rem; }
.check-grid { display: grid; gap: 0.5rem 1rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.check-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }

.powered-by { margin: 0; padding: 1rem 0; text-align: center; font-size: 0.75rem; color: var(--text-muted); }
.powered-by strong { font-weight: 600; color: var(--text); }
.site-footer .powered-by { border-top: 1px solid var(--border); margin-top: 1rem; }
.auth-wrap .powered-by { padding: 0; margin-top: -0.5rem; }
.portal > .powered-by, .admin-main > .powered-by { padding: 1.25rem 1.25rem 1.5rem; }

/* ===== setup, payments, support form ===== */
.nav-badge { display: inline-block; min-width: 1.15rem; padding: 0 0.35rem; margin-left: 0.25rem; border-radius: 999px; background: var(--warning); color: #fff; font-size: 0.7rem; font-weight: 700; text-align: center; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 0.9rem 1.1rem; margin-bottom: 1.25rem; border-radius: 0.9rem; border: 1px solid var(--border); background: var(--card); }
.notice p { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--text-muted); }
.notice-warn { background: #fffbeb; border-color: #fde68a; }
.notice-warn p, .notice-warn strong { color: #92400e; }
.notice-info { background: var(--brand-50); border-color: var(--brand-100); }
html.dark .notice-warn { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); }
html.dark .notice-warn p, html.dark .notice-warn strong { color: #fcd34d; }
html.dark .notice-info { background: rgba(37, 99, 235, 0.15); border-color: rgba(37, 99, 235, 0.3); }
a.notice { color: inherit; }
.progress { height: 0.5rem; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin: 0.5rem 0 1rem; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 999px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.checklist li { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.checklist a:hover { color: var(--brand-600); }
.check-dot { flex: none; width: 1.3rem; height: 1.3rem; border-radius: 50%; display: inline-grid; place-items: center; border: 1.5px solid var(--border); font-size: 0.7rem; font-weight: 700; color: #fff; }
.checklist li.is-done .check-dot, .channel-options li.is-on .check-dot { background: var(--success); border-color: var(--success); }
.checklist li.is-done a { color: var(--text-muted); text-decoration: line-through; }
.bank-box { display: grid; gap: 0.75rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); margin: 0 0 1.25rem; padding: 1rem 1.1rem; border-radius: 0.9rem; background: var(--bg-soft); border: 1px dashed var(--border); }
.bank-box dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.bank-box dd { margin: 0.15rem 0 0; font-weight: 700; }
.subhead { margin: 1.5rem 0 0.5rem; font-size: 0.9rem; }
.portal-main .card-panel[id] { scroll-margin-top: 5rem; }
.channel-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.channel-options li { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: 0.75rem; }
.channel-options li > label { display: flex; gap: 0.75rem; align-items: flex-start; cursor: pointer; width: 100%; }
.channel-options input[type=checkbox] { margin-top: 0.25rem; }
.channel-options p { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--text-muted); }
.channel-options li.is-locked { opacity: 0.6; }
.field input[type=file] { padding: 0.5rem; }
.field input[readonly], .field textarea[readonly] { background: var(--bg-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; }
.support-wrap { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 0.5rem; padding: 1rem; background: var(--bg-soft); }
.support-card { max-width: 34rem; }
.support-form { display: grid; gap: 1rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.email-box { display: grid; gap: 0.4rem; margin: 0 0 1.25rem; padding: 1rem 1.1rem; border-radius: 0.9rem; background: var(--bg-soft); border: 1px dashed var(--border); }
.email-box input { width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: 0.6rem; background: var(--card); color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.email-box p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }

.auth-card .auth-foot + .auth-foot { margin-top: -0.5rem; }
.verify-card { text-align: center; }
.verify-card .mail-icon { font-size: 2.25rem; line-height: 1; }
.verify-card form { display: grid; gap: 0.5rem; }
.verify-card .auth-sub { margin: 0; }

.add-company { margin-bottom: 1rem; }
.add-company summary { cursor: pointer; padding: 0.9rem 1.25rem; font-weight: 600; font-size: 0.9rem; color: var(--brand-600); }
.add-company[open] summary { border-bottom: 1px solid var(--border); }

/* ===== Touch targets on phones ===== */
@media (max-width: 767px) {
  .btn-sm { min-height: 2.5rem; padding: 0.5rem 0.9rem; }
  .btn-icon { width: 2.5rem; height: 2.5rem; }
  .link-btn { display: inline-flex; align-items: center; min-height: 2.5rem; margin-bottom: 0; }
  .inline-form select, .inline-form input[type="text"], .inline-form input[type="number"] { min-height: 2.5rem; }
  .tab { min-height: 2.5rem; }
  .list-row .inline-form, .inline-form { flex-wrap: wrap; }
}

/* ===== Admin: slide-in menu on phones ===== */
.admin-menu-btn, .admin-menu-close, .admin-backdrop { display: none; }
.admin-menu-close {
  margin-left: auto;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}
.admin-menu-close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

@media (max-width: 767px) {
  body.page-admin, .admin-shell { height: 100vh; height: 100dvh; }
  .admin-menu-btn { display: inline-flex; flex: none; }
  .admin-menu-close { display: inline-flex; }
  #collapse-btn { display: none; }
  .admin-topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .admin-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(2, 6, 23, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0s linear 0.28s;
  }
  .admin-backdrop.is-open { opacity: 1; visibility: visible; transition: opacity 0.28s ease; }

  .admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: min(18rem, 86vw);
    box-shadow: 8px 0 32px rgba(2, 6, 23, 0.45);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.28s ease, visibility 0s linear 0.28s;
  }
  .admin-sidebar.is-open { transform: translateX(0); visibility: visible; transition: transform 0.28s ease; }
}

/* ===== Phones: data tables become stacked cards (no sideways scrolling) ===== */
@media (max-width: 767px) {
  .table-wrap { overflow-x: visible; }
  table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  }
  table.data tr[hidden] { display: none; }
  table.data tr:last-child { border-bottom: 0; }
  table.data tr:hover { background: var(--bg-soft); }
  table.data tr:hover td { background: transparent; }
  table.data td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.3rem 0;
    border: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }
  table.data td::before {
    content: attr(data-label);
    flex: none;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-align: left;
  }
  table.data td:first-child { display: block; text-align: left; padding-bottom: 0.5rem; }
  table.data td:first-child::before { display: none; }
  table.data td:has(form) { flex-direction: column; align-items: stretch; text-align: left; gap: 0.35rem; }
}

/* ===== Customer dashboard tweaks ===== */
.portal-link { white-space: nowrap; }
.portal-nav { scrollbar-width: none; }
.portal-nav::-webkit-scrollbar { display: none; }
.portal-hero .btn-white { background: #fff; color: var(--brand-700); border-color: transparent; box-shadow: 0 6px 18px -6px rgba(2, 6, 23, 0.35); }
.portal-hero .btn-white:hover { background: #eff6ff; }
@media (max-width: 480px) {
  .list-row { flex-wrap: wrap; }
  .list-row > div:not(.avatar) { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
}

@media (max-width: 767px) {
  .inline-form input[type="text"] { flex: 1 1 10rem; min-width: 0; }
  table.data td:has(form) .inline-form { width: 100%; }
}

/* ===== WhatsApp link form (admin Companies) ===== */
.wa-link { margin-top: 0.35rem; }
.wa-link summary { cursor: pointer; font-size: 0.75rem; color: var(--brand-600); }
.wa-form { display: grid; gap: 0.4rem; margin-top: 0.5rem; min-width: 12rem; }
.wa-form input { padding: 0.4rem 0.55rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--card); color: var(--text); font-size: 0.8rem; }
@media (max-width: 767px) { .wa-form input { min-height: 2.5rem; } .wa-link summary { display: inline-block; padding: 0.5rem 0; } }

.field .hint { font-weight: 400; font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }
.form-actions-split { justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
@media (max-width: 480px) { .form-actions-split .btn { width: 100%; } }

.voicemail-list { display: grid; gap: 0.9rem; padding: 1.1rem 1.25rem; }
.voicemail-list > div { display: grid; gap: 0.35rem; }
.voicemail-list audio { width: 100%; max-width: 28rem; }
a.pill { text-decoration: none; }
