@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════
   Время Профи Design System v3.0 — Modern Clean UI
   ═══════════════════════════════════════════════════════ */

:root {
  color-scheme: light only;

  /* ── z-index scale ──
     10    decorative (brand-mark)
     50    sidebar (desktop)
     100   bottom-nav, sidebar-toggle
     200   mobile-topbar
     250   sidebar-overlay
     300   sidebar (mobile open)
     500   drawer-overlay
     501   drawer-panel
     600   modal-overlay
     700   toast notifications
  ── */

  /* Palette */
  --bg: #f5f7fa;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-dark: #0f172a;
  --surface-dark-2: #1e293b;
  --text: #0f172a;
  --text-secondary: #475569;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --muted: #64748b;
  --line: #e2e8f0;

  /* Brand colors */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-soft: rgba(99, 102, 241, 0.08);
  --primary-strong: #4338ca;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.1);
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.08);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.08);
  --warning: #f59e0b;
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.08);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --sidebar-bg: #0f172a;
  --sidebar-text: rgba(248, 250, 252, 0.7);
  --sidebar-text-active: #ffffff;
  --sidebar-accent: var(--primary);
  --sidebar-border: rgba(255, 255, 255, 0.06);

  /* Transition */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

/* ═══════════════════════════════════
   LOGO SAFETY GUARD
   Prevent vp-mark.svg from rendering huge before page-specific CSS loads.
   Note: sidebar/auth overrides keep their own sizes via more specific rules.
   ═══════════════════════════════════ */
img.brand-mark-img,
img.logo-mark-img,
.logo-mark img {
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

/* ═══════════════════════════════════════════════
   LAYOUT SHELLS
   ═══════════════════════════════════════════════ */

.site-shell, .auth-shell, .app-shell { position: relative; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.container-wide {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding-left: clamp(16px, 3vw, 24px);
  padding-right: clamp(16px, 3vw, 24px);
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════ */

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 50;
  transition: width var(--transition-smooth);
}

.app-sidebar::-webkit-scrollbar { width: 4px; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  font-size: 22px;
  font-weight: 800;
  font-family: 'Manrope', sans-serif;
  letter-spacing: -0.03em;
  color: #fff;
  flex-shrink: 0;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 8px;
}

/* ═══════════════════════════════════
   CABINET BRAND — COMPACT (sidebar)
   Hard-scoped: перебивает глобальное img{max-width:100%} и прочие конфликты
   ═══════════════════════════════════ */
.app-sidebar .sidebar-brand.brand-link.is-compact,
.sidebar-brand.brand-link.is-compact {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-direction: row !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 52px !important;
  padding: 14px 18px !important;
  box-sizing: border-box !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}
.app-sidebar .sidebar-brand.brand-link.is-compact .brand-mark-img,
.app-sidebar .sidebar-brand.brand-link.is-compact > img.brand-mark-img,
.sidebar-brand.brand-link.is-compact .brand-mark-img,
.sidebar-brand.brand-link.is-compact > img.brand-mark-img {
  display: block !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  flex: 0 0 28px !important;
  object-fit: contain !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  filter: drop-shadow(0 6px 14px rgba(124, 92, 255, 0.2)) !important;
}
.app-sidebar .sidebar-brand.brand-link.is-compact .brand-name,
.sidebar-brand.brand-link.is-compact .brand-name {
  display: inline-flex !important;
  align-items: baseline !important;
  gap: 4px !important;
  min-width: 0 !important;
  max-width: calc(100% - 42px) !important;
  font-size: 14px !important;
  line-height: 1.05 !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  color: #f8fafc !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.app-sidebar .sidebar-brand.brand-link.is-compact .brand-name span,
.sidebar-brand.brand-link.is-compact .brand-name span {
  color: #a78bfa !important;
}
.app-sidebar .sidebar-brand.brand-link.is-compact svg,
.app-sidebar .sidebar-brand.brand-link.is-compact img,
.sidebar-brand.brand-link.is-compact svg,
.sidebar-brand.brand-link.is-compact img {
  flex-shrink: 0 !important;
}

/* ═══ Новый логотип сайдбара (clock + gradient Профи) ═══ */
.app-sidebar .sb-brand-new { display:flex !important; align-items:center !important; gap:12px !important; padding:20px 18px 16px !important; border-bottom:1px solid rgba(99,102,241,.15) !important; }
.app-sidebar .sb-clock-icon { width:44px;height:44px;border-radius:14px;flex-shrink:0;background:linear-gradient(135deg,#4f46e5,#7c3aed);display:flex;align-items:center;justify-content:center;box-shadow:0 4px 18px rgba(99,102,241,.4);animation:sbClockPulse 2.8s ease-in-out infinite; }
@keyframes sbClockPulse { 0%,100%{box-shadow:0 0 0 0 rgba(99,102,241,.4),0 4px 18px rgba(99,102,241,.3)} 50%{box-shadow:0 0 0 7px rgba(99,102,241,0),0 4px 24px rgba(99,102,241,.5)} }
.app-sidebar .sb-brand-text { display:flex;flex-direction:column;line-height:1;gap:2px; }
.app-sidebar .sb-brand-time { font:800 17px/1 'Manrope',sans-serif;letter-spacing:-.02em;color:#f1f5f9; }
.app-sidebar .sb-brand-profi { font:900 17px/1 'Manrope',sans-serif;letter-spacing:-.02em;background:linear-gradient(90deg,#818cf8,#c084fc,#f472b6);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;background-size:200% 100%;animation:sbProfiShimmer 3s ease-in-out infinite; }
@keyframes sbProfiShimmer { 0%{background-position:100% 50%} 100%{background-position:-100% 50%} }


.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font: 800 20px/1 'Manrope', sans-serif;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #6366f1, #818cf8, #a78bfa, #6366f1);
  background-size: 300% 300%;
  animation: brandGradient 4s ease infinite;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3), 0 0 0 0 rgba(99, 102, 241, 0);
  transition: box-shadow 0.4s ease, transform 0.3s ease;
  z-index: 1;
}
.brand-mark::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  background: conic-gradient(from 0deg, #6366f1, #a78bfa, #f59e0b, #6366f1);
  animation: brandSpin 6s linear infinite;
  z-index: -2;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #818cf8, #a78bfa, #6366f1);
  background-size: 300% 300%;
  animation: brandGradient 4s ease infinite;
  z-index: -1;
}
.brand:hover .brand-mark {
  transform: scale(1.08);
  box-shadow: 0 0 28px rgba(99, 102, 241, 0.5), 0 0 8px rgba(167, 139, 250, 0.4);
}
.brand:hover .brand-mark::before {
  opacity: 1;
}
@keyframes brandGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes brandSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Brand text shimmer effect */
.brand-text {
  font: 800 23px/1 'Manrope', sans-serif;
  letter-spacing: -0.02em;
  background: linear-gradient(
    90deg,
    var(--text) 0%,
    var(--text) 40%,
    var(--primary) 50%,
    var(--text) 60%,
    var(--text) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
}
.brand:hover .brand-text {
  animation-duration: 1.5s;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: -100% 50%; }
}

/* Pulse ring on brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  position: relative;
}
.brand-text span { color: var(--primary); }
.brand-text .brand-word-time { -webkit-text-fill-color: unset; color: var(--text); }
.brand-text .brand-word-profi { -webkit-text-fill-color: unset; color: var(--primary); font-weight: 800; }

.sidebar-caption {
  margin: 0 0 24px;
  padding: 0 20px;
  font-size: 13px;
  color: var(--sidebar-text);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 12px 8px;
}

.nav-group-label {
  margin: 20px 8px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.5);
}

.nav-group-label:first-child { margin-top: 8px; }

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.nav-menu a i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.nav-menu a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 250, 252, 0.95);
}

.nav-menu a:hover i { opacity: 1; }

.nav-menu a.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.nav-menu a.active i { opacity: 1; }

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-left: auto;
  flex-shrink: 0;
}

/* Sidebar bottom */
.sidebar-bottom {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg);
  flex-shrink: 0;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition-fast);
}

.sidebar-logout:hover { background: rgba(239, 68, 68, 0.15); }

/* ═══════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════ */

.app-main {
  padding: 24px;
  background: var(--bg);
  min-width: 0;
}

.app-panel {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════ */

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 24px;
}

.page-title {
  margin: 0 0 4px;
  font-family: 'Manrope', sans-serif;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
}

.page-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 600px;
  line-height: 1.5;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */

.btn, .btn-inline, .btn-ghost, .btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary, .btn-secondary, .btn-ghost {
  padding: 10px 20px;
  font-size: 14px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

/* Focus-visible for keyboard accessibility (WCAG 2.4.7) */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* Focus-visible for keyboard accessibility (WCAG 2.4.7) */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: #cbd5e1;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover { background: var(--bg); }

.btn-inline {
  padding: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  border: none;
}

.btn-inline:hover { color: var(--primary-hover); }

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-sm:hover { transform: translateY(-1px); }

.btn-edit { background: var(--info-soft); color: var(--info); }
.btn-edit:hover { background: rgba(59, 130, 246, 0.15); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.15); }
.btn-success { background: var(--success-soft); color: var(--success); }
.btn-success:hover { background: rgba(16, 185, 129, 0.15); }
.btn-warning { background: var(--accent-soft); color: var(--accent); }
.btn-warning:hover { background: rgba(245, 158, 11, 0.15); }
.btn-muted { background: var(--bg); color: var(--text-secondary); }

/* ═══════════════════════════════════════════════
   METRICS & CARDS
   ═══════════════════════════════════════════════ */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.metric-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 18px;
}

.metric-card h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.metric-value {
  margin: 6px 0 2px;
  font: 800 clamp(24px, 2.5vw, 32px)/1 'Manrope', sans-serif;
  color: var(--text);
}

.metric-meta {
  font-size: 13px;
  color: var(--muted);
}

/* ═══════════════════════════════════════════════
   SECTION & TABLE CARDS
   ═══════════════════════════════════════════════ */

.section-card, .table-card, .panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
  font: 800 clamp(24px, 3vw, 36px)/1.1 'Manrope', sans-serif;
}

.section-heading p { margin: 0; color: var(--muted); }

/* ═══════════════════════════════════════════════
   GRIDS
   ═══════════════════════════════════════════════ */

.app-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

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

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

.feature-card, .portal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-fast);
}

.feature-card:hover, .portal-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon, .portal-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 18px;
}

.feature-card h3, .feature-card p,
.portal-card h3, .portal-card p,
.section-card h2, .section-card p,
.metric-card p, .table-card h2, .table-card p {
  margin: 0;
}

.feature-card h3, .portal-card h3, .metric-card h3,
.section-card h2, .table-card h2, .auth-card h1, .auth-card h2,
.panel-heading h2 {
  font-family: 'Manrope', sans-serif;
  letter-spacing: -0.02em;
}

.feature-card p, .portal-card p,
.metric-card p, .section-card p, .table-card p,
.auth-card p, .auth-aside p, .sidebar-caption,
.nav-group-label, .table-muted, .status-note, .form-help {
  color: var(--muted);
}

/* ═══════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════ */

.activity-table, .admin-table, .finance-table {
  width: 100%;
  border-collapse: collapse;
}

.activity-table th, .activity-table td,
.admin-table th, .admin-table td,
.finance-table th, .finance-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.activity-table th, .admin-table th, .finance-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg);
}

.activity-table tr:hover td,
.admin-table tr:hover td {
  background: rgba(99, 102, 241, 0.02);
}

/* ═══════════════════════════════════════════════
   BADGES & CHIPS
   ═══════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--accent-soft); color: var(--accent); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════
   ADMIN CRM HEADER
   ═══════════════════════════════════════════════ */

/* Base layout — visual styling in admin-modern.css */
.admin-crm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-crm-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.admin-crm-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-crm-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
  transition: all var(--transition-fast);
}

.admin-crm-icon-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.admin-crm-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.admin-crm-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
}

.admin-crm-search input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: all var(--transition-fast);
}

