/* Tavros Connect — theme on top of Bootstrap 5.3 */
:root {
  --brand: #128c7e;          /* WhatsApp teal */
  --brand-2: #25d366;        /* WhatsApp green */
  --brand-dark: #075e54;
  --ink: #0f172a;
  --muted: #64748b;
  --surface: #f6f8fb;
  --line: #e7ebf0;
  --card: #fff;
  --hover: #f1f5f9;
  --radius: 14px;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-link-color: var(--brand);
  --bs-link-hover-color: var(--brand-dark);
}

body { -webkit-font-smoothing: antialiased; }
h1, h2, h3, .display-4, .display-5 { letter-spacing: -0.02em; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; padding: .6rem 1.1rem; }
.btn-lg { padding: .8rem 1.5rem; border-radius: 12px; }
.btn-sm { padding: .32rem .7rem; font-size: .82rem; border-radius: 8px; }   /* .btn padding above would otherwise override Bootstrap's btn-sm */
.btn-brand { background: var(--brand); color: #fff; border: 0; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); color: #fff; }
.btn-brand:disabled { background: #9cc9c3; color: #fff; }
.text-brand { color: var(--brand) !important; }
.bg-brand-soft { background: #e8f6f3 !important; }

/* ---------- Brand ---------- */
.brand-mark {
  width: 36px; height: 36px; flex: none; border-radius: 10px; display: inline-flex; overflow: hidden;
  align-items: center; justify-content: center; background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .12);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-name { font-weight: 800; font-size: 1.1rem; color: var(--ink); letter-spacing: -.01em; }
/* Mobile top bar: logo → home (dashboard) */
.topbar-home { flex: none; display: inline-flex; text-decoration: none; }
.topbar-home .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
.topbar-home:active .brand-mark { transform: scale(.94); }

/* App pages on phones: always fit the screen width, never auto-zoom.
   iOS zooms into any focused field under 16px — keep fields at 16px on small screens. */
.app-body { overflow-x: clip; touch-action: manipulation; }
.app-body .app-main { min-width: 0; overflow-wrap: break-word; }
@media (max-width: 991.98px) {
  .app-body input:not([type=checkbox]):not([type=radio]):not([type=range]), .app-body select, .app-body textarea,
  .app-body .form-control, .app-body .form-control-sm, .app-body .form-select, .app-body .form-select-sm { font-size: 16px !important; }
  .app-body img, .app-body video, .app-body iframe { max-width: 100%; }
}

/* ---------- Public site ---------- */
.site-nav { background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-nav .nav-link { font-weight: 500; color: var(--ink); }
.site-nav .nav-link:hover { color: var(--brand); }

.hero {
  position: relative; overflow: hidden; padding: 6rem 0 5rem;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(37,211,102,.18), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(18,140,126,.14), transparent 60%),
    #fff;
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 600;
  color: var(--brand-dark); background: #e8f6f3; border: 1px solid #cdeee7; border-radius: 999px; padding: .35rem .8rem;
}
.hero h1 { font-weight: 800; }
.hero .lead { color: var(--muted); }
.hero-stats .num { font-weight: 800; font-size: 1.5rem; }
.hero-stats .lbl { color: var(--muted); font-size: .85rem; }

/* Phone mock */
.phone {
  max-width: 340px; margin: 0 auto; border-radius: 36px; background: #0b141a; padding: 12px;
  box-shadow: 0 30px 60px rgba(15,23,42,.25);
}
.phone-screen { border-radius: 26px; overflow: hidden; background: #efeae2; }
.phone-head { background: var(--brand-dark); color: #fff; padding: .8rem 1rem; display: flex; align-items: center; gap: .6rem; }
.phone-head .dp { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-2); display: flex; align-items: center; justify-content: center; }
.phone-body { padding: 1rem .8rem 1.4rem; min-height: 360px; }
.bubble { background: #fff; border-radius: 10px; padding: .6rem .75rem; font-size: .82rem; box-shadow: 0 1px 1px rgba(0,0,0,.08); max-width: 88%; margin-bottom: .6rem; }
.bubble.out { background: #d9fdd3; margin-left: auto; }
.bubble .meta { display: block; text-align: right; font-size: .68rem; color: #667781; margin-top: .25rem; }
.bubble .btn-link-wa { display: block; text-align: center; border-top: 1px solid #e9edef; margin: .5rem -.75rem -.6rem; padding: .45rem; color: #0a7cff; font-weight: 600; text-decoration: none; }

.section { padding: 5rem 0; }
.section-alt { background: var(--surface); }
.section-title { font-weight: 800; }
.section-sub { color: var(--muted); max-width: 640px; margin: .75rem auto 0; }

.feature-card {
  height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(15,23,42,.08); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.35rem; color: var(--brand); background: #e8f6f3; margin-bottom: 1rem;
}
.feature-card p { color: var(--muted); margin-bottom: 0; }

.step-num {
  width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand));
}

.price-card { height: 100%; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 2rem; }
.price-card.featured { border: 2px solid var(--brand); box-shadow: 0 20px 40px rgba(18,140,126,.15); position: relative; }
.price-card .tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; padding: .25rem .75rem; border-radius: 999px; }
.price { font-size: 2.4rem; font-weight: 800; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 1.5rem 0; }
.price-card li { padding: .35rem 0; color: #334155; }
.price-card li i { color: var(--brand); margin-right: .5rem; }

/* Pricing v2 (inc/pricing.php): cycle switch + plan cards, homepage and Billing page */
.pc-toggle-row { display: flex; justify-content: center; margin: 0 0 2.2rem; }
.pc-toggle { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: #eef2f1; border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.pc-toggle button { border: 0; background: transparent; border-radius: 999px; padding: .5rem 1rem; font-weight: 600; font-size: .9rem; color: #475569; white-space: nowrap; }
.pc-toggle button span { font-size: .72rem; font-weight: 700; color: var(--brand); margin-left: .15rem; }
.pc-toggle button.active { background: #fff; color: #0f172a; box-shadow: 0 2px 8px rgba(15,23,42,.1); }
.pc-card { position: relative; height: 100%; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1.75rem 1.5rem; }
.pc-card.featured { border: 2px solid var(--brand); box-shadow: 0 22px 44px rgba(18,140,126,.18); }
@media (min-width: 1200px) { .pc-card.featured { transform: translateY(-10px); } }
.pc-card.current { border-color: #0f172a; }
.pc-tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--brand); color: #fff; font-size: .74rem; font-weight: 700; padding: .28rem .8rem; border-radius: 999px; }
.pc-tag-cur { background: #0f172a; }
.pc-name { font-size: 1.2rem; font-weight: 800; margin: .25rem 0 .2rem; }
.pc-desc { color: var(--muted); font-size: .88rem; min-height: 2.6em; margin-bottom: .6rem; }
.pc-old { color: #94a3b8; text-decoration: line-through; font-weight: 600; font-size: .95rem; min-height: 1.4em; }
.pc-old[hidden] { display: block !important; visibility: hidden; }
.pc-card .price { font-size: 2.3rem; line-height: 1.1; }
.pc-billed { color: var(--muted); font-size: .82rem; margin-top: .25rem; }
.pc-nudge { display: inline-block; margin-top: .55rem; font-size: .8rem; font-weight: 700; color: #b45309; background: #fef3c7; border-radius: 8px; padding: .2rem .55rem; }
/* Per-day pricing (inc/perday.php) */
.pd-from { font-size: .8rem; font-weight: 600; color: var(--muted); }
.pd-note { margin-top: .55rem; font-size: .8rem; color: #065f46; background: #ecfdf5; border-radius: 8px; padding: .35rem .6rem; line-height: 1.35; }
.pd-start { margin-top: .7rem; font-size: .9rem; color: #1e3a8a; background: #eff6ff; border-radius: 8px; padding: .4rem .65rem; }
.pd-perks { margin-top: .45rem; font-size: .8rem; color: #065f46; }
/* Day packs on the cards / recharge page (migration 028) */
.pd-packs { list-style: none; padding: 0; margin: .7rem 0 0; font-size: .82rem; }
.pd-packs li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; border: 1px solid var(--bs-border-color); border-radius: 8px; padding: .3rem .55rem; margin-bottom: .3rem; }
.pd-packs li b { min-width: 4.2rem; }
.pd-packs li .pd-pk-rate { margin-left: auto; color: #065f46; font-weight: 600; }
.pd-packs li.best { border-color: #86efac; background: #f0fdf4; }
.pd-packs .badge { font-size: .65rem; }
.pc-plus { margin: 1.1rem 0 -.6rem; font-size: .82rem; font-weight: 700; color: var(--muted); }
.pd-compare th, .pd-compare td { white-space: nowrap; vertical-align: middle; }
.pd-compare td:not(:first-child), .pd-compare th:not(:first-child) { text-align: center; }
.pd-compare .grp td { background: var(--bs-tertiary-bg); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.pd-pack-opt { display: block; border: 2px solid var(--bs-border-color); border-radius: 12px; padding: .7rem .85rem; cursor: pointer; height: 100%; }
.pd-pack-opt:has(input:checked) { border-color: var(--brand); background: #f0fdf4; }
.pd-pack-opt input { margin-right: .35rem; }
[data-bs-theme="dark"] .pd-packs li.best, [data-bs-theme="dark"] .pd-pack-opt:has(input:checked) { background: #052e16; }
.pd-lose { margin-top: .55rem; font-size: .8rem; color: #991b1b; background: #fef2f2; border-radius: 8px; padding: .35rem .6rem; line-height: 1.35; }
.pd-lose ul { margin: .2rem 0 0; padding-left: 1.1rem; }
.pd-lose span { color: var(--muted); }
.pd-stat { border: 1px solid var(--bs-border-color); border-radius: 10px; padding: .45rem .3rem; }
.pd-stat b { display: block; font-size: 1.15rem; }
.pd-stat span { color: var(--muted); font-size: .75rem; }
.pd-stat-empty { border-color: #fca5a5; background: #fef2f2; }
.pd-stat-empty b { color: #b91c1c; }
.bal-card { border: 1px solid var(--bs-border-color); border-radius: 12px; padding: .9rem 1rem; height: 100%; }
.bal-card .bal-name { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.bal-card .bal-val { font-size: 1.8rem; font-weight: 700; line-height: 1.2; }
.bal-card .bal-val small { font-size: .95rem; font-weight: 400; color: var(--muted); }
.pd-tiers td, .pd-tiers th { white-space: nowrap; }
.pc-list { list-style: none; padding: 0; margin: 1.25rem 0 0; font-size: .9rem; }
.pc-list li { display: flex; gap: .5rem; padding: .32rem 0; color: #334155; }
.pc-list li i { color: var(--brand); flex: none; margin-top: .1rem; }
.pc-list li.off { color: #a0aab6; }
.pc-list li.off i { color: #cbd5e1; }
.pc-addon { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin: 2rem auto 0; max-width: 980px;
  background: #fff; border: 1px dashed var(--line); border-radius: 14px; padding: 1rem 1.25rem; font-size: .9rem; }
.pc-addon span { display: block; color: var(--muted); }
.pc-promo { margin-top: .5rem; font-size: .8rem; font-weight: 700; color: #15803d; background: #dcfce7; border: 1px dashed #86efac; border-radius: 8px; padding: .25rem .55rem; }
.promo-applied { display: flex; align-items: center; gap: .55rem; background: #f0fdf4; border: 1px dashed #86efac; color: #166534; border-radius: 12px; padding: .55rem .85rem; font-size: .88rem; }
.promo-applied > i { font-size: 1.1rem; }
.promo-box summary { cursor: pointer; font-size: .88rem; color: var(--brand); font-weight: 600; list-style: none; }
.promo-box summary::-webkit-details-marker { display: none; }
[data-bs-theme="dark"] .pc-promo, [data-bs-theme="dark"] .promo-applied { background: #052e16; border-color: #166534; color: #86efac; }
.card-app .pc-toggle-row { margin: 1rem 0 1.6rem; }
.card-app .pc-card { padding: 1.4rem 1.2rem; }
[data-bs-theme="dark"] .pc-card, [data-bs-theme="dark"] .pc-addon { background: #1b2730; }
[data-bs-theme="dark"] .pc-toggle { background: #111b21; }
[data-bs-theme="dark"] .pc-toggle button { color: #c3cfd7; }
[data-bs-theme="dark"] .pc-toggle button.active { background: #2a3942; color: #fff; }
[data-bs-theme="dark"] .pc-list li { color: #c3cfd7; }
[data-bs-theme="dark"] .pc-list li.off { color: #5f6f7a; }
[data-bs-theme="dark"] .pc-card.current { border-color: #c3cfd7; }

.cta-band { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; border-radius: 24px; padding: 3.5rem 2rem; }

.accordion-button:not(.collapsed) { background: #e8f6f3; color: var(--brand-dark); box-shadow: none; }
.accordion-button:focus { box-shadow: none; }

/* SEO landing pages (inc/seo.php) */
.hero.hero-sm { padding: 3rem 0 3rem; }
.prose h2 { font-weight: 800; font-size: 1.6rem; margin: 2.5rem 0 1rem; scroll-margin-top: 80px; }
.prose p, .prose li { color: #334155; line-height: 1.75; }
.prose li { margin-bottom: .35rem; }
.prose .table { font-size: .95rem; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.toc ol { margin: .5rem 0 0; padding-left: 1.2rem; }
.toc li { margin-bottom: .2rem; }
.resource-card { display: block; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; color: var(--ink); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.resource-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(15,23,42,.08); color: var(--ink); }
.qr-box { min-height: 240px; display: flex; align-items: center; justify-content: center; }
.qr-box img { max-width: 100%; height: auto; image-rendering: pixelated; }

.site-footer { padding: 4rem 0 2rem; background: #fff; border-top: 1px solid var(--line); }
.footer-title { font-weight: 700; margin-bottom: 1rem; }
.site-footer ul li { margin-bottom: .45rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand); }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth-wrap { grid-template-columns: 1.05fr 1fr; } }
.auth-side {
  display: none; color: #fff; padding: 3rem;
  background: radial-gradient(600px 300px at 80% 0%, rgba(37,211,102,.35), transparent 60%), linear-gradient(160deg, var(--brand-dark), #0b3d37);
}
@media (min-width: 992px) { .auth-side { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-side .brand-name { color: #fff; }
.auth-side li { margin-bottom: .8rem; opacity: .92; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.25rem; background: #fff; }
.auth-card { width: 100%; max-width: 440px; }
.form-control, .form-select { border-radius: 10px; padding: .65rem .85rem; border-color: #d7dde5; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(18,140,126,.15); }
.form-label { font-weight: 600; font-size: .9rem; }

.or-divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .8rem; margin: 1.25rem 0; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- App shell ---------- */
.app-body { background: var(--surface); }
.app-shell { min-height: 100vh; }
/* !important: Bootstrap's .offcanvas-lg forces a transparent background at ≥lg. */
.app-sidebar {
  background-color: #0b1f1d !important; color: #fff; width: 260px; --bs-offcanvas-width: min(292px, 84vw);
  /* soft aurora glow over the base colour (base stays overridable, e.g. admin portal indigo) */
  background-image: radial-gradient(120% 55% at 0% 0%, rgba(37,211,102,.16), transparent 60%),
                    radial-gradient(100% 45% at 100% 100%, rgba(14,165,164,.14), transparent 65%) !important;
  border-right: 1px solid rgba(255,255,255,.06);
}
@media (min-width: 992px) {
  .app-sidebar { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; }
  .app-main { margin-left: 260px; }
}
@media (max-width: 991.98px) { .app-sidebar { display: flex; flex-direction: column; } }
.sidebar-head { padding: 1.2rem 1.25rem .9rem; display: flex; align-items: center; justify-content: space-between; }
.sidebar-head .brand-name { color: #fff; letter-spacing: -.01em; }
.sidebar-nav { flex: 1; padding: .1rem .7rem 1rem; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.3); }
.sidebar-user {
  display: flex; align-items: center; gap: .7rem; margin: .4rem .75rem .5rem; padding: .7rem .8rem; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.1); box-shadow: 0 6px 18px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.08);
  color: #fff; text-decoration: none; transition: transform .15s, background .15s, border-color .15s;
}
.sidebar-user:hover { background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.06)); border-color: rgba(255,255,255,.18); color: #fff; transform: translateY(-1px); }
.sidebar-user .avatar { background: linear-gradient(135deg, #34e58a, var(--brand)); color: #06281f; flex: none; box-shadow: 0 0 0 3px rgba(37,211,102,.22); }
.sidebar-group { display: flex; align-items: center; gap: .6rem; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.38); padding: 1.1rem .7rem .4rem; }
.sidebar-group::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,.14), transparent); }
.sidebar-link {
  position: relative; display: flex; align-items: center; gap: .72rem; padding: .4rem .55rem; border-radius: 12px;
  color: rgba(255,255,255,.74); text-decoration: none; font-weight: 500; font-size: .91rem; margin-bottom: .12rem;
  transition: background .18s, color .18s, transform .18s;
}
.nav-ico {
  width: 32px; height: 32px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; color: var(--c);
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 12%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 25%, transparent);
  transition: background .18s, color .18s, transform .18s, box-shadow .18s;
}
.sidebar-link:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.sidebar-link:hover .nav-ico { transform: scale(1.08); }
.sidebar-link.active { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 42%, transparent), color-mix(in srgb, var(--c) 12%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 55%, transparent); color: #fff; font-weight: 700; }
.sidebar-link.active::before { content: ""; position: absolute; left: -.7rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); box-shadow: 0 0 12px var(--c); }
.sidebar-link.active .nav-ico { background: linear-gradient(145deg, color-mix(in srgb, var(--c) 100%, #fff 12%), var(--c)); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 55%, transparent); }
.sidebar-link:focus-visible { outline: 2px solid rgba(255,255,255,.5); outline-offset: 1px; }
.nav-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: linear-gradient(135deg, #34e58a, #25d366); color: #052e1a; font-size: .7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px rgba(37,211,102,.2); }
.sidebar-link.disabled { opacity: .45; cursor: default; }
.sidebar-link.disabled:hover { background: transparent; color: rgba(255,255,255,.75); transform: none; }
.sidebar-link.disabled:hover .nav-ico { transform: none; }
.badge-soon { margin-left: auto; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .15rem .5rem; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12); }
.sidebar-foot { padding: .9rem 1.1rem 1.1rem; border-top: 1px solid rgba(255,255,255,.08); background: linear-gradient(0deg, rgba(0,0,0,.18), transparent); }
.sidebar-foot .btn { border-radius: 12px; font-weight: 600; padding-top: .5rem; padding-bottom: .5rem; }
.sidebar-foot .btn-outline-light { border-color: rgba(255,255,255,.18); color: rgba(255,255,255,.85); }
.sidebar-foot .btn-outline-light:hover { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); }
@media (prefers-reduced-motion: reduce) { .sidebar-link, .nav-ico, .sidebar-user { transition: none; } .sidebar-link:hover { transform: none; } }

/* Light mode: bright sidebar (admin portal keeps its indigo) */
[data-bs-theme="light"] body:not(.admin-portal) .app-sidebar { background-color: #f6fbf9 !important; color: #0f2b27;
  background-image: radial-gradient(120% 50% at 0% 0%, rgba(37,211,102,.14), transparent 60%), radial-gradient(100% 40% at 100% 100%, rgba(14,165,164,.10), transparent 65%) !important;
  border-right: 1px solid #e3eeea; box-shadow: 1px 0 12px rgba(15,43,39,.04); }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-head .brand-name { color: #0f2b27; }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-head .btn-close-white { filter: none; }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-user { background: #fff; border-color: #e1ece8; box-shadow: 0 6px 16px rgba(15,43,39,.07); color: #0f2b27; }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-user:hover { background: #fff; border-color: #c9ddd7; color: #0f2b27; box-shadow: 0 8px 20px rgba(15,43,39,.1); }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-user .avatar { color: #fff; box-shadow: 0 0 0 3px rgba(37,211,102,.2); }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-group { color: #7a908b; }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-group::after { background: linear-gradient(90deg, #d6e5e0, transparent); }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-link { color: #3d5651; }
[data-bs-theme="light"] body:not(.admin-portal) .nav-ico { background: linear-gradient(145deg, color-mix(in srgb, var(--c) 22%, #fff), color-mix(in srgb, var(--c) 9%, #fff)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent); }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-link:hover { background: rgba(15,43,39,.05); color: #0f2b27; }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-link.active { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 26%, #fff), color-mix(in srgb, var(--c) 8%, #fff)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, #fff), 0 2px 8px color-mix(in srgb, var(--c) 18%, transparent); color: #0f2b27; font-weight: 700; }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-link:focus-visible { outline-color: rgba(18,140,126,.55); }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-link.disabled:hover { background: transparent; color: #3d5651; }
[data-bs-theme="light"] body:not(.admin-portal) .nav-badge { color: #fff; box-shadow: 0 0 0 3px rgba(37,211,102,.18); }
[data-bs-theme="light"] body:not(.admin-portal) .badge-soon { background: #eaf2ef; border-color: #d6e5e0; color: #5c746f; }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-foot { border-top-color: #e3eeea; background: linear-gradient(0deg, rgba(18,140,126,.06), transparent); }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-foot .btn-outline-light { border-color: #cfe0db; color: #28443f; background: #fff; }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-foot .btn-outline-light:hover { background: #eef6f3; color: #0f2b27; border-color: #b8d1ca; }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-nav { scrollbar-color: rgba(15,43,39,.2) transparent; }
[data-bs-theme="light"] body:not(.admin-portal) .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(15,43,39,.18); }

.app-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .5rem; background: var(--card); border-bottom: 1px solid var(--line); padding: .7rem 1.5rem; min-height: 64px; }
@media (max-width: 991.98px) { .app-topbar { padding: .55rem .75rem; min-height: 58px; } .app-topbar h1 { font-size: 1.05rem; } }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #e8f6f3; color: var(--brand-dark); font-weight: 700; }
.app-content { padding: 1rem .85rem 1.5rem; max-width: none; width: 100%; }
@media (min-width: 768px) { .app-content { padding: 1.5rem; } }
@media (min-width: 992px) { .app-content { padding: 2rem; } }

.card-app { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-app .card-body { padding: 1.5rem; }
.stat-card .stat-label { color: var(--muted); font-size: .85rem; font-weight: 500; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; }

/* ---------- Template preview (WhatsApp bubble) ---------- */
.tpl-canvas { background: #efeae2; border-radius: 12px; padding: 1rem; }
.tpl-bubble { background: #fff; border-radius: 10px; padding: .6rem .75rem; max-width: 340px; font-size: .88rem; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.tpl-head { font-weight: 700; margin-bottom: .35rem; }
.tpl-media { display: flex; align-items: center; justify-content: center; gap: .4rem; height: 110px; border-radius: 8px; background: #d9dee3; color: #54656f; margin: -.2rem -.3rem .5rem; font-weight: 600; }
.tpl-media i { font-size: 1.6rem; }
.tpl-body { white-space: normal; word-wrap: break-word; }
.tpl-foot { color: #667781; font-size: .78rem; margin-top: .35rem; }
.tpl-btn { border-top: 1px solid #e9edef; margin: .5rem -.75rem 0; padding: .45rem .75rem 0; text-align: center; color: #0a7cff; font-weight: 600; font-size: .85rem; }
.tpl-var { background: #fff3cd; color: #8a6d00; border-radius: 4px; padding: 0 .2rem; font-family: ui-monospace, monospace; font-size: .8rem; }
.table-app th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.table-app td { vertical-align: middle; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; }

/* ---------- Reports page ---------- */
.section-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.seg { display: inline-flex; background: #eef2f6; border-radius: 10px; padding: 3px; }
.seg a { padding: .35rem .8rem; border-radius: 8px; font-size: .85rem; font-weight: 600; color: #475569; text-decoration: none; }
.seg a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.12); }

.kpi { height: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--k); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.kpi-icon { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--kb); color: var(--k); }
.kpi-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin: .35rem 0 .2rem; }
.kpi-foot { display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--muted); }
.kpi-rate { font-weight: 700; color: var(--k); }
.kpi-src { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .1rem .4rem; border-radius: 5px; background: #f1f5f9; color: #64748b; }
.k-blue { --k: #2f6fed; --kb: #eef4ff; } .k-green { --k: #128c7e; --kb: #e8f6f3; } .k-purple { --k: #7c4dff; --kb: #f3eefe; }
.k-red { --k: #d93025; --kb: #fdecec; } .k-amber { --k: #c27c0e; --kb: #fff6e6; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: var(--muted); text-align: center; min-height: 160px; }
.empty-state i { font-size: 1.8rem; opacity: .6; }
.reason { padding: .65rem 0; border-bottom: 1px solid var(--line); }
.reason:last-child { border-bottom: 0; }
.reason-bar { height: 6px; background: #f1f5f9; border-radius: 99px; margin: .35rem 0; overflow: hidden; }
.reason-bar span { display: block; height: 100%; background: #e57373; border-radius: 99px; }
.code-chip { font-family: ui-monospace, monospace; font-size: .7rem; font-weight: 600; color: #64748b; background: #f1f5f9; border-radius: 4px; padding: .05rem .3rem; margin-left: .25rem; }

.notice { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 12px; font-size: .9rem; border: 1px solid; }
.notice i { font-size: 1.1rem; margin-top: .05rem; }
.notice-warn { background: #fff8e6; border-color: #f6dfa4; color: #7a5300; }
.notice-info { background: #eef6ff; border-color: #cfe3fb; color: #1e4f8a; }

.log-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.tabs-pill { display: inline-flex; gap: .25rem; }
.tabs-pill a { padding: .45rem .85rem; border-radius: 9px; font-weight: 600; font-size: .9rem; color: #475569; text-decoration: none; }
.tabs-pill a.active { background: #e8f6f3; color: var(--brand-dark); }
.tabs-pill .count { font-size: .72rem; background: rgba(15,23,42,.07); border-radius: 99px; padding: .05rem .45rem; margin-left: .25rem; }
.filter-chips { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.filter-chips button { border: 1px solid var(--line); background: #fff; color: #475569; border-radius: 99px; padding: .25rem .7rem; font-size: .8rem; font-weight: 600; }
.filter-chips button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.search { position: relative; }
.search i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: .85rem; }
.search input { border: 1px solid var(--line); border-radius: 9px; padding: .4rem .7rem .4rem 2rem; font-size: .85rem; width: 220px; outline: none; }
.search input:focus { border-color: var(--brand); }

.log-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: #fafbfc; padding: .75rem 1.25rem; border-bottom: 1px solid var(--line); }
.log-table td { padding: .9rem 1.25rem; vertical-align: middle; border-color: var(--line); }
.log-table tbody tr:hover { background: #fafcfc; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #e8f6f3; color: var(--brand-dark); font-size: .72rem; font-weight: 700; flex: 0 0 32px; }
.msg-cell { max-width: 460px; }
.msg-text { font-size: .87rem; color: #334155; margin-top: .25rem; }
.tpl-chip { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 600; color: #2f6fed; background: #eef4ff; border-radius: 6px; padding: .1rem .45rem; }
.tpl-chip-free { color: #475569; background: #f1f5f9; text-transform: capitalize; }
.st-pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; border-radius: 99px; padding: .2rem .65rem; }
.st-read { background: #e8f0ff; color: #2463eb; } .st-delivered { background: #e3f6ee; color: #0f7b54; }
.st-sent { background: #eef2f6; color: #475569; } .st-pending { background: #fff6e6; color: #a36500; }
.st-failed { background: #fdecec; color: #c62828; }
.timeline { display: flex; flex-wrap: wrap; gap: .15rem .6rem; font-size: .72rem; color: var(--muted); margin-top: .35rem; }
.timeline span + span::before { content: "→ "; color: #cbd5e1; }
/* ---------- Contacts / campaigns ---------- */
.tag-link { display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; border-radius: 8px; color: #334155; text-decoration: none; font-size: .9rem; }
.tag-link span { margin-left: auto; font-size: .75rem; color: var(--muted); }
.tag-link:hover { background: #f1f5f9; }
.tag-link.active { background: #e8f6f3; color: var(--brand-dark); font-weight: 600; }
.tag-row .tag-del { visibility: hidden; padding: 0 .3rem; }
.tag-row:hover .tag-del { visibility: visible; }
.tag-chip { display: inline-block; font-size: .72rem; font-weight: 600; background: #f1f5f9; color: #475569; border-radius: 6px; padding: .1rem .45rem; margin: 0 .2rem .2rem 0; }
.step-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 1rem; }
.step-card > .head { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); font-weight: 700; }
.step-card > .head .num { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.step-card > .body { padding: 1.25rem; }
.aud-option { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: .75rem .9rem; cursor: pointer; }
.aud-option:has(input:checked) { border-color: var(--brand); background: #f3fbf9; }
/* campaign audience: "Pick contacts" */
.pick-box { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; }
.pick-box .search input { width: 100%; }
.pick-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.pick-row { display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem; border-bottom: 1px solid var(--line); cursor: pointer; margin: 0; font-size: .88rem; }
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: var(--hover); }
.pick-row:has(input:checked) { background: rgba(37,211,102,.08); }
.pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pick-phone { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.pick-more { padding: .6rem .7rem; color: var(--muted); font-size: .8rem; text-align: center; }
.progress-thin { height: 8px; border-radius: 99px; background: #eef2f6; overflow: hidden; display: flex; }
.progress-thin > span { display: block; height: 100%; }
.camp-status { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 6px; padding: .15rem .5rem; }
.cs-scheduled { background: #eef4ff; color: #2f6fed; } .cs-sending { background: #fff6e6; color: #a36500; }
.cs-paused { background: #f1f5f9; color: #475569; } .cs-completed { background: #e3f6ee; color: #0f7b54; } .cs-cancelled { background: #fdecec; color: #c62828; }

.src-tag { font-size: .68rem; font-weight: 600; margin-top: .1rem; }
.src-here { color: var(--brand); } .src-other { color: #94a3b8; }
.fail-note { font-size: .76rem; color: #9f2a2a; margin-top: .35rem; max-width: 300px; line-height: 1.35; }

.checklist .item { display: flex; gap: .9rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.checklist .item:last-child { border-bottom: 0; }
.checklist .dot { flex: 0 0 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; background: #eef2f6; color: var(--muted); }
.checklist .item.done .dot { background: var(--brand); color: #fff; }
.checklist .item.current .dot { background: #e8f6f3; color: var(--brand-dark); border: 2px solid var(--brand); }
.checklist.compact .item { padding: .45rem 0; }

/* ---------- Shared helpers ---------- */
.min-w-0 { min-width: 0; }

/* ---------- Top bar: icons, bell, account ---------- */
.icon-round { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: background .15s, color .15s; }
.icon-round:hover, .icon-round[aria-expanded="true"] { background: rgba(100,116,139,.13); color: var(--ink); }
.avatar-btn { border: 0; background: transparent; padding: 0; margin-left: .2rem; border-radius: 50%; }
.bell-badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .64rem; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--card); }
.notif-menu { width: min(370px, calc(100vw - 1.25rem)); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(15,23,42,.18); }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.notif-list { max-height: min(430px, 65vh); overflow-y: auto; }
.notif-item { display: flex; gap: .7rem; padding: .7rem 1rem; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--hover); color: inherit; }
.notif-item.is-new { background: color-mix(in srgb, #25d366 9%, transparent); }
.notif-ico { width: 34px; height: 34px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .88rem; }
.notif-ico.in { background: color-mix(in srgb, #22c55e 16%, transparent); color: #16a34a; }
.notif-ico.api { background: color-mix(in srgb, #6366f1 16%, transparent); color: #6366f1; }
.notif-main { flex: 1; min-width: 0; display: block; }
.notif-top { display: flex; gap: .5rem; }
.notif-top b { min-width: 0; font-weight: 600; }
.notif-time { margin-left: auto; flex: none; font-size: .72rem; color: var(--muted); }
.notif-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .83rem; color: var(--muted); }
.notif-tag { font-size: .64rem; font-weight: 700; color: #6366f1; background: color-mix(in srgb, #6366f1 12%, transparent); border-radius: 4px; padding: 0 .3rem; white-space: nowrap; }
.notif-empty { padding: 2rem 1rem; text-align: center; color: var(--muted); font-size: .88rem; }
.notif-prefs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; padding: .55rem 1rem; border-bottom: 1px solid var(--line); background: var(--hover); font-size: .8rem; }
.notif-prefs-lbl { font-weight: 600; color: var(--muted); }
.notif-prefs .form-check-label { white-space: nowrap; }
.notif-push:empty { display: none; }
.notif-push { border-top: 1px solid var(--line); }
.notif-push .push-nudge { border: 0; border-radius: 0; margin: 0; }
/* bell rings when a new notification arrives */
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
#bellBtn.ring .bi-bell { display: inline-block; transform-origin: 50% 10%; animation: bell-ring .9s ease-in-out 2; }
@media (prefers-reduced-motion: reduce) { #bellBtn.ring .bi-bell { animation: none; } }
/* "turn on notifications" nudge (bell menu + dashboard) */
.dash-push:empty { display: none; }
.dash-push { margin-bottom: 1rem; }
.push-nudge { display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.push-nudge-ico { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(37,211,102,.14); color: #128c7e; font-size: 1.1rem; }
.push-nudge-text { flex: 1; min-width: 0; font-size: .82rem; color: var(--muted); line-height: 1.35; }
.push-nudge-text b { display: block; color: var(--ink); font-size: .88rem; }
.push-nudge .btn { flex: 0 0 auto; white-space: nowrap; }
.push-ask-ico { width: 72px; height: 72px; border-radius: 22px; margin: .25rem auto 1rem; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #25d366, #128c7e); color: #fff; font-size: 2rem; box-shadow: 0 10px 24px rgba(18,140,126,.3); }
.push-nudge-x { flex: 0 0 auto; border: 0; background: none; color: var(--muted); padding: .25rem; line-height: 1; }

/* ---------- Stat tiles + quick actions (dashboard, profile) ---------- */
.stat-tile { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 1.05rem 1.15rem; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.stat-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,.08); color: inherit; }
.stat-tile::after { content: ""; position: absolute; top: -22px; right: -22px; width: 80px; height: 80px; border-radius: 50%; background: var(--c); opacity: .08; }
.stat-tile-ico { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; color: #fff; background: var(--c); box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 35%, transparent); margin-bottom: .6rem; }
.stat-tile-val { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--ink); }
.stat-tile-lbl { font-size: .8rem; font-weight: 500; color: var(--muted); margin-top: .1rem; }
.stat-tile-lbl small { display: block; font-size: .7rem; opacity: .8; }
@media (max-width: 575.98px) {
  .stat-tile { padding: .8rem .85rem; }
  .stat-tile-ico { width: 32px; height: 32px; font-size: .9rem; margin-bottom: .4rem; border-radius: 9px; }
  .stat-tile-val { font-size: 1.35rem; }
  .stat-tile-lbl { font-size: .74rem; }
}
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
@media (min-width: 768px) { .quick-actions { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .quick-actions { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1200px) { .quick-actions { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .4rem; }
  .quick-actions a { padding: .7rem .2rem; gap: .35rem; font-size: .7rem; }
  .quick-actions .qa-ico { width: 36px; height: 36px; font-size: 1rem; } }
.quick-actions a { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .85rem .4rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .8rem; font-weight: 600; text-align: center; line-height: 1.2; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.quick-actions a:hover { transform: translateY(-2px); color: var(--ink); border-color: var(--c); box-shadow: 0 8px 20px rgba(15,23,42,.08); }
.qa-ico { position: relative; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.qa-ico b { position: absolute; top: -4px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #25d366; color: #fff; font-size: .66rem; display: flex; align-items: center; justify-content: center; border: 2px solid var(--card); }
.activity-row { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.activity-row:last-child { border-bottom: 0; }
.activity-row:hover b { color: var(--brand); }
/* Dashboard: status chips, 7-day chart, needs-attention, recent campaigns, feature launcher */
.dash-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.dash-chips .chip-link { font-size: .8rem; padding: .35rem .7rem; }
.wk-chart { display: flex; align-items: stretch; gap: .5rem; height: 150px; }
.wk-day { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wk-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--line); }
.wk-bar { width: min(16px, 40%); border-radius: 5px 5px 0 0; transition: height .4s ease; }
.wk-sent { background: #3b82f6; } .wk-recv { background: #22c55e; }
.wk-lbl { text-align: center; font-size: .72rem; color: var(--muted); margin-top: .3rem; }
.wk-key { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: .3rem; vertical-align: 0; }
.attn-row { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.attn-row:last-child { border-bottom: 0; padding-bottom: 0; }
.attn-row > .flex-grow-1 { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 767.98px) {   /* nothing may push the page wider than the phone */
  html, body { max-width: 100%; overflow-x: hidden; }
  .card-app, .card-body { min-width: 0; max-width: 100%; }
  .card-body { overflow-wrap: anywhere; }
  .attn-row { flex-wrap: wrap; gap: .4rem .6rem; }
  .attn-row > .flex-grow-1 { flex: 1 1 calc(100% - 50px); font-size: .78rem; line-height: 1.3; }
  .attn-row > .btn { margin-left: 40px; padding: .15rem .55rem; font-size: .72rem; }
}
.attn-ico { flex: 0 0 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.camp-mini { display: block; padding: .55rem 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.camp-mini:last-child { border-bottom: 0; padding-bottom: 0; }
.camp-mini:hover b { color: var(--brand); }
.dash-group-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .5rem; }
.feat-tile { display: flex; gap: .75rem; align-items: flex-start; height: 100%; padding: .85rem .9rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.feat-tile:hover { transform: translateY(-2px); color: var(--ink); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.feat-ico { flex: 0 0 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.feat-name { display: block; font-weight: 700; font-size: .9rem; line-height: 1.25; }
.feat-desc { display: block; font-size: .76rem; color: var(--muted); line-height: 1.35; margin-top: .15rem; }
.feat-badge { display: inline-block; font-size: .66rem; font-weight: 700; padding: .05rem .4rem; border-radius: 99px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); vertical-align: .1em; white-space: nowrap; }
@media (max-width: 575.98px) {
  .feat-tile { flex-direction: column; gap: .5rem; padding: .75rem; }
  .feat-ico { flex-basis: auto; width: 36px; height: 36px; font-size: 1rem; }
  .wk-chart { height: 120px; gap: .3rem; }
}

/* ---------- Profile ---------- */
.profile-logo { width: 64px; height: 64px; flex: none; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 10px 22px rgba(18,140,126,.3); }
.wa-row { display: flex; gap: .85rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.team-row { display: flex; align-items: center; gap: .75rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: 0; }

/* Billing */
.plan-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--card); }
.plan-card.current { border: 2px solid var(--brand); }
.pay-opt { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.upgrade-ico { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: #fff; background: linear-gradient(135deg, #f59e0b, #f43f5e); }
.billing-banner { border-radius: 12px; }
@media (max-width: 767.98px) {   /* compact on phones: ~half the height */
  .billing-banner { padding: .35rem .6rem; margin-bottom: .6rem !important; border-radius: 10px; font-size: .72rem; line-height: 1.25; gap: .4rem !important; }
  .billing-banner > i { display: none; }
  .billing-banner .btn-link { font-size: .72rem; }
}
.invoice-page { background: var(--surface); }
@media print {
  .no-print, .site-nav, .app-sidebar, .app-topbar { display: none !important; }
  .invoice-page { background: #fff; }
  .invoice-doc { border: 0 !important; box-shadow: none !important; }
}
.wa-row:last-child { border-bottom: 0; padding-bottom: 0; }
.wa-row-ico { width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #16a34a; background: color-mix(in srgb, #22c55e 15%, transparent); font-size: 1.15rem; }

/* ---------- Contacts: tag chips (mobile) + header ---------- */
.tag-chips-bar { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: none; }
.tag-chips-bar::-webkit-scrollbar { display: none; }
.chip-link { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: .84rem; font-weight: 500; }
.chip-link b { font-weight: 600; color: var(--muted); font-size: .75rem; }
.chip-link.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-link.active b { color: rgba(255,255,255,.8); }
.bulk-tag { width: 220px; }
.bulk-bar:not(.show) { visibility: hidden; }
@media (max-width: 767.98px) {
  .contacts-head .search { flex: 1 1 100%; }
  .contacts-head .search input { width: 100%; }
  .bulk-bar:not(.show) { display: none !important; }
  .bulk-bar { width: 100%; }
  .bulk-tag { flex: 1; width: auto; }
}

/* ---------- Tables that turn into cards on phones ---------- */
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody { display: block; width: 100%; }
  .table-stack tr { display: grid; gap: .3rem .75rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { display: block; padding: 0 !important; border: 0 !important; max-width: none !important; text-align: left !important; white-space: normal !important; background: transparent !important; }
  .table-stack td.td-empty { display: none; }

  .tpl-table tr { grid-template-columns: auto 1fr auto; grid-template-areas: "name name status" "cat lang lang" "prev prev prev" "act act act"; }
  .tpl-table .td-name { grid-area: name; font-size: .95rem; }
  .tpl-table .td-status { grid-area: status; text-align: right !important; }
  .tpl-table .td-cat { grid-area: cat; }
  .tpl-table .td-lang { grid-area: lang; }
  .tpl-table .td-lang::before { content: "· "; color: var(--muted); }
  .tpl-table .td-prev { grid-area: prev; display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tpl-table .td-act { grid-area: act; display: flex !important; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .2rem; }
  .tpl-table .td-act form { display: inline-flex !important; margin: 0; margin-left: auto; }
  .tpl-table tr { padding: .7rem .85rem; }
  .tpl-table .tpl-act { padding: .25rem .6rem; font-size: .78rem; }
  .tpl-table .td-status .badge { font-size: .68rem; }

  .contact-table tr { grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "check contact edit" "check tags tags" "check fields fields"; align-items: center; }
  .contact-table .td-check { grid-area: check; }
  .contact-table .td-contact { grid-area: contact; min-width: 0; }
  .contact-table .td-edit { grid-area: edit; }
  .contact-table .td-tags { grid-area: tags; padding-left: 40px !important; }
  .contact-table .td-fields { grid-area: fields; padding-left: 40px !important; font-size: .78rem; }
  .contact-table .td-added { display: none; }

  /* Campaign list: name + status / progress / Delivered · Read · Failed / when */
  .camp-table tr { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "name name status" "prog prog prog" "dl rd fl" "when when when"; }
  .camp-table .td-name { grid-area: name; min-width: 0; }
  .camp-table .td-status { grid-area: status; text-align: right !important; }
  .camp-table .td-prog { grid-area: prog; }
  .camp-table .td-n:nth-of-type(4) { grid-area: dl; } .camp-table .td-n:nth-of-type(5) { grid-area: rd; } .camp-table .td-n:nth-of-type(6) { grid-area: fl; }
  .camp-table .td-n { background: var(--hover, #f6f8fa) !important; border-radius: 8px; padding: .3rem .5rem !important; font-size: .95rem; }
  .camp-table .td-n::before { content: attr(data-label); display: block; font-size: .68rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
  .camp-table .td-when { grid-area: when; font-size: .75rem; }

  /* Campaign recipients: contact + time / status (+ failure reason) */
  .recip-table tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who at" "st st"; align-items: center; }
  .recip-table tr.d-none { display: none; }
  .recip-table .td-who { grid-area: who; min-width: 0; }
  .recip-table .td-at { grid-area: at; text-align: right !important; font-size: .72rem; }
  .recip-table .td-st { grid-area: st; padding-left: 40px !important; }

  /* Filter chips row scrolls sideways instead of overflowing */
  .log-head .filter-chips { width: 100%; margin-left: 0 !important; display: flex; flex-wrap: nowrap; overflow-x: auto; gap: .35rem; scrollbar-width: none; padding-bottom: 2px; }
  .log-head .filter-chips::-webkit-scrollbar { display: none; }
  .log-head .filter-chips button { flex: none; }
  .log-head > .ms-auto { width: 100%; min-width: 0; margin-left: 0 !important; }
}

/* ---------- Help & support tickets, auto-replies ---------- */
.ticket-msg { padding: .75rem .9rem; border-radius: 12px; background: var(--hover, #f6f8fa); margin-bottom: .6rem; font-size: .9rem; }
.ticket-msg.staff { background: #e8f6f3; border-left: 3px solid var(--brand); }
[data-bs-theme="dark"] .ticket-msg.staff { background: rgba(18,140,126,.18); }
.hours-row input[type=time] { flex: 1 1 0; min-width: 0; max-width: 120px; }
@media (max-width: 575.98px) {
  .hours-row { gap: .4rem !important; }
  .hours-row > label { width: 92px !important; font-size: .9rem; }
  .hours-row input[type=time] { flex: 1 1 0; min-width: 0; max-width: none; padding-inline: .4rem; }
}

/* ---------- Admin portal (site/admin/) ---------- */
.admin-portal .app-sidebar { background-color: #1e1b4b !important; }   /* indigo: you always know you're in admin */
.admin-portal .sidebar-head { border-bottom-color: rgba(255,255,255,.1); }
.admin-badge { cursor: default; }
.admin-chip { background: #eef2ff; color: #4338ca; font-weight: 700; letter-spacing: .03em; align-items: center; }
.imp-banner { display: flex; align-items: center; gap: .6rem; padding: .55rem .85rem; margin-bottom: 1rem; border-radius: 12px; background: #312e81; color: #fff; font-size: .85rem; }
.imp-banner > i { font-size: 1.1rem; }
.imp-banner > span { flex: 1; min-width: 0; }
.demo-banner { display: flex; align-items: center; gap: .55rem; padding: .45rem .8rem; margin-bottom: 1rem; border-radius: 12px; background: #ecfeff; border: 1px solid #a5f3fc; color: #155e75; font-size: .82rem; }
.demo-banner > i { font-size: 1.05rem; }
[data-bs-theme="dark"] .demo-banner { background: #083344; border-color: #155e75; color: #a5f3fc; }
.demo-cred { display: grid; gap: .4rem; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px; padding: .8rem 1rem; }
.demo-cred > div { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.demo-cred span { color: var(--muted); }
[data-bs-theme="dark"] .demo-cred { background: #111b21; border-color: #2a3942; }
.chat-main .imp-banner { margin: 0; border-radius: 0; }
.announce .btn-close { font-size: .7rem; }
.log-pre { max-height: 460px; overflow: auto; font-size: .72rem; line-height: 1.45; background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: .8rem; white-space: pre-wrap; word-break: break-word; margin: 0; }
.log-pre .text-danger { color: #fca5a5 !important; } .log-pre .text-warning { color: #fcd34d !important; }
.wk-bar.rev-stack { display: flex; flex-direction: column; width: min(26px, 60%); border-radius: 5px 5px 0 0; overflow: hidden; }
.wk-bar.api-stack { gap: 2px; border-radius: 4px 4px 0 0; }
.wk-bar.api-stack > span:first-child { border-radius: 4px 4px 0 0; }
.api-chart { height: 170px; }
.api-chart .wk-lbl { white-space: nowrap; overflow: visible; }
.dash-dot { position: absolute; left: 50%; transform: translate(-50%, 50%); min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: #a855f7; color: #fff; font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.flex-none { flex: none; }
@media (max-width: 767.98px) {
  .biz-table tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name plan" "wallet wallet" "num sent" "last last"; }
  .biz-table .td-name { grid-area: name; min-width: 0; } .biz-table .td-plan { grid-area: plan; text-align: right !important; }
  .biz-table .td-wallet { grid-area: wallet; } .biz-table .td-num { grid-area: num; } .biz-table .td-sent { grid-area: sent; text-align: right !important; }
  .biz-table .td-last { grid-area: last; } .biz-table .td-joined { display: none !important; }
  .biz-table .td-num::before, .biz-table .td-sent::before { content: attr(data-label) " "; color: var(--muted); font-size: .75rem; }
  .lead-table tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name status" "owner fu" "last last"; }
  .lead-table .td-name { grid-area: name; min-width: 0; } .lead-table .td-status { grid-area: status; text-align: right !important; }
  .lead-table .td-owner { grid-area: owner; } .lead-table .td-fu { grid-area: fu; text-align: right !important; } .lead-table .td-last { grid-area: last; }
  .lead-table .td-fu::before, .lead-table .td-last::before { content: attr(data-label) ": "; color: var(--muted); }
  .health-table tr { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name st act" "biz biz biz" "q tier last" "seven seven seven"; align-items: center; }
  .health-table .td-name { grid-area: name; } .health-table .td-st { grid-area: st; } .health-table .td-act { grid-area: act; }
  .health-table .td-biz { grid-area: biz; } .health-table .td-q { grid-area: q; } .health-table .td-tier { grid-area: tier; } .health-table .td-last { grid-area: last; text-align: right !important; }
  .health-table .td-7 { grid-area: seven; }
  .health-table .td-q::before, .health-table .td-tier::before, .health-table .td-7::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 400; }
  .recon-table tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recon-table .td-name, .recon-table .td-recon { grid-column: 1 / -1; }
  .recon-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
}
[data-bs-theme="dark"] .admin-portal .app-sidebar, [data-bs-theme="dark"].admin-portal .app-sidebar { background-color: #17153a !important; }
[data-bs-theme="dark"] .admin-chip { background: #312e81; color: #c7d2fe; }

/* ---------- Dark mode (app pages; html[data-bs-theme=dark]) ---------- */
[data-bs-theme="dark"] {
  --ink: #e6edf1; --muted: #93a3ae; --surface: #0b1418; --line: #24323a; --card: #111b21; --hover: #18252c;
  --bs-body-bg: #0b1418; --bs-body-color: #e6edf1; --bs-border-color: #2a3942; --bs-secondary-color: #93a3ae;
  --bs-tertiary-bg: #16222a; --bs-secondary-bg: #16222a; --bs-emphasis-color: #fff;
  color-scheme: dark;
}
[data-bs-theme="dark"] .brand-name { color: var(--ink); }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: #0e191e; border-color: #2a3942; color: var(--ink); }
[data-bs-theme="dark"] .form-control::placeholder { color: #6b7c87; }
[data-bs-theme="dark"] .btn-light {
  --bs-btn-bg: #1c2930; --bs-btn-color: #e6edf1; --bs-btn-border-color: #2a3942;
  --bs-btn-hover-bg: #24343c; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #33454f;
  --bs-btn-active-bg: #2a3942; --bs-btn-active-color: #fff; --bs-btn-disabled-bg: #18232a; --bs-btn-disabled-color: #6b7c87;
}
[data-bs-theme="dark"] .btn-outline-dark { --bs-btn-color: #e6edf1; --bs-btn-border-color: #3a4a53; --bs-btn-hover-bg: #e6edf1; --bs-btn-hover-color: #111; }
[data-bs-theme="dark"] .text-bg-light, [data-bs-theme="dark"] .bg-light { background-color: #1c2930 !important; color: #e6edf1 !important; }
[data-bs-theme="dark"] .bg-white { background-color: var(--card) !important; }
[data-bs-theme="dark"] .avatar, [data-bs-theme="dark"] .avatar-sm { background: rgba(18,140,126,.28); color: #6ee7d3; }
[data-bs-theme="dark"] .bg-brand-soft { background: rgba(18,140,126,.2) !important; }
[data-bs-theme="dark"] .kpi, [data-bs-theme="dark"] .step-card, [data-bs-theme="dark"] .filter-chips button, [data-bs-theme="dark"] .search input { background: var(--card); color: var(--ink); }
[data-bs-theme="dark"] .kpi-icon { background: color-mix(in srgb, var(--k) 18%, transparent); }
[data-bs-theme="dark"] .kpi-src, [data-bs-theme="dark"] .code-chip, [data-bs-theme="dark"] .tag-chip { background: #1c2930; color: #b6c3cc; }
[data-bs-theme="dark"] .seg { background: #18252c; }
[data-bs-theme="dark"] .seg a, [data-bs-theme="dark"] .tabs-pill a, [data-bs-theme="dark"] .tag-link, [data-bs-theme="dark"] .msg-text, [data-bs-theme="dark"] .price-card li { color: #c3cfd7; }
[data-bs-theme="dark"] .seg a.active { background: #24343c; color: #fff; }
[data-bs-theme="dark"] .tabs-pill a.active, [data-bs-theme="dark"] .tag-link.active, [data-bs-theme="dark"] .checklist .item.current .dot { background: rgba(18,140,126,.22); color: #6ee7d3; }
[data-bs-theme="dark"] .tag-link:hover { background: var(--hover); }
[data-bs-theme="dark"] .filter-chips button.active { background: var(--ink); color: #111; }
[data-bs-theme="dark"] .log-table th { background: #142027; }
[data-bs-theme="dark"] .log-table tbody tr:hover { background: #142027; }
[data-bs-theme="dark"] .checklist .dot, [data-bs-theme="dark"] .reason-bar, [data-bs-theme="dark"] .progress-thin { background: #1c2930; }
[data-bs-theme="dark"] .aud-option:has(input:checked) { background: rgba(18,140,126,.14); }
[data-bs-theme="dark"] .notice-warn { background: #2a2310; border-color: #5c4a12; color: #f1d38a; }
[data-bs-theme="dark"] .notice-info { background: #0f2236; border-color: #1d3b5c; color: #9cc7f5; }
[data-bs-theme="dark"] .st-read { background: #132a4a; color: #8ab4ff; }
[data-bs-theme="dark"] .st-delivered { background: #0f2e22; color: #5dd39e; }
[data-bs-theme="dark"] .st-sent { background: #1c2930; color: #c3cfd7; }
[data-bs-theme="dark"] .st-pending, [data-bs-theme="dark"] .cs-sending { background: #33270f; color: #f3c26b; }
[data-bs-theme="dark"] .st-failed, [data-bs-theme="dark"] .cs-cancelled { background: #3a1616; color: #ff8a80; }
[data-bs-theme="dark"] .cs-scheduled, [data-bs-theme="dark"] .tpl-chip { background: #132a4a; color: #8ab4ff; }
[data-bs-theme="dark"] .cs-paused, [data-bs-theme="dark"] .tpl-chip-free { background: #1c2930; color: #c3cfd7; }
[data-bs-theme="dark"] .cs-completed { background: #0f2e22; color: #5dd39e; }
[data-bs-theme="dark"] .fail-note { color: #ff9a8f; }
[data-bs-theme="dark"] .tpl-canvas { background: #0b141a; }
[data-bs-theme="dark"] .tpl-bubble { background: #202c33; color: #e9edef; }
[data-bs-theme="dark"] .tpl-foot { color: #8696a0; }
[data-bs-theme="dark"] .tpl-btn { border-color: #2a3942; color: #53bdeb; }
[data-bs-theme="dark"] .tpl-media { background: #2a3942; color: #aebac1; }
[data-bs-theme="dark"] .tpl-var { background: #4a3b00; color: #ffd666; }
[data-bs-theme="dark"] .stat-tile:hover, [data-bs-theme="dark"] .quick-actions a:hover, [data-bs-theme="dark"] .feat-tile:hover { box-shadow: 0 10px 24px rgba(0,0,0,.35); }
[data-bs-theme="dark"] .notif-ico.in { color: #4ade80; }
[data-bs-theme="dark"] .notif-ico.api, [data-bs-theme="dark"] .notif-tag { color: #a5b4fc; }
[data-bs-theme="dark"] .bg-dark { background-color: #050b0e !important; }

/* ---------- Installable app: "Get the app" bar + instructions sheet ---------- */
.pwa-standalone [data-pwa-install] { display: none !important; }
.pwa-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1060; display: flex; align-items: center; gap: .75rem;
  padding: .8rem .9rem calc(.8rem + env(safe-area-inset-bottom)); background: #0b1f1d; color: #fff;
  box-shadow: 0 -8px 30px rgba(0,0,0,.25); transform: translateY(110%); transition: transform .3s ease; }
.pwa-bar.show { transform: none; }
.pwa-bar-icon { width: 48px; height: 48px; border-radius: 12px; flex: none; background: #fff; }
.pwa-bar-text { flex: 1; min-width: 0; line-height: 1.25; }
.pwa-bar-text b { display: block; font-size: .95rem; }
.pwa-bar-text span { font-size: .8rem; opacity: .75; }
.pwa-bar-btn { flex: none; border: 0; border-radius: 11px; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; font-weight: 700; padding: .6rem 1.1rem; box-shadow: 0 6px 16px rgba(37,211,102,.35); }
.pwa-bar-close { flex: none; border: 0; background: transparent; color: rgba(255,255,255,.7); font-size: 1.1rem; padding: .3rem; }
body.has-pwa-bar { padding-bottom: 84px; }
@media (min-width: 768px) { .pwa-bar { left: auto; right: 1.25rem; bottom: 1.25rem; width: 420px; border-radius: 16px; padding-bottom: .8rem; } body.has-pwa-bar { padding-bottom: 0; } }

.pwa-sheet-wrap { position: fixed; inset: 0; z-index: 1070; display: flex; align-items: flex-end; justify-content: center; background: rgba(15,23,42,0); backdrop-filter: blur(0); transition: background .25s, backdrop-filter .25s; }
.pwa-sheet-wrap.show { background: rgba(15,23,42,.45); backdrop-filter: blur(3px); }
.pwa-sheet { width: 100%; max-width: 480px; background: var(--card); color: var(--ink); border-radius: 26px 26px 0 0; padding: .75rem 1.4rem calc(1.4rem + env(safe-area-inset-bottom)); text-align: center; transform: translateY(100%); transition: transform .3s ease; max-height: 92vh; overflow-y: auto; }
.pwa-sheet-wrap.show .pwa-sheet { transform: none; }
@media (min-width: 576px) { .pwa-sheet-wrap { align-items: center; } .pwa-sheet { border-radius: 22px; } }
.pwa-grab { width: 42px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 1rem; }
.pwa-sheet-icon { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 8px 20px rgba(15,23,42,.15); margin-bottom: .75rem; }
.pwa-sheet h2 { font-size: 1.35rem; font-weight: 800; margin-bottom: .25rem; }
.pwa-sub { color: var(--muted); margin-bottom: 1.1rem; }
.pwa-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
.pwa-tabs button { display: flex; align-items: center; justify-content: center; gap: .5rem; border: 2px solid transparent; border-radius: 14px; background: var(--hover); color: var(--muted); font-weight: 600; padding: .75rem; }
.pwa-tabs button.active { border-color: var(--brand); background: var(--card); color: var(--ink); box-shadow: 0 6px 16px rgba(18,140,126,.15); }
.pwa-steps { list-style: none; padding: 0; margin: 0 0 1.25rem; text-align: left; }
.pwa-steps li { display: flex; align-items: center; gap: .9rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.pwa-steps li:last-child { border-bottom: 0; }
.pwa-steps li > span { width: 34px; height: 34px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; font-weight: 700; }
.pwa-k { color: #0a84ff; font-size: 1.1em; }
.pwa-done { border: 0; border-radius: 12px; background: var(--hover); color: var(--ink); font-weight: 700; padding: .75rem 2.5rem; }

/* ---------------------------------------------------------------- Tavros Buddy field app (field/*.php, inside the Android WebView) */
.field-body { background: var(--bs-tertiary-bg, #f5f7fb); min-height: 100vh; }
.field-top { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; background: var(--bs-body-bg); border-bottom: 1px solid var(--line, #e5e7eb); }
.field-top .brand-mark img { width: 28px; height: 28px; }
.field-main { max-width: 640px; margin: 0 auto; padding: .75rem .75rem calc(5rem + env(safe-area-inset-bottom)); }
.field-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1020; display: flex; background: var(--bs-body-bg); border-top: 1px solid var(--line, #e5e7eb); padding-bottom: env(safe-area-inset-bottom); }
.field-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem 0 .4rem; font-size: .72rem; color: var(--bs-secondary-color); text-decoration: none; }
.field-nav a i { font-size: 1.25rem; }
.field-nav a.active { color: var(--brand, #128c7e); font-weight: 600; }
.cart-menu { width: 300px; max-width: calc(100vw - 24px); }
.cart-badge { background: var(--brand, #128c7e); }
.pc-min { font-size: .76rem; color: var(--muted); margin-top: .6rem; }

/* ---------- Account menu (avatar dropdown) ---------- */
.avatar-btn .avatar { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px rgba(18,140,126,.35); transition: transform .2s, box-shadow .2s; }
.avatar-btn:hover .avatar, .avatar-btn[aria-expanded="true"] .avatar { transform: scale(1.07) rotate(-4deg); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--brand-2); }
.user-menu { width: min(300px, calc(100vw - 1.25rem)); border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(15,23,42,.22); margin-top: .6rem !important; }
.user-menu.show { animation: um-pop .22s ease-out both; }
.um-head { position: relative; display: flex; align-items: center; gap: .85rem; padding: 1.1rem 1rem 1rem; color: #fff; background: linear-gradient(135deg, #075e54 0%, #128c7e 55%, #25d366 130%); overflow: hidden; }
.um-head::before, .um-head::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.1); pointer-events: none; }
.um-head::before { width: 120px; height: 120px; right: -35px; top: -50px; animation: um-float 6s ease-in-out infinite; }
.um-head::after { width: 70px; height: 70px; right: 40px; bottom: -40px; animation: um-float 7s ease-in-out infinite reverse; }
.um-avatar { position: relative; z-index: 1; flex: none; width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; font-weight: 700; background: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.65); backdrop-filter: blur(4px); }
.um-who { position: relative; z-index: 1; min-width: 0; }
.um-name { font-weight: 700; font-size: 1.02rem; line-height: 1.2; }
.um-biz { font-size: .8rem; opacity: .85; margin-top: 1px; }
.um-role { display: inline-flex; align-items: center; gap: .3rem; margin-top: .4rem; padding: .12rem .55rem; border-radius: 999px; font-size: .68rem; font-weight: 600; background: rgba(255,255,255,.2); }
.um-group { padding: .7rem 1rem .2rem; font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.um-item { display: flex; align-items: center; gap: .75rem; margin: 1px .5rem; width: auto; padding: .45rem .55rem; border-radius: 12px; font-weight: 500; font-size: .92rem; transition: background .15s, transform .15s; }
.user-menu.show .um-item { animation: um-in .3s ease-out both; animation-delay: calc(var(--i, 1) * 28ms + 60ms); }
.um-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); transition: transform .2s, background .2s, color .2s; }
.um-item:hover { background: color-mix(in srgb, var(--c) 9%, transparent); transform: translateX(3px); }
.um-item:hover .um-ic { background: var(--c); color: #fff; transform: scale(1.1) rotate(-6deg); }
.um-admin { font-weight: 600; }
.um-foot { padding: .5rem .5rem .55rem; margin-top: .35rem; border-top: 1px solid var(--line); }
.um-logout { width: 100%; display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .55rem; border: 0; border-radius: 12px; font-weight: 600; font-size: .92rem; color: #e11d48; background: rgba(225,29,72,.08); transition: background .2s, color .2s, transform .15s; }
.um-logout:hover { background: #e11d48; color: #fff; }
.um-logout:active { transform: scale(.97); }
.um-logout i { transition: transform .2s; }
.um-logout:hover i { transform: translateX(3px); }
[data-bs-theme="dark"] .user-menu { box-shadow: 0 20px 50px rgba(0,0,0,.55); }
[data-bs-theme="dark"] .um-logout { background: rgba(244,63,94,.15); color: #fb7185; }
[data-bs-theme="dark"] .um-logout:hover { background: #e11d48; color: #fff; }
@keyframes um-pop { from { opacity: 0; } to { opacity: 1; } }
@keyframes um-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes um-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .user-menu *, .user-menu.show, .avatar-btn .avatar { animation: none !important; transition: none !important; } }
@media (max-width: 575.98px) {
  .user-menu { width: min(236px, calc(100vw - 1.5rem)); border-radius: 14px; margin-top: .4rem !important; }
  .um-head { gap: .6rem; padding: .7rem .8rem; }
  .um-head::before { width: 80px; height: 80px; right: -25px; top: -35px; }
  .um-head::after { display: none; }
  .um-avatar { width: 38px; height: 38px; font-size: 1rem; border-width: 2px; }
  .um-name { font-size: .88rem; }
  .um-biz { font-size: .72rem; }
  .um-role { margin-top: .25rem; padding: .08rem .45rem; font-size: .6rem; }
  .um-group { padding: .45rem .8rem .1rem; font-size: .58rem; }
  .um-item { gap: .55rem; margin: 0 .35rem; padding: .28rem .4rem; border-radius: 10px; font-size: .82rem; }
  .um-ic { width: 26px; height: 26px; border-radius: 8px; font-size: .88rem; }
  .um-foot { padding: .35rem .35rem .4rem; margin-top: .2rem; }
  .um-logout { padding: .4rem; font-size: .82rem; border-radius: 10px; }
}

/* ---------- Templates page: card grid with WhatsApp-style previews ---------- */
.tpl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem; }
.tpl-search { position: relative; flex: 1 1 260px; max-width: 380px; }
.tpl-search i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; pointer-events: none; }
.tpl-search input { padding-left: 2rem; border-radius: 999px; }
.tpl-filter { display: flex; flex-wrap: wrap; gap: .4rem; }
.tpl-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tpl-card { display: flex; flex-direction: column; background: var(--card); border: 1.5px solid #c5cdd8; border-top: 4px solid var(--tc, #94a3b8); border-radius: 14px; overflow: hidden; box-shadow: 0 2px 6px rgba(15,23,42,.10); transition: box-shadow .15s, transform .15s, border-color .15s; }
.tpl-card[data-cat=marketing] { --tc: #f59e0b; }
.tpl-card[data-cat=utility] { --tc: #0ea5e9; }
.tpl-card[data-cat=authentication] { --tc: #8b5cf6; }
.tpl-card .tpl-card-b { border-top: 1px solid #d5dbe3; }
[data-bs-theme="dark"] .tpl-card { border-color: #3a4a54; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
[data-bs-theme="dark"] .tpl-card .tpl-card-b { border-top-color: #2a3942; }
.tpl-card:hover { box-shadow: 0 8px 24px -10px rgba(15,23,42,.3); transform: translateY(-2px); }
.tpl-card[hidden] { display: none; }
/* chat-wallpaper window, same height on every card; long messages fade out (click opens the full one) */
.tpl-wall { height: 250px; overflow: hidden; position: relative; cursor: pointer; padding: 14px 14px 0; text-align: left; font-size: .86rem; color: #111b21;
  background-color: #efeae2; background-image: radial-gradient(rgba(120,110,90,.12) 1.4px, transparent 1.6px), radial-gradient(rgba(120,110,90,.12) 1.4px, transparent 1.6px); background-size: 22px 22px; background-position: 0 0, 11px 11px; }
.tpl-wall::after { content: ""; position: absolute; inset: auto 0 0 0; height: 44px; background: linear-gradient(rgba(239,234,226,0), #efeae2 85%); pointer-events: none; }
.tpl-card-b { padding: .75rem .9rem .85rem; display: flex; flex-direction: column; gap: .5rem; }
.tpl-card-name { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-card-meta { display: flex; flex-wrap: wrap; gap: .3rem; }
.tpl-pill { font-size: .68rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px; background: #eef2f6; color: #475569; }
.tpl-pill-marketing { background: #fff1e0; color: #b45309; }
.tpl-pill-utility { background: #e0f2fe; color: #0369a1; }
.tpl-pill-authentication { background: #ede9fe; color: #6d28d9; }
.tpl-st-approved { background: #dcfce7; color: #166534; }
.tpl-st-pending, .tpl-st-in_appeal { background: #fef3c7; color: #92400e; }
.tpl-st-rejected { background: #fee2e2; color: #991b1b; }
.tpl-card-act { display: flex; align-items: center; gap: .4rem; margin-top: .15rem; }
.tpl-card-act form { margin: 0; }
/* the message itself — how WhatsApp draws a received template */
.tpl-msg { max-width: 100%; }
.tpl-msg .tpl-bubble { position: relative; border-radius: 0 10px 10px 10px; max-width: 100%; padding: .4rem .55rem .3rem; line-height: 1.38; font-size: .86rem; box-shadow: 0 1px 1px rgba(11,20,26,.13); }
.tpl-msg .tpl-bubble::before { content: ""; position: absolute; left: -7px; top: 0; border: 7px solid transparent; border-top-color: #fff; border-right-color: #fff; }
.tpl-msg .tpl-media { margin: -.1rem -.2rem .4rem; height: 110px; }
.tpl-time { text-align: right; font-size: .66rem; color: #667781; margin-top: .1rem; }
.tpl-btns { display: grid; gap: 2px; margin-top: 2px; }
.tpl-btns .tpl-btn { background: #fff; border: 0; margin: 0; padding: .5rem; border-radius: 8px; box-shadow: 0 1px 1px rgba(11,20,26,.13); color: #027eb5; }
[data-bs-theme="dark"] .tpl-wall { background-color: #0b141a; background-image: radial-gradient(rgba(255,255,255,.04) 1.4px, transparent 1.6px), radial-gradient(rgba(255,255,255,.04) 1.4px, transparent 1.6px); color: #e9edef; }
[data-bs-theme="dark"] .tpl-wall::after { background: linear-gradient(rgba(11,20,26,0), #0b141a 85%); }
[data-bs-theme="dark"] .tpl-msg .tpl-bubble::before { border-top-color: #202c33; border-right-color: #202c33; }
[data-bs-theme="dark"] .tpl-btns .tpl-btn { background: #202c33; color: #53bdeb; }
[data-bs-theme="dark"] .tpl-time { color: #8696a0; }
[data-bs-theme="dark"] .tpl-pill { background: #1c2930; color: #c3cfd7; }
@media (max-width: 767.98px) {
  .tpl-search { max-width: none; flex-basis: 100%; }
  .tpl-fill { margin-left: 0 !important; }
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .tpl-card { border-radius: 10px; }
  .tpl-wall { height: 190px; padding: 8px 7px 0; font-size: .68rem; }
  .tpl-msg .tpl-bubble { font-size: .68rem; line-height: 1.3; padding: .3rem .4rem .2rem; border-radius: 0 7px 7px 7px; }
  .tpl-msg .tpl-bubble::before { left: -5px; border-width: 5px; }
  .tpl-msg .tpl-media { height: 64px; margin-bottom: .3rem; }
  .tpl-msg .tpl-var { font-size: .62rem; }
  .tpl-time { font-size: .55rem; }
  .tpl-btns .tpl-btn { font-size: .66rem; padding: .3rem; }
  .tpl-card-b { padding: .5rem .5rem .55rem; gap: .35rem; }
  .tpl-card-name { font-size: .76rem; }
  .tpl-pill { font-size: .58rem; padding: .08rem .35rem; }
  .tpl-card-act { gap: .25rem; }
  .tpl-card-act .btn { padding: .2rem .4rem; font-size: .7rem; }
  .tpl-card-act .btn-brand { padding: .25rem; }
}
.tpl-var.tpl-filled { background: none; color: inherit; font-family: inherit; font-size: inherit; padding: 0; font-weight: 600; }
.tpl-fill { display: flex; align-items: center; gap: .5rem; padding-left: 2.6rem; }

/* Contact groups */
.grp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.grp-card { --g: #128c7e; position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.grp-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--g); }
.grp-card:hover { box-shadow: 0 8px 22px rgba(15,23,42,.08); transform: translateY(-1px); }
.grp-card.active { border-color: var(--g); box-shadow: 0 0 0 2px color-mix(in srgb, var(--g) 25%, transparent); }
.grp-main { display: block; padding: 1.1rem 1.1rem .8rem; color: inherit; text-decoration: none; }
.grp-ico { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; color: var(--g); background: color-mix(in srgb, var(--g) 13%, #fff); }
.grp-name { font-weight: 700; color: #0f172a; }
.grp-desc { font-size: .8rem; color: var(--muted); min-height: 1.2em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grp-count { font-size: 1.5rem; font-weight: 800; color: var(--g); line-height: 1; }
.grp-stack { display: flex; }
.grp-stack span { width: 28px; height: 28px; border-radius: 50%; margin-left: -8px; border: 2px solid #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; color: var(--g); background: color-mix(in srgb, var(--g) 15%, #fff); }
.grp-stack span.more { background: #f1f5f9; color: #475569; }
.grp-actions { display: flex; align-items: center; gap: .25rem; padding: .35rem .6rem; border-top: 1px solid var(--line); background: #fafbfc; font-size: .8rem; }
.grp-actions a, .grp-actions button { color: #475569; background: none; border: 0; padding: .25rem .45rem; border-radius: 6px; text-decoration: none; }
.grp-actions a:hover, .grp-actions button:hover { background: #eef2f6; color: var(--g); }
.grp-actions form { margin: 0; }
.grp-empty { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.1rem 1.25rem; border: 1.5px dashed #cbd5e1; border-radius: 14px; background: #fafcfb; }
.grp-empty > i { font-size: 1.8rem; color: var(--brand); }
.grp-chip { background: color-mix(in srgb, var(--g) 12%, #fff); color: var(--g); }
.grp-chip i { margin-right: .25rem; }
.swatch input, .icopick input { position: absolute; opacity: 0; pointer-events: none; }
.swatch, .icopick { position: relative; cursor: pointer; margin: 0; }
.swatch span { display: block; width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #cbd5e1; }
.swatch input:checked + span { box-shadow: 0 0 0 2px #0f172a; }
.icopick span { display: flex; width: 36px; height: 36px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 9px; color: #475569; }
.icopick input:checked + span { border-color: var(--brand); background: #e8f6f3; color: var(--brand-dark); }

/* Navigation progress bar (assets/js/app.js): shows the moment a menu link is tapped. */
#navProgress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 3000; background: #25d366; box-shadow: 0 0 8px rgba(37,211,102,.6); opacity: 0; pointer-events: none; }
#navProgress.go { opacity: 1; width: 85%; transition: width 8s cubic-bezier(.1,.7,.2,1); }
.sidebar-link.is-loading { opacity: .65; }
