/* ── v-cloak: скрывать Vue-шаблоны до монтирования ──────────────────────── */
[v-cloak] { display: none !important; }

/* ── App layout (sidebar nav + content) ─────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f0f2f5; color: #1a1a2e; }

.app-layout { display: grid; grid-template-columns: 72px 1fr; min-height: 100vh; }

/* ── Dock-sidebar ─────────────────────────────────────────────────────────── */
#appSidebar {
  background: #120F17;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid #222;
  overflow: visible;
  z-index: 100;
}

.nav-logo {
  font-size: 10px;
  font-weight: 800;
  color: #6c63ff;
  letter-spacing: .5px;
  text-align: center;
  width: 100%;
  padding-bottom: 14px;
  border-bottom: 1px solid #222;
  margin-bottom: 6px;
  line-height: 1.3;
}
.nav-logo span { display: block; color: #fff; font-size: 7px; font-weight: 600; margin-top: 2px; letter-spacing: 1px; text-transform: uppercase; }

.nav-items {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  flex: 1 1 auto;
  min-height: 0;          /* чтобы flex-элемент мог сжиматься и включить прокрутку */
  overflow-y: auto;       /* прокрутка списка, когда пунктов больше высоты экрана */
  width: 100%;
  scrollbar-width: none;  /* скрыть полосу (Firefox) */
}
.nav-items::-webkit-scrollbar { display: none; }  /* скрыть полосу (WebKit) */

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #120F17;
  border: 1px solid #252535;
  color: #6060a0;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  will-change: width, height;
}
.nav-item:hover {
  background: #1e1830;
  color: #c8c8e8;
  border-color: #3a3a5a;
}
.nav-item.active {
  background: #1a1235;
  color: #6c63ff;
  border-color: #6c63ff;
  box-shadow: 0 0 14px rgba(108, 99, 255, 0.22);
}

.nav-icon { font-size: 18px; display: flex; align-items: center; justify-content: center; pointer-events: none; }

/* Label — всплывает справа при ховере */
.nav-label {
  display: block;
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #120F17;
  border: 1px solid #333;
  color: #e8e8f0;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 9999;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.nav-item:hover .nav-label { opacity: 1; }

.nav-footer {
  padding: 12px 0 0;
  border-top: 1px solid #222;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.nav-user { font-size: 9px; color: #4a4a80; text-align: center; padding: 0 6px; word-break: break-all; }
.nav-logout-btn {
  background: none;
  border: 1px solid #2a2a4a;
  color: #6060a0;
  font-size: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-logout-btn:hover { background: #1e1e3a; color: #c8c8e8; }

/* Main content */
.app-content { padding: 32px; overflow-y: auto; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 20px; font-weight: 700; color: #1a1a2e; }
.page-header p  { font-size: 13px; color: #7070a0; margin-top: 4px; }

/* Card */
.card { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 14px; font-weight: 700; color: #1a1a2e; margin-bottom: 18px; }

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 12px; font-weight: 600; color: #4a4a6a; text-transform: uppercase; letter-spacing: 0.6px; }
.form-label .optional { font-weight: 400; color: #9090b0; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.form-input, .form-select, .form-textarea {
  padding: 9px 12px; border: 1px solid #d8d8e8; border-radius: 8px;
  font-size: 13px; color: #1a1a2e; background: #fff;
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: #6c63ff; }
.form-textarea { resize: vertical; min-height: 80px; font-family: inherit; line-height: 1.5; }
.form-hint { font-size: 11px; color: #9090b0; }

/* Tags input */
.tags-input-wrap { border: 1px solid #d8d8e8; border-radius: 8px; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 6px; cursor: text; min-height: 40px; align-items: center; background: #fff; transition: border-color 0.15s; }
.tags-input-wrap:focus-within { border-color: #6c63ff; }
.tag-item { background: #f0eeff; color: #5a52e0; font-size: 12px; padding: 3px 8px; border-radius: 20px; display: flex; align-items: center; gap: 4px; }
.tag-remove { cursor: pointer; font-size: 14px; line-height: 1; color: #9090b0; }
.tag-remove:hover { color: #e05a52; }
.tags-text-input { border: none; outline: none; font-size: 13px; min-width: 120px; flex: 1; font-family: inherit; }

/* Platform checkboxes */
.plat-checks { display: flex; flex-wrap: wrap; gap: 10px; }
.plat-check { display: none; }
.plat-check-label {
  padding: 7px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 2px solid transparent; transition: all 0.15s;
  background: #f0f2f5; color: #7070a0;
}
.plat-check:checked + .plat-check-label { border-color: currentColor; background: #fff; }
.plat-check-label.perplexity { color: #20b2aa; }
.plat-check-label.grok       { color: #e67e22; }
.plat-check-label.gemini     { color: #db2777; }
.plat-check-label.serp       { color: #3498db; }
.plat-check-label.openai     { color: #16a34a; }
.plat-check-label.yandex     { color: #cc0000; }
.plat-check-label.google_aio { color: #4285f4; }
.plat-check-label.chatgpt_ui { color: #16a34a; }

/* Buttons */
.btn-primary { background: #6c63ff; color: #fff; border: none; border-radius: 8px; padding: 10px 24px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.btn-primary:hover { background: #5a52e0; }
.btn-primary:disabled { background: #b0aae0; cursor: not-allowed; }
.save-bar { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.save-status { font-size: 13px; color: #1a6640; }

/* Login page */
body.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #1a1a2e; }
.login-card { background: #fff; border-radius: 16px; padding: 40px; width: 360px; box-shadow: 0 8px 40px rgba(0,0,0,0.3); }
.login-logo { font-size: 20px; font-weight: 700; color: #1a1a2e; margin-bottom: 8px; }
.login-logo span { color: #6c63ff; }
.login-sub { font-size: 13px; color: #9090b0; margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-error { color: #a02020; font-size: 13px; background: #fde8e8; padding: 8px 12px; border-radius: 6px; display: none; }
.login-error.show { display: block; }
.login-btn { background: #6c63ff; color: #fff; border: none; border-radius: 8px; padding: 11px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.login-btn:hover { background: #5a52e0; }
.login-btn:disabled { background: #b0aae0; cursor: not-allowed; }

/* ── Адаптив: телефоны (≤640px) ──────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Узкий icon-dock слева + контент на всю оставшуюся ширину */
  .app-layout { grid-template-columns: 52px 1fr; }
  #appSidebar { padding: 10px 0 8px; }
  .nav-item { width: 38px; height: 38px; border-radius: 9px; }
  .nav-icon { font-size: 15px; }
  .nav-logo { font-size: 8px; padding-bottom: 10px; margin-bottom: 4px; }
  .nav-logo span { font-size: 6px; }
  .nav-items { gap: 4px; }

  .app-content { padding: 16px 12px; }
  .page-header { margin-bottom: 18px; }
  .page-header h1 { font-size: 17px; }
  .page-header p { font-size: 12px; }

  /* Широкие таблицы скроллятся по горизонтали, а не растягивают страницу */
  table { display: block; overflow-x: auto; max-width: 100%; }

  /* Тулбары и группы кнопок переносятся на новую строку */
  .toolbar, .section-header, .create-form { flex-wrap: wrap; }
}

