/* PULSiA — shell del panel (layout fiel: topbar + sidebar + contenido) */
body.app { background: #f5f4f9; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.appbar {
  display: flex; align-items: center; gap: 14px; padding: 9px 18px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.logo { font-weight: 900; font-size: 26px; letter-spacing: -0.04em; color: var(--ink); font-style: italic; text-decoration: none; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 16px; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: #f6f5fb; }
.appbar-center { display: flex; align-items: center; gap: 10px; margin: 0 auto; }
.usage-pill {
  display: flex; align-items: center; gap: 10px; background: #fbfbfe; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 14px 5px 8px; font-size: 12px;
}
.usage-pill strong { display: block; font-size: 12px; }
.usage-pill span.sub { color: var(--muted); font-size: 11px; }
.usage-dot { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #d8fff4, #00c896); flex: 0 0 28px; }
.appbar-right { display: flex; align-items: center; gap: 8px; }
.lang-pill { background: #ffe3e9; color: #b11334; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 700; border: 0; cursor: pointer; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }

.app-body { display: flex; flex: 1; align-items: flex-start; gap: 18px; padding: 18px; max-width: 1420px; margin: 0 auto; width: 100%; }

.sidebar { width: 232px; flex: 0 0 232px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 74px; }
.biz-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.biz-name { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; gap: 8px; }
.biz-name .edit { color: var(--muted); font-size: 12px; }
.biz-id { font-size: 11px; color: var(--muted); margin-top: 6px; }
.nav { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  border: 0; background: transparent; text-align: left; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.nav-item:hover { background: #f4f3fa; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item .ico { width: 18px; text-align: center; opacity: .85; }
.guide-card {
  display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px; cursor: pointer; text-align: left;
}
.guide-card .ico { width: 28px; height: 28px; border-radius: 50%; background: #ffe3e9; color: #b11334; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 28px; }
.guide-card strong { display: block; font-size: 13px; }
.guide-card span { font-size: 11px; color: var(--muted); }

.page { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h1 { font-size: 26px; margin: 0; }
.section-head p { margin: 3px 0 0; font-size: 13px; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--ink); color: #fff; }

.dash-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.dash-grid.two { grid-template-columns: 1fr 1fr; }
.kpi-col { display: flex; flex-direction: column; gap: 16px; }

.kpi-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi-card .label { font-size: 13px; font-weight: 700; }
.kpi-card .sub { font-size: 12px; color: var(--muted); }
.kpi-card .value { font-size: 38px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.05; }
.kpi-card .prev { font-size: 11px; color: var(--muted); }

.chart-card h3 { margin-bottom: 2px; font-size: 16px; }
.chart-card .muted { margin: 0 0 12px; }
.hist { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 18px; }
.hist .bar { flex: 1; background: linear-gradient(180deg, #c9c2ff, #5b4bff); border-radius: 6px 6px 0 0; min-height: 3px; position: relative; }
.hist .bar span { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); }
.hist-labels { display: flex; gap: 6px; margin-top: 6px; }
.hist-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--muted); }
.tip { font-size: 11px; color: var(--muted); margin-top: 12px; }

.big-stat { display: flex; gap: 28px; }
.big-stat .n { font-size: 30px; font-weight: 900; line-height: 1.1; }
.big-stat .l { font-size: 12px; color: var(--muted); }
.rate { margin-top: 14px; }
.rate .bar { height: 8px; background: #ecebf4; border-radius: 99px; overflow: hidden; }
.rate .bar div { height: 100%; background: var(--mint); }

.tabs2 { display: flex; gap: 20px; border-bottom: 1px solid var(--line); }
.tabs2 button { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 10px 2px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tabs2 button.active { color: var(--accent); border-bottom-color: var(--accent); }

.stampcards { display: flex; flex-direction: column; gap: 14px; }
.stampcard-row { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.previews { display: flex; gap: 10px; }
.preview { flex: 1; border-radius: 12px; border: 1px solid var(--line); padding: 10px; font-size: 11px; background: #fbfbfe; }
.preview .pv-name { font-weight: 800; font-size: 12px; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview .pv-dots { display: grid; gap: 4px; }
.preview .pv-dot { aspect-ratio: 1; border-radius: 50%; border: 1px dashed #c9c8d8; }
.preview .pv-dot.on { background: var(--accent); border: 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card-actions .btn, .card-actions button { font-size: 12px; padding: 7px 12px; }

.toggle { position: relative; width: 44px; height: 24px; border-radius: 99px; background: #d9d8e6; cursor: pointer; border: 0; flex: 0 0 44px; }
.toggle.on { background: var(--accent); }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on::after { left: 23px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; }
.field label { margin: 0 0 6px; }
.field .hint { margin: 4px 0 0; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(18, 19, 26, .45); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 100; }
.modal { background: #fff; border-radius: 18px; width: min(720px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.modal.wide { width: min(1000px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }

.wiz { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.wiz-steps { display: flex; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.wiz-steps span { font-size: 11px; color: var(--muted); padding: 4px 8px; border-radius: 99px; border: 1px solid var(--line); }
.wiz-steps span.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.wiz-steps span.done { background: var(--accent-soft); color: var(--accent); }
.wiz-preview { position: sticky; top: 10px; align-self: start; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.badge.on { background: #d8fff4; color: #057a5c; }
.badge.off { background: #ffe3e9; color: #b11334; }
.badge.gray { background: #ecebf4; color: #5b5b6b; }

.info-box { background: #f4f3fa; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 12px; color: #4a4a5a; }
.warn-box { background: #fff6e0; border: 1px solid #ffe0a3; border-radius: 12px; padding: 12px 14px; font-size: 12px; color: #7a5a00; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.warn-box button { flex: 0 0 auto; }

.onb { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.onb-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.onb-steps { display: flex; gap: 12px; flex-wrap: wrap; }
.onb-step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.onb-step .chk { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 11px; flex: 0 0 20px; }
.onb-step.done .chk { background: var(--mint); border-color: var(--mint); color: #04382c; }
.onb-step.done { color: var(--ink); }
.steps-line { display: flex; gap: 6px; flex: 1; max-width: 220px; }
.steps-line .seg { height: 6px; border-radius: 99px; background: #e6e5f0; flex: 1; }
.steps-line .seg.done { background: var(--mint); }

.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.mode { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.mode .emoji { font-size: 26px; }
.mode h3 { margin: 0; font-size: 15px; }
.mode p { margin: 0; font-size: 12px; color: var(--muted); }

.settings-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.settings-row h3 { margin: 0 0 2px; font-size: 14px; }
.settings-row p { margin: 0; font-size: 12px; color: var(--muted); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.plan { border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.plan.current { border: 2px solid var(--accent); }
.plan .price { font-size: 32px; font-weight: 900; letter-spacing: -.03em; }
.plan ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
.plan table { width: 100%; font-size: 12px; border-collapse: collapse; }
.plan table td { padding: 3px 0; border-bottom: 1px dashed var(--line); }

.mega { font-size: 44px; font-weight: 900; letter-spacing: -.04em; }
.center-block { text-align: center; padding: 30px; }

@media (max-width: 900px) {
  .app-body { flex-direction: column; padding: 12px; }
  .sidebar { position: static; width: 100%; flex: auto; flex-direction: row; flex-wrap: wrap; }
  .nav { flex-direction: row; flex-wrap: wrap; flex: 1; }
  .nav-item { font-size: 12px; padding: 8px 10px; }
  .dash-grid, .dash-grid.two, .stampcard-row, .wiz { grid-template-columns: 1fr; }
  .appbar-center { display: none; }
}
