/* =========================================================
   КИТ СПОТ — клиентский ЛК
   Apple-style: минимализм, мягкие тени, тонкая подсветка
   ========================================================= */

:root {
  /* Neutrals — слегка тёплые, как в macOS */
  --bg:            #f5f5f7;
  --bg-soft:       #fbfbfd;
  --surface:       #ffffff;
  --surface-elev:  #ffffff;
  --surface-muted: #f5f5f7;

  /* Hairline borders */
  --border:        rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.10);

  /* Text */
  --text:        #1d1d1f;
  --text-soft:   #424245;
  --text-muted:  #6e6e73;
  --text-faint:  #86868b;

  /* Single accent — глубокий синий, как Apple system blue, но чуть глубже */
  --accent:        #0a84ff;
  --accent-strong: #0066d6;
  --accent-tint:   rgba(10, 132, 255, 0.08);

  /* Status tints — пастель, без насыщенности */
  --tint-yellow-bg: #fff7e0;
  --tint-yellow-fg: #8a6100;
  --tint-orange-bg: #ffeede;
  --tint-orange-fg: #8a4500;
  --tint-blue-bg:   #e6f0ff;
  --tint-blue-fg:   #1d4ed8;
  --tint-green-bg:  #e2f6ec;
  --tint-green-fg:  #11633f;
  --tint-red-bg:    #fde8eb;
  --tint-red-fg:    #8a1d27;
  --tint-gray-bg:   #efeff2;
  --tint-gray-fg:   #4a4a4f;

  /* Radii */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  /* Soft layered shadows + top highlight */
  --shadow-xs:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 2px 6px rgba(20, 24, 40, 0.04),
    0 6px 18px rgba(20, 24, 40, 0.04);
  --shadow-md:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 4px 14px rgba(20, 24, 40, 0.06),
    0 14px 40px rgba(20, 24, 40, 0.06);
  --shadow-lg:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 8px 24px rgba(20, 24, 40, 0.08),
    0 30px 60px rgba(20, 24, 40, 0.08);

  --glow-accent: 0 0 0 4px rgba(10, 132, 255, 0.10);

  --sidebar-w: 256px;
  --header-h: 64px;

  --font:
    -apple-system, BlinkMacSystemFont,
    "SF Pro Display", "SF Pro Text", "Inter",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono:
    "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Subtle radial highlight on app background */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 60vh;
  background:
    radial-gradient(60% 60% at 30% 0%, rgba(10, 132, 255, 0.07), transparent 70%),
    radial-gradient(50% 50% at 80% 10%, rgba(255, 255, 255, 0.6), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
.client-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  min-height: 100vh;
}

/* ---------- Header ---------- */
.client-header {
  grid-area: header;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-brand { display: flex; flex-direction: column; gap: 1px; }
.header-brand .brand-row { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.25), rgba(255,255,255,0) 50%),
    linear-gradient(160deg, #1d1d1f, #2c2c2e);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 11px; letter-spacing: 0.4px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.5) inset,
    0 1px 2px rgba(0,0,0,0.15);
}
.brand-title {
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
}
.brand-subtitle {
  font-size: 11.5px; color: var(--text-muted);
  letter-spacing: 0;
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-soft);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .18s, border-color .18s, color .18s;
}
.icon-btn:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.icon-btn-dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: #ff453a;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.85);
}

.user-block {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.user-block:hover {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.3), rgba(255,255,255,0) 50%),
    linear-gradient(160deg, #5b6577, #2c2c2e);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 11.5px;
  letter-spacing: 0.2px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 1px 2px rgba(0,0,0,0.12);
}
.user-name { font-size: 13px; font-weight: 500; letter-spacing: -0.01em; }
.user-caret { color: var(--text-faint); display: inline-flex; }

/* ---------- Sidebar ---------- */
.client-sidebar {
  grid-area: sidebar;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: 22px 14px 18px;
  display: flex; flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 4px 12px 12px;
  font-weight: 500;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 450;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: background .15s, color .15s, box-shadow .15s;
}
.sidebar-link:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text);
}
.sidebar-link.is-active {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(20, 24, 40, 0.04);
  font-weight: 500;
}
.sidebar-link.is-active .nav-icon { color: var(--accent); }
.sidebar-link .nav-icon {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  transition: color .15s;
}
.sidebar-link .nav-badge {
  margin-left: auto;
  background: var(--tint-gray-bg);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: 0;
}
.sidebar-link.is-active .nav-badge {
  background: var(--accent-tint);
  color: var(--accent-strong);
}

.sidebar-help {
  margin-top: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.sidebar-help::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 60%;
  background: radial-gradient(80% 100% at 20% 0%, rgba(10,132,255,0.08), transparent 70%);
  pointer-events: none;
}
.sidebar-help-title {
  font-weight: 600; font-size: 13px; margin-bottom: 4px;
  letter-spacing: -0.01em;
  position: relative;
}
.sidebar-help-text {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 8px;
  position: relative;
  line-height: 1.45;
}
.sidebar-help-mail {
  font-size: 12.5px;
  font-weight: 500;
  position: relative;
  letter-spacing: -0.01em;
}

/* ---------- Main ---------- */
.client-main {
  grid-area: main;
  padding: 32px 36px 56px;
  display: flex; flex-direction: column;
  gap: 24px;
  min-width: 0;
  max-width: 1480px;
  width: 100%;
}

.page-title { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.page-title h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.022em;
}
.page-title p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: -0.005em;
}

