/* ============================================================
   Tavo — App shell + pages + operator + onboarding + upgrade
   ============================================================ */

/* ---------------- Shell ---------------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; background: var(--bg); }
.impersonating .app-shell { min-height: calc(100vh - 44px); }

.sidebar {
  grid-row: 1; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.impersonating .sidebar { height: calc(100vh - 44px); top: 44px; }
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: var(--sp-4) var(--sp-4) var(--sp-3); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #C4472F, var(--brand-600)); display: grid; place-items: center; color: #FAF6F0; flex: none; box-shadow: 0 2px 6px rgba(138,44,27,.3); }
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -.02em; }

.ws-switch {
  margin: 0 var(--sp-3) var(--sp-3); padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; width: calc(100% - var(--sp-3) * 2); text-align: left;
  transition: background var(--t-fast), border-color var(--t-fast); background: var(--surface);
}
.ws-switch:hover { background: var(--stone-75); border-color: var(--border-strong); }
.ws-switch__mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: var(--fw-bold); font-size: 13px; flex: none; }
.ws-switch__meta { min-width: 0; flex: 1; }
.ws-switch__name { font-weight: var(--fw-semibold); font-size: var(--fs-base); }
.ws-switch__sub { font-size: var(--fs-xs); color: var(--text-3); display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.ws-switch__chev { color: var(--text-3); flex: none; }

.nav { padding: var(--sp-2) var(--sp-3); display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav__label { font-size: 10px; font-weight: var(--fw-semibold); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: var(--sp-4) 10px var(--sp-1); }
.nav__item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: var(--fw-medium); font-size: var(--fs-base);
  transition: background var(--t-fast), color var(--t-fast); position: relative;
}
.nav__item:hover { background: var(--stone-75); color: var(--text); }
.nav__item.is-active { background: var(--brand-50); color: var(--brand-700); }
.nav__item.is-active .nav__icon { color: var(--brand); }
.nav__icon { color: var(--text-3); flex: none; display: flex; }
.nav__item.is-active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--brand); }
.nav__badge { margin-left: auto; }

.sidebar__foot { padding: var(--sp-3); border-top: 1px solid var(--border); }
.usage-mini { padding: 12px; border-radius: var(--r); background: var(--stone-75); border: 1px solid var(--border); }
.usage-mini__top { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-2); margin-bottom: 7px; }
.usage-mini__val { font-weight: var(--fw-semibold); color: var(--text); font-variant-numeric: tabular-nums; }
.usage-mini__cta { margin-top: 11px; }

.op-link { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r-sm); color: var(--text-2); font-weight: var(--fw-medium); font-size: var(--fs-base); transition: background var(--t-fast); margin-top: 2px; }
.op-link:hover { background: var(--stone-75); color: var(--text); }
.op-link svg { color: var(--data); }

/* Topbar */
.main { grid-column: 2; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: var(--z-sticky);
  background: rgba(255,255,255,.85); backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-5);
}
.impersonating .topbar { top: 44px; }
.topbar__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -.01em; }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: var(--sp-2); }
.icon-btn { width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text-2); transition: background var(--t-fast), color var(--t-fast); }
.icon-btn:hover { background: var(--stone-150); color: var(--text); }
.menu-btn { display: none; }

.avatar-btn { border-radius: var(--r-full); transition: box-shadow var(--t-fast); }
.avatar-btn:hover { box-shadow: 0 0 0 3px var(--stone-150); }

/* Content */
.content { max-width: var(--content-max); margin: 0 auto; width: 100%; padding: var(--sp-6) var(--sp-5) var(--sp-9); }
.page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.page__title { font-size: var(--fs-2xl); letter-spacing: -.02em; }
.page__sub { color: var(--text-3); margin-top: 4px; font-size: var(--fs-base); }
.page__actions { display: flex; align-items: center; gap: var(--sp-2); }

