/* ==========================================================================
   InventorysHub — Onboarding Design System (Phase 1, Screen 1)
   Original token set — not derived from the existing app or from Sortly.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

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

:root {
  color-scheme: light;

  /* ---- Brand palette ------------------------------------------------- */
  --ih-ink:            #1c1a22;
  --ih-ink-soft:        #5c5768;
  --ih-ink-faint:       #948da2;

  --ih-primary:         #40315f;   /* deep indigo-violet */
  --ih-primary-600:     #2f2448;   /* hover / pressed */
  --ih-primary-100:     #ece8f5;   /* tint background */
  --ih-primary-50:      #f5f3fa;

  --ih-accent:          #e2823f;   /* warm amber — sparing use */
  --ih-accent-100:      #fbe9d9;

  --ih-bg:              #faf9f6;
  --ih-surface:         #ffffff;
  --ih-border:          #e8e4da;
  --ih-border-strong:   #d7d1c2;

  --ih-focus-ring:      rgba(64, 49, 95, 0.28);
  --ih-focus-ring-soft: rgba(64, 49, 95, 0.14);
  --ih-focus-border:    color-mix(in srgb, var(--ih-primary) 45%, var(--ih-border));

  --ih-danger:          #c1443c;
  --ih-danger-50:       #fbebe9;
  --ih-success:         #1f9d63;
  --ih-success-100:     #e4f7ee;

  /* ---- Shape & elevation --------------------------------------------- */
  --ih-radius-lg:       16px;
  --ih-radius-md:       16px;
  --ih-radius-sm:       10px;

  --ih-shadow-sm:       0 1px 2px rgba(28, 26, 34, 0.04);
  --ih-shadow-md:       0 8px 24px rgba(28, 26, 34, 0.08);
  --ih-shadow-lg:       0 20px 48px rgba(28, 26, 34, 0.12);

  /* ---- Type ------------------------------------------------------------ */
  --ih-font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---- Dark theme — same token set, softened premium-SaaS palette ------- */
html[data-theme="dark"] {
  color-scheme: dark;

  --ih-ink:            #eae7f2;
  --ih-ink-soft:        #a9a4ba;
  --ih-ink-faint:       #746f83;

  --ih-primary:         #9184bd;   /* softened lavender-purple, not neon */
  --ih-primary-600:     #a496cd;   /* hover — a touch lighter */
  --ih-primary-100:     #2c2740;   /* tint background */
  --ih-primary-50:      #221e30;

  --ih-accent:          #e2965f;
  --ih-accent-100:      #3a2a1e;

  --ih-bg:              #1a1822;
  --ih-surface:         #242030;
  --ih-surface-2:       #1f1c28;
  --ih-border:          #34303e;
  --ih-border-strong:   #47414f;

  --ih-focus-ring:      rgba(145, 132, 189, 0.32);
  --ih-focus-ring-soft: rgba(145, 132, 189, 0.18);

  --ih-danger:          #de7970;
  --ih-danger-50:       #392422;
  --ih-success:         #4fbf8a;
  --ih-success-100:     #1c3328;

  --ih-shadow-sm:       0 1px 2px rgba(0, 0, 0, 0.28);
  --ih-shadow-md:       0 8px 24px rgba(0, 0, 0, 0.36);
  --ih-shadow-lg:       0 20px 48px rgba(0, 0, 0, 0.46);
}

html, body { height: 100%; }

body {
  font-family: var(--ih-font);
  background: var(--ih-bg);
  color: var(--ih-ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; }

/* Generic visibility utility — toggled via JS instead of inline style.display */
.is-hidden { display: none; }

/* ==========================================================================
   Shell — two-column onboarding layout
   ========================================================================== */

.ob-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
}

.ob-panel-content {
  display: flex;
  flex-direction: column;
  padding: 18px clamp(18px, 6vw, 96px);
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
}

.ob-panel-visual {
  position: relative;
  background: linear-gradient(165deg, var(--ih-primary-50) 0%, var(--ih-primary-100) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ---- Brand mark ---------------------------------------------------------- */

.ob-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  width: fit-content;
}

.ob-logo-img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}
.app-sidebar-head .ob-logo-img{height: 32px;}
/* ---- Body content --------------------------------------------------------- */

.ob-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}
.ob-content-logo {
    text-align: center;
    margin-bottom: 20px;
}
.ob-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ih-primary);
  margin-bottom: 10px;
}

.ob-heading {
  font-size: clamp(1.7rem, 3vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ih-ink);
  margin-bottom: 12px;
}

.ob-subheading {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ih-ink-soft);
  margin-bottom: 16px;
}

/* ---- Choice cards ----------------------------------------------------------- */

.ob-choice-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.ob-choice {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px;
  background: var(--ih-surface);
  border: 1.5px solid var(--ih-border);
  border-radius: var(--ih-radius-md);
  box-shadow: var(--ih-shadow-sm);
  transition: border-color .16s ease, box-shadow .16s ease, transform .12s ease, background .16s ease;
  position: relative;
}

.ob-choice:hover {
  border-color: var(--ih-border-strong);
  box-shadow: var(--ih-shadow-md);
  transform: translateY(-1px);
}

.ob-choice:focus-visible {
  outline: none;
  border-color: var(--ih-primary);
  box-shadow: 0 0 0 4px var(--ih-focus-ring);
}

.ob-choice[aria-checked="true"] {
  border-color: var(--ih-primary);
  background: var(--ih-primary-50);
  box-shadow: var(--ih-shadow-md);
}

.ob-choice-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--ih-primary-100);
  color: var(--ih-primary);
  transition: background .16s ease, color .16s ease;
}

.ob-choice-icon svg { width: 24px; height: 24px; }

.ob-choice[aria-checked="true"] .ob-choice-icon {
  background: var(--ih-primary);
  color: #fff;
}

.ob-choice-text { flex: 1; padding-top: 1px; }

.ob-choice-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ih-ink);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}

.ob-choice-desc {
  font-size: 0.89rem;
  line-height: 1.45;
  color: var(--ih-ink-soft);
}

.ob-choice-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ih-border-strong);
  background: #fff;
  display: grid;
  place-items: center;
  margin-top: 2px;
  transition: border-color .16s ease, background .16s ease;
}

.ob-choice-check svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .14s ease, transform .14s ease;
}

.ob-choice[aria-checked="true"] .ob-choice-check {
  border-color: var(--ih-primary);
  background: var(--ih-primary);
}

.ob-choice[aria-checked="true"] .ob-choice-check svg {
  opacity: 1;
  transform: scale(1);
}

/* ---- Primary action ---------------------------------------------------------- */
.ob-actions-wrap{text-align:center; margin-top:24px;}
.ob-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ob-actions.start {
    justify-content: flex-end;
    margin-bottom: 15px;
}
.ob-btn-primary {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ih-font);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: var(--ih-primary);
  padding: 13px 26px;
  border-radius: 999px;
  box-shadow: var(--ih-shadow-sm);
  transition: background .16s ease, box-shadow .16s ease, transform .12s ease, opacity .16s ease;
}

.ob-btn-primary svg { width: 16px; height: 16px; transition: transform .16s ease; }

.ob-btn-primary:hover:not(:disabled) {
  background: var(--ih-primary-600);
  box-shadow: var(--ih-shadow-md);
}

.ob-btn-primary:hover:not(:disabled) svg { transform: translateX(3px); }

.ob-btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ih-focus-ring);
}

.ob-btn-primary:disabled {
  background: var(--ih-border);
  color: var(--ih-ink-faint);
  cursor: not-allowed;
  box-shadow: none;
}

.ob-progress-hint {
  font-size: 0.82rem;
  color: var(--ih-ink-faint);
  font-weight: 600;
}

/* ---- Footer note -------------------------------------------------------------- */

.ob-footnote {
 
  font-size: 0.82rem;
  color: var(--ih-ink-faint);
  line-height: 1.5; 
}
.ob-footnote.forgot{text-decoration: none;}
/* ==========================================================================
   Visual panel — original illustration
   ========================================================================== */

.ob-visual-inner {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 0 40px;
}

.ob-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.5;
}

.ob-blob-1 {
  width: 260px; height: 260px;
  background: var(--ih-accent-100);
  top: -60px; right: -40px;
}

.ob-blob-2 {
  width: 180px; height: 180px;
  background: #ffffff;
  bottom: -30px; left: -50px;
  opacity: 0.6;
}

.ob-illustration {
  position: relative;
  width: 100%;
  height: auto;
}

.ob-visual-caption {
  position: relative;
  text-align: center;
  margin-top: 28px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ih-primary-600);
}

.ob-visual-caption span {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ih-ink-soft);
  margin-top: 6px;
}

/* ---- Auth promo (login / signup right panel) ----------------------------- */

.ob-visual-inner-auth {
  max-width: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ob-visual-inner-auth .ob-illustration {
  max-width: 340px;
  margin: 0 auto;
}

.ob-auth-promo {    position: relative;    z-index: 99;    width: 100%;    margin-top: 8px;    padding: 30px;    background: #fff;    border: 1px solid rgba(4, 83, 167, .1);    border-radius: 18px;    box-shadow: 0 18px 45px rgba(15, 38, 72, .06);}

.ob-auth-promo-kicker {    display: inline-flex;    align-items: center;    gap: 7px;    margin-bottom: 13px;    padding: 6px 10px;    background: rgba(4, 83, 167, .09);    border-radius: 6px;    color: #0453a7;    font-size: 11px;    font-weight: 700;    letter-spacing: .08em;}

.ob-auth-promo-title{    margin: 0 0 9px;    font-size: 24px;    font-weight: 700;    line-height: 1.25;    letter-spacing: -.02em;    color: #475569;}

.ob-auth-promo-lead {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ih-ink-soft);
  margin-bottom: 14px;
}

.ob-auth-promo-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.ob-auth-promo-list li {    display: flex;    align-items: flex-start;        gap: 12px;    padding: 14px;    background: rgba(255, 255, 255, 0.8);    border-width: 1px;    border-style: solid;    border-color: rgba(4, 83, 167, 0.08);    border-image: none;    border-radius: 12px;    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;}.ob-auth-promo-list li:hover{    transform: translateY(-2px);    border-color: rgba(4, 83, 167, .2);    box-shadow: 0 10px 25px rgba(4, 83, 167, .08);}.ob-promo-icon {    display: flex;    align-items: center;    justify-content: center;    width: 38px;    height: 38px;    min-width: 38px;    background: rgba(4, 83, 167, .1);    border-radius: 10px;    color: #0453a7;    font-size: 15px;}
.ob-promo-icon svg {    width: 22px;    height: 22px;    display: block;    fill: none;    stroke: currentColor;    stroke-width: 1.8;    stroke-linecap: round;    stroke-linejoin: round;}
.ob-auth-promo-list strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: rgb(71, 85, 105);
  margin-bottom: 2px;
}

.ob-auth-promo-list li span {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ih-ink-faint);
}

.ob-btn-google {
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ih-surface);
  border: 1.5px solid var(--ih-border-strong);
  border-radius: var(--ih-radius-sm);
  color: var(--ih-ink);
  font-family: var(--ih-font);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 8px;
}

.ob-btn-google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.ob-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 20px;
}

.ob-auth-divider::before,
.ob-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ih-border);
}

.ob-auth-divider span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ih-ink-faint);
  white-space: nowrap;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .ob-shell { grid-template-columns: 1fr; height: auto; min-height: 100vh; overflow: visible; }
  .ob-panel-visual { order: -1; min-height: 220px; padding: 28px 24px; flex-shrink: 0; }
  .ob-panel-content { padding: 28px 24px 40px; height: auto; overflow-y: visible; }
  .ob-content { padding: 24px 0 0; }
  .ob-visual-inner { max-width: 280px; }
  .ob-visual-caption { display: none; }
  .ob-visual-inner-auth { max-width: 420px; }
  .ob-visual-inner-auth .ob-illustration { max-width: 220px; }
  .ob-auth-promo { margin-top: 4px; padding: 14px 16px; }
}

@media (max-width: 480px) {
  .ob-choice { padding: 16px 16px; gap: 12px; }
  .ob-choice-icon { width: 40px; height: 40px; border-radius: 11px; }
  .ob-actions { flex-direction: column-reverse; align-items: stretch; gap: 14px; }
  .ob-btn-primary { justify-content: center; }
  .ob-progress-hint { text-align: center; }
}

/* ==========================================================================
   Step shell — sidebar + content, used from Screen 2 onward
   ========================================================================== */

.ob2-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 296px 1fr;
  overflow: hidden;
}

/* ---- Sidebar --------------------------------------------------------- */

.ob2-sidebar {
  background: var(--ih-surface);
  border-right: 1px solid var(--ih-border);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.ob2-sidebar .ob-brand { margin-bottom: 40px; }

.ob2-steps-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ih-ink-faint);
  margin-bottom: 20px;
}

.ob2-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.ob2-step {
  display: flex;
  gap: 14px;
  position: relative;
  padding-bottom: 28px;
}

.ob2-step:last-child { padding-bottom: 0; }

.ob2-step::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: 0;
  width: 2px;
  background: var(--ih-border);
}

.ob2-step:last-child::before { display: none; }

.ob2-step.is-done::before { background: var(--ih-primary); }

.ob2-step-dot {
  flex-shrink: 0;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1.6px solid var(--ih-border-strong);
  background: var(--ih-surface);
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ih-ink-faint);
  z-index: 1;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.ob2-step-dot svg { width: 12px; height: 12px; }

.ob2-step.is-active .ob2-step-dot {
  border-color: var(--ih-primary);
  color: var(--ih-primary);
  box-shadow: 0 0 0 4px var(--ih-primary-50);
}

.ob2-step.is-done .ob2-step-dot {
  background: var(--ih-primary);
  border-color: var(--ih-primary);
  color: #fff;
}

.ob2-step-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ih-ink-faint);
  transition: color .16s ease;
}

.ob2-step-sub {
  font-size: 0.78rem;
  color: var(--ih-ink-faint);
  margin-top: 2px;
}

.ob2-step.is-active .ob2-step-name,
.ob2-step.is-done .ob2-step-name { color: var(--ih-ink); }

.ob2-sidebar-footer {
  margin-top: auto;
  padding-top: 28px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ih-ink-faint);
}

.ob2-sidebar-footer strong { color: var(--ih-ink-soft); }

/* ---- Main -------------------------------------------------------------- */

.ob2-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--ih-bg);
}

.ob2-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px 18px;
  flex-shrink: 0;
}

.ob2-topbar-greet {
  font-size: 0.95rem;
  color: var(--ih-ink-soft);
}

.ob2-topbar-greet strong { color: var(--ih-ink); }

.ob2-mobile-progress {
  display: none;
  height: 4px;
  background: var(--ih-border);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 24px 4px;
  flex-shrink: 0;
}

.ob2-mobile-progress-fill {
  height: 100%;
  background: var(--ih-primary);
  border-radius: 999px;
  transition: width .25s ease;
}

.ob2-link-ghost {
  all: unset;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ih-ink-faint);
  padding: 8px 4px;
  border-radius: var(--ih-radius-sm);
  transition: color .14s ease;
}

.ob2-link-ghost:hover { color: var(--ih-primary); }
.ob2-link-ghost:focus-visible { outline: none; color: var(--ih-primary); text-decoration: underline; }

/* Each wizard step is a full-height flex column (topbar stays fixed, body
   scrolls, navbar stays pinned to the bottom) — same behavior each step had
   back when it was its own page directly inside .ob2-main. */
.ob2-stepwrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.ob2-stepwrap.is-hidden { display: none; }

.ob2-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  padding: 8px 48px 32px;
}

.ob2-column {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

.ob2-column-wide { max-width: 640px; }

.ob2-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ih-primary);
  margin-bottom: 14px;
}

.ob2-heading {
  font-size: clamp(1.5rem, 2.6vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ih-ink);
  margin-bottom: 10px;
}

.ob2-subheading {
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--ih-ink-soft);
  margin-bottom: 32px;
}

/* ---- Form card ----------------------------------------------------------- */

.ob-field-card {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  padding: 22px 22px 8px;
  box-shadow: var(--ih-shadow-sm);
}

.ob-form-group { margin-bottom: 18px; }

/* A field needs no bottom margin when it's the last thing in its container,
   sits inside a row whose own gap already provides spacing, or is
   immediately followed by a result/summary block. */
.ob-form-group:last-child,
.app-form-row-2 .ob-form-group,
.app-form-row-3 .ob-form-group,
.app-form-image-row .ob-form-group,
.ob-form-group:has(+ .app-modal-result) {
  margin-bottom: 0;
}

.ob-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 21px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ih-ink);
  margin-bottom: 4px;
}

/* Label text stays on a single line and truncates rather than wrapping —
   a wrapped label would grow .ob-label taller than neighboring fields and
   break the shared input-row alignment. */
.ob-label-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.ob-label-optional {
  flex-shrink: 0;
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--ih-ink-faint);
  background: var(--ih-bg);
  border: 1px solid var(--ih-border);
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: none;
}

.ob-required-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ih-accent);
  display: inline-block;
}

.ob-input, .ob-textarea {
  width: 100%;
  font-family: var(--ih-font);
  font-size: 0.95rem;
  color: var(--ih-ink);
  background: var(--ih-bg);
  border: 1.4px solid var(--ih-border);
  border-radius: var(--ih-radius-sm);
  padding: 9px 12px;
transition: border-color .14s ease, box-shadow .14s ease, background .14s ease; box-shadow: none !important;}

.ob-textarea { resize: vertical; min-height: 88px; line-height: 1.5; }

.ob-input::placeholder, .ob-textarea::placeholder { color: var(--ih-ink-faint); }

.ob-input:hover, .ob-textarea:hover { border-color: var(--ih-border-strong); }

.ob-input:focus, .ob-textarea:focus {
  outline: none;
  background: var(--ih-surface);
  border-color: var(--ih-focus-border);
  box-shadow: 0 0 0 4px var(--ih-focus-ring-soft);
}

.ob-input.has-error, .ob-textarea.has-error {
  border-color: var(--ih-danger);
  background: var(--ih-danger-50);
}

.ob-hint {
  font-size: 0.79rem;
  color: var(--ih-ink-faint);
  margin-top: 7px;
  line-height: 1.4;
}

.ob-error-msg {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--ih-danger);
  margin-top: 7px;
}

.ob-error-msg.is-visible { display: flex; }.ob-error-msg-wrap {    display: flex;    height: 20px;    margin-top: -10px;    text-align: center;    justify-content: center;}.ob-error-msg-wrap .ob-error-msg {    margin: 0;}


/* Standalone validation error below a selection grid needs more clearance
   than the tight spacing used right under a text input. */
.ob-tile-grid + .ob-error-msg,
.ob-radio-grid + .ob-error-msg {
  margin-top: 16px;
}
.ob2-subheading.step-2{
    margin-bottom: 7px;
}
.ob-error-msg-wrap.step-2 {
    height: 20px;
    margin: 0 0 5px;
}