/* ---------- Stats grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.status-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px 18px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.status-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0) 30%);
  pointer-events: none;
}
.status-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.status-card .sc-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-card .sc-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}
.status-card[data-tone="blue"]   .sc-dot { background: #0a84ff; box-shadow: 0 0 0 3px rgba(10,132,255,0.15); }
.status-card[data-tone="yellow"] .sc-dot { background: #ff9f0a; box-shadow: 0 0 0 3px rgba(255,159,10,0.18); }
.status-card[data-tone="orange"] .sc-dot { background: #ff6a00; box-shadow: 0 0 0 3px rgba(255,106,0,0.18); }
.status-card[data-tone="green"]  .sc-dot { background: #30d158; box-shadow: 0 0 0 3px rgba(48,209,88,0.18); }
.status-card .sc-value {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-feature-settings: "tnum";
}
.status-card .sc-foot {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: -0.005em;
}

/* ---------- Two-column area ---------- */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}
.content-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* ---------- Generic card ---------- */
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9) 30%, rgba(255,255,255,0.9) 70%, transparent);
  pointer-events: none;
  z-index: 1;
}

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.card-head .card-sub {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-top: 2px;
  letter-spacing: -0.005em;
}
.card-head .link {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card-body { padding: 18px 22px; }

/* ---------- ER table ---------- */
.er-table-wrap { width: 100%; overflow-x: auto; }
.er-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.er-table th, .er-table td {
  text-align: left;
  padding: 13px 22px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.er-table th {
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  background: transparent;
  padding-top: 14px;
  padding-bottom: 12px;
}
.er-table tbody tr {
  transition: background .12s;
  cursor: pointer;
}
.er-table tbody tr:hover { background: rgba(0, 0, 0, 0.02); }
.er-table tbody tr.is-selected {
  background: var(--accent-tint);
}
.er-table tbody tr.is-selected td:first-child {
  position: relative;
}
.er-table tbody tr.is-selected td:first-child::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.er-table tbody tr:last-child td { border-bottom: 0; }
.er-table .er-number {
  font-weight: 500;
  color: var(--text);
  font-feature-settings: "tnum";
}
.er-table .er-updated {
  color: var(--text-muted);
  font-feature-settings: "tnum";
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.95;
  box-shadow: 0 0 0 3px currentColor;
  margin-left: 2px;
}
.badge::before { box-shadow: 0 0 0 3px color-mix(in oklab, currentColor 18%, transparent); }
.badge--yellow { color: var(--tint-yellow-fg); background: var(--tint-yellow-bg); }
.badge--orange { color: var(--tint-orange-fg); background: var(--tint-orange-bg); }
.badge--blue   { color: var(--tint-blue-fg);   background: var(--tint-blue-bg);   }
.badge--green  { color: var(--tint-green-fg);  background: var(--tint-green-bg);  }
.badge--red    { color: var(--tint-red-fg);    background: var(--tint-red-bg);    }

/* ---------- ER detail card ---------- */
.er-detail-card .meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
  margin-bottom: 22px;
}
.meta-item .meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 4px;
  font-weight: 500;
}
.meta-item .meta-value {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}
.meta-item .meta-value.is-mono { font-feature-settings: "tnum"; }

.section-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 6px 0 10px;
  font-weight: 500;
}

.message-block {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
}
.message-avatar {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.3), rgba(255,255,255,0) 50%),
    linear-gradient(160deg, #8e8e93, #636366);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.35) inset,
    0 1px 2px rgba(0,0,0,0.1);
}
.message-body { min-width: 0; }
.message-author {
  font-size: 13px;
  font-weight: 600;
  display: flex; gap: 8px; align-items: baseline;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.message-author .message-time {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 12px;
}
.message-text {
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
}

.info-block {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
}
.info-block .info-icon {
  flex-shrink: 0;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
  box-shadow: 0 0 0 3px var(--accent-tint);
}

/* ---------- Upload card ---------- */
.upload-card .dropzone {
  position: relative;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.5), rgba(245,245,247,0.4));
  padding: 32px 16px;
  text-align: center;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.upload-card .dropzone:hover,
.upload-card .dropzone.is-dragging {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(10,132,255,0.04), rgba(10,132,255,0.02));
  box-shadow: var(--glow-accent);
}
.dropzone-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface);
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 0 0 1px var(--border),
    0 4px 12px rgba(20,24,40,0.06);
}
.dropzone-text {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 12px;
  letter-spacing: -0.005em;
}
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border: 1px solid var(--border);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
  background: var(--surface);
  color: var(--text);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 1px 2px rgba(0,0,0,0.04);
}
.btn:hover { background: var(--bg-soft); }
.btn:active { transform: translateY(0.5px); }

.btn--primary {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0) 40%),
    linear-gradient(180deg, #1f8eff, #0a84ff);
  color: #fff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 1px 2px rgba(10,132,255,0.30),
    0 4px 12px rgba(10,132,255,0.25);
}
.btn--primary:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 40%),
    linear-gradient(180deg, #1a83ff, #006fe0);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 2px 4px rgba(10,132,255,0.32),
    0 6px 18px rgba(10,132,255,0.30);
}

.dropzone-hint {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: -0.005em;
}

.upload-error {
  margin-top: 12px;
  display: none;
  background: var(--tint-red-bg);
  color: var(--tint-red-fg);
  border: 1px solid rgba(138, 29, 39, 0.12);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
}
.upload-error.is-visible { display: block; }