.admin-crm-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--surface);
}

.admin-crm-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════
   ADMIN COMPONENTS
   ═══════════════════════════════════════════════ */

.admin-list { display: grid; gap: 8px; }

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.admin-list-item:hover { border-color: #cbd5e1; }

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-fast);
}

.admin-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.action-group { display: flex; flex-wrap: wrap; gap: 6px; }

/* ═══════════════════════════════════════════════
   ALERTS & FORMS
   ═══════════════════════════════════════════════ */

.alert {
  display: none;
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
}

.alert.show { display: block; }

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.15);
}

.alert-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.15);
}

.loading-note {
  display: none;
  padding: 12px 0;
  color: var(--primary);
  font-weight: 600;
  text-align: center;
}

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

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label, .form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-actions { display: grid; gap: 10px; margin-top: 8px; }

.form-hint, .form-help { font-size: 12px; color: var(--muted); }

.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.settings-section h2 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-family: 'Manrope', sans-serif;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* ═══════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════ */

.auth-shell {
  min-height: 100vh;
  padding: 24px 0;
  display: flex;
  align-items: center;
}

.auth-grid {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.auth-aside, .auth-card { border-radius: var(--radius-xl); }

.auth-aside {
  padding: 32px;
  background: var(--surface-dark);
  color: #f1f5f9;
  display: grid;
  gap: 16px;
  justify-items: start;
}

.auth-aside .brand { justify-self: center; }

.auth-card {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.hero-title, .page-title, .auth-title {
  font-family: 'Manrope', sans-serif;
  letter-spacing: -0.03em;
}

.auth-title { font-size: clamp(28px, 4vw, 40px); line-height: 1.05; }

.hero-text, .auth-subtitle { color: var(--muted); font-size: 16px; line-height: 1.6; }

.auth-form { margin-top: 24px; }

/* ═══════════════════════════════════════════════
   HERO (landing page)
   ═══════════════════════════════════════════════ */

/* brand styles moved to top near .brand-mark */

.topbar { padding: 20px 0 12px; }

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-note { color: var(--muted); font-size: 14px; }

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

.hero { padding: 28px 0 48px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}

.hero-grid > * {
  min-width: 0;
  width: 100%;
}

.hero-panel, .hero-side { backdrop-filter: none; }

.hero-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 36px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.hero-title { font-size: clamp(36px, 6vw, 60px); line-height: 1; margin: 16px 0 14px; }

.hero-side {
  padding: 24px;
  border-radius: var(--radius-xl);
  display: grid;
  gap: 16px;
  background: var(--surface-dark);
  color: #f1f5f9;
  box-shadow: var(--shadow-lg);
}

.stack-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stack-card h3, .stack-card p { margin: 0; }
.stack-card p { color: rgba(241, 245, 249, 0.7); }

.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.trust-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
}

.trust-value { font: 800 26px/1 'Manrope', sans-serif; }
.trust-label { margin-top: 6px; color: var(--muted); font-size: 13px; }

.site-section { padding: 0 0 24px; }

.cta-banner {
  margin: 16px 0 48px;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: #fff;
}

.cta-banner h2, .cta-banner p { margin: 0; }
.cta-banner h2 { font: 800 clamp(26px, 3.5vw, 40px)/1.05 'Manrope', sans-serif; }
.cta-banner p { margin-top: 10px; max-width: 650px; color: rgba(255, 255, 255, 0.85); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ═══════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════ */

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════════
   SECTION NAVIGATION
   ═══════════════════════════════════════════════ */

.cabinet-section { display: none; }
.cabinet-section.active { display: block; }
/* Гарантия: активная секция видна, даже если класс .visible не успел добавиться */
.cabinet-section.active.fade-in { opacity: 1 !important; transform: none !important; }

/* ═══════════════════════════════════════════════
   SECTION TABS
   ═══════════════════════════════════════════════ */

.section-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

/* ═══════════════════════════════════════════════
   FILTER ROW
   ═══════════════════════════════════════════════ */

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.filter-select, .filter-input {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}

.filter-select:focus, .filter-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ═══════════════════════════════════════════════
   ORDER CARDS
   ═══════════════════════════════════════════════ */

.order-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-fast);
}

.order-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.order-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.order-card-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 4px; }

.order-card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.order-card-meta span { display: flex; align-items: center; gap: 4px; }

.order-card-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin: 0; }

.order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.order-price { font-size: 16px; font-weight: 800; color: var(--primary); }

.order-btns { display: flex; gap: 6px; flex-wrap: wrap; }

.orders-list { display: flex; flex-direction: column; gap: 10px; }

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.order-item:hover { border-color: #cbd5e1; }

.order-info h4 { margin: 0 0 4px; font-family: 'Manrope', sans-serif; }
.order-meta { color: var(--muted); font-size: 13px; }

/* ═══════════════════════════════════════════════
   SPECIALIZATION CHIPS — modern redesign
   ═══════════════════════════════════════════════ */

.spec-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.spec-chip {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--card, #fff);
  color: var(--text-secondary, #64748b);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.3;
}

.spec-chip.selected {
  border-color: #6366f1;
  background: rgba(99,102,241,.09);
  color: #4338ca;
  box-shadow: 0 1px 5px rgba(99,102,241,.18);
}

.spec-chip:hover:not(.selected) {
  border-color: #a5b4fc;
  background: rgba(99,102,241,.04);
  color: #4f46e5;
}

/* ─── Profile block layout helpers ─── */
.pf-block {
  padding: 20px 20px 20px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
}
.pf-block:last-of-type { border-bottom: none; }

.pf-block-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.pf-block-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.pf-block-title { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }
.pf-block-sub   { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }

.pf-field { display: flex; flex-direction: column; gap: 5px; }
.pf-label { font-size: 12px; font-weight: 700; color: var(--text); }
.pf-hint  { font-size: 11px; color: var(--muted); line-height: 1.4; }

.pf-input {
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  transition: border-color .2s, box-shadow .2s;
  background: var(--card, #fff);
  color: var(--text);
}
.pf-input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139,92,246,.11);
  outline: none;
}

/* Skill chips — purple accent */
.skill-chip-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--card, #fff);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-secondary, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.3;
}
.skill-chip-btn.chip-selected {
  border-color: #8b5cf6;
  background: rgba(139,92,246,.09);
  color: #6d28d9;
  box-shadow: 0 1px 5px rgba(139,92,246,.2);
}
.skill-chip-btn:hover:not(.chip-selected) {
  border-color: #c4b5fd;
  background: rgba(139,92,246,.04);
  color: #7c3aed;
}

/* Brand chips — smaller, tighter */
.brand-chip {
  padding: 6px 13px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card, #fff);
  color: var(--text-secondary, #64748b);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  display: inline-flex;
  align-items: center;
}
.brand-chip.selected {
  border-color: #f59e0b;
  background: rgba(245,158,11,.08);
  color: #b45309;
  box-shadow: 0 1px 4px rgba(245,158,11,.18);
}
.brand-chip:hover:not(.selected) {
  border-color: #fcd34d;
  background: rgba(245,158,11,.04);
  color: #d97706;
}

/* Segment chips (2-column cards with title + subtitle) */
.segment-chip {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  height: auto;
  line-height: 1.4;
  border-radius: 12px !important;
}
.segment-chip.selected {
  border-color: #6366f1;
  background: rgba(99,102,241,.09);
  color: #4338ca;
  box-shadow: 0 2px 8px rgba(99,102,241,.18);
}

/* Car toggle chip */
#carToggleCard {
  transition: all .15s;
}
#carToggleCard.selected {
  border-color: #f59e0b;
  background: rgba(245,158,11,.08);
  color: #b45309;
  box-shadow: 0 1px 5px rgba(245,158,11,.2);
}
#carCheckIcon {
  color: inherit;
  transition: all .15s;
}

/* Chips count badge */
.chips-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 20px;
  background: rgba(99,102,241,.1);
  color: #4f46e5;
  font-size: 11px;
  font-weight: 700;
  transition: all .2s;
}

/* ═══════════════════════════════════════════════
   STAR RATING & REVIEWS
   ═══════════════════════════════════════════════ */