/* Mobile step-progress fill — fixed set of step fractions, not free-form data */
.ob2-fill-17  { width: 16.6%; }
.ob2-fill-25  { width: 25%; }
.ob2-fill-33  { width: 33.3%; }
.ob2-fill-50  { width: 50%; }
.ob2-fill-67  { width: 66.6%; }
.ob2-fill-75  { width: 75%; }
.ob2-fill-83  { width: 83.3%; }
.ob2-fill-100 { width: 100%; }
.ob-error-msg svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ---- Bottom nav ------------------------------------------------------------ */

.ob2-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  flex-shrink: 0;
}

.ob-skip-link {
  all: unset;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ih-ink-faint);
  padding: 8px 4px;
  transition: color .14s ease;
}

.ob-skip-link:hover { color: var(--ih-ink-soft); text-decoration: underline; }
.ob-skip-link:focus-visible { outline: none; color: var(--ih-primary); text-decoration: underline; }

.ob-btn-back {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ih-font);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ih-ink-soft);
  padding: 12px 18px;
  border-radius: 999px;
  border: 1.4px solid var(--ih-border);
  transition: border-color .14s ease, color .14s ease, background .14s ease;
}

.ob-btn-back svg { width: 15px; height: 15px; }

.ob-btn-back:hover {
  border-color: var(--ih-border-strong);
  background: var(--ih-bg);
  color: var(--ih-ink);
}

.ob-btn-back:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ih-focus-ring);
}

.ob2-navbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* ---- Step-shell responsive -------------------------------------------------- */

@media (max-width: 900px) {
  .ob2-shell { grid-template-columns: 1fr; }

  .ob2-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--ih-border);
    padding: 20px 24px;
  }

  .ob2-sidebar .ob-brand { margin-bottom: 20px; }
  .ob2-steps-label { display: none; }

  .ob2-steps {
    flex-direction: row;
    gap: 6px;
  }

  .ob2-step {
    flex: 1;
    padding-bottom: 0;
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .ob2-step::before {
    left: auto;
    top: 13px;
    right: -50%;
    width: 100%;
    height: 2px;
    bottom: auto;
  }

  .ob2-step-info { display: none; }

  .ob2-sidebar-footer { display: none; }

  .ob2-topbar, .ob2-body, .ob2-navbar { padding-left: 20px; padding-right: 20px; }
  .ob2-topbar { padding-top: 18px; padding-bottom: 10px; }
  .ob2-body { padding-top: 6px; padding-bottom: 20px; }
  .ob-field-card { padding: 20px 18px 6px; }
  .ob2-mobile-progress { display: block; margin-left: 20px; margin-right: 20px; }
  .ob2-heading { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .ob2-topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ob2-navbar { flex-direction: column-reverse; gap: 14px; }
  .ob2-navbar-right { width: 100%; justify-content: space-between; }
  .ob-btn-back { align-self: flex-start; }
  .ob-btn-primary { flex: 1; justify-content: center; }
}

/* ==========================================================================
   Selection tiles — single-select with icon + title + description
   (Business Type)
   ========================================================================== */

.ob-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ob-tile {
  all: unset;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px 16px;
  background: var(--ih-surface);
  border: 1.5px solid var(--ih-border);
  border-radius: var(--ih-radius-md);
  box-shadow: var(--ih-shadow-sm);
  transition: border-color .14s ease, box-shadow .14s ease, transform .1s ease, background .14s ease;
  min-height: 44px;
}

.ob-tile:hover { border-color: var(--ih-border-strong); box-shadow: var(--ih-shadow-md); transform: translateY(-1px); }
.ob-tile:focus-visible { outline: none; border-color: var(--ih-primary); box-shadow: 0 0 0 4px var(--ih-focus-ring); }

.ob-tile[aria-checked="true"] {
  border-color: var(--ih-primary);
  background: var(--ih-primary-50);
  box-shadow: var(--ih-shadow-md);
}

.ob-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--ih-primary-100);
  color: var(--ih-primary);
}

.ob-tile[aria-checked="true"] .ob-tile-icon { background: var(--ih-primary); color: #fff; }

.ob-tile-icon svg { width: 19px; height: 19px; }

.ob-tile-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ih-ink);
}

.ob-tile-desc {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ih-ink-faint);
}

/* ==========================================================================
   Chips — multi-select (What to track)
   ========================================================================== */

.ob-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ob-chip {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  min-height: 44px;
  background: var(--ih-surface);
  border: 1.5px solid var(--ih-border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ih-ink-soft);
  box-shadow: var(--ih-shadow-sm);
  transition: border-color .14s ease, background .14s ease, color .14s ease, transform .1s ease;
}

.ob-chip svg { width: 16px; height: 16px; flex-shrink: 0; }

.ob-chip:hover { border-color: var(--ih-border-strong); transform: translateY(-1px); }
.ob-chip:focus-visible { outline: none; border-color: var(--ih-primary); box-shadow: 0 0 0 4px var(--ih-focus-ring); }

.ob-chip[aria-checked="true"] {
  border-color: var(--ih-primary);
  background: var(--ih-primary);
  color: #fff;
}

/* ==========================================================================
   Radio cards — single-select, no description-heavy (Team Size)
   ========================================================================== */

.ob-radio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.ob-radio-card {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  min-height: 44px;
  background: var(--ih-surface);
  border: 1.5px solid var(--ih-border);
  border-radius: var(--ih-radius-md);
  box-shadow: var(--ih-shadow-sm);
  transition: border-color .14s ease, box-shadow .14s ease, transform .1s ease, background .14s ease;
}

.ob-radio-card:hover { border-color: var(--ih-border-strong); box-shadow: var(--ih-shadow-md); transform: translateY(-1px); }
.ob-radio-card:focus-visible { outline: none; border-color: var(--ih-primary); box-shadow: 0 0 0 4px var(--ih-focus-ring); }

.ob-radio-card[aria-checked="true"] {
  border-color: var(--ih-primary);
  background: var(--ih-primary-50);
  box-shadow: var(--ih-shadow-md);
}

.ob-radio-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--ih-primary-100);
  color: var(--ih-primary);
}

.ob-radio-card[aria-checked="true"] .ob-radio-icon { background: var(--ih-primary); color: #fff; }
.ob-radio-icon svg { width: 19px; height: 19px; }

.ob-radio-title { font-size: 0.92rem; font-weight: 700; color: var(--ih-ink); }
.ob-radio-desc { font-size: 0.79rem; color: var(--ih-ink-faint); margin-top: 2px; }

/* ==========================================================================
   Locale form (Region & Currency)
   ========================================================================== */

.ob-locale-detected {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--ih-success-100);
  color: var(--ih-success);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: var(--ih-radius-sm);
  margin-bottom: 22px;
}

.ob-locale-detected svg { width: 16px; height: 16px; flex-shrink: 0; }

.ob-locale-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.ob-locale-row-3 {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 12px;
}

.ob-locale-row .ob-form-group {
  margin-bottom: 0;
}

.ob-field-card > .ob-form-group {
  margin-bottom: 16px;
}

.ob-select {
  width: 100%;
  font-family: var(--ih-font);
  font-size: 0.95rem;
  color: var(--ih-ink);
  background: var(--ih-bg);
  border: 1.4px solid var(--ih-border);
  border-radius: var(--ih-radius-sm);
  padding: 13px 15px;
  min-height: 44px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%235b6072' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  transition: border-color .14s ease, box-shadow .14s ease;box-shadow: none !important;
}

.ob-select:hover { border-color: var(--ih-border-strong); }
.ob-select:focus { outline: none; border-color: var(--ih-focus-border); box-shadow: 0 0 0 4px var(--ih-focus-ring-soft); }

/* ==========================================================================
   Summary card (Create Workspace)
   ========================================================================== */

.ob-summary-card {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  box-shadow: var(--ih-shadow-sm);
  overflow: hidden;
}

.ob-summary-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--ih-border);
}

.ob-summary-row:last-child { border-bottom: none; }

.ob-summary-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--ih-primary-100);
  color: var(--ih-primary);
  margin-top: 1px;
}

.ob-summary-icon svg { width: 17px; height: 17px; }

.ob-summary-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ih-ink-faint);
  margin-bottom: 3px;
}

.ob-summary-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ih-ink);
  line-height: 1.4;
}

.ob-summary-edit {
  all: unset;
  cursor: pointer;
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ih-primary);
  flex-shrink: 0;
  padding: 4px;
}

.ob-summary-edit:hover { text-decoration: underline; }

/* ==========================================================================
   Setup / loading screen
   ========================================================================== */

.ob-setup-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 0 10px;
}

.ob-setup-anim {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--ih-primary-100);
  color: var(--ih-primary);
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  animation: ob-pulse 1.8s ease-in-out infinite;
}

.ob-setup-anim svg { width: 32px; height: 32px; }

@keyframes ob-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 var(--ih-primary-100); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 10px transparent; }
}

.ob-setup-screen h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ih-ink);
  margin-bottom: 8px;
}

.ob-setup-screen p {
  font-size: 0.92rem;
  color: var(--ih-ink-soft);
  margin-bottom: 28px;
}

.ob-setup-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  text-align: left;
}

.ob-setup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ih-ink-faint);
  padding: 12px 16px;
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-sm);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.ob-setup-item-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.6px solid var(--ih-border-strong);
  display: grid;
  place-items: center;
  color: var(--ih-ink-faint);
}

.ob-setup-item-icon svg { width: 12px; height: 12px; }

.ob-setup-item.is-done {
  color: var(--ih-ink);
  border-color: var(--ih-success);
  background: var(--ih-success-100);
}

.ob-setup-item.is-done .ob-setup-item-icon {
  background: var(--ih-success);
  border-color: var(--ih-success);
  color: #fff;
}

.ob-success-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--ih-success-100);
  color: var(--ih-success);
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
}

.ob-success-badge svg { width: 34px; height: 34px; }

/* ---- Component responsive ------------------------------------------------ */

@media (max-width: 900px) {
  .ob-tile-grid { grid-template-columns: repeat(2, 1fr); }
  .ob-radio-grid { grid-template-columns: 1fr; }
  .ob-locale-row,
  .ob-locale-row-3 { grid-template-columns: 1fr; gap: 14px; }
  .ob-summary-row { padding: 16px 20px; }
}

@media (max-width: 480px) {
  .ob-tile-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ob-tile { padding: 14px 12px; }
  .ob-chip { padding: 11px 15px; font-size: 0.85rem; }
}

/* ==========================================================================
   InventorysHub — Core App Design System
   Shares tokens/type with the onboarding wizard styles above (single file).
   ========================================================================== */


/* ---- App shell: sidebar + main ------------------------------------------- */

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 232px 1fr;
  overflow: hidden;
  transition: grid-template-columns .18s ease;
}

.app-sidebar {
  background: var(--ih-surface);
  border-right: 1px solid var(--ih-border);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
  /*overflow-y: auto;
  overflow-x: hidden;*/
}

/* ---- Sidebar head: brand + collapse toggle -------------------------------- */

.app-sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
  padding-left: 6px;
}

.app-sidebar .ob-brand { flex-shrink: 1; min-width: 0; overflow: hidden; }

.app-brand-mini {
  display: none;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--ih-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Collapse toggle — styled as a nav row, sitting with Settings at the bottom */
.app-sidebar-toggle.app-nav-link {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--ih-radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ih-ink-soft);
  transition: background .14s ease, color .14s ease;
}
.app-sidebar-toggle.app-nav-link:hover { background: var(--ih-bg); color: var(--ih-ink); }
.app-sidebar-toggle.app-nav-link svg { width: 19px; height: 19px; flex-shrink: 0; transition: transform .18s ease; }

/* ---- Nav ------------------------------------------------------------------- */

.app-nav { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.app-nav-features.has-active { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--ih-border); }

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--ih-radius-sm);
  background: transparent;
  font-family: var(--ih-font);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: inherit;
  color: var(--ih-ink-soft);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}

.app-nav-logout-form { margin: 0; width: 100%; }
button.app-nav-link {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
}

.app-nav-link svg { width: 19px; height: 19px; flex-shrink: 0; }
.app-nav-lock {
  margin-left: auto;
  display: inline-flex;
  color: var(--ih-ink-faint);
}
.app-nav-lock svg { width: 14px; height: 14px; }

.app-nav-link:hover { background: var(--ih-bg); color: var(--ih-ink); }

.app-nav-link.is-active {
  background: var(--ih-primary-50);
  color: var(--ih-primary);
}

.app-nav-link.is-active svg { color: var(--ih-primary); }

.app-sidebar-bottom {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--ih-border); position: relative;
}
button.app-sidebar-toggle {
    position: absolute;
    right: -30px;
    z-index: 999;
    top: 22px;
    border-radius: 50%;
    border: none;
    padding-top: 3px;
    background: var(--ih-primary-100);
    color: var(--ih-primary);
}
button.app-sidebar-toggle svg {
    width: 24px;
    height: 18px;
}
.ih-collapsed button.app-sidebar-toggle{right: -24px;}
.ih-collapsed button.app-sidebar-toggle svg {
    transform: rotate(180deg);
}
.app-sidebar-pinned {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

html.ih-collapsed .app-sidebar-pinned { width: 100%; }

.app-nav-link--activate {
    white-space: normal;
    line-height: 1.15;
    justify-content: center;
    text-align: center;
    border-radius: 999px;
    background: var(--ih-primary-50);
    color: var(--ih-primary);
    font-weight: 700;
    padding: 18px 12px;
    border: 1px solid var(--ih-border);
}
.app-nav-link--activate:hover { background: var(--ih-primary-100); color: var(--ih-primary); }
.app-nav-link--activate.is-active { background: var(--ih-primary-100); color: var(--ih-primary); }

html.ih-collapsed .app-nav-link--activate {
  padding: 10px 6px;
  min-height: 44px;
}
html.ih-collapsed .app-nav-link--activate .app-nav-label {
  position: static;
  transform: none;
  opacity: 1;
  background: none;
  color: inherit;
  padding: 0;
  box-shadow: none;
  white-space: normal;
  font-size: 0.62rem;
  line-height: 1.15;
  text-align: center;
}
html.ih-collapsed .app-nav-link--activate .app-nav-label::before { display: none; }

.activate-account-intro { max-width: 640px; }

/* ---- Collapsed state -------------------------------------------------------- */

html.ih-collapsed .app-shell { grid-template-columns: 76px 1fr; }

html.ih-collapsed .app-sidebar { padding: 22px 12px; align-items: center; overflow: visible; }

html.ih-collapsed .app-sidebar-head { justify-content: center; padding-left: 0; }

html.ih-collapsed .app-sidebar .ob-brand { display: none; }
html.ih-collapsed .app-brand-mini { display: flex; }

html.ih-collapsed .app-sidebar-toggle.app-nav-link svg { transform: rotate(180deg); }

html.ih-collapsed .app-nav,
html.ih-collapsed .app-sidebar-bottom .app-nav { width: 100%; }

html.ih-collapsed .app-nav-link { justify-content: center; padding: 10px; position: relative; }

html.ih-collapsed .app-sidebar-bottom { width: 100%; }

/* Tooltip: collapsed nav labels float out on hover/focus instead of disappearing */
html.ih-collapsed .app-nav-label {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--ih-ink);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 11px;
  border-radius: 7px;
  box-shadow: var(--ih-shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: none;
  z-index: 50;
}

html.ih-collapsed .app-nav-label::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 4px 4px 4px 0;
  border-style: solid;
  border-color: transparent var(--ih-ink) transparent transparent;
}

html.ih-collapsed.ih-nav-tips-ready .app-nav-label {
  transition: opacity .14s ease, transform .14s ease;
}

html.ih-collapsed.ih-nav-tips-ready .app-nav-link:hover .app-nav-label,
html.ih-collapsed.ih-nav-tips-ready .app-nav-link:focus-visible .app-nav-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ---- Main -------------------------------------------------------------- */

.app-main {
  height: 100%;
  min-width: 0; /* grid items default to min-width:auto, which lets deep content force this wider than its track */
  overflow-y: auto;
  background: var(--ih-bg);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 44px 24px;
  flex-wrap: wrap;
}

.app-header-title h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ih-ink);
  margin-bottom: 4px;
}

.app-header-title p {
  font-size: 0.9rem;
  color: var(--ih-ink-soft);
}

.app-header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ih-surface);
  border: 1.4px solid var(--ih-border);
  border-radius: 999px;
  padding: 9px 16px;
  min-width: 220px;
  transition: border-color .14s ease, box-shadow .14s ease;
}

.app-search:focus-within { border-color: var(--ih-focus-border); box-shadow: 0 0 0 4px var(--ih-focus-ring-soft); }
.app-search svg { width: 16px; height: 16px; color: var(--ih-ink-faint); flex-shrink: 0; }
.app-search input { all: unset; font-family: var(--ih-font); font-size: 0.87rem; color: var(--ih-ink); flex: 1; }
.app-search input::placeholder { color: var(--ih-ink-faint); }

.app-search-wrap { position: relative; }
.app-search-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 280px;
  max-height: 360px;
  overflow: auto;
  z-index: 50;
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-md, 12px);
  box-shadow: var(--ih-shadow-md, 0 12px 32px rgba(15, 23, 42, 0.12));
  padding: 6px 0;
}
.app-search-suggest.is-hidden { display: none; }
.app-search-section {
  padding: 8px 14px 4px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ih-ink-faint);
}
.app-search-hit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--ih-ink);
}
.app-search-hit:hover,
.app-search-hit:focus { background: var(--ih-bg); }
.app-search-hit-title { font-size: 0.9rem; font-weight: 600; }
.app-search-hit-meta { font-size: 0.78rem; color: var(--ih-ink-faint); }
.app-search-empty {
  padding: 16px 14px;
  text-align: center;
  font-size: 0.87rem;
  color: var(--ih-ink-faint);
}

.app-icon-btn {
  all: unset;
  cursor: pointer;
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ih-surface);
  border: 1.4px solid var(--ih-border);
  color: var(--ih-ink-soft);
  transition: border-color .14s ease, color .14s ease;
}

.app-icon-btn:hover { border-color: var(--ih-border-strong); color: var(--ih-ink); }
.app-icon-btn svg { width: 17px; height: 17px; }

.app-icon-btn .app-dot {
  position: absolute;
  top: 7px; right: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ih-accent);
  border: 1.5px solid var(--ih-surface);
}

.app-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ih-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
}
.app-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-flash-wrap {
    min-height: 46px;
    display: flex;
    margin-bottom: 20px;
}
.app-flash-wrap .app-flash{margin: 0px;}
.app-flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 40px 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
}
.app-flash svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.app-flash.is-success {
  color: var(--ih-success);
  background: color-mix(in srgb, var(--ih-success) 8%, var(--ih-surface));
  border: 1px solid color-mix(in srgb, var(--ih-success) 22%, var(--ih-border));
}
.app-flash.is-error {
  color: var(--ih-danger);
  background: color-mix(in srgb, var(--ih-danger) 8%, var(--ih-surface));
  border: 1px solid color-mix(in srgb, var(--ih-danger) 22%, var(--ih-border));
}
.app-page-head--settingsnav + .app-flash {
  max-width: 1180px;
  width: calc(100% - 80px);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.app-page-head--settings + .app-flash {
  max-width: 900px;
  width: calc(100% - 80px);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.app-body { padding: 25px 44px 56px; display: flex; flex-direction: column; gap: 34px; }

/* ---- Summary cards ------------------------------------------------------- */

.app-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}

.app-stat-card {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  box-shadow: var(--ih-shadow-sm);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app-stat-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--ih-primary-100);
  color: var(--ih-primary);
}

