/* Личный кабинет — styles */

.lk {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  min-height: calc(100vh - 60px);
  background: var(--bg-sunken);
}

/* ── Sidebar ─────────────────────────── */
.lk-side {
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex; flex-direction: column;
  gap: 16px;
  position: sticky; top: 60px;
  align-self: start;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.lk-side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--line);
}
.lk-side-section {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 0 6px;
}
.lk-nav { display: flex; flex-direction: column; gap: 1px; }
.lk-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  background: transparent;
  border: 0;
  text-align: left;
  color: var(--text-mid);
  font-size: 13.5px;
  font-weight: 500;
}
.lk-nav-item:hover { background: var(--bg-sunken); color: var(--text); }
.lk-nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}
.lk-nav-label { flex: 1; }
.lk-nav-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  background: var(--bg-sunken);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: lowercase;
}
.tag-free { background: var(--text); color: var(--bg); }
.lk-side-foot { margin-top: auto; }
.lk-side-help {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

/* ── Header ─────────────────────────── */
.lk-main {
  min-width: 0;
}
.lk-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.lk-crumbs {
  display: flex; gap: 6px;
  font-size: 12.5px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}
.lk-h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.025em;
}
.lk-head-actions {
  display: flex; align-items: center; gap: 10px;
}
.lk-head-status { margin-right: 8px; }

.lk-content { padding: 24px 32px 48px; background: var(--bg); min-height: 100%; }

/* ── Empty state ─────────────────────────── */
.lk-empty {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  padding-top: 8px;
}
.lk-empty-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex; flex-direction: column; gap: 18px;
}
.lk-empty-eyebrow { display: flex; align-items: center; gap: 16px; }
.upload {
  margin-top: 8px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
}
.upload-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--accent-text);
}
.lk-empty-helper {
  font-size: 13.5px;
  color: var(--text-mid);
  display: inline-flex; align-items: center; gap: 4px;
}
.link {
  color: var(--accent-text);
  font-weight: 600;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.lk-empty-steps {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.emp-step {
  display: flex; gap: 14px;
  padding: 18px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.emp-step.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.emp-step-n {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--bg-sunken); color: var(--text-mute);
  border-radius: 999px;
  font-weight: 700;
  flex-shrink: 0;
}
.is-active .emp-step-n { background: var(--accent); color: white; }
.emp-step-t { font-weight: 600; font-size: 14.5px; }
.emp-step-d { font-size: 13px; color: var(--text-mute); margin-top: 2px; }

/* ── Result: summary cards ─────────────────────────── */
.lk-result { display: flex; flex-direction: column; gap: 18px; }
.lk-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 14px;
}
.src {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.src-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.src-title { font-weight: 600; font-size: 14px; }
.src-sub { font-size: 12px; color: var(--text-mute); }
.src-meta { font-size: 11.5px; color: var(--text-mute); }
.src-count { display: flex; align-items: baseline; gap: 10px; margin-top: auto; }
.src-num { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.025em; }
.src-label { font-size: 12.5px; color: var(--text-mute); max-width: 130px; line-height: 1.3; }

.bignum {
  background: linear-gradient(135deg, oklch(28% 0.06 252) 0%, oklch(18% 0.04 252) 100%);
  color: white;
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
  overflow: hidden;
}
.bignum::after {
  content: "";
  position: absolute;
  right: -40px; bottom: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, oklch(72% 0.16 252 / 0.25), transparent 70%);
}
.bignum-head { display: flex; justify-content: space-between; align-items: center; position: relative; }
.bignum-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 92px;
  line-height: 0.9;
  letter-spacing: -0.045em;
  position: relative;
}
.bignum-sub { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: -8px; position: relative; }
.bignum-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; position: relative; }
.bn-bar { display: flex; flex-direction: column; gap: 4px; }
.bn-bar-row { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255,255,255,0.8); }
.bn-bar-track { height: 4px; background: rgba(255,255,255,0.12); border-radius: 999px; overflow: hidden; }
.bn-bar-fill { height: 100%; border-radius: 999px; }

