:root {
  --bg: #f5f8fc;
  --panel: #ffffff;
  --panel-soft: #f9fbff;
  --line: #dbe7f3;
  --text: #17324d;
  --muted: #6f84a0;
  --primary: #2f80ed;
  --primary-2: #5fa8ff;
  --success: #2fbf71;
  --danger: #e05757;
  --shadow: 0 14px 40px rgba(57, 88, 127, 0.10);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: linear-gradient(180deg, #f8fbff 0%, #f1f6fc 100%); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.app-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #e9f3ff 0%, #f7fbff 100%);
  border-right: 1px solid var(--line);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.brand { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.brand-sub { color: var(--muted); margin-top: 4px; }
.steps-nav { display: grid; gap: 10px; }
.step-link, .ghost-btn, button {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: .2s ease;
}
.step-link {
  background: rgba(255,255,255,.7);
  color: var(--text);
  border: 1px solid var(--line);
  text-align: left;
  font-weight: 600;
}
.step-link.active { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%); color: white; border-color: transparent; box-shadow: var(--shadow); }
.sidebar-actions { margin-top: auto; }
.ghost-btn { background: white; border: 1px solid var(--line); color: var(--text); }
button { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%); color: white; font-weight: 700; box-shadow: 0 10px 24px rgba(47, 128, 237, 0.2); }
button:hover, .ghost-btn:hover, .step-link:hover { transform: translateY(-1px); }
.danger-btn { background: linear-gradient(135deg, #ed6a5e 0%, #dd4c5c 100%); }

.content, .page-wrap { padding: 28px; }
.hero-card, .step-card, .report-card, .panel {
  background: var(--panel);
  border: 1px solid rgba(219,231,243,.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-card {
  padding: 26px;
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  margin-bottom: 18px;
}
.hero-card h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -0.03em; }
.hero-card p { margin: 0; max-width: 780px; color: var(--muted); line-height: 1.6; }
.hero-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-tags span {
  background: #eef6ff;
  color: var(--primary);
  border: 1px solid #d8e8ff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}
.step-card { display: none; padding: 24px; margin-bottom: 18px; }
.step-card.active { display: block; }
.section-head h2 { margin: 0 0 8px; font-size: 24px; }
.section-head p, .muted, .helper { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 18px; }
.panel { padding: 18px; }
.panel.soft { background: var(--panel-soft); }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.field span { font-size: 13px; font-weight: 700; color: #4d6583; }
input, select, textarea {
  width: 100%;
  background: #fcfeff;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #9ac7ff; box-shadow: 0 0 0 4px rgba(95, 168, 255, 0.12); }
textarea { min-height: 110px; resize: vertical; }
.xl-area { min-height: 260px; }
.actions-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions-row.between { justify-content: space-between; }
.status { color: var(--primary); font-weight: 600; }
.status.error { color: var(--danger); }
.form-grid { display: grid; gap: 16px; }
.header-grid { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.client-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.field.full { grid-column: 1 / -1; }
.tabs { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn { background: #eef6ff; color: var(--primary); border: 1px solid #d8e8ff; box-shadow: none; }
.tab-btn.active { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%); color: white; }
.client-panel { display: none; background: #fbfdff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.client-panel.active { display: block; }
.client-title { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.summary-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.summary-box > div { background: #f7fbff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.summary-box strong { display: block; font-size: 20px; margin-bottom: 6px; }
.summary-box span { color: var(--muted); font-size: 13px; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.topbar h1 { margin: 0 0 6px; }
.report-card { padding: 20px; margin-bottom: 18px; }
.report-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.report-title { font-size: 22px; font-weight: 800; }
.report-meta { color: var(--muted); margin-top: 6px; }
.table-wrap { overflow-x: auto; }
.light-table { width: 100%; border-collapse: collapse; min-width: 1100px; }
.light-table th, .light-table td { border-bottom: 1px solid var(--line); padding: 14px 12px; text-align: left; vertical-align: top; }
.light-table th { background: #f5f9fe; color: #48647f; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.preline { white-space: pre-line; }
.tiny { font-size: 12px; color: var(--muted); }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); }
  .hero-card, .topbar { flex-direction: column; align-items: flex-start; }
  .header-grid, .summary-box { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}
@media (max-width: 720px) {
  .content, .page-wrap { padding: 16px; }
  .grid-2, .client-grid, .header-grid, .summary-box { grid-template-columns: 1fr; }
}