.app-stat-icon svg { width: 19px; height: 19px; }

.app-stat-icon.is-warning { background: var(--ih-accent-100); color: var(--ih-accent); }
.app-stat-icon.is-danger  { background: var(--ih-danger-50); color: var(--ih-danger); }

.app-stat-value { font-size: 1.7rem; font-weight: 800; color: var(--ih-ink); letter-spacing: -0.02em; line-height: 1; }
.app-stat-label { font-size: 0.83rem; font-weight: 600; color: var(--ih-ink-soft); }

/* ---- Quick actions --------------------------------------------------------- */

.app-quick-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.app-action-btn {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--ih-font);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 999px;
  transition: background .14s ease, border-color .14s ease, transform .1s ease, box-shadow .14s ease;
}

.app-action-btn svg { width: 16px; height: 16px; }

/* .is-hidden alone can't beat .app-action-btn's own display:inline-flex
   (same specificity, .app-action-btn defined later) — match it explicitly. */
.app-action-btn.is-hidden { display: none; }

.app-action-btn.is-primary {
  background: var(--ih-primary);
  color: #fff;
  box-shadow: var(--ih-shadow-sm);
}
.app-action-btn.is-primary:hover { background: var(--ih-primary-600); box-shadow: var(--ih-shadow-md); transform: translateY(-1px); }

.app-action-btn.is-secondary {
  background: var(--ih-surface);
  color: var(--ih-ink);
  border: 1.4px solid var(--ih-border);
}
.app-action-btn.is-secondary:hover { border-color: var(--ih-border-strong); background: var(--ih-bg); transform: translateY(-1px); }

/* ---- Section card wrapper -------------------------------------------------- */

.app-card {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  box-shadow: var(--ih-shadow-sm);
  overflow: hidden;
}

.app-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--ih-border);
}

/* A bare section heading that introduces a card below it, rather than
   sitting inside the card's own header row. */
.app-card-head--bare {
  padding: 0;
  border: none;
  margin: 28px 0 12px;
}

.app-card-head--items {
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 16px;
}
.app-card-head--items h2 {
  flex: 0 0 auto;
  white-space: nowrap;
}
.app-card-head--items .app-item-bulk-bar {
  flex: 1 1 auto;
  min-width: 0;
}
.app-card-head--items .app-search {
  margin-left: auto;
  flex: 0 0 auto;
}

.app-card-head h2 { font-size: 1.02rem; font-weight: 800; color: var(--ih-ink); }

.app-card-head-link {
  all: unset;
  cursor: pointer;
  font-family: var(--ih-font);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ih-primary);
  text-decoration: none;
}
.app-card-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-workspace-progress-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ih-ink-faint);
}

.app-card-link {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--ih-primary);
  text-decoration: none;
}
.app-card-link:hover { text-decoration: underline; }

.app-two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }

/* ---- Inventory table -------------------------------------------------------- */

.app-table { width: 100%; border-collapse: collapse; }

.app-table th {
  text-align: left;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ih-ink-faint);
  padding: 12px 24px;
  background: var(--ih-bg);
  border-bottom: 1px solid var(--ih-border);
}

.app-table td {
  padding: 14px 24px;
  border-bottom: 1px solid var(--ih-border);
  font-size: 0.9rem;
  color: var(--ih-ink);
  vertical-align: middle;
}

.app-table tr:last-child td { border-bottom: none; }
.app-table tbody tr { transition: background .12s ease; }
.app-table tbody tr:hover { background: var(--ih-bg); }

.app-item-cell { display: flex; align-items: center; gap: 12px; }

/* Wraps an .app-item-cell in a table row when the whole row links to the item */
.app-row-link { text-decoration: none; color: inherit; display: block; }

.app-item-thumb {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: var(--ih-primary-100);
  color: var(--ih-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.app-item-thumb svg { width: 18px; height: 18px; }

/* Neutral image placeholder — used until an item has a real photo */
.app-item-photo {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--ih-bg);
  border: 1px solid var(--ih-border);
  color: var(--ih-ink-faint);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.app-item-photo svg { width: 17px; height: 17px; }
.app-item-photo img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ---- Folder icon picker (Add Folder modal) --------------------------------- */

.app-icon-picker { display: flex; flex-wrap: wrap; gap: 8px; }

.app-icon-pick {
  all: unset;
  cursor: pointer;
  width: 38px; height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ih-border);
  background: var(--ih-surface);
  color: var(--ih-ink-soft);
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}
.app-icon-pick svg { width: 17px; height: 17px; }
.app-icon-pick:hover { border-color: var(--ih-border-strong); }
.app-icon-pick.is-active {
  border-color: var(--ih-primary);
  background: var(--ih-primary-50);
  color: var(--ih-primary);
}

.app-item-name { font-weight: 700; color: var(--ih-ink); }
.app-item-sku { font-size: 0.78rem; color: var(--ih-ink-faint); margin-top: 1px; }

.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
}

.app-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.app-badge.is-instock { background: var(--ih-success-100); color: var(--ih-success); }
.app-badge.is-low     { background: var(--ih-accent-100); color: var(--ih-accent); }
.app-badge.is-out     { background: var(--ih-danger-50); color: var(--ih-danger); }
.app-badge.is-paid    { background: var(--ih-success-100); color: var(--ih-success); }

/* ---- Mobile inventory cards (shown < 720px instead of table) --------------- */

.app-inventory-cards { display: none; flex-direction: column; }

.app-inventory-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--ih-border);
  text-decoration: none;
  color: inherit;
}
.app-inventory-card:last-child { border-bottom: none; }

.app-inventory-card-body { flex: 1; min-width: 0; }
.app-inventory-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; gap: 8px; }
.app-inventory-card-qty { font-size: 0.83rem; font-weight: 700; color: var(--ih-ink-soft); flex-shrink: 0; }

/* ---- Low stock list --------------------------------------------------------- */

.app-lowstock-list { list-style: none; }

.app-lowstock-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--ih-border);
}
.app-lowstock-row:last-child { border-bottom: none; }

.app-lowstock-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--ih-accent-100);
  color: var(--ih-accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.app-lowstock-icon svg { width: 16px; height: 16px; }

.app-lowstock-body { flex: 1; min-width: 0; }
.app-lowstock-name { font-weight: 700; font-size: 0.89rem; color: var(--ih-ink); }
.app-lowstock-detail { font-size: 0.79rem; color: var(--ih-ink-faint); margin-top: 2px; }

.app-lowstock-add {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1.4px solid var(--ih-border);
  border-radius: 10px;
  background: var(--ih-surface);
  color: var(--ih-ink);
  cursor: pointer;
}
.app-lowstock-add svg { width: 16px; height: 16px; }
.app-lowstock-add:hover {
  border-color: var(--ih-primary);
  color: var(--ih-primary);
  background: var(--ih-bg);
}

/* ---- Activity list ----------------------------------------------------------- */

.app-activity-list { list-style: none; }

.app-activity-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--ih-border);
}
.app-activity-row:last-child { border-bottom: none; }

.app-activity-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ih-primary-100);
  color: var(--ih-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.app-activity-icon svg { width: 15px; height: 15px; }

.app-activity-body { flex: 1; min-width: 0; }
.app-activity-text { font-size: 0.87rem; color: var(--ih-ink); line-height: 1.45; }
.app-activity-text strong { font-weight: 700; }
.app-activity-time { font-size: 0.76rem; color: var(--ih-ink-faint); margin-top: 3px; }

/* ---- Empty state ------------------------------------------------------------- */

.app-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
}
.app-empty.is-hidden { display: none; }

.app-empty-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--ih-primary-50);
  color: var(--ih-primary);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.app-empty-icon svg { width: 26px; height: 26px; }

.app-empty h3 { font-size: 1rem; font-weight: 800; color: var(--ih-ink); margin-bottom: 6px; }
.app-empty p { font-size: 0.86rem; color: var(--ih-ink-soft); margin-bottom: 18px; max-width: 300px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  .app-summary-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px) {
  .app-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; height: auto; overflow: visible; }
  body { overflow-x: hidden; }

  .app-sidebar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    top: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    border-right: none;
    border-top: 1px solid var(--ih-border);
    z-index: 20;
    overflow: visible;
  }

  .app-sidebar-head { display: none; }
  .app-sidebar-pinned { display: contents; }
  .app-sidebar-bottom { display: contents; }
  .app-nav { display: contents; }
  .app-sidebar-bottom li:has(.app-sidebar-toggle) { display: none; }
  .app-sidebar-toggle { display: none; }

  /* Secondary destinations move into the "More" sheet on mobile — keep the
     bottom row to primary destinations only. */
  .app-sidebar > .app-nav li:has([data-more-nav]) { display: none; }
  .app-sidebar-pinned li:has([data-more-nav]) { display: none; }
  .app-sidebar-bottom li:has([data-more-nav]) { display: none; }
  .app-sidebar-pinned li:has(.app-nav-link--activate) { display: block; }
  .app-nav-features { display: none; }

  .app-nav-link.app-nav-link--activate {
    padding: 6px 4px;
    font-size: 0.62rem;
    max-width: 72px;
    border-radius: 12px;
  }

  .app-nav-link {
    flex-direction: column;
    gap: 3px;
    font-size: 0.62rem;
    padding: 6px 4px;
    border-radius: 12px;
    min-width: 0;
    max-width: 64px;
    flex: 1 1 0;
    text-align: center;
  }
  .app-nav-link svg { width: 20px; height: 20px; }
  .app-nav-link .app-nav-label { display: block; line-height: 1.15; word-break: break-word; }

  .app-main { height: auto; overflow: visible; padding-bottom: 72px; }

  .app-header { padding: 20px 20px 16px; }
  .app-body { padding: 4px 20px 32px; gap: 20px; }

  .app-search { display: none; }
  .app-items-toolbar .app-search,
  .app-card-head .app-search { display: flex; min-width: 0; flex: 1 1 180px; }
  .app-card-head--items .app-search { flex: 0 1 200px; margin-left: auto; }

  .app-summary-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .app-stat-card { padding: 16px; }
  .app-stat-value { font-size: 1.4rem; }

  .app-quick-actions { flex-wrap: wrap; }
  .app-action-btn { flex: 1 1 calc(50% - 6px); justify-content: center; }

  .app-table { display: none; }
  .app-inventory-cards { display: flex; }
}

@media (max-width: 480px) {
  .app-summary-grid { grid-template-columns: 1fr 1fr; }
  .app-header-title h1 { font-size: 1.25rem; }
}

/* ==========================================================================
   Mobile "More" nav item + bottom sheet
   ========================================================================== */

.app-more-nav-item { display: none; }

@media (max-width: 860px) {
  .app-more-nav-item { display: block; }
}

.app-more-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 30, 0.45);
  z-index: 50;
  align-items: flex-end;
  justify-content: center;
}
.app-more-sheet-overlay.is-open { display: flex; }

.app-more-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 75vh;
  overflow-y: auto;
  background: var(--ih-surface);
  border-radius: 20px 20px 0 0;
  padding: 10px 12px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(15, 20, 30, 0.2);
}

.app-more-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--ih-border-strong, var(--ih-border));
  margin: 4px auto 14px;
}

.app-more-sheet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-more-sheet-list .app-nav-link {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  max-width: none;
  width: 100%;
  padding: 13px 12px;
  font-size: 0.95rem;
  border-radius: 12px;
  color: var(--ih-text);
}
.app-more-sheet-list .app-nav-logout-form { width: 100%; }
.app-more-sheet-list .app-nav-link.is-active { background: var(--ih-surface-2, var(--ih-bg)); }
.app-more-sheet-list .app-nav-link svg { width: 20px; height: 20px; flex: none; }
.app-more-sheet-list .app-nav-link br { display: none; }
.app-more-sheet-list .app-nav-link .app-nav-label { display: block; font-size: inherit; line-height: 1.2; }
.app-more-sheet-list .app-nav-link--activate { background: transparent; color: var(--ih-ink); box-shadow: none; }
.app-more-sheet-list .app-nav-link--activate svg { color: currentColor; }
.app-more-sheet-list .app-nav-link--activate:hover { background: var(--ih-bg); color: var(--ih-ink); }

body.app-more-sheet-open { overflow: hidden; }

/* ==========================================================================
   Folders & Items — Phase 2/3
   ========================================================================== */

.app-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 73px;
  padding: 26px 40px 4px;
}
.app-page-head--tight { padding-top: 10px; }

.app-page-head--folder { max-width: 1080px; width: 100%; margin: 0 auto; box-sizing: border-box; }

.app-breadcrumb--form-top { max-width: 980px; width: 100%; margin: 22px auto 0; padding: 0 40px; box-sizing: border-box; }

.app-page-head--form { max-width: 980px; width: 100%; margin: 0 auto; box-sizing: border-box; }

.app-page-head h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ih-ink);
}

.app-page-head-actions { display: flex; gap: 10px; }

/* ---- Two-pane layout: tree + content ------------------------------------- */

.app-folder-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
  padding: 18px 40px 48px;
  align-items: start;
}

.app-folder-shell--single { grid-template-columns: 1fr; max-width: 1080px; width: 100%; margin: 0 auto; box-sizing: border-box; }

.app-tree-panel {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  box-shadow: var(--ih-shadow-sm);
  padding: 16px 14px;
  position: sticky;
  top: 18px;
}

.app-tree-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ih-bg);
  border: 1.4px solid var(--ih-border);
  border-radius: var(--ih-radius-sm);
  padding: 9px 12px;
  margin-bottom: 14px;
}
.app-tree-search svg { width: 15px; height: 15px; color: var(--ih-ink-faint); flex-shrink: 0; }
.app-tree-search input { all: unset; font-family: var(--ih-font); font-size: 0.83rem; color: var(--ih-ink); flex: 1; }
.app-tree-search input::placeholder { color: var(--ih-ink-faint); }
.app-tree-empty {
  margin: 8px 4px 0;
  font-size: 0.8rem;
  color: var(--ih-ink-faint);
}
.app-tree-empty.is-hidden { display: none; }

.app-tree { list-style: none; display: flex; flex-direction: column; gap: 1px; }

.app-tree-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border-radius: var(--ih-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ih-ink-soft);
  text-decoration: none;
  cursor: pointer;
}

.app-tree-row:hover { background: var(--ih-bg); color: var(--ih-ink); }
.app-tree-row.is-active { background: var(--ih-primary-50); color: var(--ih-primary); }

.app-tree-row svg.tree-icon { width: 16px; height: 16px; flex-shrink: 0; color: currentColor; }
.app-tree-row svg.tree-caret { width: 12px; height: 12px; flex-shrink: 0; color: var(--ih-ink-faint); transition: transform .14s ease; }
.app-tree-row.is-open svg.tree-caret { transform: rotate(90deg); }

.app-tree-children {
  list-style: none;
  margin-left: 16px;
  border-left: 1px solid var(--ih-border);
  padding-left: 6px;
  display: none;
  flex-direction: column;
  gap: 1px;
}
.app-tree-children.is-open { display: flex; }

.app-tree-divider { height: 1px; background: var(--ih-border); margin: 12px 4px; }

.app-tree-footer { display: flex; flex-direction: column; gap: 1px; }
.app-tree-footer .app-tree-row { color: var(--ih-ink-faint); }

/* ---- Folder grid ----------------------------------------------------------- */

.app-folder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.app-folder-stats {
  display: flex;
  gap: 18px;
  font-size: 0.84rem;
  color: var(--ih-ink-soft);
}
.app-folder-stats strong { color: var(--ih-ink); font-weight: 700; }

.app-view-toggle { display: flex; gap: 4px; background: var(--ih-bg); border: 1px solid var(--ih-border); border-radius: var(--ih-radius-sm); padding: 3px; }
.app-view-toggle button {
  all: unset; cursor: pointer; padding: 6px 9px; border-radius: 7px; display: grid; place-items: center; color: var(--ih-ink-faint);
}
.app-view-toggle button svg { width: 15px; height: 15px; }
.app-view-toggle button.is-active { background: var(--ih-surface); color: var(--ih-primary); box-shadow: var(--ih-shadow-sm); }

.app-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.app-folder-card {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  box-shadow: var(--ih-shadow-sm);
  overflow: visible;
  text-decoration: none;
  display: block;
  position: relative;
  transition: box-shadow .14s ease, transform .12s ease, border-color .14s ease;
}

.app-folder-card:has(.app-kebab-menu.is-open) { z-index: 20; transform: none; }

.app-folder-thumb {
  height: 92px;
  background: var(--ih-primary-50);
  color: var(--ih-primary);
  display: grid;
  place-items: center;
  border-radius: var(--ih-radius-lg) var(--ih-radius-lg) 0 0;
  overflow: hidden;
}
.app-folder-thumb svg { width: 34px; height: 34px; }

.app-folder-card-body { padding: 14px 16px; }
.app-folder-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  min-width: 0;
}
.app-folder-card-title .app-kebab-wrap { flex-shrink: 0; margin-left: auto; }
.app-folder-card-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ih-ink);
  text-decoration: none;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.app-folder-card-name:hover { color: var(--ih-primary); }
.app-folder-card-meta { font-size: 0.78rem; color: var(--ih-ink-faint); }
.app-folder-card-link { display: block; color: inherit; text-decoration: none; }

.app-folder-card-add {
  border: 1.6px dashed var(--ih-border-strong);
  border-radius: var(--ih-radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  color: var(--ih-ink-faint);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  transition: border-color .14s ease, color .14s ease, background .14s ease;
}
.app-folder-card-add:hover { border-color: var(--ih-primary); color: var(--ih-primary); background: var(--ih-primary-50); }
.app-folder-card-add svg { width: 22px; height: 22px; }

.app-folder-thumb { position: relative; }

.app-tile-badge {
  position: absolute;
  top: 8px; right: 8px;
}

.app-folder-kebab {
  position: absolute;
  top: 8px; left: 8px;
}
.app-folder-kebab .app-kebab-btn { background: rgba(255,255,255,.85); backdrop-filter: blur(2px); }

/* ---- Breadcrumb -------------------------------------------------------------- */

.app-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--ih-ink-faint);
  margin-bottom: 14px;
}
.app-breadcrumb a { color: var(--ih-ink-soft); text-decoration: none; font-weight: 600; }
.app-breadcrumb a:hover { color: var(--ih-primary); }
.app-breadcrumb .is-current { color: var(--ih-ink); font-weight: 700; }
.app-breadcrumb svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ---- Kebab menu ---------------------------------------------------------------- */

.app-kebab-wrap { position: relative; }
.app-kebab-btn {
  all: unset; cursor: pointer; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ih-ink);
  border: 1.4px solid var(--ih-border-strong); background: var(--ih-surface);
  box-shadow: var(--ih-shadow-sm);
}
.app-kebab-btn:hover { background: var(--ih-primary-50); color: var(--ih-primary); border-color: var(--ih-primary); box-shadow: var(--ih-shadow-md); }
.app-kebab-btn:focus-visible { outline: none; border-color: var(--ih-primary); box-shadow: 0 0 0 4px var(--ih-focus-ring); }
.app-kebab-btn svg { width: 18px; height: 18px; }

