* { box-sizing: border-box; }

:root {
  --brand: #ff6b35;
  --brand-dark: #e55a28;
  --brand-light: #fff3ed;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f3f4f6;
  --card: #ffffff;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  --radius: 12px;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
}

a { color: #2563eb; }
code {
  font-size: 12px;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
}

.topbar {
  background: linear-gradient(105deg, #ff6b35 0%, #f7931e 55%, #ffb347 100%);
  color: #fff;
  padding: 0 20px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.25);
}

.topbar strong { font-size: 16px; letter-spacing: 0.02em; }

.topbar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  justify-content: flex-end;
  max-width: 100%;
}

.topbar-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  opacity: 0.92;
  transition: background 0.15s;
}

.topbar-nav a:hover {
  background: rgba(255, 255, 255, 0.18);
  opacity: 1;
}

.topbar-nav a.active {
  background: rgba(255, 255, 255, 0.28);
  font-weight: 600;
  opacity: 1;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.card-muted {
  background: #fafafa;
  border: 1px solid var(--border);
  box-shadow: none;
}

h1 {
  font-size: 1.35rem;
  margin: 0 0 16px;
  font-weight: 600;
}

h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--text);
}

.page-lead {
  color: var(--muted);
  font-size: 13px;
  margin: -8px 0 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.stat-card {
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1.1;
}

.stat-value small {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}

th {
  font-size: 12px;
  text-transform: none;
  color: var(--muted);
  font-weight: 600;
  background: #fafafa;
}

tr:hover td { background: #fefefe; }

label {
  display: block;
  margin: 10px 0 6px;
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

button, .btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, transform 0.05s;
}

button:hover, .btn:hover { background: var(--brand-dark); }
button:active, .btn:active { transform: translateY(1px); }

.btn-secondary { background: #64748b; }
.btn-secondary:hover { background: #475569; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 12px; font-size: 12px; margin-right: 4px; }

.msg {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
}

.msg.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.msg.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #f3f4f6;
  color: #374151;
}

.pill-warn { background: #fef3c7; color: #92400e; }
.pill-ok { background: #d1fae5; color: #065f46; }

.filters { margin: 12px 0 16px; }
.filters a, .filters .btn-link {
  display: inline-block;
  margin: 0 6px 8px 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: #374151;
  text-decoration: none;
  font-size: 13px;
}

.filters a.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.inline-form { display: inline-block; margin: 0; vertical-align: middle; }
.evidence img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 4px;
}

.auth-page .shell { max-width: 480px; padding-top: 32px; }
.auth-card {
  margin-top: 8px;
  box-shadow: var(--shadow);
}
.auth-card h1 { text-align: center; margin-bottom: 20px; }
.auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.meta-list p {
  margin: 8px 0;
  font-size: 13px;
  color: #374151;
}

@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
  .topbar { padding: 12px 14px; }
  .topbar-nav a { padding: 5px 8px; font-size: 12px; }
  .stat-value { font-size: 1.45rem; }
}
