﻿:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --line: #e2e8f0;
  --shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.app {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 220px;
  background: #0b1a3a;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
}
.brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-item {
  color: #e2e8f0;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
}
.nav-item:hover {
  background: rgba(255,255,255,0.08);
}
.nav-item.active {
  background: rgba(255,255,255,0.16);
  font-weight: 700;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.page-title { font-weight: 700; font-size: 16px; }
.top-actions { display: flex; gap: 10px; align-items: center; }

main { padding: 22px 18px 48px; max-width: 1200px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.btn:hover { background: var(--accent-2); }
.btn.secondary { background: #334155; }
.btn.warning { background: #b45309; }
.btn.danger { background: #b91c1c; }

input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: #bfdbfe;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.45);
}
label { font-weight: 600; }

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}
.table th { color: #475569; font-weight: 700; background: #f8fafc; }

.badge {
  display: inline-block;
  padding: 4px 8px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  font-size: 12px;
}
.notice { color: var(--muted); font-size: 13px; }
.form-row { margin-bottom: 12px; }
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.tab {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
}
.tab.active {
  background: #e0e7ff;
  border-color: #c7d2fe;
  color: #1d4ed8;
  font-weight: 700;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.mini-input { max-width: 120px; }

.stars {
  color: #f59e0b;
  letter-spacing: 1px;
}

.kpi {
  font-size: 28px;
  font-weight: 700;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.filter-actions { display: flex; gap: 8px; align-items: center; }

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 10px;
  flex-wrap: wrap;
}
.page-links { display: flex; gap: 6px; flex-wrap: wrap; }
.page-link {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
}
.page-link.active {
  background: #e0e7ff;
  border-color: #c7d2fe;
  color: #1d4ed8;
  font-weight: 700;
}

/* Login */
.login-body {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-wrap { width: 100%; padding: 24px; }
.login-card {
  background: #ffffff;
  max-width: 420px;
  margin: 0 auto;
  padding: 22px;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15,23,42,0.12);
  border: 1px solid var(--line);
}
.login-brand { font-size: 18px; font-weight: 700; margin-bottom: 6px; color: #0b1a3a; }
.login-sub { color: #475569; margin-bottom: 12px; }
.login-form .btn { width: 100%; margin-top: 6px; }

@media (max-width: 900px) {
  .sidebar { width: 180px; }
}

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .brand { margin-bottom: 0; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .nav-item { padding: 6px 8px; font-size: 13px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  main { padding: 16px 12px 28px; max-width: 100%; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .mini-input { max-width: 100%; }
  .btn { width: 100%; }
  .table { display: block; overflow-x: auto; }
  .table th, .table td { padding: 8px 6px; font-size: 13px; }
  .tabs { flex-wrap: wrap; }
  .filter-row { grid-template-columns: 1fr; }
  .pagination { flex-direction: column; align-items: flex-start; }
}