.app-kebab-btn--card {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--ih-ink-faint);
}
.app-kebab-btn--card:hover,
.app-kebab-btn--card:focus-visible {
  background: var(--ih-bg);
  color: var(--ih-ink);
  border: none;
  box-shadow: none;
}
.app-kebab-btn--card svg { width: 16px; height: 16px; }

.app-kebab-menu {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + 4px);
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-sm);
  box-shadow: var(--ih-shadow-lg);
  min-width: 180px;
  max-width: min(240px, calc(100vw - 24px));
  padding: 6px;
  z-index: 40;
  box-sizing: border-box;
}
.app-kebab-menu.is-open { display: block; }
.app-kebab-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  font-family: var(--ih-font);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ih-ink-soft);
  text-align: left;
  cursor: pointer;
}
.app-kebab-menu button:hover,
.app-kebab-menu button:focus-visible {
  background: var(--ih-primary-50);
  color: var(--ih-ink);
  outline: none;
}
.app-kebab-menu button svg { width: 15px; height: 15px; flex-shrink: 0; }
.app-kebab-menu button.is-danger { color: var(--ih-danger); }
.app-kebab-menu button.is-danger:hover,
.app-kebab-menu button.is-danger:focus-visible {
  background: var(--ih-danger-50);
  color: var(--ih-danger);
}

/* ---- Items listing table (full page) ------------------------------------------ */

.app-items-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.app-filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 700; color: var(--ih-ink-soft);
  background: var(--ih-surface); border: 1.4px solid var(--ih-border);
  padding: 7px 13px; border-radius: 999px;
  text-decoration: none;
}
.app-filter-chip--warning { color: var(--ih-accent); border-color: var(--ih-accent-100); }
.app-filter-chip--danger { color: var(--ih-danger); border-color: var(--ih-danger-50); }
.app-filter-chip.is-active {
  color: var(--ih-ink);
  border-color: var(--ih-border-strong);
  background: var(--ih-bg);
}
.app-filter-chip--warning.is-active {
  color: var(--ih-accent);
  border-color: var(--ih-accent);
  background: var(--ih-accent-100);
}
.app-filter-chip--danger.is-active {
  color: var(--ih-danger);
  border-color: var(--ih-danger);
  background: var(--ih-danger-50);
}

.app-filter-row { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }

.app-search--wide { min-width: 260px; }

.app-item-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}
.app-item-bulk-bar[hidden] { display: none !important; }

.app-item-bulk-link {
  all: unset;
  cursor: pointer;
  font-family: var(--ih-font);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ih-primary);
}
.app-item-bulk-link:hover { color: var(--ih-primary-600); }
.app-item-bulk-link.is-danger { color: var(--ih-danger); }
.app-item-bulk-link.is-danger:hover { color: var(--ih-danger); opacity: 0.85; }

.app-table th.app-th-check,
.app-table td.app-td-check {
  width: 44px;
  padding-left: 16px;
  padding-right: 0;
  text-align: center;
  vertical-align: middle;
}
.app-th-check input,
.app-td-check input,
.app-inventory-card > .item-row-check {
  width: 16px;
  height: 16px;
  accent-color: var(--ih-primary);
  cursor: pointer;
  display: block;
  margin: 0 auto;
}

.app-table th.app-th-actions,
.app-table td.app-td-actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
  padding-right: 24px;
  vertical-align: middle;
}

.app-item-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  vertical-align: middle;
}

.app-item-action {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--ih-ink-soft);
  border-radius: 8px;
  text-decoration: none;
}
.app-item-action svg { width: 16px; height: 16px; }
.app-item-action:hover { background: var(--ih-bg); color: var(--ih-ink); }

.app-qty-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1.4px solid var(--ih-border);
  background: var(--ih-surface);
  color: var(--ih-ink);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.app-qty-control:hover { border-color: var(--ih-primary); color: var(--ih-primary); }

.app-mobile-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ih-ink-soft);
}
.app-mobile-select-all input {
  width: 16px;
  height: 16px;
  accent-color: var(--ih-primary);
}

.app-inventory-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.app-qty-item-name {
  font-weight: 700;
  margin: 0 0 12px;
}
.app-qty-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-qty-stepper button {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1.4px solid var(--ih-border);
  background: var(--ih-surface);
  font-size: 1.1rem;
  cursor: pointer;
}
.app-qty-stepper .ob-input { text-align: center; max-width: 120px; }
.app-modal--sm { max-width: 380px; }

/* ---- Folder / items responsive -------------------------------------------------- */

@media (max-width: 900px) {
  .app-folder-shell { grid-template-columns: 1fr; }
  .app-tree-panel { position: static; }
}

@media (max-width: 860px) {
  .app-page-head, .app-folder-shell { padding-left: 20px; padding-right: 20px; }
  .app-folder-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
  .app-folder-thumb { height: 70px; }
  .app-folder-thumb svg { width: 26px; height: 26px; }
  .app-folder-card-body { padding: 12px 12px 14px; }
  .app-folder-card-name { font-size: 0.86rem; }
  .app-kebab-menu { min-width: 168px; }
}

@media (max-width: 420px) {
  .app-folder-grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   Item Detail — Phase 5
   ========================================================================== */

.app-item-shell {
  padding: 32px 40px 56px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.app-back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ih-ink-soft);
  text-decoration: none;
  margin-bottom: 18px;
}
.app-back-link:hover { color: var(--ih-primary); }
.app-back-link svg { width: 15px; height: 15px; }

.app-item-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.app-item-topline .app-breadcrumb { margin-bottom: 0; }
.app-back-link--inline { margin-bottom: 0; flex-shrink: 0; }

.app-item-top {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  margin-bottom: 24px;
}

/* ---- Gallery ------------------------------------------------------------- */

.app-gallery-main {
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
  border-radius: var(--ih-radius-lg);
  background: var(--ih-primary-50);
  color: var(--ih-primary);
  display: grid;
  place-items: center;
  border: 1px solid var(--ih-border);
  margin-bottom: 10px;
  position: relative;
}
.app-gallery-main svg { width: 30%; height: 30%; }
.app-gallery-main img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: inherit;
}

.app-gallery-edit {
  position: absolute;
  bottom: 10px; right: 10px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  color: var(--ih-ink-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--ih-shadow-sm);
}
.app-gallery-edit svg { width: 15px; height: 15px; }

.app-gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.app-gallery-thumb {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  max-width: 48px;
  max-height: 48px;
  overflow: hidden;
  flex-shrink: 0;
  padding: 0;
  position: relative;
  border-radius: 10px;
  background: var(--ih-primary-50);
  color: var(--ih-primary);
  border: 1.6px solid transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.app-gallery-thumb.is-active { border-color: var(--ih-primary); }
.app-gallery-thumb svg { width: 40%; height: 40%; }
.app-gallery-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.app-gallery-thumb--add { border-style: dashed; border-color: var(--ih-border-strong); color: var(--ih-ink-faint); }
a.app-gallery-edit,
a.app-gallery-thumb { text-decoration: none; box-sizing: border-box; }

/* ---- Header info ------------------------------------------------------------ */

.app-item-headinfo { display: flex; flex-direction: column; min-width: 0; }

.app-item-headtop { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.app-item-headinfo h1 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ih-ink);
  margin-bottom: 4px;
}

.app-item-sku-line { font-size: 0.88rem; color: var(--ih-ink-faint); margin-bottom: 16px; }
.app-item-sku-line strong { color: var(--ih-ink-soft); font-weight: 700; }

.app-item-action-row { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 22px; }

.app-qty-hero {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  box-shadow: var(--ih-shadow-sm);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
}

.app-qty-block { display: flex; flex-direction: column; gap: 2px; }
.app-qty-block-label { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ih-ink-faint); }
.app-qty-block-value { font-size: 1.9rem; font-weight: 800; color: var(--ih-ink); letter-spacing: -0.02em; }
.app-qty-block-value.is-warning { color: var(--ih-accent); }
.app-qty-block-value.is-danger { color: var(--ih-danger); }
.app-qty-block-value--sm { font-size: 1.4rem; }
.app-qty-block-sub { font-size: 0.8rem; color: var(--ih-ink-faint); }
.app-qty-block .app-badge { margin-top: 4px; }

/* ---- Detail sections ------------------------------------------------------ */

.app-item-sections { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.app-item-sections-col { display: flex; flex-direction: column; gap: 20px; }

.app-detail-list { list-style: none; }
.app-detail-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--ih-border); }
.app-detail-row:last-child { border-bottom: none; }
.app-detail-label { font-size: 0.83rem; font-weight: 600; color: var(--ih-ink-faint); flex-shrink: 0; }
.app-detail-value { font-size: 0.87rem; font-weight: 600; color: var(--ih-ink); text-align: right; }

.app-detail-desc { padding: 18px 24px; font-size: 0.88rem; line-height: 1.6; color: var(--ih-ink-soft); }

/* ==========================================================================
   Modals — Add / Issue / Adjust Stock
   ========================================================================== */

.app-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 34, 0.45);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.app-modal-overlay.is-open { display: flex; }

.app-modal {
  background: var(--ih-surface);
  border-radius: var(--ih-radius-lg);
  box-shadow: var(--ih-shadow-lg);
  width: 100%;
  max-width: 400px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.app-modal--wide { max-width: 560px; }

.app-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--ih-border);
}
.app-modal-head h3 { font-size: 1.02rem; font-weight: 800; color: var(--ih-ink); }

.app-modal-close {
  all: unset; cursor: pointer; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; color: var(--ih-ink-faint);
}
.app-modal-close:hover { background: var(--ih-bg); color: var(--ih-ink); }
.app-modal-close svg { width: 16px; height: 16px; }

.app-modal-body { padding: 20px 22px; }

.app-modal-static-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; font-size: 0.87rem; }
.app-modal-static-row span:first-child { color: var(--ih-ink-faint); font-weight: 600; }
.app-modal-static-row span:last-child { color: var(--ih-ink); font-weight: 700; }

.app-modal-divider { height: 1px; background: var(--ih-border); margin: 6px 0 14px; }

.app-modal-result {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--ih-primary-50); border-radius: var(--ih-radius-sm);
  padding: 12px 14px; margin-top: 14px;
}
.app-modal-result span:first-child { font-size: 0.82rem; font-weight: 700; color: var(--ih-ink-soft); }
.app-modal-result span:last-child { font-size: 1.05rem; font-weight: 800; color: var(--ih-primary); }
.app-modal-result.is-danger { background: var(--ih-danger-50); }
.app-modal-result.is-danger span:last-child { color: var(--ih-danger); }

.app-modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px; border-top: 1px solid var(--ih-border);
}

.app-modal--pay {
  max-width: 460px;
  overflow: hidden;
  border: 1px solid var(--ih-border);
  box-shadow: 0 24px 64px rgba(28, 26, 34, 0.22);
}
.stripe-pay-overlay {
  background: rgba(22, 18, 32, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px;
}
.stripe-pay-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 0 20px;
}
.stripe-pay-secure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ih-success);
}
.stripe-pay-secure-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--ih-success-100);
  color: var(--ih-success);
}
.stripe-pay-secure-icon svg { width: 15px; height: 15px; }
.app-modal--pay .app-modal-head,
.stripe-pay-head {
  display: block;
  padding: 12px 22px 4px;
  border-bottom: none;
}
.stripe-pay-head h3 {
  font-size: 1.22rem;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.stripe-pay-head-copy {
  margin: 6px 0 0;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ih-ink-soft);
  line-height: 1.45;
  max-width: 36rem;
}
.app-modal--pay .app-modal-body,
.stripe-pay-body {
  padding: 12px 22px 8px;
}
.stripe-pay-summary {
  background: linear-gradient(180deg, var(--ih-primary-50) 0%, var(--ih-surface) 100%);
  border: 1px solid var(--ih-border);
  border-radius: 14px;
  padding: 14px 16px 13px;
  margin: 0 0 16px;
}
.stripe-pay-summary-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ih-ink-faint);
  margin-bottom: 4px;
}
.stripe-pay-price {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ih-ink);
  line-height: 1.45;
  margin: 0;
}
.stripe-pay-panel {
  border: 1px solid var(--ih-border);
  border-radius: 14px;
  background: var(--ih-surface);
  padding: 14px 14px 12px;
}
.stripe-pay-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ih-ink);
}
.stripe-pay-brands {
  display: inline-flex;
  gap: 6px;
}
.stripe-pay-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1px solid var(--ih-border);
  background: var(--ih-bg);
  color: var(--ih-ink-soft);
}
.stripe-pay-brand.is-visa { color: #1a1f71; }
.stripe-pay-brand.is-mc { color: #eb001b; }
.stripe-pay-brand.is-amex { color: #006fcf; }
.bill-card-fields { padding: 0; }
.bill-card-fields.is-loading .bill-stripe-field {
  background: linear-gradient(90deg, var(--ih-bg) 25%, var(--ih-primary-50) 50%, var(--ih-bg) 75%);
  background-size: 200% 100%;
  animation: billFieldPulse 1.1s ease infinite;
}
@keyframes billFieldPulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.bill-card-field { margin: 0 0 12px; }
.bill-card-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ih-ink-soft);
  margin: 0 0 6px;
}
.bill-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.bill-card-row .bill-card-field { margin-bottom: 0; }
.bill-stripe-field {
  min-height: 46px;
  padding: 13px 14px;
  border: 1px solid var(--ih-border-strong);
  border-radius: 10px;
  background: var(--ih-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.bill-stripe-field.StripeElement--focus {
  border-color: var(--ih-primary);
  background: var(--ih-surface);
  box-shadow: 0 0 0 4px var(--ih-focus-ring-soft);
}
.bill-stripe-field.StripeElement--invalid {
  border-color: var(--ih-danger);
  box-shadow: 0 0 0 4px rgba(193, 68, 60, 0.12);
}
.bill-field-error {
  margin: 6px 0 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ih-danger);
  line-height: 1.25;
}
.bill-payment-element {
  min-height: 168px;
  padding: 2px 0 4px;
}
.bill-pay-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ih-danger-50);
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ih-danger);
  line-height: 1.35;
}
.app-modal--pay .app-modal-foot,
.stripe-pay-foot {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 16px 22px 8px;
  border-top: none;
}
.stripe-pay-submit {
  width: 100%;
  justify-content: center;
  min-height: 44px;
  font-weight: 800;
}
.stripe-pay-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0 22px 16px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ih-ink-faint);
}
.stripe-pay-trust svg {
  width: 13px;
  height: 13px;
}
html[data-theme="dark"] .app-modal--pay {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .stripe-pay-brand.is-visa,
html[data-theme="dark"] .stripe-pay-brand.is-mc,
html[data-theme="dark"] .stripe-pay-brand.is-amex {
  color: var(--ih-ink);
}
@media (max-width: 520px) {
  .app-modal--pay { max-width: 100%; }
  .stripe-pay-foot {
    grid-template-columns: 1fr;
  }
  .stripe-pay-foot .app-btn-cancel {
    order: 2;
    text-align: center;
    justify-content: center;
    display: flex;
  }
}

.app-btn-cancel {
  all: unset; box-sizing: border-box; cursor: pointer; font-family: var(--ih-font); font-size: 0.87rem; font-weight: 700;
  color: var(--ih-ink-soft); padding: 10px 18px; border-radius: 999px; border: 1.4px solid var(--ih-border);
}
.app-btn-cancel:hover { background: var(--ih-bg); }

/* ---- Item detail responsive ------------------------------------------------ */

@media (max-width: 860px) {
  .app-item-shell { padding: 12px 20px 40px; }
  .app-item-top { grid-template-columns: 1fr; }
  .app-gallery-main { max-width: 220px; margin: 0 auto 10px; }
  .app-gallery-thumbs { justify-content: center; }
  .app-item-headtop { flex-direction: column; }
  .app-item-action-row .app-action-btn { flex: 1; justify-content: center; }
  .app-qty-hero { gap: 22px; }
  .app-item-sections { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Add / Edit Item form — Phase 6
   ========================================================================== */

.app-form-shell {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 40px 32px;
  box-sizing: border-box;
}

.app-form-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

.app-form-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.app-form-preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
}

.app-form-actions-top {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.app-preview-card {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  box-shadow: var(--ih-shadow-sm);
  padding: 22px 20px;
  text-align: center;
}

.app-preview-thumb {
  width: 84px;
  height: 84px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  border-radius: var(--ih-radius-md);
  background: var(--ih-primary-100);
  color: var(--ih-primary);
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
}
.app-preview-thumb svg { width: 34px; height: 34px; }

.app-preview-name {
  font-size: 1rem; font-weight: 800; color: var(--ih-ink);
  margin-bottom: 2px; word-break: break-word;
}
.app-preview-sku { font-size: 0.78rem; color: var(--ih-ink-faint); margin-bottom: 16px; }

.app-preview-divider { height: 1px; background: var(--ih-border); margin: 0 -20px 12px; }

.app-preview-row { display: flex; justify-content: space-between; gap: 8px; font-size: 0.82rem; padding: 6px 0; text-align: left; }
.app-preview-row span:first-child { color: var(--ih-ink-faint); font-weight: 600; }
.app-preview-row span:last-child { color: var(--ih-ink); font-weight: 700; text-align: right; }

.app-tips-card {
  background: var(--ih-primary-50);
  border: 1px solid var(--ih-primary-100);
  border-radius: var(--ih-radius-lg);
  padding: 18px 20px;
}
.app-tips-card h4 {
  font-size: 0.83rem; font-weight: 800; color: var(--ih-primary);
  margin-bottom: 10px; display: flex; align-items: center; gap: 7px;
}
.app-tips-card h4 svg { width: 15px; height: 15px; }
.app-tips-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.app-tips-list li { font-size: 0.79rem; line-height: 1.45; color: var(--ih-ink-soft); padding-left: 15px; position: relative; }
.app-tips-list li::before {
  content: ''; position: absolute; left: 0; top: 7px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--ih-primary);
}

.app-form-section-body { padding: 22px 24px; }

.app-image-uploader {
  all: unset;
  width: 132px;
  height: 132px;
  border-radius: var(--ih-radius-lg);
  border: 1.6px dashed var(--ih-border-strong);
  background: var(--ih-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ih-ink-faint);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  transition: border-color .14s ease, color .14s ease, background .14s ease;
  flex-shrink: 0;
}
.app-image-uploader:hover { border-color: var(--ih-primary); color: var(--ih-primary); background: var(--ih-primary-50); }
.app-image-uploader svg { width: 26px; height: 26px; }
.app-image-uploader--bar {
  width: auto;
  height: auto;
  flex-direction: row;
  padding: 12px 16px;
  gap: 8px;
}
.app-image-uploader--bar svg { width: 18px; height: 18px; }
.app-image-uploader.is-hidden { display: none; }

.app-item-image-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.app-item-image-thumb {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.4px solid var(--ih-border);
  background: var(--ih-bg);
  flex-shrink: 0;
}
.app-item-image-thumb img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.app-item-image-thumb-actions {
  position: absolute;
  inset: auto 6px 6px auto;
  display: flex;
  gap: 4px;
}
.app-item-image-thumb-btn {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.92);
  color: var(--ih-ink);
  box-shadow: var(--ih-shadow-sm);
}
.app-item-image-thumb-btn:hover { background: var(--ih-primary-50); color: var(--ih-primary); }
.app-item-image-thumb-btn.is-danger:hover { background: var(--ih-danger-50); color: var(--ih-danger); }
.app-item-image-thumb-btn svg { width: 13px; height: 13px; }
.app-preview-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: inherit;
}
.app-preview-thumb.has-photo { color: transparent; }

