:root {
  --bg: #f3f7fb;
  --card: #ffffff;
  --text: #17324d;
  --muted: #6a7d92;
  --line: #dde7f0;
  --primary: #0f7acb;
  --primary-2: #0aa2d4;
  --ok: #198754;
  --warn: #f59f00;
  --danger: #d6336c;
  --shadow: 0 12px 30px rgba(16, 54, 95, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef6fc 0%, #f6f9fc 100%);
}
a { color: inherit; text-decoration: none; }
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  padding: 28px 20px;
  background: #0f2740;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.brand { font-size: 1.4rem; font-weight: 800; }
.nav { display: grid; gap: 10px; }
.nav a {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
}
.nav a:hover { background: rgba(255,255,255,0.14); }
.content { padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.user-badge {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  display: grid;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.hero { margin-bottom: 24px; }
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat strong { font-size: 2rem; margin-top: 10px; display: block; }
.stat span { color: var(--muted); }
.stat.warn strong { color: var(--warn); }
.stat.danger strong { color: var(--danger); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .9rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
  font-weight: 700;
}
.btn.primary {
  border-color: transparent;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.center-wrap { min-height: 70vh; display: grid; place-items: center; }
.login-card { width: min(460px, 100%); }
.form-grid { display: grid; gap: 16px; }
label { display: grid; gap: 8px; font-weight: 600; }
input {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  outline: none;
}
input:focus { border-color: var(--primary); }
.alert { padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; }
.alert.error { background: #ffe6ee; color: #a61e4d; }
.demo-box {
  margin-top: 16px;
  padding: 14px;
  background: #f7fbff;
  border: 1px dashed #bfd7ea;
  border-radius: 16px;
}
.pill, .badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
}
.pill { background: #e8f4ff; color: var(--primary); }
.badge.ok { background: #e9f7ef; color: var(--ok); }
.badge.warn { background: #fff4db; color: #9a6700; }
.badge.danger { background: #ffe8f0; color: var(--danger); }
.list-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { padding-bottom: 8px; }
  .topbar { flex-direction: column; align-items: flex-start; }
}


select, textarea {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  outline: none;
  background: white;
  font: inherit;
  color: var(--text);
}
select:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 110px; }
.alert.success { background: #e9f7ef; color: #166534; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.two-col-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.full-width { grid-column: 1 / -1; }
.errors-list { margin: 10px 0 0 18px; padding: 0; }
.children-layout { align-items: start; }


.section-head-inline {
  align-items: center;
}
.section-actions {
  align-items: center;
  justify-content: flex-end;
}
.form-card {
  max-width: 980px;
}
.back-link-wrap {
  margin-bottom: 10px;
}
.back-link {
  color: var(--primary);
  font-weight: 700;
}
.required-mark {
  color: var(--danger);
  font-weight: 800;
}
.field-meta {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 500;
}
.form-actions-between {
  justify-content: space-between;
}
@media (max-width: 860px) {
  .section-head-inline,
  .form-actions-between,
  .section-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