.star-rating { display: flex; align-items: center; gap: 2px; }
.star-rating .star { color: #f59e0b; font-size: 16px; }
.star-rating .star.empty { color: var(--border); }

.rating-big { font-size: 36px; font-weight: 800; color: var(--text); }
.rating-block { display: flex; align-items: center; gap: 14px; padding: 16px 0; }

.review-item {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-author { font-weight: 700; font-size: 14px; }
.review-date { font-size: 12px; color: var(--muted); }
.review-text { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.reviews-list { display: flex; flex-direction: column; gap: 10px; }

.review-bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.review-bar-lbl { min-width: 28px; color: var(--muted); font-weight: 600; font-size: 12px; }
.review-bar-outer { flex: 1; height: 6px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.review-bar-inner { height: 100%; border-radius: 4px; background: var(--primary); transition: width 0.6s ease; }
.review-bar-cnt { min-width: 24px; text-align: right; color: var(--muted); font-size: 12px; }

/* ═══════════════════════════════════════════════
   CHAT UI
   ═══════════════════════════════════════════════ */

.chat-wrap {
  display: flex;
  flex-direction: column;
  height: 460px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
}

.chat-msg.incoming {
  align-self: flex-start;
  background: var(--bg);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-msg.outgoing {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-time { font-size: 11px; opacity: 0.6; margin-top: 4px; text-align: right; }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.chat-input-row input {
  flex: 1;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  outline: none;
}

.chat-input-row input:focus { border-color: var(--primary); }

/* Chat order list */
.chat-order-list { display: flex; flex-direction: column; gap: 0; }
.chat-order-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--card); border: none; border-bottom: 1px solid var(--line, #f1f5f9);
  border-radius: 0; cursor: pointer; transition: background .15s;
}
.chat-order-item:hover { background: var(--hover, rgba(0,0,0,.02)); }
.chat-order-item:active { background: var(--hover, rgba(0,0,0,.04)); }
.chat-order-item.chat-unread { background: rgba(59,130,246,.04); }
.chat-order-item.chat-unread:hover { background: rgba(59,130,246,.08); }

/* Chat filter tabs */
.chat-tab {
  padding: 6px 16px; border-radius: 20px; border: 1.5px solid var(--border, #e5e7eb);
  background: var(--card, #fff); font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: all .15s; white-space: nowrap;
}
.chat-tab:hover { border-color: var(--primary); color: var(--primary); }
.chat-tab.active { background: var(--primary, #3b82f6); color: #fff; border-color: var(--primary, #3b82f6); }

/* ─── Live feed indicator ─── */
.oft-live-indicator {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: 8px; font-size: 10px; font-weight: 700;
  letter-spacing: .5px; vertical-align: middle;
  background: rgba(34,197,94,.08); padding: 3px 10px 3px 8px;
  border-radius: 20px; border: 1px solid rgba(34,197,94,.2);
}
.oft-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; display: inline-block;
  box-shadow: 0 0 6px rgba(34,197,94,.5);
  animation: oftPulseLoop 2s ease-in-out infinite;
}
@keyframes oftPulseLoop {
  0%, 100% { box-shadow: 0 0 4px rgba(34,197,94,.4); transform: scale(1); }
  50%  { box-shadow: 0 0 10px 3px rgba(34,197,94,.3); transform: scale(1.2); }
}
.oft-live-label { color: #16a34a; text-transform: uppercase; font-size: 10px; }
.oft-live-time { color: var(--muted); font-weight: 500; font-size: 10px; }
.chat-messages { overflow-y: auto; scroll-behavior: smooth; }

/* ═══════════════════════════════════════════════
   CHAT V2 — 2-panel split layout
   ═══════════════════════════════════════════════ */

/* Tab switcher */
.chat-tab-switcher {
  display: flex; gap: 8px; padding: 6px;
  background: var(--bg, #f1f5f9); border-radius: 16px; margin-bottom: 18px;
}
.chat-tab-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 16px; font-size: 13px; font-weight: 700;
  background: transparent; border: 2px solid transparent; cursor: pointer;
  border-radius: 12px; color: var(--muted); transition: all .25s ease; position: relative;
}
.chat-tab-btn:hover {
  background: rgba(99,102,241,.06); color: var(--text);
}
.chat-tab-btn.active {
  background: var(--card, #fff); color: var(--text);
  border-color: rgba(99,102,241,.2);
  box-shadow: 0 2px 12px rgba(99,102,241,.1);
}
.chat-tab-btn.active .chat-tab-icon {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.chat-tab-icon {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #fff; font-size: 13px;
  transition: transform .2s, box-shadow .2s;
}
.chat-tab-label { font-size: 13px; font-weight: 700; }
.chat-tab-desc { font-size: 11px; color: var(--muted); font-weight: 500; display: none; }
.chat-badge {
  position: absolute; top: 6px; right: 6px;
  min-width: 18px; height: 18px; border-radius: 9px;
  color: #fff; font-size: 10px; font-weight: 700; padding: 0 5px; line-height: 18px; text-align: center;
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
@media (min-width: 600px) {
  .chat-tab-desc { display: block; }
  .chat-tab-btn { flex-direction: row; gap: 10px; }
}
@media (max-width: 599px) {
  .chat-tab-btn { flex-direction: column; gap: 4px; padding: 10px 6px; }
  .chat-tab-label { font-size: 11px; }
  .chat-tab-icon { width: 28px; height: 28px; font-size: 12px; }
}

/* 2-panel split */
.chat-split {
  display: flex; border: 1.5px solid var(--border); border-radius: 16px;
  overflow: hidden; background: var(--card);
  min-height: 520px; max-height: 72vh;
}
.chat-split-sidebar {
  width: 290px; min-width: 240px; flex-shrink: 0;
  display: flex; flex-direction: column;
  border-right: 1.5px solid var(--border); background: var(--bg, #f8fafc);
  overflow: hidden;
}
.chat-split-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative;
}
.chat-sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 15px 11px; border-bottom: 1px solid var(--border);
  background: var(--card); flex-shrink: 0;
}
.chat-sidebar-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted);
}
.chat-sidebar-refresh {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 12px; padding: 4px 6px; border-radius: 6px; transition: color .15s;
}
.chat-sidebar-refresh:hover { color: var(--primary); }
.chat-order-list { flex: 1; overflow-y: auto; padding: 8px 8px 4px; display: flex; flex-direction: column; gap: 0; }
.chat-list-loading { display: flex; justify-content: center; padding: 40px; color: var(--muted); }

/* Group headers in sidebar */
.chat-group-header {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 4px 5px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
  flex-shrink: 0;
}
.chat-group-header::after {
  content: ''; flex: 1; height: 1px; background: var(--border, #e5e7eb);
}
.chat-group-header:not(:first-child) { margin-top: 8px; }

/* Order items in sidebar — card style */
.chat-order-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 12px; cursor: pointer;
  transition: background .12s, box-shadow .12s;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--card, #fff);
  position: relative;
  margin-bottom: 6px;
}
.chat-order-item:hover { background: rgba(99,102,241,.04); border-color: rgba(99,102,241,.25); }
.chat-order-item.active { background: rgba(99,102,241,.07); border-color: var(--primary, #6366f1); box-shadow: 0 0 0 1px rgba(99,102,241,.15); }
/* Unread = green glow */
.chat-order-item.chat-unread {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,.18), 0 2px 10px rgba(34,197,94,.12);
  background: rgba(34,197,94,.04);
}
.chat-order-item.chat-unread:hover {
  background: rgba(34,197,94,.08);
  box-shadow: 0 0 0 2px rgba(34,197,94,.28), 0 4px 14px rgba(34,197,94,.16);
}
.chat-order-unread-badge { background: #22c55e !important; }
/* Muted style for done/archived items */
.chat-order-item.chat-order-done { opacity: .68; }
.chat-order-item.chat-order-done:hover { opacity: 1; }

/* Folder tabs inside sidebar */
.chat-folder-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  background: var(--card); flex-shrink: 0; overflow-x: auto;
}
.chat-folder-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 8px 6px 7px;
  font-size: 10px; font-weight: 700; color: var(--muted);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; transition: all .15s; white-space: nowrap; position: relative;
  min-width: 0;
}
.chat-folder-tab:hover { color: var(--text); background: rgba(99,102,241,.04); }
.chat-folder-tab.active { color: var(--primary, #6366f1); border-bottom-color: var(--primary, #6366f1); background: rgba(99,102,241,.05); }
.chat-folder-tab .cf-icon { font-size: 13px; margin-bottom: 1px; }
.chat-folder-badge {
  position: absolute; top: 4px; right: 6px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: #22c55e; color: #fff;
  font-size: 9px; font-weight: 800; line-height: 16px; text-align: center; padding: 0 4px;
}
.chat-order-av {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.chat-order-info { flex: 1; min-width: 0; }
.chat-order-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.chat-order-id { font-size: 11px; font-weight: 800; color: var(--primary, #6366f1); letter-spacing: .3px; flex-shrink: 0; }
.chat-order-name { font-weight: 700; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.chat-order-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.chat-order-status {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 6px; line-height: 1.4; white-space: nowrap; letter-spacing: .2px;
}
.chat-order-loc { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-order-person { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-order-tech { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-order-unread-badge {
  min-width: 20px; height: 20px; background: #6366f1; color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 10px; padding: 0 6px;
  line-height: 20px; text-align: center; flex-shrink: 0;
}

/* Empty state in main panel */
.chat-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; min-height: 420px; gap: 12px; color: var(--muted); padding: 40px; text-align: center;
}
.chat-empty-icon {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(139,92,246,.1));
  display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--primary);
}
.chat-empty-title { font-size: 16px; font-weight: 700; color: var(--text); }
.chat-empty-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Conversation header */
.chat-conv-header {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1.5px solid var(--line, #f1f5f9);
  background: var(--card); flex-shrink: 0;
}
.chat-conv-back {
  background: var(--bg, #f1f5f9); border: none; width: 34px; height: 34px;
  border-radius: 10px; cursor: pointer; color: var(--text); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.chat-conv-back:hover { background: var(--border); }
/* Hide back button on desktop in 2-panel */
@media (min-width: 700px) { .chat-split .chat-conv-back { display: none; } }
.chat-conv-av {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 20px; flex-shrink: 0;
}
.chat-conv-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-conv-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-send-btn { padding: 9px 16px; flex-shrink: 0; }

/* Mobile: full-width sidebar, toggle on conv-open */
@media (max-width: 699px) {
  .chat-split { flex-direction: column; max-height: none; min-height: 0; }
  .chat-split-sidebar { width: 100%; border-right: none; border-bottom: 1.5px solid var(--border); max-height: 260px; }
  .chat-split.conv-open .chat-split-sidebar { display: none; }
  .chat-split.conv-open .chat-split-main { height: calc(100svh - 130px); height: calc(100vh - 130px); overflow: hidden; }
  .chat-split .chat-conv-back { display: flex !important; }
}

/* ═══ Support form V2 ═══ */
.support-new-card {
  background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
  border: 1.5px solid rgba(139,92,246,.15); border-radius: 16px;
  padding: 20px 22px; margin-bottom: 20px;
}
.support-new-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.support-new-icon {
  width: 50px; height: 50px; border-radius: 14px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; flex-shrink: 0;
}
.support-new-title { font-size: 16px; font-weight: 800; color: #3b0764; }
.support-new-sub { font-size: 12px; color: #7c3aed; margin-top: 2px; }
.support-chips-label { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.support-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.support-chip {
  padding: 7px 13px; border-radius: 99px; border: 1.5px solid rgba(139,92,246,.25);
  background: #fff; color: #6d28d9; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.support-chip:hover { border-color: #8b5cf6; background: rgba(139,92,246,.06); }
.support-chip.active { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(124,58,237,.3); }
.support-msg-wrap { position: relative; margin-bottom: 14px; }
.support-textarea {
  width: 100%; border: 1.5px solid rgba(139,92,246,.25); border-radius: 12px;
  padding: 12px 14px; font-size: 13px; color: var(--text); background: #fff;
  resize: vertical; min-height: 100px; outline: none; font-family: inherit;
  box-sizing: border-box; transition: border-color .15s; line-height: 1.5;
}
.support-textarea:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,.12); }
.support-char-count { font-size: 11px; color: var(--muted); text-align: right; margin-top: 4px; }
.support-send-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff;
  border: none; border-radius: 12px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: opacity .15s, transform .15s;
  box-shadow: 0 3px 12px rgba(124,58,237,.3);
}
.support-send-btn:hover { opacity: .92; transform: translateY(-1px); }
.support-list-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding: 0 2px;
}
.support-list-head > span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* Support ticket cards */
.support-ticket-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--card); border: 1.5px solid var(--border); border-radius: 14px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.support-ticket-card:hover { border-color: #8b5cf6; box-shadow: 0 2px 12px rgba(139,92,246,.1); }

/* Support conversation wrapper */
.support-conv-wrap {
  border: 1.5px solid var(--border); border-radius: 16px;
  overflow: hidden; margin-top: 8px; background: var(--card);
}

/* ═══════════════════════════════════════════════
   PHOTO GRID & DOCS
   ═══════════════════════════════════════════════ */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.photo-item {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.photo-item:hover { transform: scale(1.03); }

.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-upload-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 2px dashed var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  background: var(--primary-soft);
  transition: background var(--transition-fast);
}

.photo-upload-btn:hover { background: rgba(99, 102, 241, 0.12); }
.photo-upload-btn i { font-size: 20px; }

.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.doc-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.doc-info { flex: 1; min-width: 0; }
.doc-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ═══════════════════════════════════════════════
   NOTIFICATION ITEMS
   ═══════════════════════════════════════════════ */

.notification-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: all var(--transition-fast);
}

.notification-item:hover { border-color: #cbd5e1; }

.notification-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
  color: #fff;
}

.notif-list { display: flex; flex-direction: column; gap: 0; }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: default;
}

.notif-item:last-child { border-bottom: none; }

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

.notif-icon.new-order { background: var(--primary-soft); color: var(--primary); }
.notif-icon.assigned  { background: var(--info-soft); color: var(--info); }
.notif-icon.message   { background: var(--accent-soft); color: var(--accent); }
.notif-icon.cancel    { background: var(--danger-soft); color: var(--danger); }

.notif-body { flex: 1; }
.notif-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 0 0 2px; }

.notif-item.unread .notif-title::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 6px;
  vertical-align: 1px;
}

.notif-text { font-size: 13px; color: var(--muted); margin: 0; }
.notif-time { font-size: 12px; color: var(--muted); flex-shrink: 0; }

/* ═══════════════════════════════════════════════
   LOG ITEMS
   ═══════════════════════════════════════════════ */

.log-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.log-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
  color: #fff;
}

.log-content { flex: 1; }
.log-time { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ═══════════════════════════════════════════════
   ROLE & USER CARDS
   ═══════════════════════════════════════════════ */

.role-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
}

.role-card h3 { margin: 0 0 8px; font-family: 'Manrope', sans-serif; }
.role-description { color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.role-permissions { display: flex; flex-wrap: wrap; gap: 6px; }

.permission-tag {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

.debug-info {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  border: 1px solid rgba(99, 102, 241, 0.12);
  font-size: 13px;
  margin-bottom: 16px;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: all var(--transition-fast);
}

.user-row:hover { border-color: #cbd5e1; }

.user-info { display: flex; align-items: center; gap: 12px; }

.user-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.master-card, .aggregator-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-fast);
}

.master-card:hover, .aggregator-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.master-header, .aggregator-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.master-avatar, .aggregator-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.master-stats { display: flex; gap: 20px; margin-top: 12px; font-size: 14px; }

/* ═══════════════════════════════════════════════
   FINANCE
   ═══════════════════════════════════════════════ */

.finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.finance-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.finance-card h3 { margin: 0 0 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.finance-card .value { font: 800 clamp(22px, 2.5vw, 32px)/1 'Manrope', sans-serif; }

.status-color { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }

/* ═══════════════════════════════════════════════
   BULLET LIST
   ═══════════════════════════════════════════════ */

.bullet-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.bullet-list li {
  display: flex;
  gap: 10px;
  align-items: start;
  font-size: 14px;
}

.bullet-list li::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  background: var(--primary);
  flex: 0 0 auto;
}

.status-note { margin-top: 12px; font-size: 14px; color: var(--muted); }

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.kpi-note { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* ═══════════════════════════════════════════════
   PROFILE — Hero, Tabs, Grid
   ═══════════════════════════════════════════════ */

.profile-hero {
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary-soft), rgba(245, 158, 11, 0.06));
  border: 1px solid var(--border);
}

.profile-hero-body {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 28px;
}

.profile-hero-avatar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.profile-hero-avatar .profile-avatar {
  width: 100px; height: 100px;
  font-size: 40px;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-lg);
}

.profile-hero-info { flex: 1; min-width: 0; }

.profile-hero-name {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.profile-hero-meta i { color: var(--primary); margin-right: 4px; }

.profile-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
}

.profile-stat {
  padding: 10px 20px;
  border-right: 1px solid var(--border);
  text-align: center;
  min-width: 80px;
}

.profile-stat:last-child { border-right: none; }

.profile-stat-val { font-size: 16px; font-weight: 800; color: var(--primary); line-height: 1.1; }

.profile-stat-lbl {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
}

.profile-tab {
  flex: 1;
  min-width: 100px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.profile-tab:hover { background: var(--surface); color: var(--text); }

.profile-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.profile-tab-pane { display: none; }
.profile-tab-pane.active { display: block; }

.profile-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.profile-field-table { display: flex; flex-direction: column; }

.profile-field-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.profile-field-row:last-child { border-bottom: none; }

.profile-field-label {
  min-width: 120px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-field-value { flex: 1; color: var(--text); font-size: 14px; font-weight: 500; word-break: break-word; }

.profile-cards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.profile-data-card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-height: 70px;
}

.profile-data-card-wide { grid-column: 1 / -1; }
.profile-overview-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.profile-data-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.profile-data-label i { color: var(--primary); }

.profile-data-value {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.profile-data-value-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.profile-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* Profile avatar */
.profile-card { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }

.profile-avatar-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: opacity var(--transition-fast);
}

.profile-avatar:hover { opacity: 0.85; }

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.profile-avatar:hover .profile-avatar-overlay { opacity: 1; }

.profile-avatar-btn { font-size: 12px; padding: 5px 14px; cursor: pointer; }
.profile-avatar-btn.uploading { opacity: 0.6; pointer-events: none; }
.profile-avatar-btn.success { background: var(--success) !important; border-color: var(--success) !important; }

.profile-info-list { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 10px; }

.profile-info-row { display: flex; gap: 8px; font-size: 14px; align-items: baseline; }
.profile-info-label { color: var(--muted); min-width: 100px; flex-shrink: 0; font-size: 13px; }
.profile-info-value { color: var(--text); font-weight: 500; }

.profile-logout-btn { margin-top: 14px; font-size: 13px; padding: 6px 16px; opacity: 0.7; }
.profile-logout-btn:hover { opacity: 1; }

/* Achievement cards */
.achievement-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: all var(--transition-fast);
}

.achievement-card:hover { border-color: #cbd5e1; background: var(--surface); }

.achievement-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.achievement-lbl { font-size: 13px; font-weight: 700; color: var(--text); }
.achievement-desc { font-size: 11px; color: var(--muted); }

/* ═══════════════════════════════════════════════
   DRAWER / SLIDE PANEL
   ═══════════════════════════════════════════════ */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.drawer-overlay.active { opacity: 1; pointer-events: auto; }

.drawer-panel {
  position: fixed;
  top: 0;
  right: -480px;
  width: min(480px, 100vw);
  height: 100vh;
  background: var(--surface);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.1);
  z-index: 501;
  display: flex;
  flex-direction: column;
  transition: right var(--transition-smooth);
  overflow: hidden;
}

.drawer-panel.active { right: 0; }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  font-family: 'Manrope', sans-serif;
}

.drawer-close {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.drawer-close:hover { background: var(--bg); color: var(--text); }

.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-panel {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: min(560px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-smooth);
}

.modal-overlay.active .modal-panel { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  font-family: 'Manrope', sans-serif;
}

.modal-close {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body { flex: 1; overflow-y: auto; padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════════
   MOBILE SIDEBAR
   ═══════════════════════════════════════════════ */

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  border: 0;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  transition: all var(--transition-fast);
}

.sidebar-toggle:hover { transform: scale(1.05); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 250;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s ease;
}

.sidebar-overlay.active { display: block; opacity: 1; }

/* Mobile topbar */
.mobile-topbar { display: none; }

/* Collapsible for mobile */
.mobile-collapsible-head { display: none; }
.mobile-collapsible-text { display: flex; flex-direction: column; min-width: 0; }
.mobile-collapsible-title { display: block; }
.mobile-collapsible-meta { display: block; margin-top: 2px; }
.mobile-collapsible-content { display: block; }
.collapsible-mobile.is-collapsed .mobile-collapsible-content { display: none; }

/* ═══════════════════════════════════════════════
   RESPONSIVE — Tablet (≤1080px)
   ═══════════════════════════════════════════════ */

@media (max-width: 1080px) {
  .hero-grid, .auth-grid, .app-grid,
  .portal-grid, .feature-grid { grid-template-columns: 1fr 1fr; }

  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .app-sidebar { width: 220px; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Mobile (≤768px)
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {

  .sidebar-toggle { display: flex; }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    padding: 0 12px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: none;
    z-index: 200;
    box-shadow: 0 2px 16px rgba(0,0,0,.25);
  }

  .mobile-topbar-btn {
    width: 42px; height: 42px;
    border: none;
    background: rgba(255,255,255,.08);
    color: #e2e8f0;
    font-size: 18px;
    display: grid;
    place-items: center;
    cursor: pointer;
    border-radius: 12px;
    transition: background .2s, transform .15s;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-topbar-btn:active { background: rgba(255,255,255,.18); transform: scale(.92); }

  .mobile-topbar-title {
    font-size: 17px;
    font-weight: 800;
    font-family: 'Manrope', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f1f5f9;
    letter-spacing: -.02em;
  }

  .app-shell { display: block; }

  .app-sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: min(300px, 82dvw);
    max-width: 300px;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 300;
    transform: translate3d(-100%, 0, 0);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    will-change: transform;
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    box-shadow: 8px 0 32px rgba(0,0,0,.4);
    -webkit-overflow-scrolling: touch;
  }

  .app-sidebar.open { transform: translate3d(0, 0, 0); }

  /* Padding-top: 72px for pages with mobile-topbar, or 24px for admin pages with only toggle btn */
  .app-main { padding: 24px 16px max(80px, calc(62px + env(safe-area-inset-bottom))); }
  .profi-mobile-ready .app-main { padding-top: 72px; }

  /* Admin pages: ensure sidebar toggle doesn't overlap content */
  .app-main .admin-crm-header { margin-top: 0; }
  body:not(.profi-mobile-ready) .app-main { padding-top: 68px; }

  .app-panel { padding: 14px; border-radius: var(--radius-md); }

  /* ═══ Мобильный сайдбар: улучшенная навигация ═══ */
  .app-sidebar .sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    margin-bottom: 4px;
  }
  .app-sidebar .sidebar-brand .brand-mark {
    width: 38px; height: 38px; font-size: 16px;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    box-shadow: 0 4px 12px rgba(99,102,241,.35);
  }
  .app-sidebar .nav-menu a {
    padding: 12px 14px;
    font-size: 14.5px;
    border-radius: 12px;
    margin: 1px 0;
    transition: all .2s ease;
  }
  .app-sidebar .nav-menu a i {
    font-size: 16px;
    width: 22px;
  }
  .app-sidebar .nav-menu a:active {
    transform: scale(.97);
    background: rgba(255,255,255,.1);
  }
  .app-sidebar .nav-menu a.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 4px 16px rgba(99,102,241,.35);
  }
  .app-sidebar .nav-group-label {
    font-size: 10.5px;
    margin: 18px 10px 6px;
    color: rgba(148,163,184,.45);
    letter-spacing: .1em;
  }
  .app-sidebar .sidebar-bottom {
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 12px 16px;
  }
  /* Кнопка закрытия мобильного сайдбара */
  .mobile-sidebar-close {
    position: absolute; top: 14px; right: 14px;
    width: 36px; height: 36px;
    border: none; background: rgba(255,255,255,.06);
    color: #94a3b8; font-size: 18px;
    border-radius: 10px; cursor: pointer;
    display: none; place-items: center;
    transition: background .2s, transform .15s;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-sidebar-close:active { background: rgba(255,255,255,.15); transform: scale(.9); }
  .app-sidebar.open .mobile-sidebar-close { display: grid; }
  /* ═══ END мобильный сайдбар ═══ */

  .page-head {
    flex-direction: column; gap: 10px; margin-bottom: 14px;
    padding: 14px !important; border-radius: var(--radius-sm) !important;
  }
  .page-title { font-size: clamp(18px, 5vw, 24px); }
  .page-subtitle { font-size: 13px; }

  .eyebrow { font-size: 10px; padding: 3px 10px; }

  .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .super-grid, .module-grid, .mini-chart-grid,
  .security-grid, .app-grid { grid-template-columns: 1fr !important; }

  /* Tables: scroll horizontally instead of breaking layout */
  .admin-table, .activity-table, .finance-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-table table, .table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .notification-item, .log-item { flex-wrap: wrap; }
  .log-time { width: 100%; }

  .header-actions { flex-direction: column; width: 100%; }

  .header-actions .btn-primary,
  .header-actions .btn-secondary,
  .header-actions .btn-ghost { width: 100%; justify-content: center; }

  .btn-primary, .btn-secondary, .btn-ghost {
    width: 100%; justify-content: center;
    min-height: 42px; padding: 10px 16px;
    font-size: 14px;
  }

  .hero-grid, .auth-grid, .app-grid,
  .metrics-grid, .portal-grid, .feature-grid,
  .trust-grid, .form-grid { grid-template-columns: 1fr; }

  .hero-panel, .hero-side, .auth-card, .auth-aside,
  .app-panel, .section-card, .table-card,
  .portal-card, .feature-card, .metric-card { padding: 14px; }

  .section-card { margin-bottom: 12px; overflow-x: hidden; }

  .topbar { padding: 14px 0 8px; }
  .topbar-row { flex-wrap: wrap; gap: 10px; }
  .topbar-note { display: none; }
  .hero { padding: 16px 0 32px; }

  .container-wide, .auth-grid {
    max-width: 1180px;
    width: calc(100% - 20px);
    margin: 0 auto;
    box-sizing: border-box;
  }

  .auth-shell { padding: 14px 0; align-items: flex-start; }
  .auth-aside { padding: 20px; order: 2; }
  .auth-card { padding: 20px; order: 1; }

  .admin-crm-header {
    flex-wrap: wrap; gap: 8px;
    padding: 10px 12px;
  }
  .admin-crm-search { max-width: none; width: 100%; min-width: 0; order: 3; }

  /* Drawer: avoid 100vw overflow on Android/PWA */
  .drawer-panel { width: 100%; max-width: 100%; right: -100%; }

  .profile-hero { border-radius: var(--radius-lg); }

  .profile-hero-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    gap: 14px;
  }

  .profile-hero-avatar .profile-avatar { width: 80px; height: 80px; font-size: 32px; }
  .profile-avatar-btn { width: 100%; justify-content: center; }

  .profile-hero-meta { justify-content: center; gap: 8px 16px; }
  .profile-hero-stats { width: 100%; justify-content: center; }
  .profile-stat { flex: 1; min-width: 60px; padding: 8px 10px; }

  .profile-tabs { padding: 3px; gap: 2px; border-radius: var(--radius-sm); }

  .profile-tab {
    min-width: unset;
    flex: 1 1 calc(50% - 2px);
    padding: 8px;
    font-size: 12px;
    gap: 4px;
    border-radius: 6px;
  }

  .profile-info-grid { grid-template-columns: 1fr; }
  .profile-form-grid { grid-template-columns: 1fr; }
  .profile-cards-grid { grid-template-columns: 1fr; }
  .profile-overview-grid { grid-template-columns: repeat(2, 1fr); }

  .profile-data-card { min-height: 0; padding: 10px; }
  .profile-data-label { font-size: 10px; margin-bottom: 4px; }
  .profile-data-value { font-size: 13px; }

  .profile-data-value-inline { gap: 6px; }
  .profile-data-value-inline button,
  .profile-data-value-inline .btn-secondary { width: 100%; justify-content: center; }

  #sec-profile .section-head { flex-direction: column; align-items: stretch; gap: 8px; }

  #sec-profile .section-head .btn-primary,
  #sec-profile .section-head .btn-secondary,
  #sec-profile .section-head label.btn-primary { width: 100%; justify-content: center; }

  #verificationChecklist { grid-template-columns: 1fr !important; }
  .profile-two-col-grid { grid-template-columns: 1fr !important; }
  .profile-inline-check { align-items: flex-start !important; flex-wrap: wrap; }

  .profile-field-row { flex-direction: column; gap: 2px; padding: 8px 0; }
  .profile-field-label { min-width: unset; }

  .profile-card { flex-direction: column; align-items: center; text-align: center; }
  .profile-info-row { flex-direction: column; align-items: center; gap: 2px; }
  .profile-info-label { min-width: unset; }

  .admin-card-grid, .finance-grid { grid-template-columns: 1fr; }
  .admin-list-item, .order-item, .user-row { flex-direction: column; align-items: stretch; }
  .action-group { justify-content: stretch; }

  .collapsible-mobile {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    background: var(--bg);
  }

  .settings-form { gap: 12px; }
  .form-group { gap: 4px; }
  .form-input { min-height: 40px; padding: 8px 12px; font-size: 13px; }

  .mobile-collapsible-head {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    border: none;
    background: transparent;
    color: var(--text);
    padding: 2px 0 8px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
  }

  .mobile-collapsible-title { font-size: 13px; font-weight: 700; }

  .mobile-collapsible-meta {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 230px;
  }

  .mobile-collapsible-arrow {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    transition: transform 0.2s ease;
  }

  .collapsible-mobile.is-collapsed .mobile-collapsible-arrow { transform: rotate(-90deg); }
}

/* ═══════════════════════════════════════════════
   COLLAPSED SIDEBAR (desktop)
   ═══════════════════════════════════════════════ */

/* Sidebar collapse toggle button */
.sidebar-collapse-btn {
  background: none; border: none; color: rgba(255,255,255,0.5);
  cursor: pointer; margin-left: auto; padding: 4px 6px; border-radius: 6px;
  transition: color 0.2s, background 0.2s, transform 0.3s;
  font-size: 14px; line-height: 1; display: flex; align-items: center;
}
.sidebar-collapse-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.admin-sidebar-collapsed .sidebar-collapse-btn { transform: rotate(180deg); margin: 0 auto; }

.admin-sidebar-collapsed .app-sidebar { width: var(--sidebar-collapsed-width); }
.admin-sidebar-collapsed .app-shell { grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr); }
.admin-sidebar-collapsed .sidebar-brand span:not(.brand-mark) { display: none; }
.admin-sidebar-collapsed .sidebar-brand { justify-content: center; padding: 20px 0 16px; }
/* Collapsed: только марка 28px, подпись скрыта (не переопределять .brand-name обратно в visible) */
.admin-sidebar-collapsed .sidebar-brand.brand-link.is-compact {
  justify-content: center !important;
  padding: 14px 0 !important;
  min-height: 52px !important;
}
.admin-sidebar-collapsed .sidebar-brand.brand-link.is-compact .brand-name {
  display: none !important;
}
.admin-sidebar-collapsed .sidebar-brand.brand-link.is-compact .brand-mark-img,
.admin-sidebar-collapsed .sidebar-brand.brand-link.is-compact > img.brand-mark-img {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  flex: 0 0 28px !important;
}
.admin-sidebar-collapsed .nav-group-label { display: none; }
.admin-sidebar-collapsed .nav-menu a span { display: none; }
.admin-sidebar-collapsed .nav-menu a { justify-content: center; padding: 10px; }
.admin-sidebar-collapsed .nav-badge { display: none; }
.admin-sidebar-collapsed .sidebar-logout span { display: none; }
.admin-sidebar-collapsed .sidebar-logout { justify-content: center; }
.admin-sidebar-collapsed .sidebar-nav { padding: 4px 8px 8px; }

/* ═══════════════════════════════════════════════
   COLLAPSED SIDEBAR — RESET on mobile (≤768px)
   На мобильных сайдбар всегда показывает текст
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .admin-sidebar-collapsed .app-sidebar { width: 280px !important; }
  .admin-sidebar-collapsed .sidebar-brand span:not(.brand-mark) { display: inline !important; }
  .admin-sidebar-collapsed .sidebar-brand { justify-content: flex-start !important; padding: 20px 20px 16px !important; }
  .admin-sidebar-collapsed .sidebar-brand.brand-link.is-compact {
    justify-content: flex-start !important;
    padding: 14px 18px !important;
  }
  .admin-sidebar-collapsed .sidebar-brand.brand-link.is-compact .brand-name { display: inline-flex !important; }
  .admin-sidebar-collapsed .nav-group-label { display: block !important; }
  .admin-sidebar-collapsed .nav-menu a span { display: inline !important; }
  .admin-sidebar-collapsed .nav-menu a { justify-content: flex-start !important; padding: 9px 16px !important; }
  .admin-sidebar-collapsed .nav-badge { display: inline-flex !important; }
  .admin-sidebar-collapsed .sidebar-logout span { display: inline !important; }
  .admin-sidebar-collapsed .sidebar-logout { justify-content: flex-start !important; }
  .admin-sidebar-collapsed .sidebar-nav { padding: 8px 12px 12px !important; }
  .sidebar-collapse-btn { display: none !important; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Small Mobile (≤480px)
   ═══════════════════════════════════════════════ */

@media (max-width: 480px) {
  .app-main { padding: 12px 8px max(80px, calc(72px + env(safe-area-inset-bottom))) !important; }
  .profi-mobile-ready .app-main { padding-top: 64px !important; }
  body:not(.profi-mobile-ready) .app-main { padding-top: 60px !important; }

  .app-panel { padding: 10px !important; }
  .page-head { padding: 10px !important; }
  .page-title { font-size: 17px !important; }
  .page-subtitle { font-size: 12px !important; }

  .metrics-grid { gap: 8px !important; }
  .metric-card { padding: 10px !important; }
  .metric-card .metric-value { font-size: 20px !important; }
  .metric-card h3 { font-size: 11px !important; }

  .section-card { padding: 10px !important; }
  .section-head h2 { font-size: 15px !important; }

  .btn-primary, .btn-secondary, .btn-ghost {
    min-height: 40px; padding: 8px 12px !important; font-size: 13px !important;
  }

  .form-input, select.form-input, textarea.form-input {
    min-height: 40px; font-size: 13px !important;
  }

  .auth-card { padding: 16px !important; }
  .auth-aside { display: none; }
  .auth-title { font-size: 20px !important; }

  .profile-hero-body { padding: 14px 10px !important; gap: 10px !important; }
  .profile-hero-avatar .profile-avatar { width: 64px !important; height: 64px !important; font-size: 26px !important; }
  .profile-hero-name { font-size: 16px !important; }

  .profile-tab { padding: 6px 8px !important; font-size: 11px !important; }
  .profile-overview-grid { grid-template-columns: 1fr !important; }

  .modal-box { width: calc(100vw - 16px) !important; max-height: 90vh; padding: 16px !important; }

  .photo-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .photo-item { height: 120px !important; }

  /* Компактная карточка мастера — 1 колонка на мобильном */
  #profileInfoCards { grid-template-columns: 1fr !important; }
  #profileInfoCards > div { border-right: none !important; }
}

/* ═══════════════════════════════════════════════
   GLOBAL CHAT — premium messenger shell (#sec-chat)
   Мастер + агрегатор: единая система, без смены id/class для JS.
   ═══════════════════════════════════════════════ */
#sec-chat {
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

#sec-chat .chat-m-hero-desc,
#sec-chat .chat-desk-premium__desc {
  margin: 4px 0 0;
  font: 500 12px/1.45 system-ui, -apple-system, 'Inter', sans-serif;
  color: var(--muted, #64748b);
  max-width: 42ch;
}

#sec-chat .chat-desk-premium {
  margin-bottom: 14px !important;
  padding: 0;
  border: none !important;
  background: transparent !important;
}

#sec-chat .chat-desk-premium__inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 55%, #f1f5f9 100%);
  box-shadow: 0 4px 22px rgba(15, 23, 42, 0.06), 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

#sec-chat .chat-desk-premium__icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

#sec-chat .chat-desk-premium__kicker {
  margin: 0 0 2px;
  font: 700 9px/1.2 system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

#sec-chat .chat-desk-premium__title {
  margin: 0;
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: var(--text, #0f172a) !important;
}

#sec-chat .chat-split {
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.05);
  background: var(--card, #fff);
}

#sec-chat .chat-folder-tabs {
  gap: 6px;
  padding: 6px 8px 8px;
  margin: 0 8px 8px;
  border-bottom: none;
  background: rgba(241, 245, 249, 0.85);
  border-radius: 14px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.7);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#sec-chat .chat-folder-tab {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 11px;
  border: none !important;
  border-bottom: none !important;
  padding: 8px 6px 7px;
  background: transparent;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

#sec-chat .chat-folder-tab:hover {
  background: rgba(255, 255, 255, 0.65);
  color: var(--text);
}

#sec-chat .chat-folder-tab.active {
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  color: var(--primary, #6366f1);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.12), 0 0 0 1px rgba(199, 210, 254, 0.65);
}

#sec-chat .chat-tab-switcher {
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.75);
  margin-bottom: 14px;
}

#sec-chat .chat-tab-btn {
  border-radius: 11px;
  border-width: 0 !important;
  padding: 10px 8px;
}

#sec-chat .chat-tab-btn.active {
  border-width: 0 !important;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.12), 0 0 0 1px rgba(199, 210, 254, 0.55);
}

#sec-chat .chat-empty-state {
  min-height: min(52vh, 380px);
  padding: 28px 20px;
  gap: 10px;
}

#sec-chat .chat-empty-icon {
  width: 56px;
  height: 56px;
  font-size: 22px;
}