.app-form-image-row { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 22px; }
.app-form-image-row .ob-form-group { flex: 1; margin-bottom: 0; }

.app-form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.app-form-row-2:last-child { margin-bottom: 0; }

.app-input-with-suffix { position: relative; }
.app-input-with-suffix .ob-input { padding-right: 76px; }
.app-form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.app-input-prefix { position: relative; }
.app-input-prefix span {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--ih-ink-faint); font-size: 0.95rem; pointer-events: none;
}
.app-input-prefix input { padding-left: 30px; }

.app-input-suffix-btn {
  all: unset; cursor: pointer; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-size: 0.76rem; font-weight: 700; color: var(--ih-primary); padding: 6px 10px; border-radius: 999px;
}
.app-input-suffix-btn:hover { background: var(--ih-primary-50); }

.app-custom-field-row { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.app-custom-field-row:last-of-type { margin-bottom: 0; }
.app-custom-field-row .ob-form-group { flex: 1; margin-bottom: 0; }

.app-field-remove {
  all: unset; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--ih-ink-faint); border-radius: var(--ih-radius-sm); flex-shrink: 0;
}
.app-field-remove svg { width: 16px; height: 16px; }
.app-field-remove:hover { background: var(--ih-danger-50); color: var(--ih-danger); }

.app-add-field-btn {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.84rem; font-weight: 700; color: var(--ih-primary); padding: 6px 2px; margin-top: 4px;
}
.app-add-field-btn svg { width: 14px; height: 14px; }
.app-add-field-btn:hover { text-decoration: underline; }

/* Bottom sticky bar is the mobile fallback — hidden on desktop where the
   top action row (next to the preview) is reachable instead. */
.app-form-stickybar {
  position: sticky;
  bottom: 0;
  background: transparent;
  padding: 16px 0 4px;
  display: none;
  justify-content: flex-end;
  gap: 10px;
}

/* ---- Form responsive -------------------------------------------------------- */

@media (max-width: 1080px) {
  .app-form-layout { grid-template-columns: 1fr 240px; gap: 18px; }
}

@media (max-width: 860px) {
  .app-form-shell { padding: 12px 20px 24px; }
  .app-form-layout { grid-template-columns: 1fr; }
  .app-form-preview { position: static; }
  .app-form-row-2, .app-form-row-3 { grid-template-columns: 1fr; }
  .app-item-image-thumb { width: 76px; height: 76px; }
  .app-form-image-row { flex-direction: column; align-items: center; text-align: center; }
  .app-form-image-row .ob-form-group { width: 100%; }
  .app-form-actions-top { display: none; }
  .app-form-stickybar { display: flex; padding: 12px 0 4px; }
  .app-form-stickybar .app-action-btn, .app-form-stickybar .app-btn-cancel { flex: 1; justify-content: center; }
}

/* ==========================================================================
   Add Folder modal (reuses .app-modal* base styles)
   ========================================================================== */

.app-modal-body .ob-form-group:last-child { margin-bottom: 0; }


/* ==========================================================================
   Settings shell — sub-nav panel + content (Phase 2+)
   ========================================================================== */

.app-settings-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  padding: 18px 40px 48px;
  align-items: start;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.app-page-head--settingsnav { max-width: 1180px; width: 100%; margin: 0 auto; box-sizing: border-box; }

/* No sub-nav panel needed — the overview page's own card grid IS the index.
   Centered so it doesn't sit flush-left with empty space beside it,
   regardless of whether the sidebar is expanded or collapsed. */
.app-settings-shell--single {
  grid-template-columns: 1fr;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.app-page-head--settings {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.app-settings-panel {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  box-shadow: var(--ih-shadow-sm);
  padding: 12px;
  position: sticky;
  top: 18px;
}

.app-settings-panel-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--ih-radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ih-ink-soft);
  text-decoration: none;
  transition: background .14s ease, color .14s ease;
}
.app-settings-panel-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.app-settings-panel-link:hover { background: var(--ih-bg); color: var(--ih-ink); }
.app-settings-panel-link.is-active { background: var(--ih-primary-50); color: var(--ih-primary); }
.app-settings-panel-link.is-active svg { color: var(--ih-primary); }

.app-settings-content { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* The in-page "Back to Settings" link only earns its place once the sub-nav
   panel is gone (mobile) — on desktop the panel already covers navigation. */
.app-settings-shell.has-back .app-settings-content > .app-back-link { display: none; }

@media (max-width: 900px) {
  .app-settings-shell { grid-template-columns: 1fr; }
  .app-settings-panel { position: static; }
}

@media (max-width: 860px) {
  .app-settings-shell { padding: 14px 20px 32px; }
  /* On mobile the settings overview page IS the section list — individual
     settings pages hide the panel and rely on a back link instead. */
  .app-settings-shell.has-back .app-settings-panel { display: none; }
  .app-settings-shell.has-back .app-settings-content > .app-back-link { display: inline-flex; }
}

/* ==========================================================================
   Settings — overview cards (settings.html)
   ========================================================================== */

.app-settings-overview-intro { font-size: 0.92rem; color: var(--ih-ink-soft); margin-top: -8px; margin-bottom: 4px; }

.app-settings-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.app-settings-overview-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  box-shadow: var(--ih-shadow-sm);
  padding: 20px;
  text-decoration: none;
  transition: box-shadow .14s ease, transform .12s ease, border-color .14s ease;
}
.app-settings-overview-card:hover { box-shadow: var(--ih-shadow-md); transform: translateY(-2px); border-color: var(--ih-border-strong); }

.app-settings-overview-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--ih-primary-100);
  color: var(--ih-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.app-settings-overview-icon svg { width: 19px; height: 19px; }

.app-settings-overview-title { font-size: 0.95rem; font-weight: 700; color: var(--ih-ink); margin-bottom: 3px; }
.app-settings-overview-desc { font-size: 0.82rem; line-height: 1.45; color: var(--ih-ink-faint); }

@media (max-width: 640px) {
  .app-settings-overview-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Toggle switch — notification preferences, feature activation
   ========================================================================== */

.app-toggle {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.app-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.app-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--ih-border-strong);
  border-radius: 999px;
  transition: background .16s ease;
}
.app-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--ih-shadow-sm);
  transition: transform .16s ease;
}
.app-toggle input:checked + .app-toggle-track { background: var(--ih-primary); }
.app-toggle input:checked + .app-toggle-track .app-toggle-thumb { transform: translateX(20px); }
.app-toggle input:focus-visible + .app-toggle-track { box-shadow: 0 0 0 4px var(--ih-focus-ring); }

.app-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--ih-border);
}
.app-toggle-row:last-child { border-bottom: none; }

.app-toggle-row--field { padding: 0; border-bottom: none; margin-bottom: 24px; }

.app-toggle-row-title { font-size: 0.9rem; font-weight: 700; color: var(--ih-ink); margin-bottom: 3px; }
.app-toggle-row-desc { font-size: 0.81rem; line-height: 1.45; color: var(--ih-ink-faint); }
.app-toggle-row-text { flex: 1; min-width: 0; }

/* ---- Theme toggle (light/dark) — sun/moon switch --------------------------- */

.app-theme-toggle {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.app-theme-toggle-track {
  position: relative;
  width: 44px; height: 24px;
  border-radius: 999px;
  background: var(--ih-border-strong);
  flex-shrink: 0;
  transition: background .16s ease;
}

.app-theme-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  color: var(--ih-primary);
  display: grid;
  place-items: center;
  box-shadow: var(--ih-shadow-sm);
  transition: transform .16s ease, background .16s ease, color .16s ease;
}
.app-theme-toggle-thumb svg { grid-area: 1 / 1; width: 11px; height: 11px; }
.app-theme-toggle-thumb .app-theme-icon-moon { display: none; }

.app-theme-toggle[aria-checked="true"] .app-theme-toggle-track { background: var(--ih-primary); }
.app-theme-toggle[aria-checked="true"] .app-theme-toggle-thumb { transform: translateX(20px); background: var(--ih-primary-600); color: #fff; }
.app-theme-toggle[aria-checked="true"] .app-theme-toggle-thumb .app-theme-icon-sun { display: none; }
.app-theme-toggle[aria-checked="true"] .app-theme-toggle-thumb .app-theme-icon-moon { display: block; }

.app-theme-toggle:focus-visible .app-theme-toggle-track { box-shadow: 0 0 0 4px var(--ih-focus-ring); }

.app-theme-toggle-label { font-size: 0.85rem; font-weight: 700; color: var(--ih-ink-soft); min-width: 34px; }

/* ==========================================================================
   Settings — Profile page components
   ========================================================================== */

.app-settings-page-head { margin-bottom: 2px; }
.app-settings-page-head h1 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ih-ink); margin-bottom: 4px; }
.app-settings-page-head p { font-size: 0.9rem; color: var(--ih-ink-soft); }

.app-avatar-row { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }

.app-avatar-lg {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--ih-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.app-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

.app-avatar-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.app-avatar-actions form { display: inline-flex; margin: 0; }
.app-avatar-hint {
  flex-basis: 100%;
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--ih-ink-faint);
}
.app-btn-cancel:disabled,
.app-btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.app-form-subheading { font-size: 0.86rem; font-weight: 700; color: var(--ih-ink); margin-bottom: 12px; }

.app-section-divider { height: 1px; background: var(--ih-border); margin: 26px 0 22px; }

.app-settings-save-bar { display: flex; justify-content: flex-end; }

/* ---- Complete Your Workspace wizard ----------------------------------------
   completion-modal / completion-header / completion-progress / completion-step
   / selection-grid / selection-card / completion-actions / completion-success */

.completion-modal {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}

.completion-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 20px 0;
  flex-shrink: 0;
}

.completion-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--ih-primary-50);
  color: var(--ih-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.completion-header-icon svg { width: 19px; height: 19px; }

.completion-header-text { flex: 1; min-width: 0; }
.completion-header h3 { font-size: 1.02rem; font-weight: 800; color: var(--ih-ink); }

.completion-subtext {
  font-size: 0.7rem;
  color: var(--ih-ink-soft);
  margin-top: 3px;
  line-height: 1.45;
}
.completion-subtext.is-hidden { display: none; }

.completion-header .app-modal-close { margin-top: 2px; }

.completion-progress {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 20px 20px 10px;
  flex-shrink: 0;
}
.completion-progress.is-hidden { display: none; }

.completion-progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ih-border-strong);
  flex-shrink: 0;
  transition: background .2s ease, transform .2s ease;
}
.completion-progress-dot.is-active { background: var(--ih-primary); transform: scale(1.2); }

.completion-progress-line {
  flex: 1;
  max-width: 50%;
  height: 2px;
  background: var(--ih-border);
  border-radius: 1px;
  overflow: hidden;
}
.completion-progress-line::after {
  content: '';
  display: block;
  height: 100%;
  width: 0;
  background: var(--ih-primary);
  transition: width .25s ease;
}
.completion-progress-line.is-active::after { width: 100%; }

.completion-progress-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ih-ink-faint);
  margin-left: 4px;
  white-space: nowrap; display:none;
}

.completion-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 14px 20px 18px;
}

.completion-step.is-hidden { display: none; }
.completion-step.is-animating { animation: completionStepIn .16s ease; }
@keyframes completionStepIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.completion-step-heading { font-size: 0.98rem; font-weight: 800; color: var(--ih-ink); margin-bottom: 3px; }
.completion-step-sub { font-size: 0.7rem; color: var(--ih-ink-soft); margin-bottom: 14px; }

.selection-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selection-card {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px 7px 7px;
  border: 1.5px solid var(--ih-border);
  border-radius: 999px;
  background: var(--ih-surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  /*color: var(--ih-ink);*/ color: #515054;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.selection-card:hover { border-color: var(--ih-border-strong); box-shadow: var(--ih-shadow-sm); }
.selection-card:focus-visible { outline: none; border-color: var(--ih-primary); box-shadow: 0 0 0 4px var(--ih-focus-ring); }

.selection-card-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ih-bg);
  color: var(--ih-ink-soft);
  transition: background .15s ease, color .15s ease;
}
.selection-card-icon svg { width: 14px; height: 14px; }

.selection-card-label {
  font-size: 0.83rem;
  font-weight: 700;
  white-space: nowrap;
}

.selection-card-check {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--ih-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--ih-surface);
  opacity: 0;
  transform: scale(.4);
  transition: opacity .12s ease, transform .12s ease;
}
.selection-card-check svg { width: 10px; height: 10px; }

.selection-card.is-selected {
  border-color: var(--ih-primary);
  background: var(--ih-primary-50);
  box-shadow: var(--ih-shadow-sm);
}
.selection-card.is-selected .selection-card-icon { background: var(--ih-primary); color: #fff; }
.selection-card.is-selected .selection-card-check { opacity: 1; transform: scale(1); }

.completion-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--ih-border);
  flex-shrink: 0;
}
.completion-actions.is-hidden { display: none; }
.completion-actions .app-btn-cancel.is-hidden { visibility: hidden; }

.completion-actions-end { display: flex; align-items: center; gap: 16px; }

.completion-skip {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ih-ink-faint);
  cursor: pointer;
  padding: 8px 4px;
}
.completion-skip:hover { color: var(--ih-ink-soft); }
.completion-skip:focus-visible { outline: none; text-decoration: underline; }

.completion-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 20px 16px;
}
.completion-success.is-visible { display: flex; animation: completionStepIn .2s ease; }
.completion-success-icon { width: 48px; height: 48px; color: var(--ih-success); margin-bottom: 12px; }
.completion-success h4 { font-size: 1.02rem; font-weight: 800; color: var(--ih-ink); margin-bottom: 5px; }
.completion-success p { font-size: 0.84rem; color: var(--ih-ink-soft); }

@media (max-width: 640px) {
  .completion-overlay { padding: 0; }
  .completion-modal {
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
  .selection-grid { flex-direction: column; }
  .selection-card {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--ih-radius-sm);
  }
  .selection-card-label { white-space: normal; }
  .selection-card-icon { width: 28px; height: 28px; }
  .selection-card-icon svg { width: 16px; height: 16px; }
  .selection-card-check { top: 50%; right: 14px; transform: translateY(-50%) scale(.4); }
  .selection-card.is-selected .selection-card-check { transform: translateY(-50%) scale(1); }
  .completion-actions { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
  .completion-header { padding: 18px 18px 0; }
  .completion-progress { padding: 14px 18px 0; }
  .completion-body { padding: 14px 18px 18px; }
}

.app-workspace-field-value { font-size: 0.95rem; font-weight: 600; color: var(--ih-ink); }
.app-workspace-field-value.is-unset { color: var(--ih-ink-faint); font-weight: 500; font-style: italic; }

.app-logo-uploader { width: 96px; height: 96px; position: relative; overflow: hidden; }
.app-logo-block { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.app-logo-block form { margin: 0; display: flex; }
.app-logo-uploader.has-photo { padding: 0; border-style: solid; color: transparent; }
.app-logo-uploader.has-photo svg,
.app-logo-uploader.has-photo span { display: none; }
.app-logo-uploader img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-danger-zone {
  background: var(--ih-danger-50);
  border: 1px solid var(--ih-danger);
  border-radius: var(--ih-radius-lg);
  overflow: hidden;
}
.app-danger-zone .app-card-head { border-bottom-color: rgba(193, 68, 60, 0.25); }
.app-danger-zone .app-card-head h2 { color: var(--ih-danger); }

.app-danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
}
.app-danger-row-title { font-size: 0.9rem; font-weight: 700; color: var(--ih-ink); margin-bottom: 3px; }
.app-danger-row-desc { font-size: 0.81rem; color: var(--ih-ink-soft); }

.app-btn-danger {
  all: unset;
  cursor: pointer;
  flex-shrink: 0;
  font-family: var(--ih-font);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ih-danger);
  border: 1.4px solid var(--ih-danger);
  padding: 9px 16px;
  border-radius: 999px;
  transition: background .14s ease, color .14s ease;
}
.app-btn-danger:hover { background: var(--ih-danger); color: #fff; }

@media (max-width: 860px) {
  .app-avatar-row { flex-direction: column; align-items: flex-start; }
  .app-toggle-row, .app-danger-row { flex-wrap: wrap; }
}

/* ==========================================================================
   Billing & Subscription
   billing-current / billing-cycle-toggle / plan-grid / plan-card /
   billing-compare / feature-grid
   ========================================================================== */

.billing-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 26px;
}

.billing-current-main { display: flex; align-items: center; gap: 16px; }

.billing-current-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--ih-radius-sm);
  background: var(--ih-primary-50);
  color: var(--ih-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.billing-current-icon svg { width: 26px; height: 26px; }

.billing-current-name { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 800; color: var(--ih-ink); }
.billing-current-price { font-size: 0.88rem; color: var(--ih-ink-soft); margin-top: 4px; }
.billing-current-price span { font-weight: 800; color: var(--ih-ink); font-size: 1rem; }
.billing-current-renew { font-size: 0.82rem; color: var(--ih-ink-faint); margin-top: 3px; }
.billing-current-renew strong { color: var(--ih-ink-soft); font-weight: 700; }

.billing-current-actions { display: flex; align-items: center; gap: 16px; }

.billing-cancel-link {
  all: unset;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ih-ink-faint);
}
.billing-cancel-link:hover { color: var(--ih-ink); text-decoration: underline; }
.billing-cancel-link.is-danger:hover { color: var(--ih-danger); }
.billing-cancel-link.is-hidden { display: none !important; }
.app-modal-foot.is-hidden,
.app-modal-body.is-hidden { display: none !important; }
.billing-change-success {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ih-ink);
  line-height: 1.5;
}

/* ---- Cycle toggle ------------------------------------------------------ */

.billing-cycle-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: var(--ih-bg);
  border: 1px solid var(--ih-border);
}

.billing-cycle-btn {
  all: unset;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ih-ink-soft);
  padding: 7px 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .15s ease, color .15s ease;
}
.billing-cycle-btn.is-active { background: var(--ih-surface); color: var(--ih-primary); box-shadow: var(--ih-shadow-sm); }

.billing-cycle-save {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--ih-success);
  background: var(--ih-success-100);
  padding: 2px 7px;
  border-radius: 999px;
}

/* ---- Plan cards ---------------------------------------------------------- */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 4px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--ih-surface);
  border: 1.5px solid var(--ih-border);
  border-radius: var(--ih-radius-md);
  padding: 22px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.plan-card:hover { border-color: var(--ih-border-strong); transform: translateY(-2px); box-shadow: var(--ih-shadow-md); }

.plan-card.is-popular { border-color: var(--ih-primary); box-shadow: var(--ih-shadow-md); }
.plan-card.is-current { border-color: var(--ih-primary); background: var(--ih-primary-50); }

.plan-card-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ih-primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: 999px;
}

