:root {
  /* Light premium palette */
  --bg-0: #f6f5fb;
  --bg-1: #f0eef9;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #fbfaff;
  --surface-soft: #f6f5fb;
  --border: #e8e6f1;
  --border-strong: #d8d5e6;
  --text: #1a1730;
  --text-dim: #4a4663;
  --text-muted: #8c879f;

  --accent: #5a47e0;
  --accent-2: #6d5cf0;
  --accent-3: #8b7cff;
  --accent-strong: #4838c8;
  --accent-soft: rgba(90, 71, 224, 0.10);
  --accent-tint: rgba(90, 71, 224, 0.06);

  --danger: #dc2f50;
  --danger-soft: rgba(220, 47, 80, 0.10);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.10);
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.10);

  --grad-1: linear-gradient(135deg, #5a47e0 0%, #8b7cff 50%, #c4b5fd 100%);
  --grad-2: linear-gradient(135deg, #5a47e0 0%, #8b7cff 100%);
  --grad-line: linear-gradient(90deg, transparent, rgba(90, 71, 224, .35), transparent);

  --shadow-sm: 0 1px 2px rgba(20, 16, 50, 0.05);
  --shadow: 0 8px 30px rgba(20, 16, 50, 0.06), 0 2px 6px rgba(20, 16, 50, 0.04);
  --shadow-lg: 0 30px 80px rgba(20, 16, 50, 0.12), 0 0 0 1px rgba(90, 71, 224, .06);
  --shadow-glow: 0 8px 24px rgba(90, 71, 224, 0.25);

  --radius: 14px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-0);
  background-image:
    radial-gradient(900px 500px at 90% -10%, rgba(139, 124, 255, 0.10), transparent 60%),
    radial-gradient(800px 600px at -10% 110%, rgba(79, 70, 229, 0.08), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1240px; margin: 0 auto; padding: 32px 28px 64px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.015em; margin: 0; color: var(--text); }
h1 { font-size: 22px; }
h2 { font-size: 16px; margin-bottom: 16px; }
h3 { font-size: 14px; }
a { color: var(--accent); text-decoration: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.card-pad { padding: 22px; }

/* === LOGIN === */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 420px; padding: 40px 36px;
  box-shadow: var(--shadow-lg); border-radius: var(--radius-lg);
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(400px 200px at 50% 0%, rgba(139,124,255,.10), transparent 70%);
  pointer-events: none;
}
.login-card > * { position: relative; }
.login-card h1 { margin-bottom: 8px; font-size: 24px; }
.login-card .sub { color: var(--text-muted); margin: 0 0 28px; font-size: 13.5px; }

.brand-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--grad-1);
  display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:16px;
  margin-bottom: 18px; box-shadow: var(--shadow-glow);
  letter-spacing: .02em;
}

#appSection { display: none; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; margin-bottom: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  gap: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar-title h1 { font-size: 17px; font-weight: 600; }
.topbar-title .sub { color: var(--text-muted); font-size: 12px; }

.tabs {
  display: inline-flex; gap: 4px; margin-bottom: 24px;
  background: var(--surface); padding: 5px; border-radius: 11px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: transparent; border: none; padding: 9px 18px; cursor: pointer;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  border-radius: 7px; transition: all .18s; font-family: inherit; white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--accent-tint); }
.tab.active {
  background: var(--grad-2); color: #fff;
  box-shadow: 0 4px 12px rgba(90, 71, 224, .25);
}

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

.metric { padding: 22px; position: relative; overflow: hidden; }
.metric::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--grad-line);
}
.metric-num {
  font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -0.02em;
  font-feature-settings: "tnum";
}
.metric-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 8px; font-weight: 600; }
.metric-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-tint); border: 1px solid var(--border);
  display:flex;align-items:center;justify-content:center; color: var(--accent);
  margin-bottom: 14px;
}
.metric-icon svg { width: 18px; height: 18px; }

.toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 16px;
}
.search-box { flex: 1; min-width: 200px; position: relative; }
.search-box input {
  width: 100%; padding: 11px 14px 11px 40px; border-radius: 10px;
  border: 1px solid var(--border-strong); font-size: 13px;
  background: var(--bg-2); color: var(--text);
}
.search-box::before {
  content: ""; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  background: no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c879f' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>");
}

.table-wrap { overflow-x: auto; border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
  white-space: nowrap;
}
tbody td { padding: 16px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-dim); }
tbody tr { cursor: pointer; transition: background .15s; }
tbody tr:hover { background: var(--accent-tint); }
tbody tr:last-child td { border-bottom: none; }
tbody td strong { color: var(--text); font-weight: 600; }
.muted { color: var(--text-muted); font-size: 12px; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-off { background: rgba(140,135,159,.14); color: var(--text-muted); }
.badge-err { background: rgba(192,52,79,.13); color: #c0344f; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--surface-soft); border: 1px solid var(--border-strong); border-radius: 999px; transition: .25s; }
.switch .slider::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .25s;
  box-shadow: 0 1px 3px rgba(20,16,50,.2);
}
.switch input:checked + .slider { background: var(--grad-2); border-color: transparent; box-shadow: 0 0 12px rgba(90,71,224,.25); }
.switch input:checked + .slider::before { transform: translateX(18px); background: #fff; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--text-dim); }
input, select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border-strong);
  border-radius: 9px; font-size: 13.5px; background: var(--bg-2); color: var(--text);
  font-family: inherit; transition: border .18s, box-shadow .18s, background .18s;
}
input::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: #fff;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c879f' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
  padding-right: 36px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all .18s; white-space: nowrap; letter-spacing: .005em;
}
.btn-primary {
  background: var(--grad-2); color: #fff;
  box-shadow: 0 4px 14px rgba(90, 71, 224, .25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(90, 71, 224, .35); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--surface); color: var(--text-dim); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--accent-tint); border-color: var(--accent); color: var(--text); }
.btn-soft { background: var(--accent-soft); color: var(--accent); border-color: var(--border); }
.btn-soft:hover { background: rgba(90,71,224,.16); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 7px 13px; font-size: 12px; }
.btn-block { width: 100%; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }
.hint { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }

/* MODALS */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 16, 50, 0.45);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); max-width: 760px; width: 100%;
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 92vh;
  display: flex; flex-direction: column;
  animation: slideUp .25s ease;
}
.modal-narrow { max-width: 520px; }
.modal-wide { max-width: 980px; }
.modal-head {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modal-body { padding: 24px; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0; background: var(--surface-soft); }
.x-btn {
  background: transparent; border: 1px solid var(--border); cursor: pointer; color: var(--text-muted);
  width: 34px; height: 34px; border-radius: 9px; font-size: 18px; line-height: 1;
  display:flex;align-items:center;justify-content:center; transition: all .15s;
}
.x-btn:hover { background: var(--accent-tint); color: var(--text); border-color: var(--accent); }

.creds {
  background: var(--surface-soft); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.creds-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; flex-wrap: wrap; }
.creds-row .lbl { color: var(--text-muted); min-width: 84px; font-weight: 500; }
.creds-row code {
  flex: 1; min-width: 140px; background: #fff; padding: 8px 12px; border-radius: 7px;
  border: 1px solid var(--border); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px;
  word-break: break-all; color: var(--text);
}
.copy-btn {
  background: var(--surface); border: 1px solid var(--border-strong);
  padding: 6px 12px; border-radius: 7px; font-size: 11px; cursor: pointer;
  color: var(--accent); font-weight: 600; transition: all .15s; font-family: inherit;
}
.copy-btn:hover { background: var(--accent-tint); border-color: var(--accent); }

pre.code {
  background: var(--surface-soft); border: 1px solid var(--border);
  border-radius: 9px; padding: 16px; font-size: 12.5px; overflow-x: auto; margin: 0;
  white-space: pre-wrap; word-break: break-all;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--text-dim);
}
.hidden { display: none !important; }

