:root {
  --bg: #f4f7f9;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #627282;
  --line: #dbe4ec;
  --soft: #eef4f7;
  --brand: #0f7d6d;
  --brand-dark: #0a6257;
  --accent: #b7791f;
  --ok: #147a42;
  --warn: #a86813;
  --sidebar: #13232d;
  --shadow: 0 14px 34px rgba(17, 31, 44, .08);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15,125,109,.08), transparent 36%),
    linear-gradient(315deg, rgba(183,121,31,.08), transparent 30%),
    var(--bg);
  color: var(--ink);
}

a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 26px; letter-spacing: 0; margin-bottom: 6px; }
h2 { font-size: 22px; margin-bottom: 10px; }
h3 { font-size: 17px; margin-bottom: 10px; }
p { color: var(--muted); }

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card, .panel {
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card { padding: 28px; }
.panel { padding: 20px; }
.auth .card { width: min(520px, 100%); }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

aside {
  background: var(--sidebar);
  color: #fff;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  min-height: 42px;
  display: flex;
  align-items: center;
  font-size: 19px;
  font-weight: 800;
}

.brand-logo {
  display: block;
  width: 142px;
  max-width: 100%;
  height: auto;
}

.auth-logo {
  width: 170px;
  max-width: 78%;
  height: auto;
  margin-bottom: 20px;
}

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

.nav a {
  color: #cfdae3;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 6px;
  font-weight: 700;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

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

main {
  padding: 26px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.topbar .muted {
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.stat {
  min-height: 124px;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.stat span {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.stat strong {
  font-size: 30px;
}

.form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,125,109,.14);
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 38px;
  border: 0;
  background: var(--brand);
  color: #fff;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

button:hover, .btn:hover {
  background: var(--brand-dark);
}

.secondary {
  background: #e8eef3;
  color: var(--ink);
}

.secondary:hover {
  background: #d7e0e9;
}

.muted { color: var(--muted); }

.notice {
  border-left: 4px solid var(--accent);
  background: #fff8ea;
  color: #614012;
  padding: 12px;
  border-radius: 6px;
  line-height: 1.6;
}

.contact-box {
  display: grid;
  gap: 12px;
  align-content: start;
}

.contact-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

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

th, td {
  border-bottom: 1px solid var(--line);
  padding: 12px 9px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #f7fafc;
}

tr:hover td {
  background: #fbfdfe;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #edf2f6;
  color: var(--muted);
}

.ok {
  background: #e7f6ec;
  color: var(--ok);
}

.warn {
  background: #fff4df;
  color: var(--warn);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.msg {
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: 6px;
  background: #e7f6ec;
  color: var(--ok);
  font-weight: 700;
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  aside { gap: 14px; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-4, .span-6, .span-8, .span-12 { grid-column: span 12; }
  .topbar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  main, aside { padding: 16px; }
  .card, .panel { padding: 16px; }
  .nav { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 760px; }
  button, .btn { width: 100%; }
  .actions button, .actions .btn { width: auto; }
}