.plan-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--ih-bg);
  color: var(--ih-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.plan-card-icon svg { width: 21px; height: 21px; }

.plan-card-name { font-size: 1rem; font-weight: 800; color: var(--ih-ink); margin-bottom: 6px; }

.plan-card-price { display: flex; align-items: baseline; gap: 2px; }
.plan-card-price-currency { font-size: 0.95rem; font-weight: 800; color: var(--ih-ink); }
.plan-card-price-amt { font-size: 1.9rem; font-weight: 800; color: var(--ih-ink); line-height: 1; }
.plan-card-price-period { font-size: 0.85rem; color: var(--ih-ink-faint); font-weight: 600; margin-left: 2px; }

.plan-card-price-note { font-size: 0.72rem; color: var(--ih-ink-faint); margin-top: 4px; min-height: 34px; line-height: 1.35; }
.plan-card-price-note strong { color: var(--ih-ink-soft); font-weight: 700; }
.billing-current-promo { font-size: 0.78rem; color: var(--ih-ink-faint); margin-top: 4px; max-width: 36rem; }

.plan-card-tagline { font-size: 0.83rem; color: var(--ih-ink-soft); margin: 10px 0 16px; }

.plan-card-features { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; flex: 1; }
.plan-card-features li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.84rem;
  color: var(--ih-ink-soft);
  font-weight: 600;
  list-style: none;
}
.plan-card-features li svg { width: 15px; height: 15px; color: var(--ih-success); flex-shrink: 0; }

.plan-card-cta { display: inline-flex; width: 100%; justify-content: center; margin-top: auto; }
.plan-card-cta.is-hidden { display: none; }
.plan-card-cta:disabled { cursor: default; opacity: .7; }
.plan-card-cta:disabled:hover { transform: none; }

/* ---- Feature comparison table -------------------------------------------- */

.app-table-scroll { overflow-x: auto; }

.billing-compare th, .billing-compare td { text-align: center; }
.billing-compare th:first-child, .billing-compare td:first-child { text-align: left; }
.billing-compare th.is-popular, .billing-compare td.is-popular { background: var(--ih-primary-50); }
.billing-compare td.is-yes { color: var(--ih-success); font-weight: 800; }
.billing-compare td.is-no { color: var(--ih-ink-faint); }

/* ---- Invoices ------------------------------------------------------------- */

.billing-invoice-btn {
  all: unset;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ih-ink-faint);
}
.billing-invoice-btn:hover { background: var(--ih-bg); color: var(--ih-ink); }
.billing-invoice-btn.is-danger:hover { background: var(--ih-danger-50); color: var(--ih-danger); }
.billing-invoice-btn svg { width: 16px; height: 16px; }

.billing-cancel-copy { font-size: 0.87rem; color: var(--ih-ink-soft); line-height: 1.55; }

/* ---- Feature access grid --------------------------------------------------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 22px 26px;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--ih-radius-sm);
  border: 1.4px solid var(--ih-border);
  background: var(--ih-surface);
}

.feature-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ih-bg);
  color: var(--ih-ink-faint);
}
.feature-card-icon svg { width: 14px; height: 14px; }

.feature-card-label { flex: 1; min-width: 0; font-size: 0.85rem; font-weight: 700; color: var(--ih-ink-soft); }

.feature-card-status { width: 18px; height: 18px; flex-shrink: 0; color: var(--ih-ink-faint); }
.feature-card-status svg { width: 100%; height: 100%; }

.feature-card.is-unlocked {
  background: color-mix(in srgb, var(--ih-success) 7%, var(--ih-surface));
  border-color: color-mix(in srgb, var(--ih-success) 28%, var(--ih-border));
}
.feature-card.is-unlocked .feature-card-icon { background: color-mix(in srgb, var(--ih-success) 16%, var(--ih-surface)); color: var(--ih-success); }
.feature-card.is-unlocked .feature-card-label { color: var(--ih-ink); }
.feature-card.is-unlocked .feature-card-status { color: var(--ih-success); }

@media (max-width: 1180px) {
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .billing-current { flex-direction: column; align-items: flex-start; }
  .billing-current-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; row-gap: 10px; }
  #plans.app-card-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .plan-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Support — conversation list + chat
   support-shell / support-list-panel / support-list / support-chat-panel /
   support-message / support-chat-input / support-empty
   ========================================================================== */

.support-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  height: calc(100vh - 160px);
  min-height: 480px;
  padding: 18px 40px 24px;
}

.support-list-panel,
.support-chat-panel {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  box-shadow: var(--ih-shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.support-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--ih-border);
  flex-shrink: 0;
}
.support-list-head h2 { font-size: 0.95rem; font-weight: 800; color: var(--ih-ink); }
.support-list-head .app-kebab-btn { width: 30px; height: 30px; }
.support-list-head .app-kebab-btn svg { width: 15px; height: 15px; }

.support-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 6px;
}

.support-list-item {
  padding: 12px 12px;
  border-radius: var(--ih-radius-sm);
  cursor: pointer;
  transition: background .12s ease;
}
.support-list-item:hover { background: var(--ih-bg); }
.support-list-item.is-active { background: var(--ih-primary-50); }

.support-list-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.support-list-item-title { font-size: 0.85rem; font-weight: 700; color: var(--ih-ink); line-height: 1.35; }
.support-list-item-date { font-size: 0.76rem; color: var(--ih-ink-faint); }

.support-list-empty {
  padding: 30px 16px;
  text-align: center;
  font-size: 0.83rem;
  color: var(--ih-ink-faint);
}

/* ---- Status badges ------------------------------------------------------- */

.app-badge.is-open     { background: var(--ih-primary-50); color: var(--ih-primary); flex-shrink: 0; }
.app-badge.is-waiting   { background: var(--ih-accent-100); color: var(--ih-accent); flex-shrink: 0; }
.app-badge.is-resolved  { background: var(--ih-success-100); color: var(--ih-success); flex-shrink: 0; }

/* ---- Chat panel ----------------------------------------------------------- */

.support-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ih-border);
  flex-shrink: 0;
}

.support-chat-back {
  all: unset;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--ih-ink-soft);
  flex-shrink: 0;
}
.support-chat-back svg { width: 18px; height: 18px; }
.support-chat-back:hover { background: var(--ih-bg); }

.support-chat-head-text { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.support-chat-head-text h2 { font-size: 0.98rem; font-weight: 800; color: var(--ih-ink); }
.support-chat-head-text .app-badge.is-hidden { display: none; }

.support-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.support-message { display: flex; flex-direction: column; max-width: 72%; }
.support-message.is-user { align-self: flex-end; align-items: flex-end; }
.support-message.is-support { align-self: flex-start; align-items: flex-start; }

.support-message-meta { font-size: 0.72rem; color: var(--ih-ink-faint); margin-bottom: 5px; font-weight: 600; }

.support-message-bubble {
  font-size: 0.87rem;
  line-height: 1.5;
  padding: 11px 15px;
  border-radius: var(--ih-radius-md);
}
.support-message.is-user .support-message-bubble { background: var(--ih-primary); color: #fff; border-bottom-right-radius: 4px; }
.support-message.is-support .support-message-bubble { background: var(--ih-bg); color: var(--ih-ink); border: 1px solid var(--ih-border); border-bottom-left-radius: 4px; }

.support-chat-input {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--ih-border);
  flex-shrink: 0;
}

.support-chat-textarea {
  all: unset;
  flex: 1;
  min-width: 0;
  font-family: var(--ih-font);
  font-size: 0.87rem;
  color: var(--ih-ink);
  background: var(--ih-bg);
  border: 1.4px solid var(--ih-border);
  border-radius: var(--ih-radius-sm);
  padding: 10px 14px;
  resize: none;
  max-height: 120px;
  height: var(--ta-h, auto);
  box-sizing: border-box;
  line-height: 1.4;
}
.support-chat-textarea:focus { border-color: var(--ih-focus-border); box-shadow: 0 0 0 4px var(--ih-focus-ring-soft); }
.support-chat-textarea::placeholder { color: var(--ih-ink-faint); }

.support-send-btn {
  all: unset;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ih-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s ease, transform .1s ease;
}
.support-send-btn:hover { background: var(--ih-primary-600); transform: translateY(-1px); }
.support-send-btn svg { width: 17px; height: 17px; }

/* ---- Empty states ----------------------------------------------------------- */

.support-empty {
  margin: auto;
  max-width: 320px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}
.support-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ih-primary-50);
  color: var(--ih-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.support-empty-icon svg { width: 26px; height: 26px; }
.support-empty h3 { font-size: 1rem; font-weight: 800; color: var(--ih-ink); margin-bottom: 6px; }
.support-empty p { font-size: 0.85rem; color: var(--ih-ink-soft); line-height: 1.5; }

@media (max-width: 900px) {
  .support-shell {
    grid-template-columns: 1fr;
    height: calc(100vh - 150px);
  }
  .support-list-panel { display: flex; }
  .support-chat-panel { display: none; }
  .support-shell.is-chat-active .support-list-panel { display: none; }
  .support-shell.is-chat-active .support-chat-panel { display: flex; }
  .support-chat-back { display: flex; }
}

@media (max-width: 860px) {
  .support-shell { padding-left: 20px; padding-right: 20px; }
}

.support-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ih-primary-50);
  color: var(--ih-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}
.support-presence {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--ih-ink-faint);
  display: flex;
  align-items: center;
  gap: 6px;
}
.support-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b7c4c8;
  display: inline-block;
  flex-shrink: 0;
}
.support-dot.is-on { background: #1f9d63; box-shadow: 0 0 0 3px rgba(31,157,99,.18); }
.support-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ih-primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.support-unread-sep {
  align-self: stretch;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ih-primary);
  margin: 4px 0;
}
.support-typing {
  font-size: 0.78rem;
  color: var(--ih-ink-faint);
  font-style: italic;
}
.support-jump {
  all: unset;
  cursor: pointer;
  align-self: center;
  margin: -8px auto 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ih-ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.support-jump.is-hidden,
.support-error.is-hidden { display: none; }
.support-error {
  margin: 0 18px 8px;
  font-size: 0.8rem;
  color: var(--ih-danger);
}
.support-new-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ih-ink);
  margin-bottom: 12px;
}
.support-new-label input,
.support-new-label textarea {
  font-family: var(--ih-font);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1.4px solid var(--ih-border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ih-ink);
}
.support-new-label textarea { resize: vertical; min-height: 88px; }

html.sa-chat-app .sa-intro { display: none; }
html.sa-chat-app .app-body { padding-top: 0; }
html.sa-chat-app .sa-chat-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  height: calc(100vh - 168px);
  min-height: 480px;
}
.sa-chat-inbox,
.sa-chat-thread {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  box-shadow: var(--ih-shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.sa-chat-inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--ih-border);
}
.sa-chat-inbox-head h2 { font-size: 0.95rem; font-weight: 800; margin: 0; }
.sa-chat-search {
  padding: 0 12px 10px;
}
.sa-chat-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1.4px solid var(--ih-border);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: var(--ih-font);
  font-size: 0.85rem;
}
.sa-chat-list { list-style: none; overflow-y: auto; flex: 1; padding: 6px; margin: 0; }
.sa-chat-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
}
.sa-chat-item:hover { background: var(--ih-bg); }
.sa-chat-item.is-active { background: var(--ih-primary-50); }
.sa-chat-item-body { min-width: 0; flex: 1; }
.sa-chat-preview {
  font-size: 0.8rem;
  color: var(--ih-ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sa-chat-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ih-border);
}
.sa-chat-head-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sa-chat-head-main h2 { font-size: 0.98rem; font-weight: 800; margin: 0; }
.sa-chat-people {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ih-border);
}
.sa-chat-people input {
  width: 100%;
  border: 1.4px solid var(--ih-border);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: var(--ih-font);
}
.sa-chat-people ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 180px; overflow: auto; }
.sa-chat-people li {
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}
.sa-chat-people li:hover { background: var(--ih-bg); }
.sa-chat-people li span { display: block; font-size: 0.75rem; color: var(--ih-ink-faint); }

.sa-bell { position: relative; }
.sa-bell-btn { position: relative; }
.sa-bell-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c1443c;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sa-bell-count.is-hidden { display: none; }
.sa-bell-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: 12px;
  box-shadow: var(--ih-shadow-md);
  z-index: 40;
  padding: 8px;
  max-height: 360px;
  overflow: auto;
}
.sa-bell-menu.is-open { display: block; }
.sa-bell-empty { margin: 12px; font-size: 0.85rem; color: var(--ih-ink-faint); }
.sa-bell-item {
  display: block;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.sa-bell-item:hover { background: var(--ih-bg); }
.sa-bell-item strong { display: block; font-size: 0.85rem; }
.sa-bell-item span { display: block; font-size: 0.78rem; color: var(--ih-ink-soft); }
.sa-bell-item em { font-style: normal; font-size: 0.72rem; color: var(--ih-ink-faint); }

@media (max-width: 960px) {
  html.sa-chat-app .sa-chat-shell { grid-template-columns: 1fr; height: calc(100vh - 200px); }
}

/* ==========================================================================
   Features — feature-toggle-list / feature-toggle-card / feature-toggle-note
   ========================================================================== */

.feature-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-toggle-card { padding: 0; overflow: hidden; }

.feature-toggle-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
}

.feature-toggle-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ih-primary-50);
  color: var(--ih-primary);
}
.feature-toggle-icon svg { width: 22px; height: 22px; }

.feature-toggle-text { flex: 1; min-width: 0; }
.feature-toggle-title { font-size: 0.96rem; font-weight: 800; color: var(--ih-ink); margin-bottom: 3px; }
.feature-toggle-desc { font-size: 0.84rem; color: var(--ih-ink-soft); line-height: 1.45; }

.feature-toggle-note {
  display: none;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ih-success);
  background: color-mix(in srgb, var(--ih-success) 7%, var(--ih-surface));
  border-top: 1px solid color-mix(in srgb, var(--ih-success) 22%, var(--ih-border));
  padding: 14px 24px;
}
.feature-toggle-note.is-visible { display: flex; }
.feature-toggle-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

/* ---- Feature info tooltip -------------------------------------------------- */

.feature-info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  vertical-align: middle;
  color: var(--ih-ink-faint);
  cursor: help;
}
.feature-info-tip:hover,
.feature-info-tip:focus-visible { color: var(--ih-primary); }
.feature-info-tip:focus-visible { outline: none; }

.feature-info-icon { width: 15px; height: 15px; display: block; }

.feature-info-bubble {
  position: fixed;
  left: var(--tip-x, 50%);
  top: var(--tip-y, 0px);
  transform: translate(-50%, calc(-100% - 8px));
  width: 230px;
  background: var(--ih-ink);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.45;
  white-space: normal;
  text-align: left;
  padding: 9px 11px;
  border-radius: 8px;
  box-shadow: var(--ih-shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
  z-index: 50;
}
.feature-info-tip:hover .feature-info-bubble,
.feature-info-tip:focus-visible .feature-info-bubble {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Teams — app-tabs / team-table / team-cards / role-grid / perm-groups
   ========================================================================== */

.app-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--ih-border);
  margin-bottom: 4px;
}

.app-tab-btn {
  all: unset;
  cursor: pointer;
  font-family: var(--ih-font);
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--ih-ink-faint);
  padding: 10px 4px 12px;
  margin-right: 20px;
  border-bottom: 2.5px solid transparent;
}
.app-tab-btn:hover { color: var(--ih-ink-soft); }
.app-tab-btn.is-active { color: var(--ih-primary); border-bottom-color: var(--ih-primary); }

.app-tab-panel.is-hidden { display: none; }
.app-tab-panel { display: flex; flex-direction: column; gap: 20px; }

/* ---- Users table ------------------------------------------------------- */

.team-user-cell { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ih-ink); white-space: nowrap; }

.team-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ih-primary-50);
  color: var(--ih-primary);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-row-actions { display: flex; align-items: center; gap: 2px; }

.team-table th, .team-table td { padding-left: 14px; padding-right: 14px; }
.team-table th:first-child, .team-table td:first-child { padding-left: 24px; }
.team-table th:last-child, .team-table td:last-child { padding-right: 18px; }
.team-owner-note { font-size: 0.8rem; color: var(--ih-ink-faint); font-weight: 600; }

/* ---- Mobile user cards --------------------------------------------------- */

.team-cards { display: none; flex-direction: column; }

.team-card {
  padding: 16px 22px;
  border-bottom: 1px solid var(--ih-border);
}
.team-card:last-child { border-bottom: none; }

.team-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.team-card-name { font-weight: 700; color: var(--ih-ink); font-size: 0.9rem; }
.team-card-email { font-size: 0.79rem; color: var(--ih-ink-faint); margin-top: 1px; }

.team-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.81rem;
  color: var(--ih-ink-soft);
  margin-bottom: 10px;
}

.team-card-actions { display: flex; gap: 6px; }

/* ---- Roles --------------------------------------------------------------- */

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 22px 26px;
}

.role-empty { grid-column: 1 / -1; font-size: 0.85rem; color: var(--ih-ink-faint); padding: 4px 0 22px; }

.role-card {
  border: 1.4px solid var(--ih-border);
  border-radius: var(--ih-radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.role-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.role-card-name { font-size: 0.94rem; font-weight: 800; color: var(--ih-ink); flex: 1; }

.role-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ih-primary-50);
  color: var(--ih-primary);
}
.role-card-icon svg { width: 16px; height: 16px; }
.role-card-icon--admin { background: var(--ih-accent-100); color: var(--ih-accent); }
.role-card-icon--member { background: var(--ih-bg); color: var(--ih-ink-faint); }
.role-card-icon--custom { background: color-mix(in srgb, var(--ih-primary) 12%, var(--ih-surface)); color: var(--ih-primary); }

.role-card-remove { margin-left: auto; width: 28px; height: 28px; flex-shrink: 0; }

.role-card-desc { font-size: 0.82rem; color: var(--ih-ink-soft); line-height: 1.45; margin-bottom: 12px; flex: 1; }

.role-card-perms { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.role-chip {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ih-ink-soft);
  background: var(--ih-bg);
  border: 1px solid var(--ih-border);
  border-radius: 999px;
  padding: 4px 10px;
}

.role-card-foot { font-size: 0.78rem; color: var(--ih-ink-faint); font-weight: 600; border-top: 1px solid var(--ih-border); padding-top: 10px; }

/* ---- Permission groups (Create Role modal) --------------------------------- */

.perm-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
}

.perm-group-title { font-size: 0.82rem; font-weight: 800; color: var(--ih-ink); margin-bottom: 8px; }

.perm-group-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
}

.perm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--ih-ink-soft);
  cursor: pointer;
}
.perm-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--ih-primary);
  cursor: pointer;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .role-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .team-table { display: none; }
  .team-cards { display: flex; }
  .role-grid { grid-template-columns: 1fr; padding: 18px; }
  .perm-group-items { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Warehouses — warehouse-grid / warehouse-card
   ========================================================================== */

.warehouse-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.warehouse-grid.is-hidden { display: none; }

.warehouse-card {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-md);
  box-shadow: var(--ih-shadow-sm);
  padding: 18px;
}

.warehouse-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }

.warehouse-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ih-primary-50);
  color: var(--ih-primary);
}
.warehouse-card-icon svg { width: 19px; height: 19px; }