#sec-chat .chat-empty-title {
  font-size: 15px;
}

#sec-chat .chat-empty-sub {
  font-size: 12.5px;
  max-width: 22rem;
}

/* Пустой список папок / тредов (класс из JS) */
#sec-chat .chat-folder-empty,
#sec-chat #chat-order-list > .chat-folder-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px 6px 12px;
  padding: 26px 16px;
  text-align: center;
  color: var(--muted, #64748b);
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.75);
}

#sec-chat .chat-folder-empty__ico,
#sec-chat .chat-folder-empty > i:first-child {
  font-size: 30px;
  opacity: 0.28;
  color: var(--primary, #6366f1);
  margin-bottom: 2px;
}

#sec-chat .chat-folder-empty__title,
#sec-chat .chat-folder-empty > .chat-folder-empty__title {
  font: 700 14px/1.35 system-ui, 'Inter', sans-serif;
  color: var(--text, #0f172a);
}

#sec-chat .chat-folder-empty__sub,
#sec-chat .chat-folder-empty > .chat-folder-empty__sub {
  font: 500 12px/1.45 system-ui, 'Inter', sans-serif;
  color: var(--muted, #64748b);
  max-width: 20rem;
}

@media (max-width: 699px) {
  #sec-chat .chat-folder-tabs {
    margin: 0 4px 8px;
    padding: 5px 6px 6px;
  }

  #sec-chat .chat-empty-state {
    min-height: 240px;
    padding: 20px 14px;
  }
}