/* Dropdown menu (shared) */
.pop { position: absolute; z-index: var(--z-drawer); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; min-width: 220px; animation: pop-in var(--t-fast) var(--ease-out); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.pop__item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); font-size: var(--fs-base); color: var(--text); width: 100%; text-align: left; transition: background var(--t-fast); }
.pop__item:hover { background: var(--stone-75); }
.pop__item.is-current { background: var(--brand-50); }
.pop__item svg { color: var(--text-3); }
.pop__sep { height: 1px; background: var(--border); margin: 5px 4px; }
.pop__label { font-size: 10px; font-weight: var(--fw-semibold); letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px 4px; }
.pop__danger { color: var(--danger-700); } .pop__danger svg { color: var(--danger); }

/* ---------------- Stat cards ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); }
.stat__label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-3); font-weight: var(--fw-medium); }
.stat__label svg { color: var(--stone-400); width: 17px; height: 17px; }
.stat__value { font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -.02em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat__delta { font-size: var(--fs-sm); margin-top: 4px; display: flex; align-items: center; gap: 4px; color: var(--text-3); }
.stat__delta.up { color: var(--success-700); } .stat__delta.down { color: var(--danger-700); }
.stat__delta svg { width: 15px; height: 15px; }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--sp-4); margin-top: var(--sp-4); align-items: start; }

/* Activity */
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-item__dot { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--stone-100); color: var(--text-3); }
.activity-item__dot svg { width: 16px; height: 16px; }
.activity-item__dot.billing { background: var(--brand-50); color: var(--brand); }
.activity-item__dot.member { background: var(--data-50); color: var(--data); }
.activity-item__body { min-width: 0; }
.activity-item__text { font-size: var(--fs-base); line-height: 1.4; }
.activity-item__time { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }

/* Attention list & quick actions */
.mini-proj { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.mini-proj:last-child { border-bottom: none; }
.mini-proj__body { min-width: 0; flex: 1; }
.mini-proj__name { font-weight: var(--fw-medium); font-size: var(--fs-base); }
.mini-proj__sub { font-size: var(--fs-xs); color: var(--text-3); }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-action { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); text-align: left; transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
.quick-action:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.quick-action:active { transform: translateY(1px); }
.quick-action svg { color: var(--brand); }
.quick-action span { font-weight: var(--fw-medium); font-size: var(--fs-base); }

/* ---------------- Projects ---------------- */
.toolbar { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.toolbar__search { position: relative; flex: 1; min-width: 180px; max-width: 320px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.st-new { background: var(--stone-400); } .st-inProgress { background: var(--info); }
.st-review { background: var(--warning); } .st-done { background: var(--success); }

.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); align-items: start; }
.kanban__col { background: var(--stone-75); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px; min-height: 120px; transition: background var(--t-fast), border-color var(--t-fast); }
.kanban__col.is-drop { background: var(--brand-50); border-color: var(--brand-200); border-style: dashed; }
.kanban__head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.kanban__count { margin-left: auto; color: var(--text-3); font-weight: var(--fw-medium); background: var(--surface); border-radius: 999px; padding: 1px 8px; font-size: var(--fs-xs); }
.kanban__list { display: flex; flex-direction: column; gap: 8px; }
.proj-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; cursor: grab; transition: box-shadow var(--t-fast), border-color var(--t-fast), transform var(--t-fast); }
.proj-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.proj-card.dragging { opacity: .5; }
.proj-card__top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.proj-card__title { font-weight: var(--fw-semibold); font-size: var(--fs-base); line-height: 1.3; }
.proj-card__client { font-size: var(--fs-xs); color: var(--text-3); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.proj-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 11px; }
.proj-card__value { font-weight: var(--fw-semibold); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.pr-flag { font-size: 10px; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 5px; }
.pr-high { background: var(--danger-50); color: var(--danger-700); }
.pr-medium { background: var(--warning-50); color: var(--warning-700); }
.pr-low { background: var(--stone-150); color: var(--text-3); }
.due-soon { color: var(--danger-700); }

/* ---------------- Usage ---------------- */
.usage-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
.usage-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-5); }
.usage-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.usage-card__name { display: flex; align-items: center; gap: 9px; font-weight: var(--fw-semibold); }
.usage-card__name svg { color: var(--text-3); }
.usage-card__nums { font-variant-numeric: tabular-nums; font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.usage-card__nums small { font-weight: var(--fw-medium); color: var(--text-3); font-size: var(--fs-sm); }
.usage-card__hint { font-size: var(--fs-sm); color: var(--text-3); margin-top: 10px; }
.usage-card.warn { border-color: var(--warning); } .usage-card.full { border-color: var(--brand-200); background: var(--brand-50); }

/* ---------------- Billing / pricing cards ---------------- */
.cycle-toggle { display: inline-flex; align-items: center; gap: 12px; }
.save-badge { font-size: var(--fs-xs); }
.plan-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); align-items: stretch; }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--sp-5); display: flex; flex-direction: column; position: relative; transition: box-shadow var(--t), border-color var(--t), transform var(--t); }
.plan-card--rec { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow-md); }
.plan-card__rec { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: var(--fs-xs); font-weight: var(--fw-semibold); padding: 4px 12px; border-radius: 999px; letter-spacing: .02em; }
.plan-card__name { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.plan-card__tag { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; }
.plan-card__price { margin: var(--sp-4) 0 2px; display: flex; align-items: baseline; gap: 6px; }
.plan-card__amt { font-size: var(--fs-3xl); font-weight: var(--fw-bold); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan-card__per { color: var(--text-3); font-size: var(--fs-base); }
.plan-card__eq { font-size: var(--fs-sm); color: var(--text-3); min-height: 20px; }
.plan-card__list { display: flex; flex-direction: column; gap: 10px; margin: var(--sp-5) 0; flex: 1; }
.plan-card__feat { display: flex; gap: 9px; font-size: var(--fs-base); align-items: flex-start; }
.plan-card__feat svg { color: var(--success); flex: none; margin-top: 2px; width: 17px; height: 17px; }
.plan-card.is-current { background: var(--stone-75); }
.current-flag { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-3); text-align: center; padding: 10px; }

.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.summary-item { padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.summary-item__label { font-size: var(--fs-sm); color: var(--text-3); }
.summary-item__value { font-size: var(--fs-lg); font-weight: var(--fw-semibold); margin-top: 3px; }

/* Invoice PDF preview layout */
.inv-doc { background: #fff; color: #1C1A17; padding: 40px; font-size: 13px; }
.inv-doc h1 { font-size: 22px; }

/* ---------------- Upgrade wall + checkout ---------------- */
.uw-hero { text-align: center; padding: var(--sp-2) 0 var(--sp-4); }
.uw-hero__icon { width: 56px; height: 56px; border-radius: var(--r-lg); background: linear-gradient(135deg, #C4472F, var(--brand-700)); color: #fff; display: grid; place-items: center; margin: 0 auto var(--sp-3); box-shadow: var(--shadow-md); }
.uw-hero__icon svg { width: 28px; height: 28px; }
.uw-usage { background: var(--stone-75); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; margin-bottom: var(--sp-4); }
.uw-usage__top { display: flex; justify-content: space-between; font-size: var(--fs-sm); margin-bottom: 8px; }
.uw-compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.uw-plan { border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.uw-plan--to { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand-200); background: var(--brand-50); }
.uw-plan__name { font-weight: var(--fw-bold); display: flex; align-items: center; justify-content: space-between; }
.uw-plan__price { font-size: var(--fs-xl); font-weight: var(--fw-bold); margin: 6px 0 12px; }
.uw-plan__list { display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sm); }
.uw-plan__list div { display: flex; gap: 7px; }
.uw-plan__list svg { flex: none; width: 15px; height: 15px; }
.uw-plan--to .uw-plan__list svg { color: var(--brand); }
.uw-plan--from .uw-plan__list svg { color: var(--stone-400); }

.demo-note { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-2); background: var(--info-50); border: 1px solid #cfe0f0; padding: 9px 12px; border-radius: var(--r-sm); }
.demo-note svg { color: var(--info); flex: none; }

.pay-tabs { display: flex; gap: 8px; margin-bottom: var(--sp-4); }
.pay-tab { flex: 1; border: 1px solid var(--border-strong); border-radius: var(--r); padding: 13px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: var(--fw-medium); font-size: var(--fs-sm); transition: border-color var(--t-fast), background var(--t-fast); }
.pay-tab[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand); }
.pay-tab svg { width: 22px; height: 22px; }
.blik-input { letter-spacing: .5em; text-align: center; font-size: var(--fs-xl); font-weight: var(--fw-semibold); }
.order-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: var(--fs-base); }
.order-row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; font-weight: var(--fw-bold); font-size: var(--fs-lg); }

.pay-processing { text-align: center; padding: var(--sp-7) var(--sp-4); }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--stone-200); border-top-color: var(--brand); margin: 0 auto var(--sp-4); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pay-success { text-align: center; padding: var(--sp-5) var(--sp-4); }
.success-check { width: 66px; height: 66px; border-radius: 50%; background: var(--success-50); color: var(--success); display: grid; place-items: center; margin: 0 auto var(--sp-4); animation: pop-check var(--t-slow) var(--ease-out); }
.success-check svg { width: 34px; height: 34px; }
@keyframes pop-check { from { transform: scale(.6); opacity: 0; } }