/* ── Detail card / table ─────────────────────────── */
.lk-detail-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.lk-detail-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  padding: 22px 22px 16px;
}
.lk-detail-tabs { display: flex; gap: 4px; background: var(--bg-sunken); padding: 4px; border-radius: 999px; }
.lk-tab {
  border: 0; background: transparent;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-mute);
  padding: 6px 12px;
  border-radius: 999px;
}
.lk-tab.is-active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 10px 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunken);
}
.tbl td {
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl-action { color: var(--text-mid); font-size: 13px; }
.tbl-blur td { filter: blur(5px); user-select: none; opacity: 0.55; }

/* ── Paywall ─────────────────────────── */
.paywall {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, var(--accent-soft) 40%);
  position: relative;
  margin-top: -90px;
  padding-top: 90px;
}
.paywall-inner {
  margin: 0 22px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  color: var(--accent-text);
}
.paywall-inner > svg { color: var(--accent); }
.paywall-cta { display: flex; align-items: center; gap: 16px; }
.paywall-price { display: flex; flex-direction: column; align-items: flex-end; }
.paywall-amount { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.025em; color: var(--text); }
.paywall-period { font-size: 12px; color: var(--text-mute); }
.paywall-foot {
  display: flex; gap: 24px; flex-wrap: wrap;
  padding: 16px 22px 22px;
  font-size: 12.5px; color: var(--text-mid);
}
.paywall-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* ── Phone companion column ─────────────────────────── */
.phone-dock {
  background: var(--bg-tint);
  border-left: 1px solid var(--line);
  padding: 24px 22px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 60px;
  align-self: start;
  height: calc(100vh - 60px);
  overflow: hidden;
}
.phone-dock-label { padding-bottom: 6px; }