/* ═══════════════════════════════════════════════
   GLOBAL — prevent horizontal overflow on all devices
   ═══════════════════════════════════════════════ */
html { overflow-x: hidden; }
/* 100% вместо 100vw — иначе при вертикальном скроллбаре появляется горизонтальный зазор */
body { overflow-x: hidden; max-width: 100%; }

/* ═══════════════════════════════════════════════
   CABINET — frontend verification gate (master + aggregator)
   ═══════════════════════════════════════════════ */

body.master-v2-cabinet-gate #appSidebar .nav-link[data-section="home"],
body.master-v2-cabinet-verification-pending #appSidebar .nav-link[data-section="home"],
body.master-v2-cabinet-gate #appSidebar .nav-link[data-section="feed"],
body.master-v2-cabinet-verification-pending #appSidebar .nav-link[data-section="feed"],
body.master-v2-cabinet-gate #appSidebar .nav-link[data-section="myorders"],
body.master-v2-cabinet-verification-pending #appSidebar .nav-link[data-section="myorders"],
body.master-v2-cabinet-gate #appSidebar .nav-link[data-section="chats"],
body.master-v2-cabinet-verification-pending #appSidebar .nav-link[data-section="chats"],
body.master-v2-cabinet-gate #appSidebar .nav-link[data-section="finance"],
body.master-v2-cabinet-verification-pending #appSidebar .nav-link[data-section="finance"],
body.master-v2-cabinet-gate #appSidebar .nav-link[data-section="wallet"],
body.master-v2-cabinet-verification-pending #appSidebar .nav-link[data-section="wallet"],
body.master-v2-cabinet-gate #appSidebar .nav-link[data-section="referral"],
body.master-v2-cabinet-verification-pending #appSidebar .nav-link[data-section="referral"],
body.master-v2-cabinet-gate #appSidebar .nav-link[data-section="statistics"],
body.master-v2-cabinet-verification-pending #appSidebar .nav-link[data-section="statistics"],
body.master-v2-cabinet-gate #appSidebar .mst-sb-nav-card[data-section="wallet"],
body.master-v2-cabinet-verification-pending #appSidebar .mst-sb-nav-card[data-section="wallet"],
body.master-v2-cabinet-gate .master-bottom-nav__btn[data-section="home"],
body.master-v2-cabinet-verification-pending .master-bottom-nav__btn[data-section="home"],
body.master-v2-cabinet-gate .master-bottom-nav__btn[data-section="feed"],
body.master-v2-cabinet-verification-pending .master-bottom-nav__btn[data-section="feed"],
body.master-v2-cabinet-gate .master-bottom-nav__btn[data-section="myorders"],
body.master-v2-cabinet-verification-pending .master-bottom-nav__btn[data-section="myorders"],
body.master-v2-cabinet-gate .master-bottom-nav__btn[data-section="chats"],
body.master-v2-cabinet-verification-pending .master-bottom-nav__btn[data-section="chats"] {
  display: none !important;
}