.detail-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.detail-stat { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 11px; padding: 14px; }
.detail-stat .num { font-size: 20px; font-weight: 700; color: var(--text); font-feature-settings: "tnum"; }
.detail-stat .lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; margin-top: 4px; letter-spacing: .07em; }

.recent-table { font-size: 12.5px; }
.recent-table th { padding: 10px 12px; font-size: 10px; }
.recent-table td { padding: 11px 12px; }

/* === Theme builder (admin: new client form) === */
.theme-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-card {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); padding: 14px; cursor: pointer;
  transition: all .18s; position: relative; overflow: hidden;
}
.theme-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.theme-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.theme-card.active::after {
  content: "✓"; position: absolute; top: 10px; right: 10px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--grad-2);
  color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.theme-card-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; color: var(--text); }
.theme-card-desc { font-size: 11.5px; color: var(--text-muted); margin-bottom: 12px; min-height: 30px; }
.theme-swatch {
  display: flex; gap: 4px; height: 36px; border-radius: 7px; overflow: hidden;
  border: 1px solid var(--border);
}
.theme-swatch span { flex: 1; }

/* === Custom theme builder === */
.builder-panel {
  margin-top: 14px; padding: 16px; background: var(--surface-soft);
  border: 1px solid var(--border); border-radius: 12px;
}
.builder-panel.hidden { display: none !important; }
.builder-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.builder-row:last-child { margin-bottom: 0; }
.builder-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 600; }
.base-toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.base-toggle button {
  background: transparent; border: none; padding: 7px 14px; font-size: 12.5px; font-weight: 600;
  color: var(--text-muted); border-radius: 6px; cursor: pointer; font-family: inherit; transition: all .15s;
}
.base-toggle button.active { background: var(--grad-2); color: #fff; box-shadow: 0 2px 6px rgba(90,71,224,.2); }

/* === Color Picker (custom theme accent) === */
.color-picker-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Контейнер-карточка: палитра + hue + HEX в одном блоке */
.color-picker-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  max-width: 420px;
  width: 100%;
}

.pickr-host {
  width: 100%;
  display: block;
}
.pickr-host .pickr,
.pickr-host .pickr .pcr-app,
.pickr-host .pickr .pcr-app[data-theme=classic] {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.pcr-color-chooser {
  flex-shrink: 0 !important;
  margin-left: 8px !important;
}
/* Сбрасываем оформление встроенного app — мы сами рисуем рамку через .color-picker-card */
.pcr-app,
.pcr-app[data-theme=classic] {
  position: static !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 10px !important;
  font-family: inherit !important;
}

.pcr-selection .pcr-color-preview { display: none !important; }

.pcr-interaction {
  display: none !important;
}

/* HEX-строка как нижняя секция той же карточки */
.hex-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-soft);
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 6px 8px 6px 12px;
  transition: background .18s;
}
.hex-row:focus-within {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--accent-soft);
}
.hex-prefix {
  color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  font-weight: 600;
}
.hex-input {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  padding: 6px 0 !important;
  font-family: ui-monospace, "SF Mono", Menlo, monospace !important;
  font-size: 12.5px !important;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
  box-shadow: none !important;
  outline: none;
}
.hex-input:focus { box-shadow: none !important; }
.hex-input.invalid { color: var(--danger); }

.hex-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  flex-shrink: 0;
}
.hex-copy:hover { background: var(--accent-tint); color: var(--accent); border-color: var(--accent); }
.hex-copy.copied { background: var(--success-soft); color: var(--success); border-color: var(--success); }

.hex-error {
  font-size: 11.5px;
  color: var(--danger);
  min-height: 14px;
  padding-left: 2px;
}


