:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --accent: #7c3aed;
  --accent2: #3b82f6;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --ok: #22c55e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: var(--panel);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid #334155;
}

.logo { font-size: 22px; font-weight: 800; letter-spacing: .5px; margin-bottom: 20px; }
.logo span { color: var(--accent); }

.nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: all .15s;
}
.nav-btn:hover { background: #263449; color: var(--text); }
.nav-btn.active { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; }

.sidebar-footer { margin-top: auto; color: var(--muted); font-size: 12px; }

.main { flex: 1; padding: 32px; overflow-y: auto; }

h1 { font-size: 24px; margin-bottom: 20px; }

.tab { display: none; }
.tab.active { display: block; }

.cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.card {
  background: var(--panel);
  border-radius: 14px;
  padding: 24px;
  min-width: 140px;
  text-align: center;
  border: 1px solid #334155;
}
.card-num { font-size: 32px; font-weight: 700; color: var(--accent2); }
.card-label { color: var(--muted); font-size: 13px; margin-top: 6px; }
.hint { color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.form label { font-size: 13px; color: var(--muted); }
.form select, .form textarea, .form input {
  background: var(--panel);
  border: 1px solid #334155;
  border-radius: 10px;
  color: var(--text);
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
}
.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.primary:disabled { opacity: .5; }

.proposal-result { margin-top: 24px; }
.proposal-result img { max-width: 100%; border-radius: 12px; margin-bottom: 16px; }
.proposal-result pre {
  white-space: pre-wrap;
  background: var(--panel);
  padding: 20px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
}

.project-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.project-list li {
  background: var(--panel);
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid #334155;
}

.ok { color: var(--ok); font-weight: 600; }

/* --- генератор КП: режимы --- */
.mode-switcher { display: flex; gap: 12px; margin-bottom: 24px; }
.mode-switcher button {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}
.mode-switcher button.active {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  border-color: transparent;
}

.universal-mode .info-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

.universal-mode textarea, .template-mode textarea,
.universal-mode input, .template-mode select {
  width: 100%;
  background: var(--panel);
  border: 1px solid #334155;
  border-radius: 10px;
  color: var(--text);
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 12px;
}
.template-mode select { margin-top: 4px; }

.context-fields { display: grid; gap: 12px; margin-top: 8px; }
.context-fields input, .context-fields textarea {
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  font-size: 14px;
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
}

.proposal-result .cover-image, .proposal-result img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,.3);
}

.actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.actions button {
  flex: 1;
  min-width: 120px;
  padding: 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}
.actions button:first-child { background: var(--accent); }
.actions button:nth-child(2) { background: var(--accent2); }
.actions button:nth-child(3) { background: #10b981; }