/* Master: при gate/pending в первых двух группах сайдбара не остаётся видимых пунктов — убираем «пустые» заголовки и списки */
body.master-v2-cabinet-gate #appSidebar .sidebar-nav > .nav-group-label:nth-child(1),
body.master-v2-cabinet-verification-pending #appSidebar .sidebar-nav > .nav-group-label:nth-child(1),
body.master-v2-cabinet-gate #appSidebar .sidebar-nav > ul.nav-menu:nth-child(2),
body.master-v2-cabinet-verification-pending #appSidebar .sidebar-nav > ul.nav-menu:nth-child(2),
body.master-v2-cabinet-gate #appSidebar .sidebar-nav > .nav-group-label:nth-child(3),
body.master-v2-cabinet-verification-pending #appSidebar .sidebar-nav > .nav-group-label:nth-child(3),
body.master-v2-cabinet-gate #appSidebar .sidebar-nav > ul.nav-menu:nth-child(4),
body.master-v2-cabinet-verification-pending #appSidebar .sidebar-nav > ul.nav-menu:nth-child(4) {
  display: none !important;
}

/* Пока ждём verification-status — не показывать рабочие панели даже до первого showSection */
body.master-v2-cabinet-verification-pending .master-panel[data-panel="home"],
body.master-v2-cabinet-verification-pending .master-panel[data-panel="feed"],
body.master-v2-cabinet-verification-pending .master-panel[data-panel="myorders"],
body.master-v2-cabinet-verification-pending .master-panel[data-panel="chats"],
body.master-v2-cabinet-verification-pending .master-panel[data-panel="finance"],
body.master-v2-cabinet-verification-pending .master-panel[data-panel="wallet"],
body.master-v2-cabinet-verification-pending .master-panel[data-panel="referral"],
body.master-v2-cabinet-verification-pending .master-panel[data-panel="statistics"] {
  display: none !important;
}

.vp-cabinet-verification-pending-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
}

.vp-pending-card {
  width: min(420px, 100%);
  border-radius: 18px;
  padding: 22px 20px 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
  border: 1px solid rgba(99, 102, 241, 0.22);
  box-shadow:
    0 12px 40px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset;
  text-align: center;
}

.vp-pending-title {
  font: 800 17px/1.3 'Manrope', system-ui, sans-serif;
  color: #0f172a;
  margin: 12px 0 6px;
}

.vp-pending-sub {
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
  margin: 0 0 14px;
}

.vp-pending-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  animation: vp-pending-spin 0.75s linear infinite;
}

@keyframes vp-pending-spin {
  to {
    transform: rotate(360deg);
  }
}

.vp-pending-logout {
  margin-top: 4px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.85);
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.master-verification-gate-shell .mvp-gate-card {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.98) 52%, rgba(238, 242, 255, 0.94) 100%);
  box-shadow:
    0 4px 28px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}

.master-verification-gate-shell .mvp-gate-card__decor {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 0% 0%, rgba(99, 102, 241, 0.16), transparent 55%),
    radial-gradient(90% 70% at 100% 0%, rgba(14, 165, 233, 0.12), transparent 50%);
  pointer-events: none;
}

.master-verification-gate-shell .mvp-gate-card__inner {
  position: relative;
  z-index: 1;
  padding: 28px 26px 26px;
}

.master-verification-gate-shell .mvp-gate-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font-size: 20px;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}

.master-verification-gate-shell .mvp-gate-card__title {
  margin: 0 0 8px;
  font: 800 22px/1.25 'Manrope', system-ui, sans-serif;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.master-verification-gate-shell .mvp-gate-card__lead {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
}

.master-verification-gate-shell .mvp-gate-missing {
  margin: 0 0 16px;
  padding: 12px 14px 12px 28px;
  border-radius: 12px;
  background: rgba(254, 243, 199, 0.55);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #78350f;
  font-size: 13px;
  line-height: 1.45;
}

.master-verification-gate-shell .mvp-gate-missing li + li {
  margin-top: 6px;
}

.master-verification-gate-shell .mvp-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.master-verification-gate-shell .mvp-gate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Manrope', system-ui, sans-serif;
  cursor: pointer;
  border: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.master-verification-gate-shell .mvp-gate-btn:active {
  transform: translateY(1px);
}

.master-verification-gate-shell .mvp-gate-btn--primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.master-verification-gate-shell .mvp-gate-btn--secondary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.28);
}

.master-verification-gate-shell .mvp-gate-btn--ghost {
  background: rgba(255, 255, 255, 0.75);
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.master-verification-gate-shell .mvp-gate-retry {
  margin-bottom: 12px;
}

@media (max-width: 520px) {
  .master-verification-gate-shell .mvp-gate-card__inner {
    padding: 22px 16px 20px;
  }
  .master-verification-gate-shell .mvp-gate-actions {
    flex-direction: column;
  }
  .master-verification-gate-shell .mvp-gate-btn {
    width: 100%;
    justify-content: center;
  }
}

body.cabinet-role-agg.agg-cabinet-verification-gate #sec-dashboard > .agg-hero,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-dashboard > .agg-hero,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-dashboard > #vp-onboarding-aggregator,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-dashboard > #vp-onboarding-aggregator,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-dashboard > .agg-dash-attention,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-dashboard > .agg-dash-attention,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-dashboard > .agg-dash-kpi-prem,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-dashboard > .agg-dash-kpi-prem,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-dashboard > .agg-dash-orders-cta-card,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-dashboard > .agg-dash-orders-cta-card,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-dashboard > #dash-unread-widget,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-dashboard > #dash-unread-widget,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-dashboard > #broadcastWidget,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-dashboard > #broadcastWidget,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-dashboard > #onlineMastersWidget,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-dashboard > #onlineMastersWidget,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-dashboard > .agg-quick-actions,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-dashboard > .agg-quick-actions,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-dashboard > #banner-app-download,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-dashboard > #banner-app-download,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-dashboard > .agg-dash-live-feed-card,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-dashboard > .agg-dash-live-feed-card {
  display: none !important;
}

body.cabinet-role-agg.agg-cabinet-verification-gate #sec-orders,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-orders,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-chat,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-chat,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-finance,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-finance,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-masters,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-masters,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-stats,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-stats,
body.cabinet-role-agg.agg-cabinet-verification-gate #sec-wallet,
body.cabinet-role-agg.agg-cabinet-verification-pending #sec-wallet {
  display: none !important;
}

/* Aggregator: gate/pending — рабочие пункты (#appSidebar / #mobileBottomNav выше специфичности чем .app-sidebar) */
body.cabinet-role-agg.agg-cabinet-verification-gate #appSidebar a[data-section="dashboard"],
body.cabinet-role-agg.agg-cabinet-verification-pending #appSidebar a[data-section="dashboard"],
body.cabinet-role-agg.agg-cabinet-verification-gate #appSidebar a[data-section="orders"],
body.cabinet-role-agg.agg-cabinet-verification-pending #appSidebar a[data-section="orders"],
body.cabinet-role-agg.agg-cabinet-verification-gate #appSidebar a[data-section="masters"],
body.cabinet-role-agg.agg-cabinet-verification-pending #appSidebar a[data-section="masters"],
body.cabinet-role-agg.agg-cabinet-verification-gate #appSidebar a[data-section="chat"],
body.cabinet-role-agg.agg-cabinet-verification-pending #appSidebar a[data-section="chat"],
body.cabinet-role-agg.agg-cabinet-verification-gate #appSidebar a[data-section="finance"],
body.cabinet-role-agg.agg-cabinet-verification-pending #appSidebar a[data-section="finance"],
body.cabinet-role-agg.agg-cabinet-verification-gate #appSidebar a[data-section="wallet"],
body.cabinet-role-agg.agg-cabinet-verification-pending #appSidebar a[data-section="wallet"],
body.cabinet-role-agg.agg-cabinet-verification-gate #appSidebar a[data-section="stats"],
body.cabinet-role-agg.agg-cabinet-verification-pending #appSidebar a[data-section="stats"],
body.cabinet-role-agg.agg-cabinet-verification-gate #mobileBottomNav a[data-section="dashboard"],
body.cabinet-role-agg.agg-cabinet-verification-pending #mobileBottomNav a[data-section="dashboard"],
body.cabinet-role-agg.agg-cabinet-verification-gate #mobileBottomNav a[data-section="orders"],
body.cabinet-role-agg.agg-cabinet-verification-pending #mobileBottomNav a[data-section="orders"],
body.cabinet-role-agg.agg-cabinet-verification-gate #mobileBottomNav a[data-section="masters"],
body.cabinet-role-agg.agg-cabinet-verification-pending #mobileBottomNav a[data-section="masters"],
body.cabinet-role-agg.agg-cabinet-verification-gate #mobileBottomNav a[data-section="chat"],
body.cabinet-role-agg.agg-cabinet-verification-pending #mobileBottomNav a[data-section="chat"],
body.cabinet-role-agg.agg-cabinet-verification-gate .agg-more-tile[data-more-go="finance"],
body.cabinet-role-agg.agg-cabinet-verification-pending .agg-more-tile[data-more-go="finance"],
body.cabinet-role-agg.agg-cabinet-verification-gate .agg-more-tile[data-more-go="wallet"],
body.cabinet-role-agg.agg-cabinet-verification-pending .agg-more-tile[data-more-go="wallet"],
body.cabinet-role-agg.agg-cabinet-verification-gate .agg-more-tile[data-more-go="stats"],
body.cabinet-role-agg.agg-cabinet-verification-pending .agg-more-tile[data-more-go="stats"] {
  display: none !important;
}