.file-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 14px;
}
.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
}
.file-row:hover { background: var(--surface); box-shadow: var(--shadow-xs); }
.file-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 8px;
  background: var(--tint-red-bg);
  color: var(--tint-red-fg);
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.4px;
}
.file-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-name {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-meta {
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: -0.005em;
}
.file-remove {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: transparent; border: 0;
  color: var(--text-faint);
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.file-remove:hover { background: var(--tint-red-bg); color: var(--tint-red-fg); }

/* ---------- Notifications card ---------- */
.notifications-card .notif-list {
  display: flex; flex-direction: column;
}
.notif-item {
  display: flex; gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.notif-item:hover { background: rgba(0,0,0,0.02); }
.notif-item:last-child { border-bottom: 0; }
.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  background: var(--text-faint);
}
.notif-item[data-tone="blue"]   .notif-dot { background: #0a84ff; box-shadow: 0 0 0 3px rgba(10,132,255,0.15); }
.notif-item[data-tone="green"]  .notif-dot { background: #30d158; box-shadow: 0 0 0 3px rgba(48,209,88,0.18); }
.notif-item[data-tone="red"]    .notif-dot { background: #ff453a; box-shadow: 0 0 0 3px rgba(255,69,58,0.18); }
.notif-item[data-tone="yellow"] .notif-dot { background: #ff9f0a; box-shadow: 0 0 0 3px rgba(255,159,10,0.18); }
.notif-body { min-width: 0; flex: 1; }
.notif-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.notif-time {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 3px;
  letter-spacing: -0.005em;
  font-feature-settings: "tnum";
}

.notif-item.is-unread {
  background: rgba(10, 132, 255, 0.035);
}
.notif-item.is-unread .notif-title {
  font-weight: 600;
}
.notif-text {
  margin-top: 5px;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Stepper ---------- */
.stepper-card .stepper-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.stepper-card .stepper-head h2 {
  margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.015em;
}
.stepper-card .stepper-er {
  color: var(--text-muted);
  font-size: 12.5px;
  letter-spacing: -0.005em;
}
.stepper-card .stepper-er strong {
  color: var(--text); font-weight: 500;
  font-feature-settings: "tnum";
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 28px 22px 30px;
  gap: 0;
  position: relative;
  margin: 0;
  list-style: none;
}
.stepper-step {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  position: relative;
  padding: 0 8px;
}
.stepper-step::after {
  content: "";
  position: absolute;
  top: 17px;
  left: calc(50% + 22px);
  right: calc(-50% + 22px);
  height: 2px;
  background: var(--border-strong);
  z-index: 0;
  border-radius: 2px;
}
.stepper-step:last-child::after { display: none; }
.stepper-step.is-done::after {
  background: linear-gradient(90deg, #30d158, #30d158);
}

.stepper-dot {
  position: relative;
  z-index: 1;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-faint);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
  margin-bottom: 12px;
  transition: background .2s, color .2s, box-shadow .2s;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 0 0 1px var(--border-strong),
    0 1px 2px rgba(0,0,0,0.04);
}
.stepper-step.is-done .stepper-dot {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.25), rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #34d365, #28b04a);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 0 0 1px rgba(40,176,74,0.4),
    0 2px 6px rgba(48,209,88,0.25),
    0 8px 16px rgba(48,209,88,0.15);
}
.stepper-step.is-active .stepper-dot {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.25), rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #1f8eff, #0a84ff);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 0 0 1px rgba(10,132,255,0.4),
    0 0 0 5px rgba(10,132,255,0.12),
    0 2px 6px rgba(10,132,255,0.30),
    0 10px 20px rgba(10,132,255,0.18);
}
.stepper-step.is-active .stepper-label {
  color: var(--text);
  font-weight: 600;
}
.stepper-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.35;
  max-width: 160px;
  letter-spacing: -0.01em;
}
.stepper-step.is-done .stepper-label { color: var(--text-soft); }

/* ---------- Mobile menu toggle ---------- */
.menu-toggle { display: none; }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  :root { --sidebar-w: 0px; }

  .client-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main";
  }

  .client-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .28s ease;
    z-index: 50;
    box-shadow: var(--shadow-lg);
  }
  .client-sidebar.is-open { transform: translateX(0); }

  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(20, 24, 40, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 40;
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
  }
  .sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }

  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    margin-right: 12px;
    box-shadow: var(--shadow-xs);
  }

  .client-header { padding: 0 16px; }
  .header-brand .brand-subtitle { display: none; }
  .user-name, .user-caret { display: none; }
  .icon-btn:first-of-type { display: none; } /* hide search on mobile */

  .client-main { padding: 20px 16px 32px; gap: 18px; }
  .page-title h1 { font-size: 24px; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .status-card { padding: 14px 16px; }
  .status-card .sc-value { font-size: 28px; }

  .er-table th, .er-table td { padding: 11px 16px; font-size: 13px; }
  .card-head { padding: 14px 16px; }
  .card-body { padding: 14px 16px; }

  .er-detail-card .meta-grid { grid-template-columns: 1fr; gap: 12px 16px; }

  /* Stepper -> vertical */
  .stepper {
    grid-template-columns: 1fr;
    padding: 18px 18px 22px;
    gap: 18px;
  }
  .stepper-step {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    padding: 0;
    gap: 14px;
  }
  .stepper-step::after {
    top: 34px;
    left: 17px;
    right: auto;
    bottom: -18px;
    width: 2px;
    height: auto;
  }
  .stepper-dot { margin-bottom: 0; }
  .stepper-label { max-width: none; padding-top: 6px; }
}

/* =========================================================
   API-connected client LK additions
   ========================================================= */
.is-hidden { display: none !important; }

