* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: #111827;
  background: #f6f7fb;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

.login-screen.hidden { display: none; }

.login-card {
  width: min(420px, 100%);
  padding: 34px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.login-card h1 { margin: 18px 0 6px; }
.login-card p { margin: 0 0 24px; color: #64748b; }
.login-card label { display: grid; gap: 8px; margin: 16px 0; font-weight: 600; }
.login-card input { width: 100%; }
.login-card button { width: 100%; margin-top: 8px; }
.form-error { min-height: 24px; margin-top: 12px; color: #b91c1c; text-align: center; }
.logout-button { margin: auto 20px 24px; background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.22); }
.empty { text-align: center; color: #94a3b8; padding: 32px !important; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 24px;
  color: #ffffff;
  background: #111827;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #111827;
  background: #ffffff;
  font-size: 24px;
  font-weight: 800;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 4px;
  color: #cbd5e1;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  padding: 12px 14px;
  border-radius: 8px;
  color: #d1d5db;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}

.nav a:hover,
.nav a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.workspace {
  margin-left: 260px;
  padding: 30px;
}

.section {
  margin-bottom: 28px;
  padding: 26px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

h1,
h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
}

p {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.metric {
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fbfcff;
}

.metric span {
  display: block;
  color: #6b7280;
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 1fr 1.2fr auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #111827;
  background: #ffffff;
  font-size: 14px;
}

button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: #111827;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

button.secondary {
  color: #111827;
  border: 1px solid #d1d5db;
  background: #ffffff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid #eef0f4;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #374151;
  background: #f9fafb;
  font-size: 13px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  color: #1f2937;
  background: #e8f2ff;
  font-size: 12px;
  font-weight: 700;
}

.tag.used {
  color: #166534;
  background: #dcfce7;
}

.tag.warning {
  color: #92400e;
  background: #fef3c7;
}

.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.insight {
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fbfcff;
}

.insight span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

.insight strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

@media (max-width: 920px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .workspace {
    margin-left: 0;
    padding: 18px;
  }

  .metrics,
  .form-grid,
  .practice-grid {
    grid-template-columns: 1fr;
  }
}
