/*
Опис: PCBHub app shell refinements for top navbar, sidebar, footer, and viewer sizing.
Шлях: public/assets/ui.css
*/

:root {
  --ck-topbar-height: 64px;
  --ck-footer-height: 46px;
  --ck-sidebar-width: 248px;
}

.ck-app .ck-shell {
  grid-template-columns: var(--ck-sidebar-width) minmax(0, 1fr);
}

.ck-main {
  margin: 0;
  max-width: none;
  padding: 0;
}

.ck-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.ck-content-inner {
  margin: 0 auto;
  max-width: 1280px;
  padding: 24px;
  width: 100%;
}

.ck-topbar {
  background: rgba(255, 255, 255, 0.96);
  border: 0;
  border-bottom: 1px solid var(--ck-line);
  border-radius: 0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: var(--ck-topbar-height);
  margin: 0;
  padding: 0 20px;
  top: 0;
  width: 100%;
}

.ck-topbar-left {
  align-items: center;
  display: flex;
  gap: 18px;
  min-width: 0;
}

.ck-topbar-status {
  align-items: center;
  display: flex;
  gap: 8px;
}

.ck-status-pill {
  background: var(--ck-surface-muted);
  border: 1px solid var(--ck-line);
  border-radius: 999px;
  color: var(--ck-text-muted);
  font-size: 12px;
  padding: 5px 9px;
  white-space: nowrap;
}

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

.ck-nav-active {
  background: var(--ck-sidebar-soft);
  color: #ffffff !important;
}

.ck-footer {
  align-items: center;
  background: #ffffff;
  border-top: 1px solid var(--ck-line);
  color: var(--ck-text-muted);
  display: grid;
  font-size: 12px;
  gap: 12px;
  grid-template-columns: 1fr auto 1fr;
  min-height: var(--ck-footer-height);
  padding: 8px 20px;
  width: 100%;
}

.ck-footer-left,
.ck-footer-center,
.ck-footer-right {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ck-footer-center {
  justify-content: center;
}

.ck-footer-right {
  justify-content: flex-end;
}

/* ================================================================
   ADMIN — Бейджі статусів клієнтів та планів
   ================================================================ */

/* Статуси організацій */
.ck-admin-status-active {
  background: #dcfce7;
  color: #166534;
}

.ck-admin-status-trial {
  background: #dbeafe;
  color: #1e40af;
}

.ck-admin-status-suspended {
  background: #fef3c7;
  color: #92400e;
}

.ck-admin-status-canceled {
  background: #fee2e2;
  color: #991b1b;
}

.ck-admin-status-paused {
  background: #fef3c7;
  color: #92400e;
}

.ck-admin-status-trialing {
  background: #dbeafe;
  color: #1e40af;
}

.ck-admin-status-past_due {
  background: #fee2e2;
  color: #991b1b;
}

/* Тарифні плани */
.ck-admin-plan-free {
  background: var(--ck-surface-muted);
  color: var(--ck-text-muted);
}

.ck-admin-plan-pro {
  background: #dbeafe;
  color: #1e40af;
}

.ck-admin-plan-team {
  background: #ede9fe;
  color: #5b21b6;
}

.ck-admin-plan-enterprise {
  background: #0f172a;
  color: #e2e8f0;
}

/* Посилання "Admin" у sidebar тільки для system_admin */
.ck-nav-admin-link {
  color: #fbbf24 !important;
}

.ck-nav-admin-link:hover {
  background: rgba(251, 191, 36, 0.12) !important;
}

/* ================================================================
   AUTH / LOGIN — Premium темна сторінка входу
   ================================================================ */

/* Перекриває світлий body-градієнт з app.css */
body.ck-auth {
  background:
    radial-gradient(ellipse at 16% 60%, rgba(23, 92, 211, 0.22) 0%, transparent 52%),
    radial-gradient(ellipse at 88% 15%, rgba(15, 159, 154, 0.13) 0%, transparent 44%),
    linear-gradient(155deg, #080c16 0%, #0a1220 52%, #0c1828 100%);
  color: #f1f5f9;
  min-height: 100vh;
}

/* Flash-повідомлення фіксовані поверх layout */
.ck-auth-flashes {
  left: 50%;
  max-width: 480px;
  pointer-events: none;
  position: fixed;
  top: 20px;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  z-index: 300;
}

.ck-auth-flashes:empty {
  display: none;
}

.ck-auth-flashes .ck-flash {
  pointer-events: auto;
}

/* Двоколонковий split-layout — hero ліворуч, форма праворуч */
.ck-auth-split {
  display: grid;
  grid-template-columns: 1fr 480px;
  margin: 0;
  min-height: 100vh;
  padding: 0;
}

/* ---- HERO: ліва колонка ---- */
.ck-auth-hero {
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 44px 72px 36px;
  position: relative;
}

/* Декоративна точкова сітка — PCB-натхнення */
.ck-auth-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  inset: 0;
  pointer-events: none;
  position: absolute;
}

/* Анімований синій glow у центрі hero */
.ck-auth-glow {
  animation: ck-glow-pulse 9s ease-in-out infinite;
  background: radial-gradient(ellipse at center, rgba(23, 92, 211, 0.24) 0%, transparent 65%);
  border-radius: 50%;
  height: 700px;
  left: -10%;
  pointer-events: none;
  position: absolute;
  top: 15%;
  width: 700px;
}

@keyframes ck-glow-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.1); }
}