.client-auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  position: relative;
  z-index: 1;
}
.auth-card {
  width: min(460px, 100%);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.auth-card-head {
  padding: 28px 30px 18px;
  border-bottom: 1px solid var(--border);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.auth-brand .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
.auth-card h1 {
  margin: 0 0 6px;
  font-size: 25px;
  letter-spacing: -0.025em;
  font-weight: 600;
}
.auth-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
}
.auth-card-body { padding: 22px 30px 28px; }
.oauth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.oauth-btn {
  width: 100%;
  justify-content: center;
  height: 42px;
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}
.oauth-btn:hover {
  background: var(--bg-soft);
}
.oauth-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #4285f4;
  background: #fff;
  border: 1px solid var(--border);
}
.oauth-icon--google { color: #4285f4; }
.oauth-icon--yandex {
  color: #fff;
  background: #fc3f1d;
  border-color: rgba(0,0,0,0.08);
}
.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--text-faint);
  font-size: 11.5px;
}
.oauth-divider::before,
.oauth-divider::after {
  content: "";
  height: 1px;
  background: var(--border);
  flex: 1;
}
.oauth-divider span { white-space: nowrap; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.field input {
  width: 100%;
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  color: var(--text);
  padding: 0 13px;
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--glow-accent);
}
.form-row { display: flex; gap: 10px; align-items: center; }
.form-row .field { flex: 1; }
.form-message {
  display: none;
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.form-message.is-visible { display: block; }
.form-message.is-error {
  background: var(--tint-red-bg);
  border-color: rgba(138, 29, 39, 0.12);
  color: var(--tint-red-fg);
}
.form-message.is-success {
  background: var(--tint-green-bg);
  border-color: rgba(17, 99, 63, 0.12);
  color: var(--tint-green-fg);
}
.debug-code {
  display: none;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 500;
}
.debug-code.is-visible { display: block; }
.debug-code code {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: .08em;
}
.auth-note {
  margin-top: 16px;
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.45;
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-muted);
}
.btn--ghost:hover {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--text);
}
.btn:disabled,
.icon-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.register-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.register-form input {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  padding: 0 12px;
  outline: none;
  font: inherit;
  font-feature-settings: "tnum";
}
.register-form input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--glow-accent);
}
.muted-text {
  color: var(--text-muted);
  font-size: 13px;
}
.empty-state {
  padding: 22px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}
.er-table tbody tr.is-disabled {
  cursor: default;
}
.er-table tbody tr.is-disabled:hover {
  background: transparent;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 32px));
  display: none;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}
.toast.is-visible { display: block; }
.toast.is-error {
  background: var(--tint-red-bg);
  color: var(--tint-red-fg);
  border-color: rgba(138, 29, 39, 0.14);
}
.toast.is-success {
  background: var(--tint-green-bg);
  color: var(--tint-green-fg);
  border-color: rgba(17, 99, 63, 0.14);
}

@media (max-width: 560px) {
  .auth-card-head, .auth-card-body { padding-left: 20px; padding-right: 20px; }
  .form-row { flex-direction: column; align-items: stretch; }
}

/* =========================================================
   Patch 07 — финальная полировка клиентского ЛК
   ========================================================= */

.page-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  min-height: 24px;
}
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.66);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  box-shadow: var(--shadow-xs);
}
.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 3px rgba(48,209,88,0.14);
}

.btn {
  justify-content: center;
  min-height: 38px;
}
.btn.is-loading {
  pointer-events: none;
}
.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: .75;
  animation: kitspot-spin .75s linear infinite;
}
.icon-btn .btn-spinner {
  width: 15px;
  height: 15px;
}
@keyframes kitspot-spin { to { transform: rotate(360deg); } }

