/* xmlriver_hub — dark theme, single-file CSS */
:root {
  --bg: #0f1419;
  --bg-card: #1a1f2e;
  --bg-card-hover: #232938;
  --text: #e4e7ec;
  --text-muted: #8b94a7;
  --border: #2a3142;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo { font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none; }
.logo:hover { text-decoration: none; }
.header-nav { display: flex; gap: 16px; flex: 1; }
.header-nav a { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.header-nav a:hover { color: var(--text); text-decoration: none; }
.user-menu { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--text-muted); font-size: 14px; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text);
  font-size: 14px; font-weight: 500; cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--bg-card-hover); text-decoration: none; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Badges */
.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 12px; font-weight: 600; color: #fff;
}
.badge-error { background: var(--red); }
.badge-warning { background: var(--yellow); color: #1a1f2e; }
.badge-notice { background: var(--blue); }
.badge-admin { background: var(--primary); }

/* Auth pages */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
}
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 40px; width: 100%; max-width: 400px;
}
.auth-card h1 { margin-bottom: 24px; font-size: 24px; }
.auth-link { margin-top: 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-wide { max-width: 600px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field span { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.form-field input, .form-field select, .form-field textarea, .select {
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text);
  font-size: 14px; font-family: inherit;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--primary); }
.form-row { display: flex; gap: 16px; }
.form-row .form-field { flex: 1; }
.hidden { display: none !important; }

/* Alerts */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 16px; font-size: 14px;
}
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid var(--red); color: var(--red); }
.alert-warning { background: rgba(234,179,8,0.15); border: 1px solid var(--yellow); color: var(--yellow); }

/* Page header */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-header h1 { font-size: 24px; }
.muted { color: var(--text-muted); font-size: 14px; }
.text-sm { font-size: 13px; }
.mt { margin-top: 24px; }
.mb { margin-bottom: 24px; }

/* Stats grid */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
}
.stat-value { display: block; font-size: 28px; font-weight: 700; }
.stat-label { display: block; color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* Info grid */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .info-grid { grid-template-columns: 1fr; } }
.info-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.info-card h3 { font-size: 16px; margin-bottom: 16px; }
.info-card ul { list-style: disc; padding-left: 20px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead { background: var(--bg-card); }
.table th {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table tr:hover td { background: var(--bg-card); }
.table-sm th, .table-sm td { padding: 6px 10px; font-size: 13px; }

.kv-table { width: 100%; font-size: 14px; }
.kv-table td { padding: 6px 0; }
.kv-table td:first-child { color: var(--text-muted); width: 40%; }

/* Truncate */
.truncate { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state p { margin-bottom: 16px; font-size: 16px; }

/* Code */
code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: 'SF Mono', Consolas, monospace; }
pre { background: var(--bg); padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); overflow: auto; font-size: 12px; }
pre code { padding: 0; background: transparent; }

/* Responsive */
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px; gap: 12px; }
  .header-nav { order: 3; width: 100%; }
  .form-row { flex-direction: column; }
  .truncate { max-width: 180px; }
}