.theme-preview-wrap {
  margin-top: 16px; padding: 16px; background: var(--bg-0);
  border: 1px dashed var(--border-strong); border-radius: 12px;
}
.theme-preview-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; font-weight: 600; }
.theme-preview-frame {
  border-radius: 10px; padding: 18px; min-height: 200px;
  background-size: cover; background-position: center;
  position: relative; overflow: hidden;
  border: 1px solid var(--border);
}
.theme-preview-frame .demo-modal {
  border-radius: 12px; padding: 16px; max-width: 320px;
  margin: 0 auto;
}
.theme-preview-frame .demo-h { font-weight: 600; font-size: 13px; margin: 0 0 10px; }
.theme-preview-frame .demo-drop { border: 1.5px dashed; border-radius: 8px; padding: 14px; text-align: center; font-size: 12px; }
.theme-preview-frame .demo-btns { display: flex; gap: 6px; margin-top: 10px; }
.theme-preview-frame .demo-btn { padding: 6px 12px; border-radius: 6px; font-size: 11.5px; font-weight: 600; flex: 1; text-align: center; }

/* === Mobile adaptive === */
@media (max-width: 900px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .theme-picker { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .container { padding: 16px 14px 40px; }
  .topbar { padding: 14px 16px; margin-bottom: 18px; flex-wrap: wrap; }
  .topbar-title h1 { font-size: 15px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 16px; }
  .metric-num { font-size: 22px; }
  .metric-icon { width: 32px; height: 32px; margin-bottom: 10px; }
  .metric-icon svg { width: 15px; height: 15px; }
  .tabs { width: 100%; padding: 4px; }
  .tab { padding: 8px 14px; font-size: 12.5px; flex: 1; }
  .toolbar { padding: 12px 14px; }
  .search-box { min-width: 100%; }
  thead th, tbody td { padding: 11px 12px; font-size: 12.5px; }
  thead th { font-size: 10px; }
  .row-actions { gap: 6px; }
  .row-actions .btn-sm { padding: 6px 10px; font-size: 11px; }
  .modal { max-height: 100vh; height: 100%; max-width: 100%; border-radius: 0; }
  .modal-backdrop { padding: 0; }
  .modal-body { padding: 18px 16px; }
  .modal-head { padding: 16px; }
  .modal-foot { padding: 14px 16px; }
  .creds-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .creds-row .lbl { min-width: 0; }
  .creds-row code { width: 100%; }
  .login-card { padding: 28px 22px; }
  .detail-stats { grid-template-columns: repeat(2, 1fr); }
  .detail-stat .num { font-size: 17px; }
  .color-picker-card { max-width: 100%; }
  .pickr-host .pcr-app { padding: 8px 8px 6px !important; }
  .hex-row { padding: 5px 6px 5px 10px; }
  .hex-copy { width: 26px; height: 26px; }

}


@media (max-width: 420px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===== Аналитика — блок «Успешные генерации» ===== */
.success-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.success-main {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.success-pct {
  font-size: 52px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  background: var(--grad-2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.success-meta { display: flex; flex-direction: column; gap: 4px; }
.success-title { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: .01em; }
.success-sub { font-size: 12px; color: var(--text-muted); }

.success-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
  padding: 12px 14px;
  border-left: 1px solid var(--border);
}
.success-side-row {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.success-side-row .muted { color: var(--text-muted); }
.success-side-num { font-weight: 600; color: var(--text); }
.success-side-pct { color: var(--text-muted); font-size: 11.5px; opacity: 0.85; min-width: 38px; text-align: right; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok   { background: var(--success); }
.dot-warn { background: var(--warn);    }
.dot-err  { background: #c0344f;        }

/* В карточке клиента — тот же блок, чуть компактнее */
.detail-success-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}
.detail-success-main { display: flex; align-items: baseline; gap: 10px; }
.detail-success-pct  {
  font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1;
  background: var(--grad-2); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.detail-success-lbl  { font-size: 12px; color: var(--text-muted); }
.detail-success-side { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.detail-success-item {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center;
  font-size: 12px;
}
.detail-success-item strong { color: var(--text); font-weight: 600; }

@media (max-width: 640px) {
  .success-block { flex-direction: column; align-items: flex-start; }
  .success-side  { border-left: none; border-top: 1px solid var(--border); width: 100%; padding-left: 0; padding-top: 14px; }
}