.er-table td.empty-state-cell {
  white-space: normal;
  padding: 0;
}
.empty-state--rich {
  padding: 34px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty-state--compact { padding: 22px 16px; }
.empty-title {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.empty-text {
  max-width: 420px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}
.empty-actions { margin-top: 8px; }

.skeleton-row td {
  padding-top: 15px;
  padding-bottom: 15px;
}
.skeleton-line {
  display: inline-block;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0,0,0,0.05), rgba(0,0,0,0.085), rgba(0,0,0,0.05));
  background-size: 220% 100%;
  animation: kitspot-skeleton 1.35s ease-in-out infinite;
}
.skeleton-line.w-120 { width: 120px; }
.skeleton-line.w-140 { width: 140px; }
.skeleton-line.w-160 { width: 160px; }
@keyframes kitspot-skeleton {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.upload-card .dropzone.is-disabled {
  border-color: var(--border);
  background: rgba(245,245,247,0.55);
  box-shadow: none;
  cursor: not-allowed;
}
.upload-card .dropzone.is-disabled:hover {
  border-color: var(--border);
  background: rgba(245,245,247,0.55);
  box-shadow: none;
}
.upload-card .dropzone.is-disabled .dropzone-icon {
  color: var(--text-faint);
  opacity: .75;
}
.upload-card .dropzone.is-uploading {
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}

.file-row {
  min-width: 0;
}
.file-name, .notif-title, .notif-text {
  overflow-wrap: anywhere;
}

.form-message.is-visible,
.upload-error.is-visible,
.debug-code.is-visible,
.toast.is-visible {
  animation: kitspot-fade-in .16s ease-out;
}
@keyframes kitspot-fade-in {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-card {
  border: 1px solid var(--border);
}
.auth-card .btn--primary {
  width: 100%;
}
.auth-note {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.register-form input:disabled,
.field input:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.toast {
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

@media (max-width: 880px) {
  .page-meta { margin-top: 6px; }
  .sync-pill { font-size: 11.5px; }
  .card-head {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .client-header {
    gap: 10px;
  }
  .header-actions {
    gap: 6px;
  }
  .status-card .sc-label {
    align-items: flex-start;
    min-height: 36px;
  }
  .card-head {
    flex-direction: column;
  }
  .card-head > .btn,
  .card-head button {
    width: 100%;
  }
  .er-table th:nth-child(3),
  .er-table td:nth-child(3) {
    display: none;
  }
  .dropzone-text {
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
  }
  .toast {
    right: 16px;
    bottom: 16px;
  }
}

/* Patch 11: профиль клиента и способы входа */
.profile-body {
  display: grid;
  gap: 12px;
}
.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
}
.profile-row span {
  color: var(--text-muted);
  font-size: 12.5px;
}
.profile-row strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-align: right;
}
.profile-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-method {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
}

/* =========================================================
   Patch 12 — упрощение ЛК клиента и модальные действия
   ========================================================= */

body.modal-open {
  overflow: hidden;
}

.client-sidebar .sidebar-nav {
  gap: 6px;
}

/* основной рабочий блок: слева список и уведомления, справа действия */
.content-grid {
  grid-template-columns: minmax(520px, 1.18fr) minmax(360px, .82fr);
}

/* Верхний прогресс как в схеме: лёгкая линия без лишней карточки */
.stepper-card--top {
  background: transparent;
  box-shadow: none;
  overflow: visible;
  padding: 0 4px;
}
.stepper-card--top::before { display: none; }
.stepper-card--top .stepper-head {
  display: none;
}
.stepper-card--top .stepper {
  padding: 12px 0 10px;
}
.stepper-card--top .stepper-step::after {
  top: 17px;
  left: calc(50% + 22px);
  right: calc(-50% + 22px);
  height: 2px;
  background: rgba(48, 209, 88, .32);
}
.stepper-card--top .stepper-step.is-done::after {
  background: #30d158;
}
.stepper-card--top .stepper-dot {
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
}
.stepper-card--top .stepper-step.is-done .stepper-dot,
.stepper-card--top .stepper-step.is-active .stepper-dot {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.25), rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #34d365, #28b04a);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 0 0 1px rgba(40,176,74,0.4),
    0 2px 6px rgba(48,209,88,0.25),
    0 8px 16px rgba(48,209,88,0.15);
}
.stepper-card--top .stepper-step.is-active .stepper-label,
.stepper-card--top .stepper-step.is-done .stepper-label {
  color: var(--text-soft);
  font-weight: 500;
}

/* уведомления теперь живут в ширину блока “Мои ЭР” */
.notifications-card--inline .card-head {
  align-items: center;
}
.notifications-card--inline .notif-toggle {
  white-space: nowrap;
}
.notifications-card--inline.is-collapsed .notif-list .notif-item:not(:first-child) {
  display: none;
}
.notif-toggle.is-hidden {
  display: none;
}
.notif-text {
  white-space: pre-wrap;
}

/* сообщение отказа в блоке данных от декларанта */
.message-block.is-rejected {
  background: var(--tint-red-bg);
  border-color: rgba(138, 29, 39, 0.14);
}
.message-block.is-rejected .message-avatar {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0) 50%),
    linear-gradient(160deg, #ff5a62, #b4232c);
}
.message-block.is-rejected .message-author,
.message-block.is-rejected .message-text {
  color: var(--tint-red-fg);
}
.message-text {
  white-space: pre-wrap;
}

/* модальные окна регистрации и профиля */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(29, 29, 31, 0.34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.modal-backdrop.is-hidden {
  display: none;
}
.modal-card {
  width: min(580px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: kitspot-modal-in .16s ease-out;
}
@keyframes kitspot-modal-in {
  from { opacity: 0; transform: translateY(6px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.modal-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}
.modal-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-faint);
  font-size: 28px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .14s, color .14s;
}
.modal-close:hover {
  background: var(--bg-soft);
  color: var(--text);
}
.modal-body {
  padding: 18px 22px 22px;
}
.register-modal-card .register-form input {
  height: 42px;
  border-radius: 12px;
}
.register-modal-card .register-form .btn--primary {
  min-height: 42px;
}
.profile-modal-card {
  width: min(520px, 100%);
}
.profile-logout-btn {
  margin-top: 4px;
  width: 100%;
}

/* upload: визуально подчёркиваем закрытое состояние до запроса декларанта */
.upload-card .dropzone.is-disabled .btn--primary {
  opacity: .55;
  box-shadow: none;
}
.upload-card .dropzone.is-disabled .dropzone-text {
  color: var(--text-muted);
  font-weight: 500;
}

@media (max-width: 1180px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 10px;
  }
  .modal-card {
    border-radius: 20px;
  }
  .modal-head,
  .modal-body {
    padding-left: 18px;
    padding-right: 18px;
  }
  .stepper-card--top .stepper {
    grid-template-columns: 1fr;
    padding: 10px 0;
  }
  .stepper-card--top .stepper-step::after {
    top: 34px;
    left: 17px;
    right: auto;
    bottom: -18px;
    width: 2px;
    height: auto;
  }
}


/* Patch 15: единый логотип КИТ.ТК СПОТ как в prod */
.brand-mark--logo {
  background: #ffffff !important;
  color: transparent !important;
  padding: 3px;
  border: 1px solid rgba(26, 74, 142, 0.12);
  box-shadow: 0 8px 18px rgba(26, 74, 142, 0.12), inset 0 1px 0 rgba(255,255,255,.94) !important;
  overflow: hidden;
}
.brand-mark--logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: inherit;
}

/* ======================================================================
   Patch 16 — client LK aligned with production workplace visual theme
   Applies the same premium light/glass UI language used by employee workspaces.
   Business logic and selectors are preserved.
   ====================================================================== */

:root {
  --kit-blue: #335cff;
  --kit-blue-2: #6f7dff;
  --kit-red: #e0475f;
  --kit-green: #19b777;
  --kit-yellow: #f4c542;

  --bg: #f5f7ff;
  --bg-soft: rgba(248, 250, 255, 0.72);
  --surface: rgba(255, 255, 255, 0.84);
  --surface-elev: rgba(255, 255, 255, 0.94);
  --surface-muted: rgba(247, 249, 255, 0.78);
  --border: rgba(86, 103, 150, 0.16);
  --border-strong: rgba(70, 86, 130, 0.26);

  --text: #121827;
  --text-soft: rgba(18, 24, 39, 0.76);
  --text-muted: rgba(18, 24, 39, 0.58);
  --text-faint: rgba(18, 24, 39, 0.42);

  --accent: var(--kit-blue);
  --accent-strong: #274adf;
  --accent-tint: rgba(79, 106, 255, 0.10);

  --tint-yellow-bg: rgba(244, 197, 66, 0.15);
  --tint-yellow-fg: #8a6400;
  --tint-orange-bg: rgba(255, 139, 65, 0.14);
  --tint-orange-fg: #9a4d00;
  --tint-blue-bg: rgba(79, 106, 255, 0.12);
  --tint-blue-fg: #274adf;
  --tint-green-bg: rgba(25, 183, 119, 0.12);
  --tint-green-fg: #0f7a4d;
  --tint-red-bg: rgba(224, 71, 95, 0.12);
  --tint-red-fg: #b93448;
  --tint-gray-bg: rgba(18, 24, 39, 0.07);
  --tint-gray-fg: rgba(18, 24, 39, 0.66);

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius: 20px;
  --radius-lg: 26px;
  --radius-xl: 30px;

  --shadow-xs: 0 1px 0 rgba(255,255,255,.78) inset, 0 8px 22px rgba(35,48,90,.045);
  --shadow-sm: 0 1px 0 rgba(255,255,255,.82) inset, 0 16px 44px rgba(35,48,90,.07), 0 2px 8px rgba(35,48,90,.035);
  --shadow-md: 0 1px 0 rgba(255,255,255,.88) inset, 0 22px 62px rgba(35,48,90,.10), 0 4px 16px rgba(35,48,90,.05);
  --shadow-lg: 0 28px 90px rgba(32,43,84,.18), 0 6px 22px rgba(32,43,84,.08), inset 0 1px 0 rgba(255,255,255,.9);
  --glow-accent: 0 0 0 4px rgba(79, 106, 255, 0.14), 0 10px 30px rgba(79, 106, 255, 0.12);

  --gradient-luxe: linear-gradient(135deg, #5e7dff 0%, #8468ff 42%, #b06ff7 72%, #6dc7ff 100%);
  --gradient-dark: linear-gradient(135deg, #0a1020 0%, #141c31 46%, #222c47 100%);
  --ease-luxe: cubic-bezier(.2, .75, .25, 1);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
}

html,
body.client-lk-pro {
  max-width: 100%;
  overflow-x: hidden;
}

body.client-lk-pro {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-weight: 400;
  text-rendering: geometricPrecision;
  color: var(--text);
  background:
    radial-gradient(circle at 11% 10%, rgba(91, 124, 255, 0.22) 0, transparent 34vw),
    radial-gradient(circle at 92% 7%, rgba(139, 101, 255, 0.20) 0, transparent 30vw),
    radial-gradient(circle at 77% 86%, rgba(76, 183, 255, 0.18) 0, transparent 36vw),
    linear-gradient(135deg, #fbfcff 0%, #f7f8ff 42%, #eef3ff 100%);
  background-attachment: fixed;
}

body.client-lk-pro::before,
body.client-lk-pro::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body.client-lk-pro::before {
  z-index: 0;
  background:
    linear-gradient(115deg, rgba(255,255,255,.18), transparent 36%),
    radial-gradient(circle at 24% 18%, rgba(255,255,255,.72), transparent 18vw),
    radial-gradient(circle at 70% 18%, rgba(147,127,255,.12), transparent 25vw);
  animation: clientPageAura 18s var(--ease-luxe) infinite alternate;
}
body.client-lk-pro::after {
  z-index: 0;
  opacity: .32;
  background-image:
    linear-gradient(rgba(54,72,118,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54,72,118,.05) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 72%, transparent);
}

.client-ambient-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.ambient-orb {
  position: absolute;
  display: block;
  width: 42vw;
  height: 42vw;
  min-width: 420px;
  min-height: 420px;
  border-radius: 999px;
  filter: blur(54px);
  opacity: .36;
  transform: translateZ(0);
  animation: clientOrbFloat 22s var(--ease-luxe) infinite alternate;
}
.ambient-orb-1 { left: -14vw; top: -16vw; background: radial-gradient(circle, rgba(97,121,255,.42), rgba(97,121,255,0) 68%); }
.ambient-orb-2 { right: -16vw; top: 5vw; background: radial-gradient(circle, rgba(179,121,255,.34), rgba(179,121,255,0) 70%); animation-delay: -6s; }
.ambient-orb-3 { right: 8vw; bottom: -18vw; background: radial-gradient(circle, rgba(89,205,255,.34), rgba(89,205,255,0) 70%); animation-delay: -12s; }

@keyframes clientPageAura {
  0% { opacity: .62; transform: translate3d(0,0,0) scale(1); }
  100% { opacity: .92; transform: translate3d(0,-18px,0) scale(1.02); }
}
@keyframes clientOrbFloat {
  0% { transform: translate3d(-12px,8px,0) scale(1); }
  100% { transform: translate3d(34px,-26px,0) scale(1.08); }
}

body.client-lk-pro * {
  -webkit-tap-highlight-color: transparent;
}
body.client-lk-pro ::selection {
  background: rgba(92,124,255,.22);
  color: #0f172a;
}

.client-auth-screen,
.client-layout {
  position: relative;
  z-index: 2;
}

.client-layout {
  width: min(100%, 1760px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(10px, 1.1vw, 20px);
  gap: 14px;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto 1fr;
}

.client-header,
.client-sidebar,
.card,
.status-card,
.auth-card,
.modal-card,
.sidebar-help,
.updated-pill {
  border: 1px solid rgba(255,255,255,.72);
  background:
    linear-gradient(145deg, rgba(255,255,255,.92), rgba(255,255,255,.68)),
    radial-gradient(circle at 12% 0%, rgba(98,124,255,.09), transparent 32%),
    radial-gradient(circle at 96% 8%, rgba(139,104,255,.10), transparent 35%);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.card::before,
.status-card::after,
.client-header::before,
.client-sidebar::before,
.auth-card::before,
.modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgba(255,255,255,.82), rgba(255,255,255,0) 34%),
    linear-gradient(to bottom, rgba(255,255,255,.52), rgba(255,255,255,0));
  opacity: .76;
}

.client-header {
  min-height: 78px;
  height: auto;
  border-radius: 26px;
  padding: 12px 14px;
  top: clamp(8px, 1vw, 16px);
  box-shadow: 0 18px 54px rgba(21,31,65,.10), inset 0 1px 0 rgba(255,255,255,.78);
}

.client-sidebar {
  position: sticky;
  top: clamp(96px, 7vw, 110px);
  height: calc(100vh - 120px);
  border-radius: 26px;
  padding: 18px 14px;
  overflow: hidden;
}

.client-main {
  max-width: none;
  padding: 18px clamp(10px, 1vw, 18px) 42px;
  gap: 18px;
}

.brand-mark.brand-mark--logo,
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  padding: 5px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    var(--gradient-luxe) border-box;
  border: 1px solid transparent;
  color: var(--ink, #0f172a);
  box-shadow: 0 14px 36px rgba(61,92,210,.18), inset 0 1px 0 rgba(255,255,255,.96);
}
.brand-mark.brand-mark--logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}
.brand-title,
.header-brand .brand-title,
.auth-brand .brand-title {
  color: #111827;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.brand-subtitle,
.header-brand .brand-subtitle,
.auth-brand .brand-subtitle {
  color: var(--muted, rgba(18,24,39,.58));
  font-size: 12px;
}

.page-title h1,
.auth-card h1,
.card-head h2,
.stepper-card .stepper-head h2,
.modal-head h2 {
  color: #111827;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.page-title h1 { font-size: 28px; }
.page-title p,
.card-sub,
.auth-card p,
.modal-head p {
  color: var(--text-muted);
  font-weight: 400;
}

.btn,
button.btn,
.icon-btn,
.user-block,
.sidebar-link,
.notif-toggle,
.modal-close {
  transition: transform .24s var(--ease-luxe), box-shadow .24s var(--ease-luxe), border-color .24s var(--ease-luxe), background .24s var(--ease-luxe), color .24s var(--ease-luxe), opacity .24s ease;
}
.btn,
button.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 42px;
  border: 1px solid rgba(78,93,136,.16);
  border-radius: 15px;
  padding: 11px 16px;
  background: rgba(255,255,255,.66);
  color: #111827;
  font-weight: 600;
  letter-spacing: -0.015em;
  box-shadow: 0 10px 26px rgba(35,48,90,.06), inset 0 1px 0 rgba(255,255,255,.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.btn:hover,
button.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(78,103,255,.26);
  background: rgba(255,255,255,.86);
  color: var(--kit-blue);
  box-shadow: 0 16px 34px rgba(55,77,145,.10), inset 0 1px 0 rgba(255,255,255,.92);
}
.btn--primary,
button.btn--primary,
.register-modal-card .register-form .btn--primary {
  border-color: rgba(255,255,255,.18);
  background: var(--gradient-dark);
  color: #fff;
  box-shadow: 0 16px 34px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn--primary:hover,
button.btn--primary:hover {
  background: linear-gradient(135deg, #111a2f 0%, #1c2742 52%, #303a5d 100%);
  color: #fff;
  box-shadow: 0 20px 44px rgba(15,23,42,.22), inset 0 1px 0 rgba(255,255,255,.16);
}
.btn--danger,
button.btn--danger,
.profile-logout-btn,
.sidebar-logout-btn {
  border-color: rgba(224,71,95,.22);
  color: var(--kit-red);
  background: rgba(255,255,255,.72);
}
.btn--danger:hover,
button.btn--danger:hover,
.profile-logout-btn:hover,
.sidebar-logout-btn:hover {
  background: rgba(255,241,244,.90);
  color: #c7334a;
}

.icon-btn,
.user-block {
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(78,93,136,.14);
  box-shadow: 0 10px 26px rgba(35,48,90,.06), inset 0 1px 0 rgba(255,255,255,.82);
}
.icon-btn:hover,
.user-block:hover {
  transform: translateY(-1px);
  color: var(--kit-blue);
  background: rgba(255,255,255,.88);
  border-color: rgba(78,103,255,.26);
}
.user-avatar,
.message-avatar {
  background: var(--gradient-dark);
  box-shadow: 0 12px 28px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.16);
}

.sidebar-section-label {
  color: var(--text-faint);
  font-weight: 700;
}
.sidebar-link {
  border-radius: 16px;
  color: var(--text-soft);
  padding: 11px 12px;
}
.sidebar-link:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.56);
  color: var(--kit-blue);
}
.sidebar-link.is-active {
  border-color: rgba(255,255,255,.70);
  background: rgba(255,255,255,.78);
  color: #111827;
  box-shadow: 0 14px 34px rgba(35,48,90,.06), inset 0 1px 0 rgba(255,255,255,.78);
}
.sidebar-link.is-active .nav-icon { color: var(--kit-blue); }
.sidebar-link .nav-badge {
  background: rgba(79,106,255,.10);
  color: var(--kit-blue);
}
.sidebar-help {
  border-radius: 20px;
}

.card,
.status-card,
.auth-card,
.modal-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.card-head {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(78,93,136,.10);
}
.card-body {
  padding: 20px 24px;
}
.status-card {
  padding: 20px;
}
.status-card:hover,
.card:hover {
  box-shadow: var(--shadow-md);
}
.status-card .sc-value {
  color: #111827;
  font-weight: 700;
}
.status-card .sc-label {
  color: var(--text-muted);
}

.er-table th {
  background: rgba(255,255,255,.34);
  color: rgba(18,24,39,.52);
  font-weight: 700;
}
.er-table td,
.er-table th {
  border-bottom-color: rgba(78,93,136,.10);
}
.er-table tbody tr:hover {
  background: rgba(247,249,255,.84);
}
.er-table tbody tr.is-selected {
  background: rgba(79,106,255,.10);
}
.er-table .er-number {
  color: #111827;
  font-weight: 700;
}

.badge {
  border: 1px solid rgba(255,255,255,.48);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 18px rgba(35,48,90,.08);
}
.badge--blue { background: linear-gradient(135deg, rgba(79,106,255,.14), rgba(109,199,255,.12)); }
.badge--green { background: linear-gradient(135deg, rgba(25,183,119,.14), rgba(66,217,157,.12)); }
.badge--red { background: linear-gradient(135deg, rgba(224,71,95,.14), rgba(255,241,244,.86)); }
.badge--orange { background: linear-gradient(135deg, rgba(255,139,65,.15), rgba(255,255,255,.76)); }
.badge--yellow { background: linear-gradient(135deg, rgba(244,197,66,.16), rgba(255,255,255,.76)); }

.message-block,
.info-block,
.file-row,
.dropzone,
.profile-method,
.profile-field,
.notif-item,
.updated-pill {
  border: 1px solid rgba(78,93,136,.12);
  background: rgba(255,255,255,.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.message-block,
.info-block,
.file-row,
.dropzone {
  border-radius: 18px;
}
.info-block {
  color: var(--kit-blue);
  background: rgba(79,106,255,.08);
}
.info-block .info-icon {
  background: var(--gradient-dark);
  box-shadow: 0 10px 24px rgba(15,23,42,.16);
}

.upload-card .dropzone {
  border-style: dashed;
  background:
    linear-gradient(145deg, rgba(255,255,255,.72), rgba(247,249,255,.54)),
    radial-gradient(circle at 50% 0, rgba(79,106,255,.08), transparent 48%);
}
.upload-card .dropzone:hover,
.upload-card .dropzone.is-dragging {
  border-color: rgba(79,106,255,.42);
  box-shadow: var(--glow-accent);
}
.dropzone-icon,
.file-icon {
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(35,48,90,.08), inset 0 1px 0 rgba(255,255,255,.82);
}
.file-icon {
  background: rgba(224,71,95,.12);
  color: var(--kit-red);
}

.stepper-card--top {
  padding: 0 8px;
}
.stepper-card--top .stepper-step.is-done .stepper-dot,
.stepper-card--top .stepper-step.is-active .stepper-dot,
.stepper-step.is-done .stepper-dot,
.stepper-step.is-active .stepper-dot {
  background: var(--gradient-dark);
  color: #fff;
  box-shadow: 0 16px 32px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.16);
}
.stepper-step.is-done::after,
.stepper-card--top .stepper-step.is-done::after {
  background: linear-gradient(90deg, var(--kit-blue), var(--kit-blue-2));
}
.stepper-dot {
  border: 1px solid rgba(255,255,255,.74);
  background: rgba(255,255,255,.78);
  box-shadow: 0 12px 28px rgba(35,48,90,.08), inset 0 1px 0 rgba(255,255,255,.86);
}

.modal-backdrop {
  background:
    radial-gradient(circle at 24% 12%, rgba(94,125,255,.22), transparent 32vw),
    rgba(10,16,32,.46);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}
.modal-card {
  box-shadow: var(--shadow-lg);
}
.modal-head {
  background:
    linear-gradient(145deg, rgba(255,255,255,.86), rgba(246,248,255,.66)),
    radial-gradient(circle at 0 0, rgba(92,124,255,.12), transparent 42%);
}
.modal-close:hover {
  background: rgba(255,255,255,.86);
  color: var(--kit-blue);
}

input,
select,
textarea,
.field .control,
.register-modal-card .register-form input {
  min-height: 44px;
  border: 1px solid rgba(78,93,136,.16);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  color: #111827;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78), 0 1px 0 rgba(255,255,255,.5);
  transition: border-color .22s var(--ease-luxe), box-shadow .22s var(--ease-luxe), background .22s var(--ease-luxe);
}
input:focus,
select:focus,
textarea:focus,
.field .control:focus {
  border-color: rgba(78,103,255,.42);
  background: rgba(255,255,255,.96);
  box-shadow: var(--glow-accent), inset 0 1px 0 rgba(255,255,255,.96);
}

.auth-card {
  width: min(492px, calc(100vw - 32px));
  border-radius: 34px;
  animation: clientCardRise .7s var(--ease-luxe) both;
}
.auth-card-head,
.auth-card-body {
  padding-left: clamp(24px, 3vw, 38px);
  padding-right: clamp(24px, 3vw, 38px);
}
.oauth-btn {
  background: rgba(255,255,255,.66);
  border-color: rgba(78,93,136,.16);
}
.oauth-icon {
  border-color: rgba(78,93,136,.14);
}
@keyframes clientCardRise {
  from { opacity: 0; transform: translate3d(0,18px,0) scale(.985); }
  to { opacity: 1; transform: translate3d(0,0,0) scale(1); }
}

.toast,
.client-toast {
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(12,18,34,.96), rgba(28,38,65,.94));
  box-shadow: 0 24px 70px rgba(15,23,42,.28), inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

@media (max-width: 1180px) {
  .content-grid { grid-template-columns: 1fr; }
  .client-sidebar { top: 0; }
}
@media (max-width: 880px) {
  .client-layout {
    display: grid;
    width: 100%;
    padding: 8px;
    grid-template-columns: 1fr;
  }
  .client-header {
    top: 8px;
    border-radius: 22px;
    padding: 10px;
  }
  .client-sidebar {
    border-radius: 0 26px 26px 0;
    height: 100vh;
  }
  .client-main {
    padding: 18px 8px 34px;
  }
  .brand-mark.brand-mark--logo,
  .brand-mark {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 15px;
  }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .card-head,
  .card-body {
    padding-left: 16px;
    padding-right: 16px;
  }
}
@media (max-width: 560px) {
  .client-main { padding-left: 2px; padding-right: 2px; }
  .stats-grid { gap: 10px; }
  .status-card { border-radius: 22px; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
