/* 爱图万物平台控制台 */
:root {
  --bg: #0f172a;
  --sidebar: #1e293b;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --danger: #dc2626;
  --warn: #d97706;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
.hidden { display: none !important; }

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--sidebar);
  color: #e2e8f0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 20px 18px;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid #334155;
}
.sidebar-brand small {
  display: block;
  font-weight: 400;
  color: #94a3b8;
  font-size: 12px;
  margin-top: 4px;
}
.nav-group { padding: 12px 10px 4px; font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .06em; }
.nav-item {
  display: block;
  padding: 10px 18px;
  color: #cbd5e1;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: #334155; color: #fff; }
.nav-item.active { background: #334155; color: #fff; border-left-color: var(--primary); }
.sidebar-foot { margin-top: auto; padding: 16px 18px; border-top: 1px solid #334155; font-size: 13px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar h1 { margin: 0; font-size: 18px; color: #1e3a5f; }
.content { padding: 24px; flex: 1; }

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(15,23,42,.08);
  margin-bottom: 16px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.stat-box {
  background: linear-gradient(135deg, #eff6ff, #fff);
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 16px;
}
.stat-box .label { font-size: 12px; color: var(--muted); }
.stat-box .value { font-size: 26px; font-weight: 700; color: #1e3a8a; margin-top: 4px; }

.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
}
.btn:hover { background: var(--primary-hover); }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover { background: #cbd5e1; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: var(--danger); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid #f1f5f9; text-align: left; vertical-align: middle; }
.table th { color: #475569; font-weight: 600; background: #f8fafc; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.muted { color: var(--muted); font-size: 13px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-blue { background: #dbeafe; color: #1e40af; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin: 0 0 16px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #475569; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 240px; overflow-y: auto; }
.perm-grid label { font-size: 12px; display: flex; gap: 6px; align-items: center; }

.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
}
.login-card {
  background: #fff; border-radius: 16px; padding: 32px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-card h1 { margin: 0 0 8px; font-size: 22px; color: #1e3a5f; }
.login-card p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.toast {
  position: fixed; bottom: 24px; right: 24px; background: #1e293b; color: #fff;
  padding: 12px 18px; border-radius: 8px; font-size: 14px; display: none; z-index: 2000;
}
.tool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tool-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: #fff;
}
.tool-card h4 { margin: 0 0 6px; }
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 100; height: 100%; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
}
