:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
  color: #1f2933;
  background: #f4f6f8;
  letter-spacing: 0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f4f6f8; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.65; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 24px; }
h2 { margin-bottom: 18px; font-size: 17px; }
.muted, .hint { color: #697581; }
.hint { margin: 8px 0 0; font-size: 13px; }
.error { min-height: 20px; color: #b42318; font-size: 13px; }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-panel { width: min(380px, 100%); padding: 36px; border: 1px solid #d9dee3; border-radius: 8px; background: #fff; box-shadow: 0 10px 30px rgb(31 41 51 / 8%); }
.brand-mark { display: grid; width: 44px; height: 44px; margin-bottom: 20px; place-items: center; border-radius: 7px; background: #d94f32; color: #fff; font-weight: 800; }
.brand-mark.small { width: 32px; height: 32px; margin: 0; font-size: 12px; }
label { display: grid; gap: 7px; margin-bottom: 14px; color: #38434d; font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; border: 1px solid #cbd2d9; border-radius: 5px; padding: 9px 10px; background: #fff; color: #1f2933; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #1c7c70; box-shadow: 0 0 0 3px rgb(28 124 112 / 12%); }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, Consolas, monospace; }
button { min-height: 38px; border: 0; border-radius: 5px; padding: 8px 14px; font-weight: 650; }
.primary { background: #1c7c70; color: #fff; }
.primary:hover { background: #166b61; }
.secondary { border: 1px solid #cbd2d9; background: #fff; color: #34414c; }
.danger { border: 1px solid #f0b5ad; background: #fff; color: #b42318; }
.app-shell { min-height: 100vh; }
aside { position: fixed; inset: 0 auto 0 0; display: flex; width: 220px; flex-direction: column; padding: 20px 14px; border-right: 1px solid #d9dee3; background: #fff; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; }
nav { display: grid; gap: 4px; }
.nav-item { width: 100%; min-height: 42px; background: transparent; color: #52606d; text-align: left; }
.nav-item:hover, .nav-item.active { background: #edf4f2; color: #11675d; }
.logout { margin-top: auto; }
.content { margin-left: 220px; padding: 28px 34px 50px; }
header { display: flex; align-items: center; justify-content: space-between; max-width: 1220px; margin: 0 auto 26px; }
header p { margin-bottom: 0; color: #697581; }
.page { max-width: 1220px; margin: 0 auto; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { min-height: 112px; padding: 20px; border: 1px solid #d9dee3; border-radius: 7px; background: #fff; }
.stat strong { display: block; margin-top: 14px; font-size: 28px; }
.stat span { color: #697581; font-size: 13px; }
.section-block { margin-bottom: 18px; padding: 22px; border: 1px solid #d9dee3; border-radius: 7px; background: #fff; }
.section-block.compact { margin: 0; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin-bottom: 6px; }
.info-list { margin: 0; }
.info-list div { display: grid; grid-template-columns: 160px 1fr; padding: 13px 0; border-bottom: 1px solid #edf0f2; }
.info-list div:last-child { border-bottom: 0; }
dt { color: #697581; }
dd { margin: 0; }
.split-layout { display: grid; grid-template-columns: minmax(280px, 0.75fr) minmax(360px, 1.25fr); gap: 18px; margin-bottom: 18px; }
.table-section { padding: 0; overflow: hidden; }
.table-section > h2, .table-section > .section-heading { padding: 20px 22px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 16px; border-top: 1px solid #e5e9ec; text-align: left; white-space: nowrap; }
th { color: #697581; background: #fafbfc; font-weight: 650; }
.badge { display: inline-block; border-radius: 4px; padding: 3px 7px; background: #edf0f2; font-size: 12px; }
.badge.active, .badge.unused { background: #e3f3ef; color: #11675d; }
.badge.disabled, .badge.expired { background: #fbe9e7; color: #a53627; }
.row-actions { display: flex; gap: 6px; }
.row-actions button { min-height: 30px; padding: 4px 8px; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.check-row { display: flex; gap: 24px; margin-bottom: 16px; }
.check-row label { display: flex; align-items: center; gap: 8px; margin: 0; }
.check-row input { width: auto; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 360px; padding: 12px 16px; border-radius: 6px; background: #24313a; color: #fff; box-shadow: 0 8px 24px rgb(31 41 51 / 25%); }
@media (max-width: 900px) {
  aside { position: static; width: 100%; min-height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .brand { padding: 0 12px 0 0; }
  nav { display: flex; }
  .nav-item { width: auto; white-space: nowrap; }
  .logout { margin: 0 0 0 auto; }
  .content { margin-left: 0; padding: 22px 18px 40px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  aside { align-items: stretch; flex-wrap: wrap; }
  .brand { width: 100%; margin-bottom: 10px; }
  nav { flex: 1; }
  .logout { margin-left: 0; }
  header { align-items: end; }
  h1 { font-size: 21px; }
  .stats, .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .section-block { padding: 18px; }
  .info-list div { grid-template-columns: 1fr; gap: 5px; }
}
