:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #d97706;
  --warning-soft: #ffedd5;
  --dark: #111827;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, button, summary {
  font: inherit;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}
.sidebar {
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.brand-card, .auth-card-top {
  display: flex;
  gap: 14px;
  align-items: center;
}
.brand-card h1, .auth-card-top h2, .page-head h2 { margin: 0 0 4px; }
.brand-card p, .auth-card-top p, .page-head p { margin: 0; color: var(--muted); }
.brand-badge {
  height: 46px;
  width: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1d4ed8, #60a5fa);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.brand-badge.big { height: 60px; width: 60px; }
.nav-list { display: grid; gap: 8px; }
.nav-list a {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text);
  border: 1px solid transparent;
}
.nav-list a:hover, .nav-list a.active {
  background: var(--primary-soft);
  border-color: #bfdbfe;
  text-decoration: none;
}
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; }
.mini-user {
  padding: 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
}
.mini-user strong, .mini-user span { display: block; }
.mini-user span { color: var(--muted); font-size: 14px; margin-top: 6px; }
.main-content { padding: 26px; }
.auth-main {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  width: min(100%, 480px);
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(226,232,240,.95);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 22px;
}
.chip-group { display: flex; gap: 10px; flex-wrap: wrap; }
.chip, .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  color: #1e3a8a;
  font-size: 13px;
}
.card {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(226,232,240,.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.narrow-card { max-width: 620px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-head h3 { margin: 0; }
.split details summary { list-style: none; }
.split details summary::-webkit-details-marker { display: none; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}
.stat-card strong {
  display: block;
  font-size: 34px;
  margin-top: 10px;
}
.two-col {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.profile-grid span, .info-row span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}
.profile-grid strong, .info-row strong { display: block; margin-top: 6px; }
.stack-list { display: grid; gap: 12px; }
.info-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: none; }
.filter-grid, .grid-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.filter-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-form.single-col { grid-template-columns: 1fr; }
.grid-form.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
input, select {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  outline: none;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96,165,250,.16);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}
.checkbox-row input, .inline-actions input {
  width: 18px;
  min-height: 18px;
}
.inline-actions { align-content: start; }
.inline-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.full-span { grid-column: 1 / -1; }
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #f8fafc;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: .96; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { min-height: 36px; padding: 8px 12px; font-size: 13px; }
.btn-full { width: 100%; }
.alert {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert.success { background: var(--success-soft); color: #166534; border-color: #bbf7d0; }
.alert.danger { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.alert.warning { background: var(--warning-soft); color: #9a3412; border-color: #fed7aa; }
.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}
th, td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}
tbody tr:hover { background: #fbfdff; }
.muted { color: var(--muted); font-size: 13px; margin-top: 4px; }
.top-gap { margin-top: 14px; }
.demo-box {
  margin-top: 18px;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
}
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat-grid, .two-col, .filter-grid, .filter-grid.four, .grid-form, .grid-form.compact, .profile-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 720px) {
  .main-content, .sidebar { padding: 18px; }
  .page-head { flex-direction: column; }
  .stat-grid, .two-col, .filter-grid, .filter-grid.four, .grid-form, .grid-form.compact, .profile-grid {
    grid-template-columns: 1fr;
  }
  table { min-width: 820px; }
}