body.cabinet-role-agg.agg-cabinet-verification-gate #sbSubRow,
body.cabinet-role-agg.agg-cabinet-verification-pending #sbSubRow {
  display: none !important;
}

/* Aggregator: пустые группы «Основное» / «Финансы и аналитика» при gate/pending */
body.cabinet-role-agg.agg-cabinet-verification-gate #appSidebar .sidebar-nav > .nav-group-label:nth-child(1),
body.cabinet-role-agg.agg-cabinet-verification-pending #appSidebar .sidebar-nav > .nav-group-label:nth-child(1),
body.cabinet-role-agg.agg-cabinet-verification-gate #appSidebar .sidebar-nav > ul.nav-menu:nth-child(2),
body.cabinet-role-agg.agg-cabinet-verification-pending #appSidebar .sidebar-nav > ul.nav-menu:nth-child(2),
body.cabinet-role-agg.agg-cabinet-verification-gate #appSidebar .sidebar-nav > .nav-group-label:nth-child(3),
body.cabinet-role-agg.agg-cabinet-verification-pending #appSidebar .sidebar-nav > .nav-group-label:nth-child(3),
body.cabinet-role-agg.agg-cabinet-verification-gate #appSidebar .sidebar-nav > ul.nav-menu:nth-child(4),
body.cabinet-role-agg.agg-cabinet-verification-pending #appSidebar .sidebar-nav > ul.nav-menu:nth-child(4) {
  display: none !important;
}

body.cabinet-role-agg.agg-cabinet-verification-pending #aggVerificationPanel {
  display: none !important;
}

body.cabinet-role-agg.agg-cabinet-verification-gate #aggVerificationPanel {
  margin-bottom: 18px !important;
  border-radius: 18px !important;
  border-width: 1px !important;
  border-color: rgba(99, 102, 241, 0.28) !important;
  box-shadow:
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 45%, rgba(238, 242, 255, 0.95) 100%) !important;
}

/* ═══════════════════════════════════════════════
   UNIFIED verification profile workspace (master + agg)
   ═══════════════════════════════════════════════ */

.uvp-workspace {
  width: 100%;
  min-width: 0;
}

.uvp-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

@media (min-width: 880px) {
  .uvp-layout {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 280px);
    gap: 18px 20px;
  }
}

.uvp-layout__main {
  min-width: 0;
}

.uvp-layout__aside {
  min-width: 0;
}

.uvp-benefits {
  padding: 14px 14px 12px;
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.92) 0%, rgba(238, 242, 255, 0.88) 55%, rgba(248, 250, 252, 0.95) 100%);
  box-shadow:
    0 6px 22px rgba(15, 23, 42, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset;
}

.uvp-benefits--agg {
  border-color: rgba(245, 158, 11, 0.28);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(254, 243, 199, 0.35) 45%, rgba(248, 250, 252, 0.96) 100%);
}

.uvp-benefits__title {
  margin: 0 0 10px;
  font: 800 13px/1.3 'Manrope', system-ui, sans-serif;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.uvp-benefits__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.uvp-benefit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  line-height: 1.35;
}

.uvp-benefit:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.uvp-benefit__ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.12);
}

.uvp-benefits--agg .uvp-benefit__ico {
  color: #c2410c;
  background: rgba(245, 158, 11, 0.18);
}

.uvp-benefit__text {
  min-width: 0;
}

body.master-v2-cabinet-gate .master-verification-gate-shell .mvp-gate-card {
  max-width: min(920px, 100%);
}

.uvp-header {
  margin-bottom: 14px;
}

.uvp-header__title {
  margin: 0 0 8px;
}

.uvp-header__lead {
  margin: 0;
}

.uvp-header__title--agg {
  margin: 0 0 8px;
  font: 800 17px/1.25 'Manrope', system-ui, sans-serif;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.uvp-header__lead--agg {
  font-size: 13px;
  line-height: 1.55;
  color: #475569;
}

.uvp-progress {
  margin: 0 0 16px;
  padding: 12px 14px 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(241, 245, 249, 0.92));
  border: 1px solid rgba(99, 102, 241, 0.16);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 8px 28px rgba(15, 23, 42, 0.05);
}

.uvp-progress__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.uvp-progress__cap {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.uvp-progress__pct {
  font: 800 14px/1 'Manrope', system-ui, sans-serif;
  color: #4f46e5;
}

.uvp-progress__track-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.uvp-progress__track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.07), rgba(15, 23, 42, 0.04));
  border: 1px solid rgba(148, 163, 184, 0.22);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) inset;
}

.uvp-progress__bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 28%, #22d3ee 62%, #818cf8 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35) inset,
    0 2px 10px rgba(79, 70, 229, 0.35);
  transition: width 0.35s ease;
}

.uvp-progress__milestones {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 2px;
  margin-top: 2px;
}

.uvp-milestone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
}

.uvp-milestone__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.uvp-milestone__lbl {
  font-variant-numeric: tabular-nums;
}

.uvp-milestone--done {
  color: #047857;
}

.uvp-milestone--done .uvp-milestone__dot {
  background: linear-gradient(145deg, #34d399, #059669);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.35),
    0 2px 6px rgba(5, 150, 105, 0.25);
}

.uvp-milestone--current .uvp-milestone__dot {
  width: 10px;
  height: 10px;
  background: linear-gradient(145deg, #a5b4fc, #6366f1);
  box-shadow:
    0 0 0 2px rgba(99, 102, 241, 0.35),
    0 3px 10px rgba(79, 70, 229, 0.35);
}

.uvp-milestone--current {
  color: #4338ca;
}

.uvp-steps {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

@media (min-width: 520px) {
  .uvp-steps {
    grid-template-columns: 1fr 1fr;
  }
}

.uvp-steps--agg {
  margin-bottom: 12px;
}

.uvp-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.75));
  min-height: 54px;
  box-sizing: border-box;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.uvp-step:focus-within {
  outline: none;
  box-shadow:
    0 2px 10px rgba(15, 23, 42, 0.04),
    0 0 0 2px rgba(99, 102, 241, 0.28);
}

.uvp-step__ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  background: rgba(241, 245, 249, 0.95);
  color: #475569;
}

.uvp-step__body {
  min-width: 0;
  flex: 1;
}

.uvp-step__title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.uvp-step__meta {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.35;
}

.uvp-step--done {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, rgba(209, 250, 229, 0.45), rgba(255, 255, 255, 0.75));
}

.uvp-step--done .uvp-step__ico {
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
}

.uvp-step--pending {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.5), rgba(255, 255, 255, 0.8));
}

.uvp-step--pending .uvp-step__ico {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

.uvp-step--missing {
  border-color: rgba(239, 68, 68, 0.28);
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.35), rgba(255, 255, 255, 0.85));
}

.uvp-step--missing .uvp-step__ico {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.uvp-step--locked {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.65);
  opacity: 0.92;
}

.uvp-step--locked .uvp-step__ico {
  background: rgba(226, 232, 240, 0.95);
  color: #94a3b8;
}

.uvp-step--warning {
  border-color: rgba(234, 179, 8, 0.4);
  background: linear-gradient(135deg, rgba(254, 249, 195, 0.4), rgba(255, 255, 255, 0.85));
}

.uvp-step--warning .uvp-step__ico {
  background: rgba(234, 179, 8, 0.2);
  color: #a16207;
}

.uvp-todo {
  margin-bottom: 14px;
}

.uvp-todo__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #92400e;
  margin-bottom: 6px;
}

.master-verification-gate-shell .uvp-todo__list.mvp-gate-missing {
  margin-top: 0;
}

.uvp-todo__hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(254, 243, 199, 0.55);
  border: 1px solid rgba(245, 158, 11, 0.32);
  color: #78350f;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
}

.uvp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.uvp-actions__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Manrope', system-ui, sans-serif;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.uvp-actions__btn:active {
  transform: translateY(1px);
}

.uvp-actions__btn--primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 3px 12px rgba(217, 119, 6, 0.28);
}

.uvp-actions__btn--docs {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.28);
}

.uvp-actions__btn--support {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  box-shadow: 0 3px 12px rgba(14, 165, 233, 0.25);
}

.uvp-actions__btn--ghost {
  background: rgba(255, 255, 255, 0.75);
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.agg-uvp-verif-panel {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.98) 0%, rgba(254, 243, 199, 0.35) 42%, rgba(248, 250, 252, 0.96) 100%);
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

.agg-uvp-verif-panel__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.agg-uvp-verif-panel__badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.28);
}

.agg-uvp-verif-panel__main {
  flex: 1;
  min-width: 0;
}

.agg-uvp-workspace .uvp-progress {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(238, 242, 255, 0.75));
}

@media (max-width: 480px) {
  .uvp-actions {
    flex-direction: column;
  }
  .uvp-actions__btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .uvp-progress__bar {
    transition: none;
  }
  .uvp-step {
    transition: none;
  }
  .uvp-actions__btn {
    transition: none;
  }
  .uvp-actions__btn:active {
    transform: none;
  }
}

/* ═══════════════════════════════════════════════
   MASTER PROFILE — категории ленты (feed-cat-*)
   ═══════════════════════════════════════════════ */

.feed-cat-card {
  margin: 0 0 18px;
  padding: 14px 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(238, 242, 255, 0.55) 48%, rgba(248, 250, 252, 0.96) 100%);
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
}

.feed-cat-card__hd {
  margin-bottom: 8px;
}

.feed-cat-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.feed-cat-card__lead {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #475569;
}

.feed-cat-card__note {
  margin: 0 0 12px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #64748b;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.feed-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 520px) {
  .feed-cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .feed-cat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.feed-cat-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 10px;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  color: #334155;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.feed-cat-chip:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(255, 255, 255, 1);
}

.feed-cat-chip.is-active {
  color: #1e1b4b;
  border-color: rgba(99, 102, 241, 0.65);
  background: linear-gradient(145deg, rgba(224, 231, 255, 0.95), rgba(199, 210, 254, 0.55));
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.18);
}

.feed-cat-chip:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.feed-cat-empty-hint {
  margin: 10px 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #b45309;
}

.feed-cat-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feed-cat-save {
  flex: 1 1 auto;
  min-width: min(100%, 200px);
}

.feed-cat-status {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.feed-cat-status--ok {
  color: #14532d;
  background: rgba(220, 252, 231, 0.95);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.feed-cat-status--err {
  color: #7f1d1d;
  background: rgba(254, 226, 226, 0.95);
  border: 1px solid rgba(248, 113, 113, 0.45);
}

.feed-cat-status--warn {
  color: #78350f;
  background: rgba(254, 243, 199, 0.95);
  border: 1px solid rgba(245, 158, 11, 0.42);
}

.feed-cat-readonly {
  margin: 0 0 12px;
  padding: 10px 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(248, 250, 252, 0.92);
}

.feed-cat-readonly__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  margin: 0 0 4px;
}

.feed-cat-readonly__sub {
  margin: 0 0 8px;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: #64748b;
}

.feed-cat-readonly__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.feed-cat-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25;
  word-break: break-word;
}

.feed-cat-pill--admin {
  color: #3730a3;
  background: rgba(224, 231, 255, 0.95);
  border: 1px solid rgba(129, 140, 248, 0.55);
}