.warehouse-card-text { flex: 1; min-width: 0; }
.warehouse-card-name { font-size: 0.94rem; font-weight: 800; color: var(--ih-ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.warehouse-card-code { font-size: 0.7rem; font-weight: 700; color: var(--ih-ink-faint); background: var(--ih-bg); border: 1px solid var(--ih-border); border-radius: 999px; padding: 2px 8px; }
.warehouse-card-location { font-size: 0.81rem; color: var(--ih-ink-soft); margin-top: 3px; }

.warehouse-card-stats {
  display: flex;
  gap: 22px;
  font-size: 0.83rem;
  color: var(--ih-ink-soft);
  border-top: 1px solid var(--ih-border);
  padding-top: 14px;
}
.warehouse-card-stats strong { color: var(--ih-ink); font-weight: 800; }

.warehouse-card-view { width: 100%; justify-content: center; margin-top: 14px; text-align: center; }

@media (max-width: 1180px) {
  .warehouse-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .warehouse-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Item Detail — Barcode card
   ========================================================================== */

.app-barcode-body { padding: 20px 26px; }

.app-barcode-value-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--ih-bg);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.app-barcode-bars { width: 100%; max-width: 200px; height: 44px; color: var(--ih-ink); }
.app-barcode-bars svg { width: 100%; height: 100%; }

.app-barcode-value { font-family: 'Courier New', monospace; font-size: 0.95rem; font-weight: 700; color: var(--ih-ink); letter-spacing: 0.04em; word-break: break-all; text-align: center; }

.app-barcode-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app-barcode-actions .app-action-btn { flex: 1; justify-content: center; }

.app-card.is-barcode-plan-locked {
  position: relative;
  opacity: 0.55;
  cursor: pointer;
}
.app-card.is-barcode-plan-locked .app-barcode-actions {
  pointer-events: none;
}
.app-barcode-plan-tip,
.app-plan-feature-tip {
  display: none;
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  z-index: 4;
  width: min(280px, calc(100% - 24px));
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ih-ink);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.app-card.is-barcode-plan-locked.is-tip-open .app-barcode-plan-tip,
.is-plan-feature-locked.is-tip-open .app-plan-feature-tip {
  display: block;
  pointer-events: auto;
}
.app-plan-feature-tip-link {
  color: #7ec8ff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.app-plan-feature-tip-link:hover,
.app-plan-feature-tip-link:focus-visible {
  color: #a6dcff;
}

.is-plan-feature-locked {
  position: relative;
  opacity: 0.55;
  cursor: pointer;
}
.is-plan-feature-locked select,
.is-plan-feature-locked button,
.is-plan-feature-locked input {
  pointer-events: none;
}

.app-scan-placeholder {
  width: 100%;
  height: 140px;
  border: 1.5px dashed var(--ih-border-strong);
  border-radius: var(--ih-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ih-ink-faint);
  margin-bottom: 16px;
}
.app-scan-placeholder svg { width: 40px; height: 40px; }

#barcodePrintArea { display: none; }

@media print {
  body * { visibility: hidden; }
  #barcodePrintArea, #barcodePrintArea * { visibility: visible; }
  #barcodePrintArea {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
  }
  .app-print-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 40px;
  }
  .app-print-label-name { font-size: 1.3rem; font-weight: 800; }
  .app-print-label-sku { font-size: 0.95rem; color: #555; }
  .app-print-label-barcode { font-family: 'Courier New', monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: 0.08em; margin-top: 10px; }
}

@media (max-width: 640px) {
  .app-barcode-actions .app-kebab-btn { flex: 0 0 auto; }
}

/* ==========================================================================
   Purchase Orders — po-vendor-notice / po-row / po-card / po-line-items
   ========================================================================== */

.po-vendor-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: color-mix(in srgb, var(--ih-accent) 10%, var(--ih-surface));
  border: 1px solid color-mix(in srgb, var(--ih-accent) 30%, var(--ih-border));
  border-radius: var(--ih-radius-md);
  padding: 16px 18px;
  margin-bottom: 18px;
  color: var(--ih-accent);
}
.po-vendor-notice.is-hidden { display: none; }
.po-vendor-notice svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.po-vendor-notice-text { flex: 1; }
.po-vendor-notice-text strong { display: block; font-size: 0.88rem; color: var(--ih-ink); margin-bottom: 2px; }
.po-vendor-notice-text p { font-size: 0.83rem; color: var(--ih-ink-soft); }
.po-vendor-notice .app-action-btn { flex-shrink: 0; }

@media (max-width: 640px) {
  .po-vendor-notice { flex-wrap: wrap; }
  .po-vendor-notice .app-action-btn { justify-content: center; margin-left: 32px; width: calc(100% - 32px); }
}

.po-row { cursor: pointer; }
.po-card { cursor: pointer; }

#poVendorInlineNotice a { color: inherit; text-decoration: underline; }

.po-line-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

.po-line-row {
  display: grid;
  grid-template-columns: 2fr 0.8fr 1fr 0.9fr auto;
  gap: 10px;
  align-items: end;
}
.po-line-row .ob-form-group { margin-bottom: 0; }

.po-line-total {
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--ih-ink);
  padding: 11px 0;
  text-align: right;
}

@media (max-width: 680px) {
  .po-line-row { grid-template-columns: 1fr 1fr; grid-template-areas: "name name" "qty cost" "total remove"; }
  .po-line-row > *:nth-child(1) { grid-area: name; }
  .po-line-row > *:nth-child(2) { grid-area: qty; }
  .po-line-row > *:nth-child(3) { grid-area: cost; }
  .po-line-row > *:nth-child(4) { grid-area: total; }
  .po-line-row > *:nth-child(5) { grid-area: remove; justify-self: end; }
}

/* ==========================================================================
   Custom Fields — cf-list / cf-row / cf-options
   ========================================================================== */

.cf-list { list-style: none; }

.cf-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--ih-border);
}
.cf-row:last-child { border-bottom: none; }

.cf-row-order { display: flex; align-items: center; flex-shrink: 0; }
.cf-drag-handle {
  all: unset;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 28px;
  height: 36px;
  border-radius: 8px;
  color: var(--ih-ink-faint);
  cursor: grab;
  touch-action: none;
}
.cf-drag-handle svg { width: 16px; height: 16px; pointer-events: none; }
.cf-drag-handle:hover { background: var(--ih-bg); color: var(--ih-ink); }
.cf-row.is-dragging { opacity: 0.45; }
.cf-row.is-dragging .cf-drag-handle { cursor: grabbing; }

.cf-row-text { flex: 1; min-width: 0; }
.cf-row-name { font-size: 0.92rem; font-weight: 700; color: var(--ih-ink); margin-bottom: 4px; }
.cf-row-meta { display: flex; align-items: center; gap: 10px; font-size: 0.81rem; color: var(--ih-ink-faint); }

.cf-type-chip {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ih-primary);
  background: var(--ih-primary-50);
  border-radius: 999px;
  padding: 2px 9px;
}

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

.cf-options-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cf-option-row { display: flex; align-items: center; gap: 8px; }
.cf-option-row .ob-input { flex: 1; }

@media (max-width: 640px) {
  .cf-row { flex-wrap: wrap; padding: 16px 18px; }
  .cf-row-actions { width: 100%; justify-content: flex-end; }
}

/* ==========================================================================
   Reports — report-group / report-card / report-summary / report-detail
   ========================================================================== */

.report-group { margin-bottom: 30px; }
.report-group-title { font-size: 0.95rem; font-weight: 800; color: var(--ih-ink); margin-bottom: 14px; }

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.report-card.is-hidden { display: none; }

.report-card {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.report-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ih-primary-50);
  color: var(--ih-primary);
  margin-bottom: 14px;
}
.report-card-icon svg { width: 20px; height: 20px; }
.report-card-icon--warn { background: var(--ih-accent-100); color: var(--ih-accent); }
.report-card-icon--danger { background: var(--ih-danger-50); color: var(--ih-danger); }

.report-card-name { font-size: 0.95rem; font-weight: 800; color: var(--ih-ink); margin-bottom: 6px; }
.report-card-desc { font-size: 0.83rem; color: var(--ih-ink-soft); line-height: 1.45; margin-bottom: 16px; flex: 1; }
.report-card-btn { width: 100%; justify-content: center; }

/* ---- Detail view header --------------------------------------------------- */

.report-detail-back { flex-shrink: 0; }

.report-detail-title-row { max-width: 1080px; width: 100%; margin: 0 auto; padding: 6px 40px 4px; box-sizing: border-box; }
.report-detail-title-row h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ih-ink); }
.report-detail-desc { font-size: 0.85rem; color: var(--ih-ink-soft); margin-top: 4px; }

@media (max-width: 860px) {
  .report-detail-title-row { padding-left: 20px; padding-right: 20px; }
}

/* ---- Summary strip --------------------------------------------------------- */

.report-summary-strip.is-hidden { display: none; }

.report-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.report-summary-card {
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-md);
  box-shadow: var(--ih-shadow-sm);
  padding: 16px 18px;
}
.report-summary-value { font-size: 1.4rem; font-weight: 800; color: var(--ih-ink); }
.report-summary-label { font-size: 0.79rem; color: var(--ih-ink-faint); font-weight: 600; margin-top: 3px; }

.report-diff-neg { color: var(--ih-danger); font-weight: 700; }

@media (max-width: 1180px) {
  .report-grid { grid-template-columns: repeat(2, 1fr); }
  .report-summary-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .report-summary-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .report-grid { grid-template-columns: 1fr; }
  .report-summary-strip { grid-template-columns: 1fr 1fr; gap: 10px; }
  .report-summary-card { padding: 14px; }
  .report-summary-value { font-size: 1.2rem; }
}

/* ==========================================================================
   Select Custom Fields — field-select-list / cf-select-empty
   ========================================================================== */

.field-select-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.field-select-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.4px solid var(--ih-border);
  border-radius: var(--ih-radius-sm);
  cursor: pointer;
}
.field-select-item:hover { border-color: var(--ih-border-strong); background: var(--ih-bg); }

.field-select-item input {
  width: 17px;
  height: 17px;
  accent-color: var(--ih-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.field-select-item-name { flex: 1; font-size: 0.87rem; font-weight: 700; color: var(--ih-ink); }

#modalSelectFields .app-modal-foot { justify-content: space-between; align-items: center; }
.field-select-foot-actions { display: flex; gap: 10px; }

.cf-select-empty {
  text-align: center;
  padding: 30px 24px;
}
.cf-select-empty p { font-size: 0.85rem; color: var(--ih-ink-faint); margin-bottom: 14px; }

@media (max-width: 540px) {
  #modalSelectFields .app-modal-foot { flex-wrap: wrap; }
  #linkManageFields { width: 100%; text-align: center; order: 2; }
  .field-select-foot-actions { width: 100%; order: 1; }
  .field-select-foot-actions .app-btn-cancel,
  .field-select-foot-actions .app-action-btn { flex: 1; justify-content: center; }
}

/* ==========================================================================
   Item bulk import
   ========================================================================== */

.import-shell { max-width: 760px; }

.import-steps {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}
.import-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-size: 0.82rem;
  color: var(--ih-ink-soft);
  font-weight: 600;
}
.import-step span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ih-surface-2, var(--ih-surface));
  border: 1px solid var(--ih-border);
  font-size: 0.75rem;
}
.import-step.is-active { color: var(--ih-ink); }
.import-step.is-active span,
.import-step.is-done span {
  background: var(--ih-accent);
  border-color: var(--ih-accent);
  color: #fff;
}
.import-lead {
  margin: 0 0 16px;
  color: var(--ih-ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}
.import-file-meta {
  font-size: 0.8rem;
  color: var(--ih-ink-soft);
  font-weight: 500;
}
.import-drop {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 36px 20px;
  border: 1.5px dashed var(--ih-border);
  border-radius: var(--ih-radius-md);
  background: color-mix(in srgb, var(--ih-accent) 4%, var(--ih-surface));
  cursor: pointer;
  text-align: center;
}
.import-drop svg { width: 28px; height: 28px; color: var(--ih-accent); }
.import-drop strong { font-size: 0.92rem; color: var(--ih-ink); }
.import-drop span { font-size: 0.8rem; color: var(--ih-ink-soft); }
.import-drop.is-drag,
.import-drop:hover {
  border-color: var(--ih-accent);
  background: color-mix(in srgb, var(--ih-accent) 8%, var(--ih-surface));
}
.import-drop.is-busy { opacity: 0.65; pointer-events: none; }
.import-map-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}
.import-map-row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 12px;
  align-items: center;
}
.import-map-row .ob-label { margin: 0; }
.import-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  flex-wrap: wrap;
}
.import-result-lead {
  font-size: 0.95rem;
  color: var(--ih-ink);
  margin: 0 0 16px;
}
.app-card.is-hidden { display: none; }

.ih-toast-host {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 240;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 24px));
}
.ih-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 14px 14px 14px 16px;
  border-radius: var(--ih-radius-md);
  box-shadow: var(--ih-shadow-md);
  background: var(--ih-surface);
  border: 1.4px solid var(--ih-border);
  transform: translateX(120%);
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
}
.ih-toast.is-in {
  transform: translateX(0);
  opacity: 1;
}
.ih-toast.is-success {
  border-color: color-mix(in srgb, var(--ih-success) 35%, var(--ih-border));
  background: color-mix(in srgb, var(--ih-success) 8%, var(--ih-surface));
}
.ih-toast.is-error {
  border-color: color-mix(in srgb, var(--ih-danger) 35%, var(--ih-border));
  background: color-mix(in srgb, var(--ih-danger) 8%, var(--ih-surface));
}
.ih-toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.ih-toast-icon svg { width: 20px; height: 20px; display: block; }
.ih-toast.is-success .ih-toast-icon { color: var(--ih-success); }
.ih-toast.is-error .ih-toast-icon { color: var(--ih-danger); }
.ih-toast-copy {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.4;
  color: var(--ih-ink);
}
.ih-toast-close {
  all: unset;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ih-ink-faint);
  flex-shrink: 0;
  margin: -4px -4px 0 0;
}
.ih-toast-close:hover { background: var(--ih-bg); color: var(--ih-ink); }
.ih-toast-close svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .ih-toast-host {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
    align-items: stretch;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ih-toast { transition: none; transform: none; }
}

@media (max-width: 640px) {
  .import-map-row { grid-template-columns: 1fr; gap: 4px; }
  .import-steps { flex-wrap: wrap; }
}

/* ==========================================================================
   Super Admin — same app.css components, distinct teal palette
   Scoped to html.sa-app so customer app colors stay unchanged.
   ========================================================================== */

html.sa-app,
html.sa-app body {
  overflow-x: hidden;
  max-width: 100%;
}

html.sa-app .app-shell,
html.sa-app .app-main,
html.sa-app .app-body,
html.sa-app .app-card,
html.sa-app .app-header,
html.sa-app .sa-filters,
html.sa-app .dataTables_wrapper {
  min-width: 0;
  max-width: 100%;
}

html.sa-app {
  --ih-ink:            #14242b;
  --ih-ink-soft:        #4a646c;
  --ih-ink-faint:       #7d949b;

  --ih-primary:         #0e6b72;
  --ih-primary-600:     #0a545a;
  --ih-primary-100:     #dceff1;
  --ih-primary-50:      #eef7f8;

  --ih-accent:          #c45c26;
  --ih-accent-100:      #f8e6db;

  --ih-bg:              #f3f7f8;
  --ih-surface:         #ffffff;
  --ih-border:          #d5e1e4;
  --ih-border-strong:   #b7c9ce;

  --ih-focus-ring:      rgba(14, 107, 114, 0.28);
  --ih-focus-ring-soft: rgba(14, 107, 114, 0.14);
}

html.sa-app[data-theme="dark"] {
  --ih-ink:            #e4eef0;
  --ih-ink-soft:        #9db3b8;
  --ih-ink-faint:       #6f868c;

  --ih-primary:         #5eb8bf;
  --ih-primary-600:     #7ac8ce;
  --ih-primary-100:     #1c3538;
  --ih-primary-50:      #162b2e;

  --ih-accent:          #e08a58;
  --ih-accent-100:      #3a271c;

  --ih-bg:              #121c1e;
  --ih-surface:         #1b292c;
  --ih-surface-2:       #162326;
  --ih-border:          #2c3e42;
  --ih-border-strong:   #3e555a;

  --ih-focus-ring:      rgba(94, 184, 191, 0.32);
  --ih-focus-ring-soft: rgba(94, 184, 191, 0.18);
}

.sa-app .sa-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ih-primary);
  margin: 0 0 4px;
}

.sa-app .sa-header { align-items: flex-start; }
.sa-app .sa-header-copy {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.sa-app .sa-header-icon {
  width: 44px;
  height: 44px;
  padding: 8px;
  background: var(--ih-primary-50);
  border: 1px solid var(--ih-border);
  border-radius: 14px;
}
.sa-app .sa-intro {
  margin: 6px 0 0;
  max-width: 560px;
  font-size: 0.9rem;
  color: var(--ih-ink-soft);
  font-weight: 550;
}
.sa-app .sa-signout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.material-icons-outlined.sa-i {
  font-family: 'Material Icons Outlined', sans-serif;
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  flex-shrink: 0;
  user-select: none;
  overflow: hidden;
  vertical-align: middle;
}

.sa-app .sa-i {
  display: inline-flex;
  vertical-align: -3px;
  flex-shrink: 0;
}
.sa-app .app-nav-link .sa-i { width: 20px; height: 20px; }
.sa-app .app-card-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sa-app .app-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sa-app .sa-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.86rem;
  color: var(--ih-ink-soft);
}
.sa-app .sa-crumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ih-primary);
  font-weight: 700;
  text-decoration: none;
}

.sa-app .sa-filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ih-surface);
  border: 1.4px solid var(--ih-border);
  border-radius: 12px;
  padding: 0 12px;
  min-width: 0;
  flex: 1 1 180px;
}
.sa-app .sa-filter-search input {
  border: 0 !important;
  box-shadow: none !important;
  min-height: 42px;
  padding-left: 0;
  width: 100%;
}

.sa-app .app-table thead th {
  background: #10262b;
  color: #f4fbfc;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 13px 16px;
  border-bottom: 0;
  white-space: normal;
}
html.sa-app[data-theme="dark"] .app-table thead th {
  background: #071416;
  color: #e8f4f5;
}
.sa-app .app-table thead th .sa-i {
  margin-right: 4px;
  vertical-align: -3px;
}
.sa-app .app-table td { padding: 13px 16px; }

.sa-app table.dataTable.sa-customers-table thead th {
  padding: 8px 12px;
  line-height: 1.2;
}
.sa-app table.dataTable.sa-customers-table tbody td {
  padding: 6px 12px;
  line-height: 1.25;
}
.sa-app .sa-customers-table .sa-act {
  padding: 4px 8px;
}
.sa-app .sa-customers-table .sa-name-link {
  gap: 6px;
}
.sa-app .sa-customers-table .sa-row-actions {
  gap: 6px;
}
.sa-app .sa-empty-cell {
  text-align: center;
  color: var(--ih-ink-faint);
  padding: 28px 16px !important;
}

