/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f5f5f5; color: #1a1a2e; min-height: 100vh; }

/* ─── Topbar ────────────────────────────────────────────────────────────────── */
.topbar {
  background: #1a1a2e;
  color: #fff;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 32px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-logo { font-size: 22px; }
.topbar-title { font-size: 17px; font-weight: 700; letter-spacing: .5px; color: #e8c97a; }
.topbar-nav { display: flex; gap: 4px; }
.nav-link {
  color: rgba(255,255,255,.7); text-decoration: none; padding: 6px 14px;
  border-radius: 6px; font-size: 14px; transition: all .15s;
}
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,.12); }

/* ─── Views ─────────────────────────────────────────────────────────────────── */
.view { display: none; padding: 28px 32px; max-width: 1100px; margin: 0 auto; }
.view.active { display: block; }

/* ─── Page header ───────────────────────────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 700; color: #1a1a2e; }
.btn-row { display: flex; gap: 10px; }
.meta-row { font-size: 13px; color: #666; margin-top: 4px; }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  padding: 9px 18px; border: none; border-radius: 7px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: all .15s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #e0e7ff; color: #2563eb; }
.btn-secondary:hover { background: #c7d2fe; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-ghost { background: transparent; color: #555; border: 1px solid #ddd; }
.btn-ghost:hover { background: #f0f0f0; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ─── Cases grid ────────────────────────────────────────────────────────────── */
.cases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.case-card {
  background: #fff; border-radius: 12px; padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08); cursor: pointer;
  transition: box-shadow .15s, transform .1s; border: 1px solid #eee;
}
.case-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.13); transform: translateY(-2px); }
.case-card-name { font-size: 17px; font-weight: 700; color: #1a1a2e; margin-bottom: 6px; }
.case-card-debt { font-size: 18px; font-weight: 700; color: #dc2626; margin-bottom: 8px; }
.case-card-date { font-size: 12px; color: #888; }
.case-card-status { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.status-draft    { background: #fef9c3; color: #854d0e; }
.status-ready    { background: #dcfce7; color: #166534; }
.status-filed    { background: #e0e7ff; color: #1e40af; }
.case-card-actions { display: flex; gap: 8px; margin-top: 14px; }
.empty-state { text-align: center; padding: 60px 20px; color: #888; }
.empty-state-icon { font-size: 56px; margin-bottom: 12px; }
.empty-state h2 { font-size: 20px; color: #555; margin-bottom: 8px; }

/* ─── Wizard ─────────────────────────────────────────────────────────────────── */
.wizard { background: #fff; border-radius: 14px; box-shadow: 0 2px 12px rgba(0,0,0,.08); overflow: hidden; }
.wizard-steps { display: flex; background: #f8f9ff; border-bottom: 1px solid #e8eaf0; overflow-x: auto; }
.step {
  padding: 14px 20px; font-size: 13px; font-weight: 600; color: #888;
  cursor: default; white-space: nowrap; border-bottom: 3px solid transparent; transition: all .15s;
}
.step.active { color: #2563eb; border-bottom-color: #2563eb; background: #fff; }
.step.done   { color: #16a34a; }
.wizard-panel { display: none; padding: 28px 32px; }
.wizard-panel.active { display: block; }
.wizard-panel h2 { font-size: 20px; font-weight: 700; margin-bottom: 20px; color: #1a1a2e; }
.wizard-panel h3 { font-size: 15px; font-weight: 700; color: #374151; margin-bottom: 12px; }
.wizard-footer { display: flex; gap: 12px; padding: 20px 32px; background: #f8f9ff; border-top: 1px solid #eee; }

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: #555; }
.field input, .field select, .field textarea {
  padding: 9px 12px; border: 1.5px solid #dde1f0; border-radius: 7px;
  font-size: 14px; transition: border-color .15s; background: #fafbff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: #2563eb; background: #fff;
}
.hint { color: #666; font-size: 13px; margin-bottom: 16px; line-height: 1.5; }
.checkbox-row label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: #374151; cursor: pointer; }
.checkbox-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

/* ─── Dynamic lists (кредиторы, имущество и пр.) ────────────────────────────── */
.list-item {
  background: #f8f9ff; border: 1.5px solid #e0e7ff; border-radius: 10px;
  padding: 18px 20px; margin-bottom: 12px; position: relative;
}
.list-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.list-item-title { font-size: 14px; font-weight: 700; color: #374151; }
.list-item .form-grid { background: transparent; }
.btn-remove { position: absolute; top: 14px; right: 14px; }

/* ─── Tabs ───────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid #e8eaf0; margin-bottom: 24px; }
.tab {
  padding: 11px 22px; background: none; border: none; font-size: 14px;
  font-weight: 600; color: #888; cursor: pointer; border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: all .15s;
}
.tab:hover { color: #2563eb; }
.tab.active { color: #2563eb; border-bottom-color: #2563eb; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Docs grid ──────────────────────────────────────────────────────────────── */
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.doc-card {
  background: #fff; border: 1.5px solid #e0e7ff; border-radius: 12px;
  padding: 18px 20px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.doc-icon { font-size: 32px; flex-shrink: 0; }
.doc-info { flex: 1; }
.doc-name { font-size: 14px; font-weight: 700; color: #1a1a2e; margin-bottom: 3px; }
.doc-desc { font-size: 12px; color: #777; }

/* ─── Checklist ──────────────────────────────────────────────────────────────── */
.checklist-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.checklist-cat { margin-bottom: 20px; }
.checklist-cat-title { font-size: 15px; font-weight: 700; color: #1a1a2e; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid #e0e7ff; }
.checklist-item { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; font-size: 14px; color: #374151; }
.checklist-item input[type=checkbox] { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; cursor: pointer; }

/* ─── Info box ───────────────────────────────────────────────────────────────── */
.info-box { background: #eff6ff; border: 1.5px solid #bfdbfe; border-radius: 10px; padding: 16px 20px; font-size: 14px; color: #1e3a5f; line-height: 1.7; }

/* ─── Code view ──────────────────────────────────────────────────────────────── */
.code-view { background: #1e1e2e; color: #cdd6f4; padding: 20px; border-radius: 10px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; line-height: 1.6; }

/* ─── Print-all bar ─────────────────────────────────────────────────────────── */
.print-all-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #2563eb 100%);
  border-radius: 12px; padding: 16px 22px; margin-bottom: 16px; color: #fff;
}
.print-all-title { font-size: 16px; font-weight: 700; }
.print-all-desc  { font-size: 12px; opacity: .8; margin-top: 2px; }

/* ─── Doc card actions ───────────────────────────────────────────────────────── */
.doc-card { flex-wrap: wrap; }
.doc-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ─── Print styles ───────────────────────────────────────────────────────────── */
@media print {
  .topbar, .tabs, .btn, .page-header .btn-row, .checklist-header .btn { display: none !important; }
  .tab-panel { display: block !important; }
  .checklist-item input[type=checkbox] { -webkit-print-color-adjust: exact; }
}

@media (max-width: 640px) {
  .view { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: 1; }
  .docs-grid { grid-template-columns: 1fr; }
  .doc-card { flex-direction: column; align-items: flex-start; }
}
