* { box-sizing: border-box; }
body { font-family: -apple-system, "Segoe UI", sans-serif; margin:0; background:#f4f6f9; color:#222; }
header {
  display:flex; align-items:center; gap:20px; padding:10px 20px;
  background:#1f2937; color:#fff; flex-wrap:wrap;
}
header .brand { font-weight:700; font-size:1.1em; }
header nav a { color:#d1d5db; text-decoration:none; margin-right:14px; }
header nav a:hover { color:#fff; }
header .user { margin-left:auto; font-size:.9em; }
header .user a { color:#93c5fd; }
main { padding: 20px; max-width: 1200px; margin: 0 auto; }
.card { background:#fff; padding:16px; border-radius:8px; margin-bottom:16px;
        box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card.narrow { max-width: 380px; margin: 60px auto; }
.row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:6px 0; }
.row input, .row select { padding:7px 9px; border:1px solid #cbd5e1; border-radius:6px; font-size:1em; }
button, .btn {
  padding:7px 14px; border:none; border-radius:6px; background:#e5e7eb;
  cursor:pointer; font-size:.95em; text-decoration:none; color:#111; display:inline-block;
}
button.primary, .btn.primary { background:#2563eb; color:#fff; }
button.danger { background:#dc2626; color:#fff; }
button:hover { opacity:.9; }
.grid { width:100%; border-collapse:collapse; background:#fff; border-radius:8px;
        overflow:hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.grid th, .grid td { padding:8px 10px; border-bottom:1px solid #eef; text-align:center; }
.grid th { background:#f1f5f9; font-weight:600; }
.profit { color:#16a34a; font-weight:600; }
.inline { display:inline-flex; gap:4px; }
.flash-wrap { padding: 0 20px; margin-top: 10px; }
.flash { padding:10px 14px; border-radius:6px; margin:4px 0; }
.flash.ok { background:#dcfce7; color:#166534; }
.flash.error { background:#fee2e2; color:#991b1b; }
label { display:block; margin:8px 0; }
input { padding:8px; width:100%; border:1px solid #cbd5e1; border-radius:6px; }
.hint { font-size:.85em; color:#6b7280; margin-top:8px; }
/* ---------- публичная часть: витрина и кабинет ---------- */
.site-header { display:flex; align-items:center; gap:20px; padding:14px 24px;
  background:#0f172a; color:#fff; flex-wrap:wrap; }
.site-header .brand { color:#fff; font-weight:700; font-size:1.1em; text-decoration:none; }
.site-header nav { margin-left:auto; display:flex; gap:16px; flex-wrap:wrap; }
.site-header nav a { color:#cbd5e1; text-decoration:none; font-size:.95em; }
.site-header nav a:hover { color:#fff; }
.site-main { padding:24px; max-width:960px; margin:0 auto; overflow-x:auto; }
.site-main.is-wide { max-width: 1560px; }
.site-footer { display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap;
  padding:20px 24px; color:#6b7280; font-size:.85em; }
.site-footer a { color:#6b7280; }
.hero { padding:20px 0 8px; }
.hero h1 { margin:0 0 8px; font-size:1.9em; line-height:1.2; }
.hero p { color:#4b5563; margin:0; }
.converter select { padding:9px; border:1px solid #cbd5e1; border-radius:6px; font-size:1em; }
.converter input { max-width:150px; }
.converter-out { font-size:1.15em; margin:12px 0 4px; }
.rates th, .rates td { text-align:left; }
.rates td:nth-child(3), .rates td:nth-child(4) { text-align:right; font-variant-numeric:tabular-nums; }
.cta { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-top:16px; }
.client-card p { margin:4px 0; }
h4 { margin:16px 0 4px; font-size:.95em; color:#374151; }
code { background:#f1f5f9; padding:1px 5px; border-radius:4px; font-size:.95em; }
@media (max-width: 600px) {
  .site-main { padding:16px; }
  .site-header { padding:12px 16px; }
  .hero h1 { font-size:1.5em; }
  .grid { font-size:.85em; }
  .grid th, .grid td { padding:6px; }
}

/* иконки валют на витрине */
.cur-ico { display:inline-block; width:22px; height:15px; border-radius:2px; overflow:hidden;
  vertical-align:-2px; margin-right:8px; background:#fff; box-shadow:0 0 0 1px rgba(15,23,42,.14); }
.cur-ico svg { display:block; width:100%; height:100%; }
.rates td.cur { text-align:left; }

/* ============================================================
   Публичный сайт: редизайн (только body.site)
   ============================================================ */
.site {
  --ink: #0b1220;
  --ink-2: #1f2937;
  --muted: #5b667a;
  --line: #e6eaf1;
  --bg: #f5f7fb;
  --brand: #1d4ed8;
  --brand-2: #3b82f6;
  --gold: #c99a2e;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.site .shell { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* ---------- шапка ---------- */
.site .site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.site .header-inner { display: flex; align-items: center; gap: 18px; }
.site .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.site .brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(150deg, #1e3a8a, #2563eb); font-size: 20px;
  box-shadow: 0 8px 18px -8px rgba(37,99,235,.7);
}
.site .brand-mark.small { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }
.site .brand-text { font-size: 14px; line-height: 1.15; color: var(--muted); }
.site .brand-text b { color: var(--ink); font-size: 15px; }
.site .site-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site .site-nav a {
  color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 9px 12px; border-radius: 10px; transition: background .15s, color .15s;
}
.site .site-nav a:hover { background: #eef2ff; color: var(--brand); }
.site .site-nav .nav-cta {
  background: var(--ink); color: #fff; font-weight: 600;
}
.site .site-nav .nav-cta:hover { background: var(--brand); color: #fff; }

/* ---------- hero ---------- */
.site .hero {
  position: relative; overflow: hidden; color: #e8eefc;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(59,130,246,.55), transparent 62%),
    radial-gradient(700px 400px at 88% 0%, rgba(201,154,46,.28), transparent 60%),
    linear-gradient(165deg, #0b1220 0%, #101c3a 48%, #16285a 100%);
}
.site .hero-glow {
  position: absolute; inset: auto -10% -55% auto; width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(59,130,246,.35), transparent 62%);
  pointer-events: none;
}
.site .hero-inner { position: relative; padding: 72px 0 64px; }
.site .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: #9fb6e8; border: 1px solid rgba(159,182,232,.32);
  padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.04);
}
.site .hero h1 {
  margin: 20px 0 0; font-size: clamp(34px, 6vw, 62px); line-height: 1.02;
  letter-spacing: -.03em; font-weight: 800; color: #fff;
}
.site .hero h1 .accent {
  background: linear-gradient(96deg, #f4d580, #c99a2e 55%, #f4d580);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.site .hero-lead {
  margin: 18px 0 0; max-width: 560px; font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.6; color: #b9c6e2;
}
.site .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.site .hero-facts {
  display: flex; gap: 34px; flex-wrap: wrap; margin: 42px 0 0; padding: 18px 0 0;
  border-top: 1px solid rgba(255,255,255,.1);
}
.site .hero-facts div { display: flex; flex-direction: column; gap: 4px; }
.site .hero-facts dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #8fa4cd; }
.site .hero-facts dd { margin: 0; font-size: 24px; font-weight: 700; color: #fff; letter-spacing: -.02em; }

/* ---------- кнопки ---------- */
.site .btn.lg { padding: 13px 22px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.site .btn.primary {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8); color: #fff; border: none;
  box-shadow: 0 14px 30px -14px rgba(37,99,235,.9);
}
.site .btn.primary:hover { filter: brightness(1.06); }
.site .btn.ghost {
  background: rgba(255,255,255,.06); color: #e8eefc; border: 1px solid rgba(255,255,255,.22);
}
.site .btn.ghost:hover { background: rgba(255,255,255,.12); }
.site .btn.light { background: #fff; color: var(--ink); }
.site .btn.light:hover { background: #f1f5ff; }

/* ---------- секции ---------- */
.site .section { padding: 56px 0 0; }
.site .section:last-of-type { padding-bottom: 64px; }
.site .section-head { margin-bottom: 22px; }
.site .section-head h2 {
  margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.025em; font-weight: 750;
}
.site .section-sub { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- калькулятор ---------- */
.site .calc-card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px;
  box-shadow: 0 24px 60px -34px rgba(15,23,42,.35);
}
.site .seg {
  display: inline-flex; gap: 4px; padding: 4px; background: #f1f5f9;
  border-radius: 12px; margin-bottom: 18px;
}
.site .seg-btn {
  border: none; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: 9px; cursor: pointer; transition: .15s;
}
.site .seg-btn.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(15,23,42,.12); }
.site .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.site .chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px 8px 8px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink-2); transition: .15s;
}
.site .chip .cur-ico { width: 20px; height: 14px; margin-right: 0; }
.site .chip:hover { border-color: #c7d2fe; background: #f8faff; }
.site .chip.active { border-color: var(--brand); background: #eef2ff; color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.site .calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: end; }
.site .field { display: block; }
.site .field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.site .field-box {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 14px; background: #fbfcfe;
}
.site .field-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,.12); background: #fff; }
.site .field-box input {
  border: none; background: transparent; font-size: 26px; font-weight: 700; width: 100%;
  padding: 0; letter-spacing: -.02em; color: var(--ink); outline: none;
}
.site .field-suffix { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.site .calc-result {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 18px;
  border-radius: 14px; background: linear-gradient(160deg, #0b1220, #16285a); color: #fff;
}
.site .res-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #9fb6e8; }
.site .res-value { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.site .res-rate { font-size: 13px; color: #b9c6e2; }
.site .res-rate b { color: #f4d580; }
.site .calc-note { margin: 16px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---------- карточки курсов ---------- */
.site .rate-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}
.site .rate-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px;
  box-shadow: 0 18px 40px -32px rgba(15,23,42,.5); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.site .rate-card:hover {
  transform: translateY(-3px); border-color: #dbe3f3;
  box-shadow: 0 26px 50px -30px rgba(15,23,42,.45);
}
.site .rate-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.site .rate-head .cur-ico { width: 30px; height: 20px; margin-right: 0; }
.site .rate-name { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.site .rate-name b { font-size: 15px; letter-spacing: .02em; }
.site .rate-name span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site .rate-line {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 0; border-top: 1px dashed var(--line); font-size: 14px; color: var(--muted);
}
.site .rate-line b { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.site .rate-line.sell b { color: var(--brand); }
.site .rate-foot { margin-top: 4px; font-size: 11px; color: #9aa4b6; letter-spacing: .04em; }

/* ---------- шаги ---------- */
.site .steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.site .steps-list li { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.site .step-num {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: #eef2ff; color: var(--brand); font-weight: 800; font-size: 14px; margin-bottom: 12px;
}
.site .steps-list h3 { margin: 0 0 6px; font-size: 16px; letter-spacing: -.01em; }
.site .steps-list p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ---------- финальный блок ---------- */
.site .cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
  background:
    radial-gradient(600px 240px at 85% 0%, rgba(201,154,46,.35), transparent 60%),
    linear-gradient(160deg, #0b1220, #16285a);
  color: #fff; border-radius: 22px; padding: 28px;
}
.site .cta-band h2 { margin: 0 0 6px; font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -.02em; }
.site .cta-band p { margin: 0; color: #b9c6e2; font-size: 14px; max-width: 520px; }

/* ---------- подвал ---------- */
.site .site-footer { border-top: 1px solid var(--line); background: #fff; padding: 22px 0; margin-top: 56px; }
.site .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site .footer-brand { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.site .footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.site .footer-links a { color: var(--muted); text-decoration: none; font-size: 13px; }
.site .footer-links a:hover { color: var(--brand); }

/* ---------- вспышки ---------- */
.site .flash-wrap { margin-top: 16px; }
.site .flash { border-radius: 12px; }

@media (max-width: 760px) {
  .site .shell { width: min(1120px, 100% - 28px); }
  .site .hero-inner { padding: 48px 0 44px; }
  .site .calc-grid { grid-template-columns: 1fr; }
  .site .hero-facts { gap: 22px; margin-top: 30px; }
  .site .hero-facts dd { font-size: 20px; }
  .site .section { padding-top: 40px; }
  .site .brand-text { display: none; }
  .site .site-nav { gap: 2px; }
  .site .site-nav a { padding: 8px 10px; font-size: 13px; }
  .site .site-footer { margin-top: 40px; }
}

/* широкая главная: секции во всю ширину, контент внутри .shell */
.site .site-main.wide { max-width: none; padding: 0; overflow: hidden; }
.site .section.first { padding-top: 40px; }

/* ============================================================
   Панель сотрудника (body.admin)
   ============================================================ */
.admin {
  --ink: #0b1220; --ink-2: #1f2937; --muted: #64748b; --line: #e5e9f2;
  --side: #0d1526; --side-2: #16223a; --brand: #2563eb; --gold: #c99a2e;
  background: #f1f4f9; color: var(--ink); -webkit-font-smoothing: antialiased;
}
.admin-layout.is-auth { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }

/* ---------- сайдбар ---------- */
.admin-side {
  background: linear-gradient(180deg, #0d1526 0%, #101c33 100%);
  color: #c7d2e4; padding: 18px 14px 16px; position: sticky; top: 0;
  height: 100vh; display: flex; flex-direction: column; gap: 8px;
}
.admin-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; padding: 4px 6px 14px; }
.admin-brand .brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(150deg, #1e3a8a, #2563eb); font-size: 19px;
  box-shadow: 0 10px 22px -12px rgba(37,99,235,.9);
}
.admin-brand-text { font-size: 13px; line-height: 1.2; color: #93a4c2; }
.admin-brand-text small { display: block; font-size: 11px; color: #6d7f9e; letter-spacing: .04em; }

.admin-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.admin-nav .nav-group {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #5f7192;
  padding: 14px 10px 6px;
}
.admin-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: #c2cfe4; text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background .14s, color .14s;
}
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.active { background: linear-gradient(90deg, rgba(37,99,235,.9), rgba(37,99,235,.65)); color: #fff; box-shadow: 0 10px 20px -14px #2563eb; }
.admin-nav .ni { width: 18px; height: 18px; flex: none; opacity: .9; }
.admin-side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.08); }
.admin-side-foot a { color: #8fa4c7; text-decoration: none; font-size: 12.5px; }
.admin-side-foot a:hover { color: #fff; }

/* ---------- основная область ---------- */
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin .admin-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 26px; background: rgba(255,255,255,.9);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line); color: var(--ink); flex-wrap: wrap;
}
.admin-top-left { display: flex; align-items: center; gap: 10px; }
.admin-user { font-size: 14px; font-weight: 600; }
.role-pill {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
}
.role-pill.is-admin { background: #eef2ff; color: #1d4ed8; }
.role-pill.is-cashier { background: #ecfdf5; color: #047857; }
.admin-top-right { display: flex; align-items: center; gap: 14px; }
.admin-profit { display: flex; flex-direction: column; line-height: 1.15; text-align: right; }
.admin-profit span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.admin-profit b { font-size: 15px; font-variant-numeric: tabular-nums; }
.admin .btn.ghost-sm {
  padding: 8px 14px; border-radius: 10px; background: #f1f5f9; color: var(--ink-2);
  font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid var(--line);
}
.admin .btn.ghost-sm:hover { background: #e8eef8; }

.admin .admin-content { padding: 22px 26px 44px; max-width: 1680px; width: 100%; margin: 0; }
.admin-layout.is-solo { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.admin-layout.is-solo .admin-main { width: min(420px, 100%); }
.admin-layout.is-solo .admin-content { max-width: 100%; padding: 0; }
.admin-layout.is-solo .card.narrow { margin: 0; max-width: 100%; }

/* ---------- заголовки и KPI ---------- */
.admin .page-head { margin: 0 0 18px; }
.admin .page-head h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.admin .page-sub { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.admin .kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 16px; }
.admin .kpi {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 12px 28px -26px rgba(15,23,42,.6);
}
.admin .kpi-label { display: block; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.admin .kpi-value { display: block; margin-top: 6px; font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.admin .kpi-value small { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- карточки ---------- */
.admin .card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  margin-bottom: 16px; box-shadow: 0 16px 40px -34px rgba(15,23,42,.6);
}
.admin .card h3 { margin: 0 0 12px; font-size: 16px; letter-spacing: -.01em; }
.admin .card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.admin .card-head h3 { margin: 0; }
.admin .card-hint { font-size: 12.5px; color: var(--muted); }
.admin .hint { color: var(--muted); font-size: 13px; }

/* ---------- таблицы ---------- */
.admin .table-wrap { overflow-x: auto; }
.admin .grid {
  width: 100%; border-collapse: separate; border-spacing: 0; background: transparent;
  box-shadow: none; font-size: 13.5px;
}
.admin .grid th {
  background: #f7f9fd; color: var(--muted); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; font-weight: 700; padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.admin .grid th.num, .admin .grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.admin .grid td { padding: 10px 12px; border-bottom: 1px solid #eef2f8; vertical-align: middle; }
.admin .grid tbody tr:hover td { background: #f8faff; }
.admin .grid tbody tr:last-child td { border-bottom: none; }
.admin .grid .profit { color: #047857; font-weight: 700; }

.admin .cell-cur { white-space: nowrap; }
.admin .cell-cur .cur-ico { width: 26px; height: 17px; margin-right: 9px; vertical-align: middle; }
.admin .cell-cur-text { display: inline-block; vertical-align: middle; line-height: 1.25; text-align: left; }
.admin .cell-cur-text small { color: var(--muted); font-size: 12px; }

/* ---------- формы ---------- */
.admin input, .admin select {
  border: 1px solid #d8e0ee; border-radius: 10px; padding: 9px 11px; font-size: 14px;
  background: #fff; color: var(--ink); width: auto; transition: border-color .14s, box-shadow .14s;
}
.admin input:focus, .admin select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.admin label { font-size: 13px; color: var(--muted); }
.admin label input, .admin label select { display: block; margin-top: 6px; width: 100%; }
.admin .inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.admin .inline-form input { width: 92px; padding: 7px 9px; font-size: 13px; }
.admin .btn-sm {
  border: 1px solid var(--line); background: #f1f5f9; color: var(--ink); font-size: 13px;
  font-weight: 600; padding: 7px 12px; border-radius: 9px; cursor: pointer;
}
.admin .btn-sm:hover { background: #e8eef8; }
.admin .form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin .form-row input { flex: 1 1 140px; }

.admin .btn {
  border-radius: 10px; font-size: 13px; font-weight: 600; padding: 9px 14px;
  border: 1px solid var(--line); background: #f1f5f9; color: var(--ink);
}
.admin .btn.primary, .admin button.primary {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8); color: #fff; border: none;
  border-radius: 10px; font-size: 13px; font-weight: 600; padding: 9px 16px;
  box-shadow: 0 12px 24px -14px rgba(37,99,235,.85);
}
.admin button { border-radius: 10px; }
.admin button.danger { background: #dc2626; color: #fff; border: none; padding: 9px 14px; font-weight: 600; }
.admin .btn:hover, .admin button:hover { filter: brightness(.98); }

/* ---------- вспышки ---------- */
.admin .flash-wrap { padding: 14px 26px 0; }
.admin .flash { border-radius: 12px; font-size: 14px; box-shadow: 0 10px 24px -20px rgba(15,23,42,.6); }

/* ---------- адаптив ---------- */
@media (max-width: 1000px) {
  .admin-layout.is-auth { grid-template-columns: 1fr; }
  .admin-side {
    position: static; height: auto; flex-direction: column; padding: 12px;
  }
  .admin-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .admin-nav .nav-group { display: none; }
  .admin-nav a { padding: 8px 10px; font-size: 13px; }
  .admin-side-foot { display: none; }
  .admin .admin-content { padding: 16px; }
  .admin .admin-top { padding: 10px 16px; }
  .admin .flash-wrap { padding: 10px 16px 0; }
}

/* ---------- справочная панель котировок ---------- */
.admin .q-tools { display: flex; align-items: center; gap: 8px; }
.admin .src-chip {
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: lowercase;
  padding: 4px 9px; border-radius: 999px; background: #eef2ff; color: #1d4ed8;
  border: 1px solid #dbe4ff; white-space: nowrap;
}
.admin .src-chip.err { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.admin .live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #22c55e;
  margin-left: 6px; vertical-align: middle; box-shadow: 0 0 0 0 rgba(34,197,94,.55);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.admin .dev-up { color: #b45309; font-weight: 600; }
.admin .dev-down { color: #047857; font-weight: 600; }
.admin .q-empty { color: var(--muted); font-size: 13px; padding: 14px 12px; }
@media (max-width: 640px) {
  .admin .q-tools { width: 100%; justify-content: space-between; }
}

/* ---------- витрина: отключённые котировки и статус настройки ---------- */
.site .notice-card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px;
  text-align: center; box-shadow: 0 24px 60px -40px rgba(15,23,42,.45);
}
.site .notice-card h2 { margin: 0 0 10px; font-size: clamp(22px, 3vw, 28px); letter-spacing: -.02em; }
.site .notice-card p { margin: 0 auto 18px; max-width: 520px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.admin .status-pill {
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
}
.admin .status-pill.on { background: #ecfdf5; color: #047857; }
.admin .status-pill.off { background: #fef2f2; color: #b91c1c; }

/* иконки валют в таблицах панели */
.admin .cur-ico { width:22px; height:15px; vertical-align:-2px; margin-right:6px; }
.admin .cell-cur .cur-ico { width:24px; height:16px; }
.admin .arrow { color: var(--muted); margin: 0 2px; }
.site .grid .cur-ico { width:22px; height:15px; vertical-align:-2px; margin-right:6px; }
.site .pick-ico { display:inline-flex; align-items:center; }
.site .pick-ico .cur-ico { width:24px; height:16px; margin-right:0; }

/* ---------- бренд, языки, кросс-обмен ---------- */
.site .logo, .admin .logo { display:block; flex:none; box-shadow:0 10px 22px -14px rgba(37,99,235,.9); }
.site .brand-text { display:flex; flex-direction:column; line-height:1.12; }
.site .brand-text small { font-size:11px; color:var(--muted); font-weight:500; letter-spacing:.02em; }
.site .lang-switch { display:flex; gap:2px; margin-left:6px; }
.site .lang-switch a { font-size:12px; font-weight:700; color:var(--muted);
  text-decoration:none; padding:6px 8px; border-radius:8px; letter-spacing:.03em; }
.site .lang-switch a:hover { background:#eef2ff; color:var(--brand); }
.site .lang-switch a.active { background:var(--ink); color:#fff; }
.site .cross-row { display:flex; gap:16px; flex-wrap:wrap; margin-bottom:18px; }
.site .cross-row .field { min-width:200px; }
.site .cross-row select { width:100%; padding:9px 11px; border:1px solid var(--line);
  border-radius:10px; font-size:14px; background:#fff; }
@media (max-width: 760px) {
  .site .lang-switch { margin-left:auto; }
  .site .brand-text small { display:none; }
}

/* ---------- переключатель языков ---------- */
.site .lang { position: relative; margin-left: 8px; }
.site .lang > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  transition: border-color .14s, box-shadow .14s;
}
.site .lang > summary::-webkit-details-marker { display: none; }
.site .lang > summary:hover { border-color: #c7d2fe; }
.site .lang[open] > summary { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.site .lang .chev { width: 12px; height: 12px; color: var(--muted); }
.site .lang-flag { display: inline-block; flex: none; }
.site .lang-flag svg { display: block; width: 20px; height: 13px; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(15,23,42,.14); }
.site .lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 196px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 24px 50px -28px rgba(15,23,42,.55);
}
.site .lang-menu a {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px;
  text-decoration: none; color: var(--ink-2); font-size: 13.5px;
}
.site .lang-menu a:hover { background: #f1f5ff; }
.site .lang-menu a.active { background: #eef2ff; color: var(--brand); font-weight: 600; }
.site .lang-menu a em { margin-left: auto; font-style: normal; font-size: 11px;
  color: var(--muted); letter-spacing: .04em; }
@media (max-width: 760px) {
  .site .lang { margin-left: auto; }
  .site .lang > summary span { display: none; }
}

/* ---------- меню языков: всплывает по наведению ---------- */
.site .lang-btn {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  transition: border-color .14s, box-shadow .14s;
}
.site .lang-btn:hover { border-color: #c7d2fe; }
.site .lang:hover .lang-btn, .site .lang.open .lang-btn {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.site .lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 196px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 24px 50px -28px rgba(15,23,42,.55);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .14s, transform .14s, visibility .14s;
}
.site .lang:hover .lang-menu,
.site .lang:focus-within .lang-menu,
.site .lang.open .lang-menu { opacity: 1; visibility: visible; transform: none; }

/* ---------- кросс-обмен ---------- */
.site .cross-card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px;
  box-shadow: 0 24px 60px -34px rgba(15,23,42,.35);
}
.site .cross-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: end;
}
.site .cross-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.site .pick-row {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 14px; padding: 9px 12px; background: #fbfcfe;
}
.site .pick-row:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,.12); background: #fff; }
.site .pick-row select {
  border: none; background: transparent; font-size: 15px; font-weight: 600; color: var(--ink);
  width: 100%; outline: none; cursor: pointer;
}
.site .cross-swap {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: #f1f5f9; color: var(--ink-2); display: grid; place-items: center;
  cursor: pointer; margin-bottom: 6px; transition: background .14s, transform .14s;
}
.site .cross-swap:hover { background: #e8eef8; transform: rotate(180deg); }
.site .cross-out {
  background: linear-gradient(160deg, #0b1220, #16285a); border-radius: 14px;
  padding: 14px 18px; display: flex; flex-direction: column; gap: 4px;
  color: #fff; min-height: 68px; justify-content: center;
}
.site .cross-out .res-value { color: #fff; }
.site .cross-out .res-rate { color: #b9c6e2; font-size: 13px; }
@media (max-width: 760px) {
  .site .cross-grid { grid-template-columns: 1fr; }
  .site .cross-swap { margin: 0 auto; transform: rotate(90deg); }
  .site .cross-swap:hover { transform: rotate(270deg); }
}

/* ---------- компактное меню языков ---------- */
.site .lang-menu {
  min-width: 176px; max-width: 220px; padding: 5px; border-radius: 12px;
}
.site .lang-menu a {
  padding: 7px 8px; gap: 8px; font-size: 13px; border-radius: 8px; line-height: 1.2;
}
.site .lang-menu a em { font-size: 10.5px; color: #94a3b8; }
.site .lang-flag { width: 18px; height: 12px; line-height: 0; }
.site .lang-flag svg { width: 18px; height: 12px; display: block; }
.site .lang-btn { gap: 6px; padding: 6px 9px; font-size: 12px; }
.site .lang-btn .lang-flag { width: 18px; height: 12px; }
.site .lang-btn .chev { width: 10px; height: 10px; }
.site .lang-menu { max-height: 280px; overflow-y: auto; }
.site .lang.picked .lang-menu { opacity: 0; visibility: hidden; }
.site .lang-menu .tick { margin-left: auto; color: var(--brand); flex: none; }

/* ---------- кросс-обмен: симметричная сетка ---------- */
.site .cross-card { padding: 24px; }
.site .cross-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.site .cross-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.site .cross-col .field-label {
  min-height: 17px; display: block; font-size: 12.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.site .cross-mid { display: flex; align-items: center; justify-content: center; }

.site .cross-card .pick-row {
  height: 48px; box-sizing: border-box; padding: 0 12px; gap: 9px;
  border: 1px solid var(--line); border-radius: 13px; background: #fbfcfe;
}
.site .cross-card .pick-row select { font-size: 14.5px; font-weight: 600; }
.site .cross-card .pick-ico { width: 22px; height: 15px; display: flex; align-items: center; }
.site .cross-card .pick-ico .cur-ico { width: 22px; height: 15px; margin: 0; }

.site .cross-card .field-box {
  height: 64px; box-sizing: border-box; display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: 13px; background: #fbfcfe; padding: 0 16px;
}
.site .cross-card .field-box input { font-size: 26px; font-weight: 700; }
.site .cross-card .field-box:focus-within {
  border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,.12); background: #fff;
}

.site .cross-card .cross-out {
  height: 64px; box-sizing: border-box; display: flex; flex-direction: column;
  justify-content: center; gap: 2px; padding: 0 18px; border-radius: 13px;
  background: linear-gradient(160deg, #0b1220, #16285a); color: #fff;
}
.site .cross-card .cross-out .res-value { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.15; }
.site .cross-card .cross-out .res-rate { font-size: 12px; color: #b9c6e2; }

.site .cross-swap {
  width: 48px; height: 48px; border-radius: 14px; margin: 0;
  background: #f1f5f9; border: 1px solid var(--line); color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s, transform .2s, color .15s;
}
.site .cross-swap:hover { background: var(--brand); border-color: var(--brand); color: #fff; transform: rotate(180deg); }

@media (max-width: 820px) {
  .site .cross-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .site .cross-mid { padding: 4px 0; }
  .site .cross-swap { transform: rotate(90deg); }
  .site .cross-swap:hover { transform: rotate(270deg); }
}
.site .cross-card .pick-row select { min-width: 0; flex: 1 1 auto; }

/* ---------- ровное выравнивание кода и названия валюты ---------- */
.admin .cur-table th:first-child,
.admin .cur-table td:first-child,
.admin .quotes-table th:first-child,
.admin .quotes-table td:first-child { text-align: left; }
.admin .cur-table .cell-cur,
.admin .quotes-table .cell-cur { text-align: left; }
.admin .cur-table .cell-cur-text,
.admin .quotes-table .cell-cur-text { align-items: flex-start; text-align: left; }
.admin .cur-table .cell-cur-text b,
.admin .cur-table .cell-cur-text small,
.admin .quotes-table .cell-cur-text b,
.admin .quotes-table .cell-cur-text small { display: block; text-align: left; }

/* ---------- ровные строки в таблицах панели ---------- */
.admin .cur-table td,
.admin .quotes-table td { height: 56px; vertical-align: middle; }
.admin .cur-table th,
.admin .quotes-table th { height: 40px; vertical-align: middle; }
.admin .cur-table .cell-cur-text small,
.admin .quotes-table .cell-cur-text small {
  display: block; max-width: 210px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.admin .cur-table .inline-form input,
.admin .cur-table .inline-form .btn-sm,
.admin .cur-table .inline-form button { height: 32px; box-sizing: border-box; }
.admin .cur-table .inline-form input { padding: 0 9px; }
.admin .cur-table td.num, .admin .quotes-table td.num { white-space: nowrap; }

/* кнопка выхода на витрину в шапке панели */
.admin .store-link {
  display: inline-flex; align-items: center; gap: 7px;
  background: #eef2ff; color: #1d4ed8; border-color: #dbe4ff; text-decoration: none;
}
.admin .store-link:hover { background: #e0e9ff; }
.admin .store-link svg { flex: none; }
@media (max-width: 640px) {
  .admin .store-link { padding: 8px 10px; font-size: 0; gap: 0; }
  .admin .store-link svg { width: 16px; height: 16px; }
}

/* ---------- режим приложения (PWA) на iPhone/iPad ---------- */
@media (display-mode: standalone) {
  .site .site-header { padding-top: max(10px, env(safe-area-inset-top)); }
  .site .site-footer { padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  .site .site-main { padding-bottom: env(safe-area-inset-bottom); }
}
.site { -webkit-tap-highlight-color: transparent; }
.site body, .site input, .site button { -webkit-text-size-adjust: 100%; }

/* ---------- кабинет: карточки счетов ---------- */
.site .section-head { display:flex; align-items:center; gap:10px; margin:26px 0 12px; }
.site .section-head h3 { margin:0; }
.site .section-head .hint { margin-left:auto; color:var(--muted); font-size:13px; }

.site .acc-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(232px, 1fr)); gap:14px; }
.site .acc-card {
  background:#fff; border:1px solid var(--line); border-radius:16px; padding:16px 18px;
  display:flex; flex-direction:column; gap:10px; min-height:136px;
  box-shadow:0 1px 2px rgba(16,24,40,.04), 0 10px 24px -20px rgba(16,24,40,.35);
  transition:border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.site .acc-card:hover { border-color:#cdd9ec; box-shadow:0 2px 8px rgba(16,24,40,.07); transform:translateY(-1px); }
.site .acc-head { display:flex; align-items:center; gap:8px; }
.site .acc-code { font-weight:750; font-size:14px; color:var(--ink); }
.site .acc-num {
  margin-left:auto; font:11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  color:var(--muted); background:#f4f7fc; border-radius:6px; padding:2px 6px;
}
.site .acc-balance { font-size:27px; font-weight:750; letter-spacing:-.02em; line-height:1; color:var(--ink); }
.site .acc-foot { display:flex; flex-wrap:wrap; gap:10px; font-size:12px; color:var(--muted); margin-top:auto; }
.site .acc-frozen { color:#b45309; font-weight:600; }
.site .acc-new { justify-content:center; gap:10px; border:1px dashed #c8d5ea; background:#fbfcfe; box-shadow:none; }
.site .acc-new:hover { transform:none; border-color:var(--brand-2); }
.site .acc-new .acc-code { color:var(--muted); font-weight:600; font-size:13px; }
.site .acc-new select, .site .acc-new button { width:100%; }

/* ---------- кабинет: формы в карточках ---------- */
.site .row { gap:10px; margin:10px 0; }
.site .row input, .site .row select {
  padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:#fff;
  color:var(--ink); font-size:14px; font-family:inherit; line-height:1.2;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.site .row input::placeholder { color:#9aa8bd; }
.site .row input:focus, .site .row select:focus {
  outline:none; border-color:var(--brand-2); box-shadow:0 0 0 3px rgba(59,130,246,.15);
}
.site .row button.primary { border-radius:12px; padding:11px 18px; font-weight:650; }
.site .conv-arrow {
  display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px;
  border-radius:50%; background:#eef4ff; color:var(--brand); font-weight:700; font-size:13px;
}
.site .conv-preview:empty { display:none; }
.site .conv-preview {
  display:inline-block; margin:2px 0 0; padding:8px 12px; border-radius:10px;
  background:#f2f7ff; color:var(--brand); font-weight:650; font-size:13px;
}

/* ---------- кабинет: история операций ---------- */
.site .ops-card {
  background:#fff; border:1px solid var(--line); border-radius:14px; padding:0; overflow:hidden;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
.site .ops-table { width:100%; border-collapse:collapse; }
.site .ops-table th {
  text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.06em;
  color:var(--muted); padding:12px 14px; border-bottom:1px solid var(--line); background:#fafcff;
}
.site .ops-table td { padding:12px 14px; border-bottom:1px solid #eef2f8; vertical-align:middle; }
.site .ops-table tr:last-child td { border-bottom:none; }
.site .ops-table tr:hover td { background:#f7fafe; }
.site .ops-date { color:var(--muted); font:12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; white-space:nowrap; }
.site .ops-type { font-weight:650; font-size:13px; color:var(--ink); }
.site .ops-tag {
  display:inline-block; margin-left:6px; padding:2px 8px; border-radius:999px;
  font-size:10.5px; font-weight:650; background:#eef2f8; color:#475569;
}
.site .ops-tag.warn { background:#fef3c7; color:#b45309; }
.site .ops-tag.bad { background:#fee2e2; color:#b91c1c; }
.site .ops-amount { font-weight:750; white-space:nowrap; font-variant-numeric:tabular-nums; }
.site .ops-amount.plus { color:#15803d; }
.site .ops-amount.minus { color:#b91c1c; }
.site .ops-total { color:#334155; white-space:nowrap; font-variant-numeric:tabular-nums; }
.site .ops-rate { color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }

/* ---------- кабинет: счётчик в заголовке ---------- */
.site .count-pill {
  display:inline-block; min-width:22px; padding:1px 8px; margin-left:6px; border-radius:999px;
  background:#eef2f8; color:#475569; font-size:12px; font-weight:700; vertical-align:2px;
}

/* контролы внутри карточек кабинета (в т.ч. форма открытия счёта) */
.site .card select, .site .card input[type="number"], .site .card input[type="text"],
.site .card input[type="email"], .site .card input[type="password"] {
  padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:#fff;
  color:var(--ink); font-size:14px; font-family:inherit; line-height:1.2;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.site .card select:focus, .site .card input:focus {
  outline:none; border-color:var(--brand-2); box-shadow:0 0 0 3px rgba(59,130,246,.15);
}
.site .card h3 { margin:0 0 10px; }

/* ссылка на чек в истории кабинета */
.site .ops-receipt {
  display:inline-block; padding:4px 10px; border-radius:999px; font-size:11.5px;
  font-weight:650; text-decoration:none; color:var(--brand);
  background:#eef4ff; white-space:nowrap;
}
.site .ops-receipt:hover { background:#e0ecff; }

/* назначение платежа в истории кабинета */
.site .ops-purpose {
  margin-top:4px; font-size:11.5px; color:var(--muted); line-height:1.35;
  max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

/* ---------- чат клиента с администратором ---------- */
.site .chat-box {
  max-height: 340px; overflow-y: auto; padding: 12px; border-radius: 12px;
  background: #f7f9fd; border: 1px solid var(--line); display:flex; flex-direction:column; gap:10px;
}
.site .chat-msg { display:flex; flex-direction:column; gap:3px; max-width:78%; }
.site .chat-msg.mine { align-self:flex-end; align-items:flex-end; }
.site .chat-msg.theirs { align-self:flex-start; align-items:flex-start; }
.site .chat-bubble {
  padding:9px 13px; border-radius:14px; font-size:14px; line-height:1.4;
  background:#fff; border:1px solid var(--line); color:var(--ink); word-break:break-word;
}
.site .chat-msg.mine .chat-bubble {
  background:linear-gradient(180deg,#3b82f6,#2563eb); border-color:transparent; color:#fff;
}
.site .chat-meta { font-size:10.5px; color:var(--muted); }

.admin .chat-box {
  max-height: 460px; overflow-y: auto; padding: 14px; border-radius: 12px;
  background:#f8fafc; border:1px solid #e2e8f0; display:flex; flex-direction:column; gap:10px;
}
.admin .chat-msg { display:flex; flex-direction:column; gap:3px; max-width:76%; }
.admin .chat-msg.mine { align-self:flex-end; align-items:flex-end; }
.admin .chat-msg.theirs { align-self:flex-start; align-items:flex-start; }
.admin .chat-bubble {
  padding:9px 13px; border-radius:14px; font-size:14px; line-height:1.4;
  background:#fff; border:1px solid #e2e8f0; color:#0f172a; word-break:break-word;
}
.admin .chat-msg.mine .chat-bubble { background:#2563eb; border-color:transparent; color:#fff; }
.admin .chat-meta { font-size:10.5px; color:#64748b; }
.admin .nav-badge {
  display:inline-block; margin-left:6px; min-width:18px; padding:1px 6px; border-radius:999px;
  background:#dc2626; color:#fff; font-size:10.5px; font-weight:700; text-align:center;
}

/* QR-код заявки на снятие */
.site .qr-wrap {
  display:inline-block; padding:10px; background:#fff; border:1px solid var(--line);
  border-radius:14px; box-shadow:0 10px 30px -22px rgba(16,24,40,.5);
}
.site .qr-wrap svg { display:block; }


/* ---------- виджеты кабинета ---------- */
.site .card {
  position:relative; background:#fff; border:1px solid var(--line); border-radius:18px;
  padding:16px 18px; margin:0 0 16px;
  box-shadow:0 1px 2px rgba(16,24,40,.05), 0 18px 40px -34px rgba(16,24,40,.55);
  transition:box-shadow .18s ease, border-color .18s ease;
}
.site .card:hover { border-color:#d8e3f3; box-shadow:0 2px 6px rgba(16,24,40,.07), 0 22px 46px -32px rgba(16,24,40,.6); }
.site .card > h3:first-child {
  display:flex; align-items:center; gap:9px;
  margin:-16px -18px 14px; padding:13px 18px;
  font-size:15px; letter-spacing:-.01em;
  border-bottom:1px solid #eef2f8; border-radius:18px 18px 0 0;
  background:linear-gradient(180deg,#fbfdff,#f4f8ff);
}
.site .card > h3:first-child::before {
  content:""; width:10px; height:10px; flex:0 0 10px; border-radius:4px;
  background:linear-gradient(135deg,#60a5fa,#1d4ed8);
  box-shadow:0 2px 6px -2px rgba(29,78,216,.6);
}

/* заголовок раздела как шапка виджета */
.site .section-head {
  display:flex; align-items:center; gap:9px; margin:24px 0 12px;
}
.site .section-head h3 { margin:0; font-size:16px; letter-spacing:-.01em; }
.site .section-head::before {
  content:""; width:10px; height:10px; flex:0 0 10px; border-radius:4px;
  background:linear-gradient(135deg,#60a5fa,#1d4ed8);
  box-shadow:0 2px 6px -2px rgba(29,78,216,.6);
}
.site .section-head .hint, .site .section-head .count-pill { margin-left:0; }

/* виджеты панели */
.admin .card {
  border:1px solid #e6ebf3; border-radius:14px; padding:0; overflow:hidden;
  box-shadow:0 1px 2px rgba(16,24,40,.04); margin-bottom:16px; background:#fff;
}
.admin .card > .card-head {
  display:flex; align-items:center; gap:10px; padding:12px 16px; margin:0;
  border-bottom:1px solid #eef2f8; background:linear-gradient(180deg,#fbfdff,#f6f9ff);
}
.admin .card > .card-head h3 { margin:0; font-size:14px; }
.admin .card > h3:first-child {
  margin:0; padding:12px 16px; font-size:14px; border-bottom:1px solid #eef2f8;
  background:linear-gradient(180deg,#fbfdff,#f6f9ff);
}
.admin .card > :not(.card-head):not(h3):not(table):not(.table-wrap) { margin-left:16px; margin-right:16px; }
.admin .card > table.grid { margin:0; border-radius:0; box-shadow:none; }
.admin .card > .form-row, .admin .card > form, .admin .card > p { margin-top:14px; }
.admin .card > *:last-child { margin-bottom:14px; }

/* KPI-плитки панели в том же языке, что и виджеты */
.admin .kpi {
  border:1px solid #e6ebf3; border-radius:14px; background:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.04); padding:14px 16px;
}
.admin .kpi-label { font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; color:#64748b; }
.admin .kpi-value { font-size:22px; letter-spacing:-.02em; }

/* ячейки с селекторами в таблицах не сжимаем */
.admin .grid td select, .admin .grid td input,
.site .grid td select, .site .grid td input { box-sizing: border-box; }
.admin .grid td.prop-cell { white-space: nowrap; }

/* описание товара: две строки максимум, дальше многоточие */
.admin .goods-desc, .site .goods-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
  max-width: 340px; font-size: 11.5px; line-height: 1.35; margin-top: 2px;
}
.admin .grid td { max-width: 360px; }

/* компактная закупка в таблице товаров */
.admin .goods-table td, .site .goods-table td { padding: 8px 8px; vertical-align: middle; }
.admin .goods-table th, .site .goods-table th { padding: 9px 8px; font-size: 11px; white-space: nowrap; }
.admin .goods-table td.purchase-cell, .site .goods-table td.purchase-cell { width: 290px; min-width: 290px; }
.admin .purchase-form, .site .purchase-form { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.admin .purchase-line, .site .purchase-line { display: flex; align-items: center; gap: 6px; }
.admin .purchase-line input, .site .purchase-line input,
.admin .purchase-line select, .site .purchase-line select {
  width: auto; padding: 6px 8px; font-size: 12.5px; border-radius: 9px; border: 1px solid #d7dfec;
}
.admin .purchase-line input[name="qty"] { width: 78px; }
.admin .purchase-line input[name="price"] { width: 84px; }
.admin .purchase-line select { width: 92px; }
.site .purchase-line input[name="qty"] { width: 82px; }
.site .purchase-line input[name="price"] { width: 86px; }
.site .purchase-line select { width: 96px; }
.admin .purchase-cash { display: flex; align-items: center; gap: 5px; font-size: 11.5px; white-space: nowrap; }
.admin .purchase-cash input { width: auto; }
.admin .purchase-line .btn-sm, .site .purchase-line .btn-sm { padding: 6px 10px; font-size: 12px; }
.admin .goods-table { min-width: 1180px; }
.site .goods-table { min-width: 1100px; }

/* кнопка «Назад» */
.admin .back-btn { display: inline-flex; align-items: center; gap: 6px; }
.site .back-row { margin: 14px auto -6px; }
.site .back-btn {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  padding: 8px 14px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(16,24,40,.05);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.site .back-btn:hover { border-color: var(--brand-2); color: var(--brand); box-shadow: 0 2px 8px -4px rgba(29,78,216,.4); }

/* кнопка удаления позиции в счёте (кабинет) */
.site .inv-remove-cell, .admin .inv-remove-cell { width: 44px; min-width: 44px; text-align: center; }
.site .inv-remove, .admin .inv-remove {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
  border: 1px solid #f0d3d3; background: #fff5f5; color: #b91c1c;
  transition: background .15s ease, border-color .15s ease;
}
.site .inv-remove:hover, .admin .inv-remove:hover { background: #fee2e2; border-color: #f5b5b5; }

/* ============ плагин «Бухгалтерия» (кабинет компании) ============ */
.acct-shell { display:grid; grid-template-columns:240px 1fr; gap:20px; align-items:start; }
@media (max-width: 960px){ .acct-shell { grid-template-columns:1fr; } }

.acct-hero {
  position:relative; overflow:hidden; border-radius:20px; padding:22px 26px;
  background:linear-gradient(135deg,#0f172a 0%,#1e3a8a 55%,#2563eb 100%);
  color:#fff; margin-bottom:18px;
}
.acct-hero::after {
  content:""; position:absolute; right:-60px; top:-60px; width:220px; height:220px;
  border-radius:50%; background:rgba(255,255,255,.10);
}
.acct-hero::before {
  content:""; position:absolute; right:40px; bottom:-80px; width:160px; height:160px;
  border-radius:50%; background:rgba(255,255,255,.07);
}
.acct-hero h2 { margin:0 0 6px; font-size:24px; letter-spacing:-.02em; }
.acct-hero .who { font-size:13.5px; opacity:.85; }
.acct-hero .badges { display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.acct-hero .pill {
  display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px;
  background:rgba(255,255,255,.16); font-size:12.5px; font-weight:600; backdrop-filter:blur(4px);
}
.acct-hero .pill.ok { background:rgba(16,185,129,.28); }
.acct-hero .pill .dotlive { width:7px; height:7px; border-radius:50%; background:#34d399; }

.acct-side {
  position:sticky; top:16px; background:#fff; border:1px solid #e3e9f3; border-radius:18px;
  padding:10px; box-shadow:0 12px 30px -26px rgba(15,23,42,.6);
}
.acct-side .hd {
  font-size:10.5px; text-transform:uppercase; letter-spacing:.08em; color:#7c8aa0;
  padding:8px 12px 6px;
}
.acct-side a {
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:12px;
  color:#1e293b; text-decoration:none; font-size:13.5px; font-weight:600; margin-bottom:2px;
  transition:background .15s ease, color .15s ease, transform .12s ease;
}
.acct-side a:hover { background:#f2f6fd; transform:translateX(2px); }
.acct-side a.on { background:linear-gradient(135deg,#1d4ed8,#3b82f6); color:#fff; box-shadow:0 10px 20px -14px rgba(29,78,216,.9); }
.acct-side .ic {
  width:26px; height:26px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  background:#eef2f9; color:#1d4ed8; font-size:13px; flex:0 0 26px;
}
.acct-side a.on .ic { background:rgba(255,255,255,.22); color:#fff; }

.acct-seg { display:flex; gap:6px; flex-wrap:wrap; padding:10px 12px; background:#fff;
  border:1px solid #e3e9f3; border-radius:14px; margin-bottom:16px; align-items:center; }
.acct-seg a {
  text-decoration:none; padding:7px 14px; border-radius:10px; font-size:13px; font-weight:600;
  color:#1e293b; background:#fff; border:1px solid transparent;
}
.acct-seg a:hover { background:#f2f6fd; }
.acct-seg a.on { background:#1d4ed8; color:#fff; }
.acct-seg .range { margin-left:auto; font-size:12px; color:#64748b; }

.acct-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px; margin-bottom:16px; }
.acct-kpi {
  position:relative; background:#fff; border:1px solid #e3e9f3; border-radius:16px; padding:16px 18px;
  box-shadow:0 14px 30px -30px rgba(15,23,42,.75); overflow:hidden;
}
.acct-kpi .k-ic {
  width:32px; height:32px; border-radius:10px; display:flex; align-items:center; justify-content:center;
  background:#eef2f9; color:#1d4ed8; font-size:15px; margin-bottom:10px;
}
.acct-kpi .k-lbl { font-size:12px; color:#64748b; font-weight:600; }
.acct-kpi .k-val { font-size:23px; font-weight:800; margin-top:4px; letter-spacing:-.02em; color:#0f172a; }
.acct-kpi .k-sub { font-size:11.5px; color:#7c8aa0; margin-top:4px; }
.acct-kpi.pos .k-ic { background:#e8f7ee; color:#15803d; } .acct-kpi.pos .k-val { color:#15803d; }
.acct-kpi.neg .k-ic { background:#fdecec; color:#b91c1c; } .acct-kpi.neg .k-val { color:#b91c1c; }
.acct-kpi.violet .k-ic { background:#ede9fe; color:#6d28d9; }
.acct-kpi::after { content:""; position:absolute; right:-24px; bottom:-24px; width:78px; height:78px;
  border-radius:50%; background:rgba(29,78,216,.05); }

.acct-card { background:#fff; border:1px solid #e3e9f3; border-radius:18px; padding:18px 20px; margin-bottom:16px; }
.acct-card > h3 { margin:0 0 4px; font-size:16px; letter-spacing:-.01em; }
.acct-card > .sub { font-size:12.5px; color:#64748b; margin:0 0 14px; }
.acct-card .grid { margin-top:6px; }
.acct-card tfoot td { border-top:1px solid #e3e9f3; }

.acct-note {
  display:flex; gap:12px; padding:14px 16px; border-radius:14px; background:#f8fafc;
  border:1px solid #e8eef7; font-size:12.5px; color:#475569; margin-top:10px;
}
.acct-note .ni { color:#1d4ed8; font-size:14px; }

.acct-empty { display:flex; flex-direction:column; align-items:center; gap:8px; padding:26px 10px; color:#64748b; }
.acct-empty .e-ic { width:44px; height:44px; border-radius:14px; background:#eef2f9; display:flex;
  align-items:center; justify-content:center; font-size:19px; color:#1d4ed8; }
.acct-empty b { color:#0f172a; font-size:14px; }
.acct-empty span { font-size:12.5px; }

.acct-result { width:100%; border-collapse:collapse; }
.acct-result td { padding:11px 4px; border-bottom:1px solid #eef2f9; font-size:13.5px; vertical-align:top; }
.acct-result td.num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.acct-result tr.total-main td { background:#e8f7ee; font-weight:800; color:#166534; }
.acct-result tr.total-mid td { background:#f2f6fd; font-weight:700; }
.acct-result .hint-cell { display:block; font-size:11.5px; color:#7c8aa0; font-weight:400; margin-top:2px; }

.acct-bar { height:14px; border-radius:8px; background:#eef2f9; overflow:hidden; }
.acct-bar > i { display:block; height:100%; border-radius:8px; background:linear-gradient(90deg,#1d4ed8,#60a5fa); }
.acct-legend { display:flex; gap:16px; flex-wrap:wrap; font-size:12px; color:#475569; margin-top:10px; }
.acct-legend .sw { display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:6px; }

@media print {
  .acct-side, .acct-seg, .site-header, .site-footer { display:none !important; }
  .acct-shell { display:block; }
  .acct-hero { background:#fff; color:#000; border:1px solid #ccc; }
}

/* ---------- модульная навигация ЛК ---------- */
.site .cabnav {
  position: relative; z-index: 0;
  margin: 0 auto 16px; padding: 0;
}
.site .cabnav-inner {
  display: flex; align-items: center; gap: 4px;
  background: #fff;
  border: 1px solid var(--line); border-radius: 16px;
  padding: 6px; box-shadow: 0 10px 24px -26px rgba(15,23,42,.55);
  overflow-x: auto; scrollbar-width: none;
}
.site .cabnav-inner::-webkit-scrollbar { display: none; }
.site .cabnav-label {
  flex: none; font-size: 10px; font-weight: 800; letter-spacing: .14em;
  color: #94a3b8; padding: 0 8px 0 6px; text-transform: uppercase;
}
.site .cabnav-a {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px 8px 9px; border-radius: 11px;
  color: var(--ink-2, #1f2937); text-decoration: none;
  font-size: 13px; font-weight: 700; white-space: nowrap; line-height: 1;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.site .cabnav-a:hover { background: #eef2ff; color: var(--brand); }
.site .cabnav-ico {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: #eef2f9; color: #475569; flex: none;
  transition: background .16s ease, color .16s ease;
}
.site .cabnav-ico svg { width: 15px; height: 15px; }
.site .cabnav-a:hover .cabnav-ico { background: #dbeafe; color: var(--brand); }
.site .cabnav-a.is-on {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff; box-shadow: 0 8px 18px -12px rgba(29,78,216,.85);
}
.site .cabnav-a.is-on .cabnav-ico { background: rgba(255,255,255,.22); color: #fff; }
.site .cabnav-a.is-on:hover { color: #fff; }
.site .cabnav-sep { flex: none; width: 1px; height: 18px; background: var(--line); }
@media (max-width: 900px) {
  .site .cabnav { margin-bottom: 12px; }
  .site .cabnav-label { display: none; }
  .site .cabnav-a { padding: 8px 11px; font-size: 12.5px; }
}

/* ---------- кабинет: строки форм (как .row) ---------- */
.site .form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.site .form-row input, .site .form-row select {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  color: var(--ink); font-size: 14px; font-family: inherit; line-height: 1.2;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.site .form-row input::placeholder { color: #9aa8bd; }
.site .form-row input:focus, .site .form-row select:focus {
  outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.site .form-row button.primary {
  border-radius: 12px; padding: 11px 18px; font-weight: 650; font-size: 14px;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8); color: #fff;
  box-shadow: 0 14px 30px -16px rgba(37,99,235,.9);
}
.site .form-row button.primary:hover { filter: brightness(1.06); opacity: 1; }
.site .form-row button.danger { border-radius: 12px; padding: 11px 16px; font-size: 14px; font-weight: 650; }
.site .form-row button.btn-sm { border-radius: 10px; padding: 8px 12px; }

/* ============================================================
   Нижняя плашка сайта: фиксирована у самого низа экрана
   ============================================================ */
body.site {
  padding-bottom: calc(74px + env(safe-area-inset-bottom));
}
.site .site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 30px -22px rgba(15, 23, 42, .5);
  z-index: 100;
}
.site .site-footer .footer-inner {
  width: min(1120px, 100% - 24px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px 18px;
  flex-wrap: wrap;
}
.site .site-footer .footer-brand {
  font-size: 13px;
  gap: 7px;
  color: var(--ink-2);
  font-weight: 700;
}
.site .site-footer .footer-brand .logo { width: 22px; height: 22px; }
.site .site-footer .footer-links {
  gap: 2px 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.site .site-footer .footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12.5px;
  padding: 7px 9px;
  border-radius: 9px;
  transition: background .14s, color .14s;
  white-space: nowrap;
}
.site .site-footer .footer-links a:hover {
  background: #eef4ff;
  color: var(--brand);
}
@media (max-width: 560px) {
  body.site { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .site .site-footer { padding: 5px 0 calc(5px + env(safe-area-inset-bottom)); }
  .site .site-footer .footer-inner { width: calc(100% - 12px); gap: 0 2px; flex-wrap: nowrap; }
  .site .site-footer .footer-brand span { display: none; }
  .site .site-footer .footer-brand .logo { width: 20px; height: 20px; }
  .site .site-footer .footer-links { gap: 0; flex-wrap: nowrap; justify-content: space-evenly; flex: 1; }
  .site .site-footer .footer-links a { font-size: 11px; padding: 7px 3px; letter-spacing: -.01em; }
}
/* не перекрывать фиксированной плашкой «липкие» кнопки сохранения */
.ge-save { bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