/* ---------------- Welcome ---------------- */
.welcome { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: var(--sp-4); background: rgba(19,18,16,.45); backdrop-filter: blur(3px); animation: overlay-in var(--t) forwards; }
.welcome__card { background: var(--surface); border-radius: var(--r-2xl); box-shadow: var(--shadow-xl); max-width: 500px; width: 100%; overflow: hidden; transform: translateY(12px) scale(.98); opacity: 0; animation: modal-in var(--t-slow) var(--ease-out) forwards; }
.welcome__top { padding: var(--sp-6) var(--sp-6) var(--sp-4); }
.welcome__badge { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--brand-700); background: var(--brand-50); padding: 5px 11px; border-radius: 999px; }
.welcome__title { font-size: var(--fs-2xl); margin: var(--sp-3) 0 8px; letter-spacing: -.02em; }
.welcome__text { color: var(--text-2); line-height: 1.55; }
.welcome__actions { padding: 0 var(--sp-6) var(--sp-4); display: flex; flex-direction: column; gap: 9px; }
.welcome-action { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--r); text-align: left; transition: border-color var(--t-fast), background var(--t-fast); }
.welcome-action:hover { border-color: var(--brand-200); background: var(--brand-50); }
.welcome-action__ic { width: 36px; height: 36px; border-radius: 9px; background: var(--stone-100); color: var(--brand); display: grid; place-items: center; flex: none; }
.welcome-action__t { font-weight: var(--fw-semibold); font-size: var(--fs-base); }
.welcome-action__d { font-size: var(--fs-xs); color: var(--text-3); }
.welcome-action__arrow { margin-left: auto; color: var(--text-3); }
.welcome__foot { padding: var(--sp-4) var(--sp-6); background: var(--surface-2); display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); }