/* iPhone */
.pf {
  width: 264px;
  height: 540px;
  margin: 0 auto;
  background: linear-gradient(135deg, #2a2c2f, #0e0f10);
  border-radius: 42px;
  padding: 11px;
  box-shadow:
    0 0 0 1.5px #2a2c2f,
    0 30px 60px -20px rgba(0,0,0,0.35),
    0 6px 18px rgba(0,0,0,0.15);
  position: relative;
}
.pf-notch {
  position: absolute;
  top: 22px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 26px;
  background: #0e0f10;
  border-radius: 999px;
  z-index: 2;
}
.pf-screen {
  width: 100%; height: 100%;
  border-radius: 32px;
  background: #17191b;
  color: #f3f3f0;
  padding: 16px 14px 10px;
  display: flex; flex-direction: column; gap: 8px;
  overflow: hidden;
  position: relative;
}
.pf-status {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 600;
  padding: 0 8px 4px;
}
.pf-top { display: flex; align-items: center; gap: 8px; padding-top: 18px; }
.pf-back { background: transparent; border: 0; color: oklch(72% 0.16 252); font-size: 12px; padding: 0; }
.pf-title { font-size: 12px; font-weight: 600; }
.pf-counter {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 4px 4px 0;
}
.pf-count { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.pf-count-sub { font-size: 10.5px; color: #898a86; margin-top: -2px; }
.pf-sync {
  font-size: 10.5px; color: #c5c6c2;
  display: inline-flex; align-items: center; gap: 6px;
  padding-bottom: 4px;
}
.pf-sync-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: oklch(70% 0.16 155);
  box-shadow: 0 0 6px oklch(70% 0.16 155 / 0.8);
}
.pf-viewfinder {
  position: relative;
  height: 168px;
  border-radius: 14px;
  background: repeating-linear-gradient(45deg, #1d1f22 0 6px, #17191b 6px 12px);
  overflow: hidden;
}
.pf-corner {
  position: absolute; width: 20px; height: 20px;
  border: 2px solid oklch(72% 0.16 252);
}
.pf-corner.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.pf-corner.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; border-top-right-radius: 6px; }
.pf-corner.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; border-bottom-left-radius: 6px; }
.pf-corner.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }
.pf-scanline {
  position: absolute; left: 14px; right: 14px;
  height: 2px; background: oklch(72% 0.16 252);
  box-shadow: 0 0 12px oklch(72% 0.16 252 / 0.6);
  animation: pfscan 2.6s ease-in-out infinite;
}
@keyframes pfscan {
  0%, 100% { top: 18px; opacity: 0.5; }
  50% { top: calc(100% - 22px); opacity: 1; }
}
.pf-dm {
  position: absolute;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.06);
  padding: 8px;
  border-radius: 4px;
}
.pf-dm-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  width: 100%; height: 100%;
  background: white;
  border: 2px solid white;
}
.pf-overlay {
  position: absolute;
  left: 50%; bottom: 14px; transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  backdrop-filter: blur(8px);
}
.pf-recent { padding: 0 4px; margin-top: 6px; flex: 1; min-height: 0; }
.pf-recent-h { font-size: 10.5px; color: #898a86; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.pf-recent-list { display: flex; flex-direction: column; gap: 4px; }
.pf-recent-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px;
  background: #1d1f22;
  border-radius: 8px;
  font-size: 11.5px;
}
.pf-fab {
  position: absolute;
  left: 22px; right: 22px; bottom: 30px;
  background: oklch(72% 0.16 252);
  color: #0e0f10;
  text-align: center;
  padding: 11px;
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.pf-home {
  position: absolute;
  left: 50%; bottom: 8px; transform: translateX(-50%);
  width: 110px; height: 4px;
  background: white;
  border-radius: 4px;
  opacity: 0.85;
}

/* responsive */
@media (max-width: 1200px) {
  .lk { grid-template-columns: 240px minmax(0, 1fr); }
  .phone-dock { display: none; }
}
@media (max-width: 900px) {
  .lk { grid-template-columns: 1fr; }
  .lk-side { display: none; }
  .lk-summary { grid-template-columns: 1fr; }
  .lk-empty { grid-template-columns: 1fr; }
}

/* ── Upload states ─────────────────────────── */
.upload-progress {
  border-color: var(--accent);
  background: var(--accent-soft);
  cursor: default;
  pointer-events: none;
}
.upload-done {
  border-color: oklch(60% 0.18 155);
  background: oklch(97% 0.03 155);
}
[data-theme="dark"] .upload-done {
  background: oklch(22% 0.05 155);
}
.upload-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.upload-check { display: flex; align-items: center; }

/* ── QR code block ─────────────────────────── */
.qr-wrap {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: white;
  border-radius: 14px;
  border: 1px solid var(--border);
}
[data-theme="dark"] .qr-wrap {
  background: #f8f8f6;
}
.qr-placeholder {
  margin-top: 16px;
  height: 180px;
  border-radius: 14px;
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ── Scan step with QR ─────────────────────────── */
.scan-step {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  padding: 28px 32px;
  margin-bottom: 20px;
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
}
.scan-step-left { flex: 1; }
.scan-step-qr { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.scan-step-eyebrow { display: flex; align-items: center; gap: 10px; }
.scan-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.scan-count-num { font-size: 28px; font-weight: 800; font-family: var(--font-mono); color: var(--accent-text); line-height: 1; }
.scan-count-label { font-size: 13px; color: var(--text-mute); }

/* ── Reconcile overlay ─────────────────────────── */
.reconcile-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reconcile-overlay-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
  text-align: center;
}

/* ── Payment success banner ─────────────────────────── */
.payment-success-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: oklch(97% 0.03 155);
  border: 1px solid oklch(85% 0.08 155);
  border-radius: var(--radius-md);
  color: oklch(35% 0.12 155);
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 18px;
  animation: slideDown 0.3s ease;
}
[data-theme="dark"] .payment-success-banner {
  background: oklch(22% 0.05 155);
  border-color: oklch(35% 0.08 155);
  color: oklch(75% 0.12 155);
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