.feed-cat-pill--other {
  color: #92400e;
  background: rgba(254, 243, 199, 0.75);
  border: 1px solid rgba(251, 191, 36, 0.45);
}

/* ═══════════════════════════════════════════════
   AGGREGATOR — рабочий профиль (workspace, без правок API)
   ═══════════════════════════════════════════════ */

#sec-profile .agg-profile-workspace {
  max-width: 100%;
  overflow-x: hidden;
  padding-bottom: 2px;
}

/* Компактный intro перед главным summary (синий герой) */
#sec-profile .agg-profile-hero {
  margin: 0 0 8px;
  padding: 10px 12px 11px;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(238, 242, 255, 0.42) 48%, rgba(248, 250, 252, 0.98) 100%);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

#sec-profile .agg-profile-hero__title {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  font-family: Manrope, Inter, system-ui, sans-serif;
}

#sec-profile .agg-profile-hero__sub {
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: #64748b;
}

/* Мини-подсказки 2×2 / одна строка на широком — без «крупных карточек» */
#sec-profile .agg-profile-hints {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 10px;
}

@media (min-width: 720px) {
  #sec-profile .agg-profile-hints {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

#sec-profile .agg-profile-hint-card {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.88);
}

#sec-profile .agg-profile-hint-card__ico {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #4338ca;
  background: rgba(224, 231, 255, 0.75);
}

#sec-profile .agg-profile-hint-card__text {
  margin: 0;
  font-size: 0.625rem;
  line-height: 1.3;
  color: #475569;
}

/* Главный summary: ниже синего блока, чуть плотнее шапка */
#sec-profile .agg-hero-summary-card__gradient {
  padding: 20px 18px 44px;
}

@media (max-width: 520px) {
  #sec-profile .agg-hero-summary-card__gradient {
    padding: 16px 14px 38px;
  }
}

#sec-profile .agg-hero-summary-card__body {
  margin-top: -34px;
}

@media (max-width: 520px) {
  #sec-profile .agg-hero-summary-card__body {
    margin-top: -30px;
  }
}

/* Вкладки — главный рабочий слой: чуть больше воздуха */
#sec-profile .profile-nav-grid {
  gap: 8px;
  margin-bottom: 14px;
}

#sec-profile .profile-tab-pane {
  padding-top: 4px;
}

#sec-profile .profile-tab-pane > .agg-profile-card:first-child,
#sec-profile .profile-tab-pane > .agg-profile-trust-card:first-child {
  margin-top: 0;
}

#sec-profile .agg-profile-card {
  margin-bottom: 14px;
  padding: 14px 16px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.045);
}

#sec-profile .agg-profile-trust-card {
  margin-bottom: 14px;
  padding: 14px 16px 16px;
  border-radius: 16px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  background: linear-gradient(165deg, rgba(240, 253, 244, 0.42) 0%, rgba(255, 255, 255, 0.97) 55%);
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.045);
}

#sec-profile .agg-profile-card__hd {
  margin-bottom: 6px;
}

#sec-profile .agg-profile-card__title {
  margin: 0 0 3px;
  font-size: 0.9375rem;
  font-weight: 800;
  color: #0f172a;
  font-family: Manrope, Inter, system-ui, sans-serif;
}

#sec-profile .agg-profile-card__sub {
  margin: 0;
  font-size: 0.71875rem;
  line-height: 1.4;
  color: #64748b;
}

#sec-profile .agg-profile-micro-hint {
  margin: 0 0 6px;
  font-size: 0.625rem;
  line-height: 1.35;
  color: #64748b;
}

#sec-profile .profile-tab-pane .profile-info-card h3,
#sec-profile .profile-tab-pane .section-head h3 {
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
}

#sec-profile .profile-tab-pane .profile-info-grid {
  gap: 14px;
}

@media (max-width: 768px) {
  #sec-profile .profile-tab-pane .profile-info-grid {
    gap: 12px;
  }
}

#sec-profile .profile-tab-pane .section-card {
  border-radius: 14px;
}

#sec-profile .agg-profile-card .section-card {
  border-radius: 12px;
  border: 1px solid rgba(241, 245, 249, 0.95);
}

#sec-profile .agg-profile-team-metrics {
  gap: 10px;
}

@media (max-width: 520px) {
  #sec-profile .agg-profile-team-metrics {
    grid-template-columns: 1fr !important;
  }
}

#sec-profile .agg-profile-metric-card {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  min-width: 0;
}

#sec-profile .agg-profile-metric-card .metric-value {
  word-break: break-word;
}

/* ═══════════════════════════════════════════════
   PROFILE TRUST / READINESS (master + aggregator)
   ═══════════════════════════════════════════════ */

.trust-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.trust-state--ok {
  color: #14532d;
  background: rgba(220, 252, 231, 0.95);
  border-color: rgba(34, 197, 94, 0.35);
}

.trust-state--pending {
  color: #92400e;
  background: rgba(254, 243, 199, 0.95);
  border-color: rgba(245, 158, 11, 0.42);
}

.trust-state--warn {
  color: #7f1d1d;
  background: rgba(254, 226, 226, 0.95);
  border-color: rgba(248, 113, 113, 0.4);
}

#panel-profile .profile-readiness-card {
  margin: 0 0 12px;
  padding: 10px 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.97) 0%, rgba(238, 242, 255, 0.45) 42%, rgba(248, 250, 252, 0.98) 100%);
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
  max-width: 100%;
  overflow: hidden;
}

#panel-profile .profile-readiness-card__hd {
  margin-bottom: 8px;
}

#panel-profile .profile-readiness-card__title {
  margin: 0 0 3px;
  font-size: 0.9375rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

#panel-profile .profile-readiness-card__sub {
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: #64748b;
}

#panel-profile .profile-readiness-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

#panel-profile .profile-readiness-ring-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

#panel-profile .profile-readiness-ring-wrap .profile-readiness-ring__lbl {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}

#panel-profile .profile-readiness-ring {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: conic-gradient(
    #6366f1 var(--readiness-pct, 0%),
    rgba(226, 232, 240, 0.95) 0
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

#panel-profile .profile-readiness-ring::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.9);
  pointer-events: none;
  z-index: 1;
}

#panel-profile .profile-readiness-ring__lbl {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #312e81;
  z-index: 2;
  pointer-events: none;
}

#panel-profile .profile-readiness-hero__meta {
  flex: 1;
  min-width: 0;
}

#panel-profile .profile-readiness-hint {
  margin: 6px 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #475569;
}

#panel-profile .profile-readiness-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

@media (min-width: 640px) {
  #panel-profile .profile-readiness-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  #panel-profile .profile-readiness-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

#panel-profile .readiness-chip {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.92);
}

#panel-profile .readiness-chip__lbl {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 3px;
}

#panel-profile .readiness-chip__st {
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

#panel-profile .readiness-chip--ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(240, 253, 244, 0.75);
}

#panel-profile .readiness-chip--ok .readiness-chip__st {
  color: #15803d;
}

#panel-profile .readiness-chip--pending {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(254, 252, 232, 0.85);
}

#panel-profile .readiness-chip--pending .readiness-chip__st {
  color: #b45309;
}

#panel-profile .readiness-chip--warn {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(254, 242, 242, 0.75);
}

#panel-profile .readiness-chip--warn .readiness-chip__st {
  color: #b91c1c;
}

#panel-profile .profile-readiness-portfolio {
  margin-top: 2px;
}

#panel-profile .profile-readiness-port-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 60px));
  gap: 5px;
  align-items: start;
}

#panel-profile .profile-readiness-port-thumb {
  display: block;
  width: 60px;
  height: 60px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

@media (max-width: 520px) {
  #panel-profile .profile-readiness-port-grid {
    grid-template-columns: repeat(2, minmax(0, 52px));
    gap: 4px;
  }

  #panel-profile .profile-readiness-port-thumb {
    width: 52px;
    height: 52px;
  }
}

/* Профиль мастера: компактнее блок категорий ленты (только #panel-profile) */
#panel-profile .feed-cat-card {
  margin: 0 0 14px;
  padding: 11px 12px 13px;
  border-radius: 14px;
  box-shadow: 0 5px 18px rgba(15, 23, 42, 0.05);
}

#panel-profile .feed-cat-card__hd {
  margin-bottom: 6px;
}

#panel-profile .feed-cat-card__title {
  font-size: 0.9375rem;
}

#panel-profile .feed-cat-card__lead {
  margin: 0 0 6px;
  font-size: 0.75rem;
  line-height: 1.38;
}

#panel-profile .feed-cat-card__note {
  margin: 0 0 10px;
  font-size: 0.6875rem;
  line-height: 1.32;
  padding: 6px 8px;
}

#panel-profile .profile-readiness-port-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#panel-profile .profile-readiness-port-more {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 800;
  color: #4338ca;
  background: rgba(224, 231, 255, 0.9);
  border: 1px dashed rgba(99, 102, 241, 0.45);
}

.profile-empty-state {
  text-align: center;
  padding: 18px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.95);
}

.profile-empty-state--compact {
  padding: 12px 10px;
}

.profile-empty-state--compact.profile-empty-state--table {
  text-align: left;
  padding: 14px 12px;
}

.profile-empty-state--warn {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(255, 251, 235, 0.85);
}

.profile-empty-state__ico {
  font-size: 1.5rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.profile-empty-state__title {
  margin: 0 0 6px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
}

.profile-empty-state__text {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #64748b;
}

/* Агрегатор — герой: сетка статистики (desktop 4 col, mobile 2×2) */
#sec-profile .agg-hero-stats-grid {
  padding: 0 24px 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border-light, #f1f5f9);
  max-width: 100%;
}

#sec-profile .agg-hero-stats-cell {
  text-align: center;
  padding: 14px 8px;
  border-right: 1px solid var(--border-light, #f1f5f9);
  min-width: 0;
}

#sec-profile .agg-hero-stats-cell:last-child {
  border-right: none;
}

@media (max-width: 520px) {
  #sec-profile .agg-hero-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #sec-profile .agg-hero-stats-cell:nth-child(2n) {
    border-right: none;
  }

  #sec-profile .agg-hero-stats-cell:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border-light, #f1f5f9);
  }
}

#sec-profile .agg-hero-trust {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

#sec-profile .agg-hero-trust__headline {
  display: inline-flex;
  margin-bottom: 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

#sec-profile .agg-hero-trust .agg-hero-trust__headline.trust-state--ok {
  color: #ecfdf5;
  background: rgba(22, 163, 74, 0.42);
  border-color: rgba(52, 211, 153, 0.55);
}

#sec-profile .agg-hero-trust .agg-hero-trust__headline.trust-state--pending {
  color: #fffbeb;
  background: rgba(217, 119, 6, 0.48);
  border-color: rgba(251, 191, 36, 0.55);
}

#sec-profile .agg-hero-trust .agg-hero-trust__headline.trust-state--warn {
  color: #fef2f2;
  background: rgba(220, 38, 38, 0.42);
  border-color: rgba(252, 165, 165, 0.55);
}

#sec-profile .agg-hero-trust-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-width: 100%;
}

@media (min-width: 480px) {
  #sec-profile .agg-hero-trust-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 720px) {
  #sec-profile .agg-hero-trust-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

#sec-profile .agg-hero-trust-cell {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 0.625rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
}

#sec-profile .agg-hero-trust-cell.trust-state--ok {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.45);
}

#sec-profile .agg-hero-trust-cell.trust-state--pending {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.45);
}

#sec-profile .agg-hero-trust-cell.trust-state--warn {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.4);
}

#sec-profile .agg-hero-trust-cell__lbl {
  display: block;
  line-height: 1.25;
}

/* ═══════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════ */

@media print {
  .app-sidebar, .sidebar-toggle, .sidebar-overlay,
  .mobile-topbar, .admin-crm-header { display: none !important; }
  .app-shell { display: block; }
  .app-main { padding: 0; }
  .app-panel { box-shadow: none; border: none; }
}