/* ---------------- Impersonation banner ---------------- */
.impersonation-banner { position: fixed; top: 0; left: 0; right: 0; height: 44px; z-index: var(--z-toast); background: var(--stone-900); color: #fff; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: var(--fs-sm); padding: 0 var(--sp-4); }
.impersonation-banner strong { font-weight: var(--fw-semibold); }
.impersonation-banner .btn { height: 30px; }

/* ---------------- Operator panel ---------------- */
.op-shell { min-height: 100vh; background: var(--stone-950); color: var(--text-inverse); }
.op-shell.on-dark { background: #17150F; }
.op-top { position: sticky; top: 0; z-index: var(--z-sticky); background: rgba(23,21,15,.85); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-6); height: var(--topbar-h); }
.op-top__brand { display: flex; align-items: center; gap: 10px; font-weight: var(--fw-bold); }
.op-top__brand .brand-mark { background: linear-gradient(135deg, #1F7A73, #196861); box-shadow: none; }
.op-badge { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: #8FE0D8; background: rgba(31,122,115,.18); padding: 4px 10px; border-radius: 999px; }
.op-content { max-width: 1240px; margin: 0 auto; padding: var(--sp-6); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.metric { background: #221F18; border: 1px solid rgba(255,255,255,.07); border-radius: var(--r-lg); padding: var(--sp-4); }
.metric--hero { grid-column: span 2; background: linear-gradient(135deg, #2A2620, #221F18); }
.metric__label { font-size: var(--fs-sm); color: #A79F94; display: flex; align-items: center; gap: 7px; }
.metric__value { font-size: var(--fs-3xl); font-weight: var(--fw-bold); letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.metric--hero .metric__value { font-size: var(--fs-4xl); }
.metric__delta { font-size: var(--fs-sm); color: #6EDBA6; display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.metric__delta svg { width: 15px; height: 15px; }
.op-card { background: #221F18; border: 1px solid rgba(255,255,255,.07); border-radius: var(--r-lg); padding: var(--sp-5); }
.op-card__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); margin-bottom: var(--sp-4); display: flex; align-items: center; justify-content: space-between; }
.op-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--sp-4); margin-top: var(--sp-4); align-items: start; }
.op-chart { width: 100%; height: 240px; }
.dist-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dist-row__label { width: 78px; font-size: var(--fs-sm); color: #C4BCB1; }
.dist-row__track { flex: 1; height: 10px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.dist-row__fill { height: 100%; border-radius: 999px; }
.dist-row__val { width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.op-table { width: 100%; border-collapse: collapse; }
.op-table th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: #97907F; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.op-table td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: var(--fs-sm); }
.op-table tr.is-clickable { cursor: pointer; }
.op-table tr.is-clickable:hover td { background: rgba(255,255,255,.03); }
.op-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: var(--fs-sm); padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); color: #C4BCB1; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.chip[aria-pressed="true"] { background: rgba(31,122,115,.2); border-color: var(--data); color: #8FE0D8; }
.tstat { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); padding: 3px 9px; border-radius: 999px; }
.tstat--active { background: rgba(46,125,91,.18); color: #6EDBA6; }
.tstat--trial { background: rgba(47,109,176,.2); color: #8FC0F0; }
.tstat--past_due { background: rgba(180,122,22,.2); color: #E4B75F; }
.tstat--canceled { background: rgba(255,255,255,.08); color: #97907F; }

/* ---------------- Onboarding ---------------- */
.onb { min-height: 100vh; display: grid; grid-template-columns: 400px 1fr; }
.onb__aside { background: var(--stone-900); color: var(--text-inverse); padding: var(--sp-7) var(--sp-6); display: flex; flex-direction: column; }
.onb__aside.on-dark { }
.onb__brand { display: flex; align-items: center; gap: 10px; font-weight: var(--fw-bold); font-size: var(--fs-lg); }
.onb-steps { margin-top: var(--sp-8); display: flex; flex-direction: column; gap: 4px; }
.onb-step { display: flex; align-items: center; gap: 14px; padding: 11px 0; color: #97907F; transition: color var(--t); }
.onb-step.is-active { color: #fff; }
.onb-step.is-done { color: #C4BCB1; }
.onb-step__num { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.2); display: grid; place-items: center; font-size: var(--fs-sm); font-weight: var(--fw-semibold); flex: none; transition: all var(--t); }
.onb-step.is-active .onb-step__num { background: var(--brand); border-color: var(--brand); }
.onb-step.is-done .onb-step__num { background: var(--success); border-color: var(--success); color: #fff; }
.onb__main { padding: var(--sp-8) var(--sp-7); display: flex; flex-direction: column; overflow-y: auto; }
.onb__body { max-width: 460px; margin: auto; width: 100%; }
.onb-progress { height: 3px; background: var(--stone-200); border-radius: 999px; overflow: hidden; margin-bottom: var(--sp-7); }
.onb-progress__bar { height: 100%; background: var(--brand); border-radius: 999px; transition: width var(--t-slow) var(--ease-out); }
.onb-title { font-size: var(--fs-2xl); letter-spacing: -.02em; }
.onb-sub { color: var(--text-3); margin-top: 6px; margin-bottom: var(--sp-6); }
.onb-actions { display: flex; justify-content: space-between; margin-top: var(--sp-6); gap: var(--sp-3); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { border: 1px solid var(--border-strong); border-radius: var(--r); padding: 14px; text-align: left; display: flex; gap: 11px; align-items: center; transition: border-color var(--t-fast), background var(--t-fast); }
.choice:hover { border-color: var(--brand-200); }
.choice.is-sel { border-color: var(--brand); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand); }
.choice__ic { color: var(--brand); flex: none; }
.invite-row { display: flex; gap: 8px; margin-bottom: 8px; }

/* ---------------- Demo mode panel ---------------- */
.demo-fab { position: fixed; bottom: 18px; left: 18px; z-index: var(--z-drawer); }
.demo-fab__btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--stone-900); color: #fff; font-size: var(--fs-sm); font-weight: var(--fw-medium); box-shadow: var(--shadow-lg); transition: transform var(--t-fast); }
.demo-fab__btn:hover { transform: translateY(-1px); }
.demo-fab__btn .dot { width: 7px; height: 7px; border-radius: 50%; background: #6EDBA6; box-shadow: 0 0 0 3px rgba(110,219,166,.25); }
.demo-panel { position: fixed; bottom: 66px; left: 18px; z-index: var(--z-drawer); width: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xl); padding: var(--sp-4); animation: pop-in var(--t-fast) var(--ease-out); }
.demo-panel__title { font-weight: var(--fw-semibold); display: flex; align-items: center; gap: 8px; }
.demo-panel__text { font-size: var(--fs-sm); color: var(--text-3); margin: 4px 0 var(--sp-4); line-height: 1.5; }
.demo-panel__actions { display: flex; flex-direction: column; gap: 8px; }

/* ---------------- Payment method ---------------- */
.pay-method { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.pay-method__info { display: flex; align-items: center; gap: var(--sp-3); }
.pay-method__brand { width: 46px; height: 32px; border-radius: 7px; background: linear-gradient(135deg, var(--stone-800), var(--stone-600)); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.pay-method__label { font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.pay-method__meta { font-size: var(--fs-sm); color: var(--text-3); }

/* ---------------- Guided tour ---------------- */
.tour { position: fixed; inset: 0; z-index: var(--z-modal); }
.tour-blocker { position: absolute; inset: 0; }
.tour-spot { position: fixed; border-radius: var(--r); box-shadow: 0 0 0 9999px rgba(19,18,16,.62); outline: 2px solid var(--brand); outline-offset: 0; transition: all var(--t-slow) var(--ease-out); pointer-events: none; }
.tour-tip { position: fixed; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-xl); padding: var(--sp-4); animation: pop-in var(--t) var(--ease-out); }
.tour-tip__step { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--brand); letter-spacing: .03em; text-transform: uppercase; }
.tour-tip__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); margin: 6px 0 6px; }
.tour-tip__text { font-size: var(--fs-base); color: var(--text-2); line-height: 1.5; }
.tour-tip__dots { display: flex; gap: 5px; margin: var(--sp-4) 0 var(--sp-3); }
.tour-tip__dots span { width: 6px; height: 6px; border-radius: 999px; background: var(--stone-300); transition: all var(--t); }
.tour-tip__dots span.on { width: 18px; background: var(--brand); }
.tour-tip__actions { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }

/* View enter animation (route/workspace change) */
.content.is-enter { animation: view-enter var(--t-slow) var(--ease-out); }
@keyframes view-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.op-content.is-enter { animation: view-enter var(--t-slow) var(--ease-out); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: 1fr; }
  .op-grid { grid-template-columns: 1fr; }
  .metric--hero { grid-column: span 2; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: var(--z-drawer); width: 280px; transform: translateX(-100%); transition: transform var(--t) var(--ease); box-shadow: var(--shadow-xl); }
  .sidebar.is-open { transform: translateX(0); }
  .impersonating .sidebar { top: 44px; }
  .main { grid-column: 1; }
  .menu-btn { display: grid; }
  .drawer-scrim { position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); background: rgba(19,18,16,.4); animation: overlay-in var(--t) forwards; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-cards { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .usage-grid { grid-template-columns: 1fr; }
  .onb { grid-template-columns: 1fr; }
  .onb__aside { display: none; }
  .content { padding: var(--sp-5) var(--sp-4) var(--sp-9); }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric--hero { grid-column: span 1; }
  .summary-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .uw-compare { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 var(--sp-4); }
  .modal__foot { flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
}