.sa-app .sa-name-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sa-app .sa-act {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  font-family: var(--ih-font);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  border: 1.4px solid var(--ih-border);
  background: var(--ih-surface);
  color: var(--ih-ink);
}
.sa-app .sa-act:hover { border-color: var(--ih-border-strong); background: var(--ih-bg); }
.sa-app .sa-act-icon {
  padding: 6px;
  gap: 0;
}
.sa-app .sa-act-icon .sa-i {
  display: block;
}
.sa-app .sa-act-on { border-color: #b7e4cc; background: var(--ih-success-100); color: var(--ih-success); }
.sa-app .sa-act-off { border-color: #f0c4c0; background: var(--ih-danger-50); color: var(--ih-danger); }
.sa-app .sa-act-impersonate {
  border-color: #edc4a6;
  background: #f8e6db;
  color: #c45c26;
}
.sa-app .sa-act-impersonate:hover {
  border-color: #c45c26;
  background: #f3d5c0;
  color: #a3491c;
}
.sa-app .sa-act-delete {
  border-color: #f0c4c0;
  background: var(--ih-danger-50);
  color: var(--ih-danger);
}
.sa-app .sa-act-delete:hover {
  border-color: #c1443c;
  background: #f8d7d4;
  color: #9a2f29;
}
.sa-app .sa-page-meta-delete {
  margin-top: 16px;
}
.sa-app .sa-toggle {
  width: 36px;
  height: 20px;
  vertical-align: middle;
}

.sa-app .sa-toggle .app-toggle-track {
  background: #c9d4d7;
}

.sa-app .sa-toggle .app-toggle-thumb {
  width: 14px;
  height: 14px;
  top: 3px;
  left: 3px;
}

.sa-app .sa-toggle input:checked + .app-toggle-track {
  background: #1f9d63;
}

.sa-app .sa-toggle input:checked + .app-toggle-track .app-toggle-thumb {
  transform: translateX(16px);
}

.sa-app .sa-account-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.sa-app .sa-obar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 92px;
  max-width: 160px;
}

.sa-app .sa-obar-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #d5e1e4;
  overflow: hidden;
}

.sa-app .sa-obar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #0e6b72;
}

.sa-app .sa-obar.is-done .sa-obar-fill { background: #1f9d63; }
.sa-app .sa-obar.is-zero .sa-obar-fill { background: #b7c9ce; }

.sa-app .sa-obar-pct {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ih-ink);
  min-width: 2.4em;
}

html.sa-app[data-theme="dark"] .sa-app .sa-obar-track,
html.sa-app[data-theme="dark"] .sa-obar-track {
  background: #2c3e42;
}

.sa-app .sa-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sa-app .sa-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sa-app .sa-nav-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ih-ink-faint);
  margin: 0 12px 10px;
}

.sa-app .sa-metrics {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 0;
}

.sa-app .sa-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.sa-app .sa-card-body {
  padding: 20px 26px 24px;
}

.sa-app .sa-card-body h2,
.sa-app .sa-card-body h3 {
  margin: 0 0 14px;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--ih-ink);
}

.sa-app .sa-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sa-app .sa-list li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ih-border);
}

.sa-app .sa-list li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.sa-app .sa-list a {
  font-weight: 700;
  color: var(--ih-ink);
  text-decoration: none;
}

.sa-app .sa-list a:hover { color: var(--ih-primary); }

.sa-app .sa-list span,
.sa-app .sa-empty,
.sa-app .sa-muted {
  color: var(--ih-ink-faint);
  font-size: 0.85rem;
}

.sa-app .sa-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: var(--ih-surface);
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  box-shadow: var(--ih-shadow-sm);
  padding: 12px 14px;
}

.sa-app .sa-filters a.app-action-btn {
  text-decoration: none;
}

.sa-app .sa-filters .sa-add-btn {
  margin-left: auto;
}

html.sa-app .sa-filters > .sa-filter-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  height: auto;
  padding: 9px 14px;
  white-space: nowrap;
}

.sa-app .sa-filters input,
.sa-app .sa-filters select,
.sa-app .sa-form input,
.sa-app .sa-form select,
.sa-app .sa-form textarea,
.sa-app .sa-plan-assign select {
  font-family: var(--ih-font);
  font-size: 0.9rem;
  border: 1.4px solid var(--ih-border);
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--ih-surface);
  color: var(--ih-ink);
  min-height: 44px;
}

.sa-app .sa-form textarea { min-height: 0; }

.sa-app .sa-filters input:focus,
.sa-app .sa-filters select:focus,
.sa-app .sa-form input:focus,
.sa-app .sa-form select:focus,
.sa-app .sa-form textarea:focus {
  outline: none;
  border-color: var(--ih-focus-border);
  box-shadow: 0 0 0 4px var(--ih-focus-ring-soft);
}

.sa-app .sa-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
}

.sa-app .sa-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--ih-ink);
}

.sa-app .sa-check {
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
}

.sa-app .sa-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sa-app .sa-tabs a {
  padding: 9px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--ih-ink-soft);
  background: var(--ih-surface);
  border: 1.4px solid var(--ih-border);
}

.sa-app .sa-tabs a:hover { border-color: var(--ih-border-strong); color: var(--ih-ink); }

.sa-app .sa-tabs a.is-active {
  background: var(--ih-primary);
  color: #fff;
  border-color: var(--ih-primary);
}

.sa-app .sa-dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 22px;
}

.sa-app .sa-dl dt {
  color: var(--ih-ink-faint);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sa-app .sa-dl dd {
  margin: 4px 0 0;
  font-weight: 650;
  color: var(--ih-ink);
}

.sa-app .sa-plan-assign {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin: 12px 0 22px;
}
.sa-app .sa-plan-assign-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ih-ink-faint);
}
.sa-app .sa-plan-assign-field select {
  min-width: 200px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 650;
}

.sa-app .app-table a {
  color: var(--ih-primary);
  font-weight: 700;
  text-decoration: none;
}

.sa-app .app-table a:hover { text-decoration: underline; }

.sa-app .app-body { gap: 22px; }

.sa-app .sa-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sa-app .sa-row-actions .app-action-btn {
  padding: 7px 12px;
  font-size: 0.78rem;
}

.sa-app .sa-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: var(--ih-success-100);
  color: var(--ih-success);
}

.sa-app .sa-pill.is-off {
  background: var(--ih-danger-50);
  color: var(--ih-danger);
}

.sa-impersonate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: #0e6b72;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 650;
}
.sa-impersonate-bar span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.sa-impersonate-bar .app-action-btn.is-secondary {
  background: #fff;
  color: #0e6b72;
  border: 0;
  padding: 7px 14px;
  font-size: 0.8rem;
}

html.sa-app .dataTables_wrapper {
  padding: 4px 0 8px;
  color: var(--ih-ink);
  overflow: visible;
}

html.sa-app .dataTables_wrapper .sa-dt-top,
html.sa-app .dataTables_wrapper .sa-dt-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 12px 16px;
}

html.sa-app .dataTables_wrapper .sa-dt-bottom {
  border-top: 1px solid var(--ih-border);
}

html.sa-app .dataTables_wrapper .dataTables_length,
html.sa-app .dataTables_wrapper .dataTables_filter,
html.sa-app .dataTables_wrapper .dataTables_info,
html.sa-app .dataTables_wrapper .dataTables_paginate {
  float: none;
  margin: 0;
  padding: 0;
}

html.sa-app .dataTables_wrapper .dataTables_length label,
html.sa-app .dataTables_wrapper .dataTables_filter label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 0.84rem;
  color: var(--ih-ink-soft);
  margin: 0;
}

html.sa-app .dataTables_wrapper .dataTables_length select,
html.sa-app .dataTables_wrapper .dataTables_filter input {
  border: 1.4px solid var(--ih-border);
  border-radius: 12px;
  padding: 8px 12px;
  background: var(--ih-surface);
  color: var(--ih-ink);
  font: inherit;
  min-height: 40px;
}

html.sa-app .dataTables_wrapper .dataTables_filter input {
  min-width: 0;
  width: min(220px, 100%);
}

html.sa-app .dataTables_wrapper .dataTables_length select:focus,
html.sa-app .dataTables_wrapper .dataTables_filter input:focus {
  outline: none;
  border-color: var(--ih-focus-border);
  box-shadow: 0 0 0 4px var(--ih-focus-ring-soft);
}

html.sa-app .dataTables_wrapper .dataTables_info {
  font-size: 0.82rem;
  color: var(--ih-ink-faint);
  padding-top: 0;
}

html.sa-app .dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 1.4px solid var(--ih-border) !important;
  border-radius: 10px !important;
  background: var(--ih-surface) !important;
  color: var(--ih-ink) !important;
  padding: 6px 12px !important;
  margin: 0 3px !important;
  font-weight: 700 !important;
}

html.sa-app .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #e8f4f5 !important;
  color: #0e6b72 !important;
  border-color: #0e6b72 !important;
}

html.sa-app .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html.sa-app .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #0e6b72 !important;
  color: #fff !important;
  border-color: #0e6b72 !important;
}

html.sa-app .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
html.sa-app .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.45;
  background: var(--ih-surface) !important;
  color: var(--ih-ink-faint) !important;
  border-color: var(--ih-border) !important;
}

html.sa-app .dataTables_wrapper table.dataTable {
  margin: 0 !important;
  border-collapse: collapse !important;
  width: 100% !important;
  table-layout: auto;
}

html.sa-app .dataTables_wrapper table.dataTable thead th,
html.sa-app .dataTables_wrapper table.dataTable tbody td {
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

html.sa-app .dataTables_wrapper table.dataTable thead th {
  background: #10262b;
  color: #f4fbfc;
}

html.sa-app .dataTables_wrapper table.dataTable.no-footer {
  border-bottom: 0;
}

html.sa-app .dataTables_wrapper table.dataTable tbody td.dataTables_empty {
  padding: 28px 16px;
  color: var(--ih-ink-faint);
  text-align: center;
}

html.sa-app .dataTables_wrapper .dataTables_paginate {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}

html.sa-app table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
html.sa-app table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
  padding-left: 32px;
}

html.sa-app table.dataTable > tbody > tr.child ul.dtr-details {
  width: 100%;
  display: grid;
  gap: 8px;
}

html.sa-app table.dataTable > tbody > tr.child ul.dtr-details > li {
  border-bottom: 1px solid var(--ih-border);
  padding: 6px 0;
}

html.sa-app table.dataTable > tbody > tr.child span.dtr-title {
  font-weight: 800;
  color: var(--ih-ink-faint);
  min-width: 0;
}

html.sa-app .sa-filters > select,
html.sa-app .sa-filters > button,
html.sa-app .sa-filters > a {
  flex: 1 1 140px;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1100px) {
  .sa-app .sa-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .sa-app .sa-dl { grid-template-columns: 1fr; }
  .sa-app .sa-header { gap: 16px; }
  .sa-app .sa-intro { max-width: none; }
  .sa-app .sa-filters .sa-add-btn { margin-left: 0; }
  .sa-app .sa-metrics { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .sa-app .sa-card-body { padding: 16px 16px 20px; }
  html.sa-app .dataTables_wrapper .sa-dt-top,
  html.sa-app .dataTables_wrapper .sa-dt-bottom {
    flex-direction: column;
    align-items: stretch;
  }
  html.sa-app .dataTables_wrapper .dataTables_filter label,
  html.sa-app .dataTables_wrapper .dataTables_length label {
    width: 100%;
  }
  html.sa-app .dataTables_wrapper .dataTables_filter input {
    width: 100%;
    flex: 1;
  }
  html.sa-app .dataTables_wrapper .dataTables_paginate {
    justify-content: center;
  }
}

@media (max-width: 860px) {
  html.sa-app .app-table,
  html.sa-app table.dataTable {
    display: table !important;
    width: 100% !important;
  }

  html.sa-app .app-sidebar {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 2px;
    padding-left: 4px;
    padding-right: 4px;
  }

  html.sa-app .sa-nav-label {
    display: none;
  }

  html.sa-app .app-sidebar-pinned li:has(.app-nav-logout-form) {
    display: none;
  }

  html.sa-app .app-nav-link {
    flex: 1 1 20%;
    max-width: 20%;
  }

  html.sa-app .app-main {
    padding-bottom: 118px;
  }

  html.sa-app .app-action-btn {
    flex: 1 1 auto;
  }
}

.sa-app .sa-ob-stat {
  position: relative;
  overflow: hidden;
}
.sa-app .sa-ob-stat::after {
  content: "";
  position: absolute;
  inset: auto -20px -28px auto;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14,107,114,.18), transparent 68%);
  pointer-events: none;
}

.sa-app .sa-ob-funnels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.sa-app .sa-ob-funnel .app-card-head {
  align-items: center;
}

.sa-app .sa-ob-stages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px 20px;
}

.sa-app .sa-ob-stage-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
}
.sa-app .sa-ob-stage-top strong { font-weight: 800; color: var(--ih-ink); }
.sa-app .sa-ob-stage-top span { font-weight: 800; color: var(--ih-primary); }

.sa-app .sa-ob-stage-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(14,107,114,.12);
  overflow: hidden;
  margin: 6px 0 4px;
  box-shadow: inset 0 0 0 1px rgba(14,107,114,.08);
}
.sa-app .sa-ob-stage-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0e6b72, #5eb8bf);
  box-shadow: 0 0 12px rgba(14,107,114,.35);
}
.sa-app .sa-ob-stage-fill.is-low { background: linear-gradient(90deg, #c45c26, #e08a58); box-shadow: 0 0 12px rgba(196,92,38,.3); }
.sa-app .sa-ob-stage-fill.is-done { background: linear-gradient(90deg, #1f9d63, #4fbf8a); box-shadow: 0 0 12px rgba(31,157,99,.3); }
.sa-app .sa-ob-stage p { margin: 0; font-size: 0.75rem; color: var(--ih-ink-faint); }

.sa-app .sa-pipe {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.sa-app .sa-pipe-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c9d4d7;
  box-shadow: 0 0 0 3px rgba(201,212,215,.35);
}
.sa-app .sa-pipe-dot.is-done {
  background: #1f9d63;
  box-shadow: 0 0 10px rgba(31,157,99,.55);
}
.sa-app .sa-pipe-dot.is-skip {
  background: #c45c26;
  box-shadow: 0 0 10px rgba(196,92,38,.4);
}
.sa-app .sa-pipe-dot.is-miss {
  background: #d5e1e4;
  box-shadow: 0 0 0 3px rgba(14,107,114,.12);
}

.sa-app .sa-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sa-app .sa-chip-lack {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f8e6db;
  color: #c45c26;
  font-size: 0.72rem;
  font-weight: 800;
}

.sa-app .sa-ob-flag {
  margin-top: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #c1443c;
  white-space: nowrap;
}
.sa-app .sa-ob-flag.is-ok { color: #1f9d63; }
.sa-app .sa-ob-flag.is-mid { color: #0e6b72; }

.sa-app .sa-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ih-ink);
  white-space: nowrap;
}

.sa-app tr.sa-ob-stuck td {
  background: rgba(196, 92, 38, 0.06);
}

.sa-app .sa-filters .app-action-btn.is-secondary {
  background: var(--ih-surface);
  color: var(--ih-ink);
  border: 1.4px solid var(--ih-border);
}

@media (max-width: 1100px) {
  .sa-app .sa-ob-funnels { grid-template-columns: 1fr; }
}

.sa-app .sa-ob-page .app-stat-label,
.sa-app .sa-ob-page .app-stat-value,
.sa-app .sa-ob-page .app-card-head h2,
.sa-app .sa-ob-page .sa-ob-stage-top,
.sa-app .sa-ob-page .sa-ob-stage-top strong,
.sa-app .sa-ob-page .sa-ob-stage p,
.sa-app .sa-ob-page .sa-muted,
.sa-app .sa-ob-page .sa-pill,
.sa-app .sa-ob-page .sa-chip-lack,
.sa-app .sa-ob-page .sa-act,
.sa-app .sa-ob-page .app-action-btn {
  white-space: nowrap;
}

.sa-app .sa-ob-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  max-width: 100%;
  min-width: 0;
}

.sa-app .sa-ob-page .sa-chip-wrap,
.sa-app .sa-ob-page .sa-pipe,
.sa-app .sa-ob-page .sa-row-actions {
  flex-wrap: nowrap;
}

.sa-app .sa-ob-page table.app-table thead th,
.sa-app .sa-ob-page table.app-table tbody td,
html.sa-app .sa-ob-page .dataTables_wrapper table.dataTable thead th,
html.sa-app .sa-ob-page .dataTables_wrapper table.dataTable tbody td {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.sa-app .sa-ob-page .sa-obar {
  flex-wrap: nowrap;
}

.demo-mode-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: #123b40;
  color: #fff;
}
.demo-mode-bar-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.demo-mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.demo-mode-cta-text {
  font-size: 0.9rem;
  font-weight: 600;
}
.demo-mode-bar .demo-mode-signup {
  background: #fff;
  color: #123b40;
  border: 0;
}
.demo-mode-bar .demo-mode-signup:hover {
  background: #e8f4f5;
  color: #123b40;
}

.app-shell.is-demo-preview-shell {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}
.demo-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 22, 26, 0.38);
}
.demo-gate-card {
  width: min(420px, 100%);
  background: var(--ih-surface, #fff);
  color: var(--ih-ink, #122);
  border-radius: 16px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28); position: relative;
}
.demo-gate-card .demo-close-btn {
    position: absolute;
    right: 8px;
    top: 8px;
}
.demo-gate-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}
.demo-gate-card p {
  margin: 0 0 18px;
  color: var(--ih-ink-muted, #556);
  font-size: 0.92rem;
  line-height: 1.45;
}
.demo-gate-submit {
  width: 100%;
  justify-content: center;
  margin-top: 14px;
}
.demo-gate-error {
  color: #b42318;
  font-size: 0.8rem;
  margin: 8px 0 0;
}
body.is-demo-mode .app-page-head .app-action-btn.is-primary,
body.is-demo-mode .app-card-head .app-action-btn.is-primary,
body.is-demo-mode .app-header-tools .app-action-btn.is-primary {
  pointer-events: none;
  opacity: 0.45;
}
@media (max-width: 1399px){.ob-panel-content{padding: 18px clamp(28px, 6vw, 96px);}	.ob-heading{font-size: clamp(1.5rem, 3vw, 1.5rem); margin-bottom: 12px;}.ob-form-group {margin-bottom: 12px;}.ob-subheading{margin-bottom: 16px;}}
@media (min-width: 861px) {
  body.is-demo-mode,
  body.is-demo-preview {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body.is-demo-mode .demo-mode-bar {
    position: relative;
    flex: 0 0 auto;
  }
  body.is-demo-mode .app-shell,
  body.is-demo-preview .app-shell {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }
  body.is-demo-mode .app-sidebar,
  body.is-demo-preview .app-sidebar {

    min-height: 0;
  }
}
.ob-content-logo.m-logo{display:none;}
@media (max-width: 767px){
.ob-shell{display:block;}
.ob-content-logo.desktop-logo {display: none;}
.ob-content-logo.m-logo{display:block;}
.ob-visual-inner-auth {max-width: 100%;padding: 0;}
.ob-auth-promo-list{grid-template-columns: 1fr;}
.ob-footnote{text-align:center;}
.ob-actions.forgot-pass {flex-direction: row;}
}