/* Основний вміст hero — центрований по вертикалі */
.ck-auth-hero-inner {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 24px;
  position: relative;
  z-index: 1;
}

/* Логотип PCBHub */
.ck-auth-logo {
  align-items: center;
  color: #ffffff;
  display: inline-flex;
  font-size: 20px;
  font-weight: 800;
  gap: 10px;
  letter-spacing: -0.4px;
  margin-bottom: 44px;
  text-decoration: none;
  user-select: none;
}

.ck-auth-logo-mark {
  align-items: center;
  background: linear-gradient(135deg, #175cd3 0%, #0f9f9a 100%);
  border-radius: 10px;
  color: #ffffff;
  display: inline-flex;
  flex-shrink: 0;
  height: 38px;
  justify-content: center;
  width: 38px;
}

/* Заголовок продукту */
.ck-auth-headline {
  color: #f8fafc;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1.6px;
  line-height: 1.07;
  margin-bottom: 22px;
}

/* Градієнтний текст для акценту */
.ck-gradient-text {
  background: linear-gradient(90deg, #60a5fa 0%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Підзаголовок */
.ck-auth-lead {
  color: #94a3b8;
  font-size: 16px;
  line-height: 1.68;
  margin-bottom: 24px;
  max-width: 440px;
}

/* Блок довіри в hero — під lead text */
.ck-auth-hero-trust {
  margin-bottom: 24px;
}

.ck-auth-hero-trust-label {
  color: #3d5068;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* Trust-бейджики */
.ck-auth-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ck-auth-badge {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  color: #cbd5e1;
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  gap: 7px;
  letter-spacing: 0.2px;
  padding: 6px 12px;
  transition: background 0.15s, border-color 0.15s;
}

.ck-auth-badge:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Кольорова точка-індикатор бейджика */
.ck-auth-badge-dot {
  background: linear-gradient(135deg, #175cd3, #0f9f9a);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  height: 6px;
  width: 6px;
}

/* Footer лівої hero-панелі */
.ck-auth-hero-footer {
  color: #334155;
  font-size: 13px;
  position: relative;
  z-index: 1;
}

/* ---- PANEL: права колонка з картою форми ---- */
.ck-auth-panel {
  align-items: center;
  background: rgba(255, 255, 255, 0.018);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  padding: 48px 40px;
}

/* Картка форми — frosted glass ефект */
.ck-auth-card {
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.048);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 8px 40px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  box-sizing: border-box;
  max-width: 380px;
  overflow: hidden;
  padding: 40px 36px 32px;
  width: 100%;
}

/* Логотип в картці — тільки на мобільному */
.ck-auth-card-logo {
  align-items: center;
  color: #ffffff;
  display: none;
  font-size: 18px;
  font-weight: 800;
  gap: 9px;
  letter-spacing: -0.3px;
  margin-bottom: 28px;
}

.ck-auth-card-logo-mark {
  align-items: center;
  background: linear-gradient(135deg, #175cd3 0%, #0f9f9a 100%);
  border-radius: 8px;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

/* Заголовок та підзаголовок картки */
.ck-auth-card-title {
  color: #f1f5f9;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.ck-auth-card-sub {
  color: #64748b;
  font-size: 14px;
  margin-bottom: 28px;
}

/* Форма — вертикальна сітка полів */
.ck-auth-form {
  display: grid;
  gap: 16px;
}

/* Поле форми */
.ck-field {
  display: grid;
  gap: 6px;
}

.ck-field-label {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

/* Input — темний стиль для auth сторінки */
.ck-field-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  color: #f1f5f9;
  font: inherit;
  font-size: 15px;
  height: 44px;
  min-height: unset;
  padding: 0 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.ck-field-input::placeholder {
  color: #3f4f63;
}

.ck-field-input:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(37, 99, 235, 0.85);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18), 0 0 0 1px rgba(37, 99, 235, 0.4);
  outline: none;
}

/* Кнопка Sign in */
.ck-auth-btn {
  align-items: center;
  background: linear-gradient(135deg, #175cd3 0%, #1d4ed8 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  gap: 8px;
  height: 44px;
  justify-content: center;
  letter-spacing: 0.1px;
  margin-top: 4px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
  width: 100%;
}

.ck-auth-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  box-shadow: 0 4px 20px rgba(23, 92, 211, 0.45), 0 1px 4px rgba(0,0,0,0.3);
}

.ck-auth-btn:active {
  transform: scale(0.985);
}

.ck-auth-btn-arrow {
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.15s, transform 0.15s;
}

.ck-auth-btn:hover .ck-auth-btn-arrow {
  opacity: 1;
  transform: translateX(2px);
}

/* Footer всередині картки — тільки на мобільному */
.ck-auth-card-footer {
  color: #334155;
  font-size: 12px;
  margin-bottom: 0;
  margin-top: 24px;
  text-align: center;
}

/* ================================================================
   RESPONSIVE — адаптивна верстка
   ================================================================ */

/* Планшети та менші десктопи */
@media (max-width: 960px) {
  .ck-auth-split {
    grid-template-columns: 1fr 420px;
  }

  .ck-auth-hero {
    padding: 44px 48px 36px;
  }

  .ck-auth-headline {
    font-size: 38px;
    letter-spacing: -1.1px;
  }
}

/* Мобільні пристрої: перехід до одноколонкового layout */
@media (max-width: 768px) {
  .ck-auth-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  /* Hero стає горизонтальним заголовком */
  .ck-auth-hero {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    border-right: none;
    padding: 36px 24px 28px;
  }

  .ck-auth-headline {
    font-size: 30px;
    letter-spacing: -0.8px;
  }

  .ck-auth-hero-inner {
    justify-content: flex-start;
    padding-bottom: 0;
  }

  .ck-auth-logo {
    margin-bottom: 28px;
  }

  .ck-auth-lead {
    font-size: 14px;
    margin-bottom: 18px;
  }

  .ck-auth-hero-trust {
    margin-bottom: 18px;
  }

  /* Footer hero прихований на мобільному (є footer в картці) */
  .ck-auth-hero-footer {
    display: none;
  }

  /* Форма займає весь екран знизу */
  .ck-auth-panel {
    background: transparent;
    padding: 32px 20px 48px;
  }

  .ck-auth-card {
    max-width: 100%;
  }

  /* Логотип в картці з'являється тільки на мобільному */
  .ck-auth-card-logo {
    display: inline-flex;
  }

  /* Footer картки з'являється замість hero footer */
  .ck-auth-card-footer {
    display: block;
  }
}

/* Малі мобільні */
@media (max-width: 420px) {
  .ck-auth-hero {
    padding: 28px 18px 22px;
  }

  .ck-auth-headline {
    font-size: 26px;
    letter-spacing: -0.6px;
  }

  .ck-auth-panel {
    padding: 24px 14px 40px;
  }

  /* Прозора картка без рамки на дуже малих екранах */
  .ck-auth-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
  }
}

/* ================================================================
   AUTH: PRODUCT PREVIEW WINDOW
   ================================================================ */

.ck-auth-preview {
  animation: ck-preview-fadein 0.55s ease both;
  animation-delay: 0.15s;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  margin-top: 36px;
  opacity: 0;
  overflow: hidden;
}

@keyframes ck-preview-fadein {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ck-auth-preview-chrome {
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  gap: 10px;
  padding: 9px 12px;
}

.ck-auth-preview-dots {
  display: flex;
  flex-shrink: 0;
  gap: 5px;
}

.ck-auth-preview-dot {
  border-radius: 50%;
  display: block;
  height: 8px;
  width: 8px;
}

.ck-auth-preview-dot:nth-child(1) { background: rgba(255, 95, 87, 0.6); }
.ck-auth-preview-dot:nth-child(2) { background: rgba(254, 188, 46, 0.6); }
.ck-auth-preview-dot:nth-child(3) { background: rgba(40, 200, 64, 0.6); }

.ck-auth-preview-tabs {
  display: flex;
  gap: 2px;
}

.ck-auth-preview-tab {
  background: transparent;
  border: none;
  border-radius: 5px;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  transition: background 0.13s, color 0.13s;
}

.ck-auth-preview-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}

.ck-auth-preview-tab.is-active {
  background: rgba(23, 92, 211, 0.18);
  color: #60a5fa;
}

.ck-auth-preview-url {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  color: #334155;
  display: flex;
  flex: 1;
  font-size: 10px;
  height: 22px;
  margin-left: 4px;
  padding: 0 8px;
}

/* Preview panel switching */
.ck-preview-panel {
  display: none;
}

.ck-preview-panel.is-active {
  animation: ck-panel-in 0.2s ease;
  display: block;
}

@keyframes ck-panel-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* BOM panel */
.ck-preview-bom {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 10.5px;
  line-height: 1.5;
}

.ck-preview-bom-header {
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #475569;
  display: grid;
  font-size: 10px;
  font-weight: 600;
  grid-template-columns: 60px 1fr 36px 100px;
  letter-spacing: 0.4px;
  padding: 6px 14px;
  text-transform: uppercase;
}

.ck-preview-bom-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  display: grid;
  grid-template-columns: 60px 1fr 36px 100px;
  padding: 5px 14px;
  transition: background 0.12s;
}

.ck-preview-bom-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.ck-preview-bom-row .ref  { color: #60a5fa; font-weight: 600; }
.ck-preview-bom-row .val  { color: #34d399; }

.pill {
  border-radius: 4px;
  display: inline-block;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 1px 7px;
  text-transform: uppercase;
}

.pill-ok    { background: rgba(22, 163, 74, 0.15);  color: #4ade80; }
.pill-warn  { background: rgba(217, 119, 6, 0.15);  color: #fbbf24; }
.pill-order { background: rgba(220, 38, 38, 0.12);  color: #f87171; }
.pill-risk  { background: rgba(168, 85, 247, 0.14); color: #c084fc; }

.ck-preview-bom-footer {
  color: #334155;
  display: flex;
  font-size: 9.5px;
  justify-content: space-between;
  padding: 6px 14px;
}

.ck-preview-bom-ai {
  color: #818cf8;
  font-weight: 600;
}

/* Stats panel */
.ck-preview-stats {
  padding: 14px 14px 10px;
}

.ck-preview-stats-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 12px;
}

.ck-preview-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  padding: 10px 8px;
  text-align: center;
}

.ck-preview-stat-value {
  color: #f1f5f9;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
}

.ck-preview-stat-label {
  color: #475569;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.ck-preview-activity {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  padding: 10px 12px;
}

.ck-preview-activity-label {
  color: #475569;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.ck-preview-activity-item {
  align-items: center;
  color: #64748b;
  display: flex;
  font-size: 10.5px;
  gap: 8px;
  padding: 3px 0;
}

.ck-preview-activity-item .ts {
  color: #334155;
  font-size: 9.5px;
  margin-left: auto;
  white-space: nowrap;
}

.dot {
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  height: 6px;
  width: 6px;
}

.dot-blue   { background: #3b82f6; }
.dot-green  { background: #22c55e; }
.dot-purple { background: #a78bfa; }

/* PCB traces animation in hero background */
.ck-auth-traces {
  height: 100%;
  inset: 0;
  opacity: 0.14;
  pointer-events: none;
  position: absolute;
  width: 100%;
}

.ck-auth-trace-path {
  stroke-dasharray: 14 10;
  animation: ck-trace-flow 5s linear infinite;
}

@keyframes ck-trace-flow {
  to { stroke-dashoffset: -96; }
}

/* ================================================================
   AUTH: OAUTH / SSO PLACEHOLDER
   ================================================================ */

.ck-auth-divider {
  align-items: center;
  color: #2d3f55;
  display: flex;
  font-size: 11px;
  gap: 10px;
  margin: 20px 0 12px;
}

.ck-auth-divider::before,
.ck-auth-divider::after {
  background: rgba(255, 255, 255, 0.07);
  content: '';
  flex: 1;
  height: 1px;
}

/* Flex + wrap розв'язує overflow на будь-якій ширині */
.ck-auth-oauth {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.ck-auth-oauth-note {
  color: #243143;
  font-size: 10.5px;
  margin: 0 0 16px;
  text-align: center;
}

.ck-auth-oauth-btn {
  align-items: center;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 7px;
  color: #334155;
  cursor: default;
  display: flex;
  flex: 1 1 auto;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  gap: 5px;
  height: 34px;
  justify-content: center;
  min-width: 72px;
  overflow: hidden;
  padding: 0 10px;
  white-space: nowrap;
}

/* Активна OAuth кнопка — коли provider налаштований (наприклад Google) */
a.ck-auth-oauth-btn,
.ck-auth-oauth-btn--on {
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  text-decoration: none;
}

a.ck-auth-oauth-btn:hover,
.ck-auth-oauth-btn--on:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.95);
}

/* ================================================================
   AUTH: FORGOT PASSWORD LINK
   ================================================================ */

.ck-auth-field-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0;
}

.ck-auth-field-row .ck-field-label {
  margin-bottom: 0;
}

.ck-auth-forgot {
  color: #3d5068;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.13s;
}

.ck-auth-forgot:hover {
  color: #60a5fa;
}

/* ================================================================
   AUTH: SOCIAL PROOF / TRUST
   ================================================================ */

.ck-auth-trust {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #243143;
  font-size: 10.5px;
  font-weight: 500;
  margin-top: 16px;
  padding-top: 13px;
  text-align: center;
}

/* Тег-рядок без рамок — виключно інформаційний */
.ck-auth-trust-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
  row-gap: 0;
}

.ck-auth-trust-icon {
  color: #1e2d3d;
  cursor: default;
  font-size: 10.5px;
  font-weight: 500;
  user-select: none;
}

/* Крапка-роздільник між тегами */
.ck-auth-trust-icon + .ck-auth-trust-icon::before {
  color: #1a2535;
  content: '·';
  margin: 0 6px;
}

/* ================================================================
   AUTH: SIGNUP CTA
   ================================================================ */

.ck-auth-signup {
  color: #3d5068;
  font-size: 13px;
  margin-bottom: 0;
  margin-top: 16px;
  text-align: center;
}

.ck-auth-signup a {
  color: #60a5fa;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.13s;
  white-space: nowrap;
}

.ck-auth-signup a:hover {
  color: #93c5fd;
}

/* ================================================================
   AUTH: PLACEHOLDER PAGE (forgot / register)
   ================================================================ */

.ck-auth-coming-soon {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}

.ck-auth-coming-soon-logo {
  align-items: center;
  color: #fff;
  display: inline-flex;
  font-size: 18px;
  font-weight: 800;
  gap: 9px;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
  text-decoration: none;
}

.ck-auth-coming-soon h1 {
  color: #f1f5f9;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.ck-auth-coming-soon p {
  color: #64748b;
  font-size: 15px;
  line-height: 1.6;
  max-width: 360px;
}

/* ================================================================
   AUTH RESPONSIVE — additions for new elements
   ================================================================ */

@media (max-width: 960px) {
  .ck-auth-preview-url { display: none; }
  .ck-preview-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ck-preview-bom-header,
  .ck-preview-bom-row { grid-template-columns: 52px 1fr 28px 90px; }
  .ck-auth-logo { margin-bottom: 32px; }
}

@media (max-width: 768px) {
  .ck-auth-preview { margin-top: 24px; }
  .ck-auth-oauth { grid-template-columns: 1fr 1fr 1fr; }
  .ck-auth-trust-icons { gap: 5px; }
}

@media (max-width: 420px) {
  .ck-auth-oauth { grid-template-columns: 1fr; }
  .ck-auth-preview-tabs { gap: 1px; }
  .ck-preview-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

body[data-page="viewer"] .ck-content {
  overflow: hidden;
}

body[data-page="viewer"] .ck-content-inner {
  max-width: none;
  padding: 0;
  width: 100%;
}

body[data-page="viewer"] .ck-main {
  height: 100vh;
  max-width: none;
}

/* ================================================================
   WORKSPACE: Tab navigation
   ================================================================ */
.ck-workspace-header { padding: 0 0 20px; border-bottom: 1px solid var(--ck-line, #e2e8f0); margin-bottom: 24px; }
.ck-workspace-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--ck-line, #e2e8f0); margin-bottom: 28px; }
.ck-workspace-tab { padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--ck-text-muted, #64748b); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ck-workspace-tab:hover { color: var(--ck-text, #0f172a); }
.ck-workspace-tab.is-active { color: var(--ck-primary, #175cd3); border-bottom-color: var(--ck-primary, #175cd3); }
.ck-trial-banner { background: linear-gradient(90deg,rgba(23,92,211,0.08),rgba(15,159,154,0.08)); border: 1px solid rgba(23,92,211,0.2); border-radius: 10px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.ck-trial-banner-text { font-size: 13px; color: var(--ck-text, #0f172a); }
.ck-trial-banner-days { font-weight: 700; color: #175cd3; }
.ck-ws-kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 28px; }
.ck-ws-kpi-card { background: var(--ck-surface,#fff); border: 1px solid var(--ck-line,#e2e8f0); border-radius: 10px; padding: 20px; }
.ck-ws-kpi-value { font-size: 28px; font-weight: 700; color: var(--ck-text,#0f172a); line-height: 1; margin-bottom: 6px; }
.ck-ws-kpi-label { font-size: 12px; color: var(--ck-text-muted,#64748b); font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }
.ck-ws-kpi-sub { font-size: 11px; color: var(--ck-text-muted,#64748b); margin-top: 4px; }
.ck-activity-list { display: flex; flex-direction: column; gap: 0; }
.ck-activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ck-line,#e2e8f0); }
.ck-activity-item:last-child { border-bottom: none; }
.ck-activity-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; flex-shrink: 0; margin-top: 5px; }
.ck-activity-body { flex: 1; min-width: 0; font-size: 13px; color: var(--ck-text,#0f172a); }
.ck-activity-ts { font-size: 11px; color: var(--ck-text-muted,#64748b); flex-shrink: 0; }

@media (max-width: 900px) {
  .ck-app .ck-shell {
    grid-template-columns: 1fr;
  }

  .ck-sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .ck-topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 16px;
  }

  .ck-topbar-status,
  .ck-footer-center,
  .ck-footer-right {
    justify-content: flex-start;
  }

  .ck-footer {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   WORKSPACE SWITCHER — sidebar dropdown для перемикання org
   ================================================================ */
.ck-ws-switcher {
  position: relative;
  margin: auto 0 0;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.ck-ws-switcher > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  user-select: none;
  outline: none;
  transition: background 0.12s;
}

.ck-ws-switcher > summary::-webkit-details-marker { display: none; }
.ck-ws-switcher > summary:hover { background: rgba(255, 255, 255, 0.05); }

.ck-ws-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ck-ws-info {
  flex: 1;
  min-width: 0;
}

.ck-ws-orgname {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ck-ws-orgmeta {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.5px;
}

.ck-ws-caret {
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

details[open].ck-ws-switcher .ck-ws-caret { transform: rotate(180deg); }

.ck-ws-panel {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 8px;
  right: 8px;
  background: #1a2235;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  padding: 6px;
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
}

.ck-ws-panel-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.28);
  padding: 6px 8px 4px;
}

.ck-ws-org-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  text-align: left;
  transition: background 0.1s;
}

.ck-ws-org-btn:hover { background: rgba(255, 255, 255, 0.07); }
.ck-ws-org-btn.is-current { background: rgba(23, 92, 211, 0.18); }

.ck-ws-org-av {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ck-ws-org-body { flex: 1; min-width: 0; }

.ck-ws-org-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ck-ws-org-meta {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.32);
  letter-spacing: 0.3px;
}
