/* ============================================================
   HiveCore Admin — 管理面板樣式（繼承主站暗色主題）
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+TC:wght@300;400;500;700&display=swap');

:root {
  --bg-primary: #06061A;
  --bg-card: #111128;
  --bg-sidebar: #08081E;
  --bg-input: #0c0c22;
  --border: #1E1E3F;
  --text-primary: #F0F2FF;
  --text-secondary: #8B8FAE;
  --text-muted: #5A5E7A;
  --accent: #6C3AFF;
  --accent-hover: #5A2DE0;
  --accent-light: #9D7AFF;
  --accent-glow: rgba(108, 58, 255, 0.3);
  --green: #39FF85;
  --orange: #FFB020;
  --red: #FF3B5C;
  --blue: #00E5FF;
  --font-sans: 'Inter', 'Noto Sans TC', sans-serif;
  --font-mono: 'Consolas', monospace;
  --radius: 12px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-sans); background: var(--bg-primary); color: var(--text-primary); }
a { color: var(--accent-light); text-decoration: none; }

/* ── Layout ────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 240px; background: var(--bg-sidebar); border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; bottom: 0; padding: 20px 0; overflow-y: auto;
}
.sidebar-logo { font-size: 20px; font-weight: 800; color: var(--accent-light); padding: 0 20px 4px; }
.sidebar-subtitle { font-size: 11px; color: var(--text-muted); padding: 0 20px 20px; text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; font-size: 14px; color: var(--text-secondary);
  border-left: 3px solid transparent; transition: all 0.15s;
}
.sidebar-nav a:hover { background: rgba(124,58,237,0.08); color: var(--text-primary); }
.sidebar-nav a.active { background: rgba(124,58,237,0.12); color: var(--accent-light); border-left-color: var(--accent); }
.sidebar-nav .divider { height: 1px; background: var(--border); margin: 12px 20px; }

.admin-main { flex: 1; margin-left: 240px; padding: 24px 32px; }

/* ── Page Header ───────────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 700; }
.page-header p { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* ── Stats Grid ────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.stat-card .sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Data Table ────────────────────────────────────────────── */
.data-table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.data-table-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.data-table-header h2 { font-size: 16px; font-weight: 600; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 16px; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; background: var(--bg-input); }
.data-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.data-table tr:hover td { background: rgba(124,58,237,0.04); }
.data-table tr:last-child td { border-bottom: none; }

/* ── Badges ────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-green { background: #166534; color: var(--green); }
.badge-orange { background: #92400e; color: var(--orange); }
.badge-red { background: #7f1d1d; color: var(--red); }
.badge-blue { background: #1e3a5f; color: var(--blue); }
.badge-purple { background: rgba(124,58,237,0.2); color: var(--accent-light); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; border: none; cursor: pointer; transition: all 0.15s; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-danger { background: var(--red); color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-input { width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 14px; outline: none; }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-bar { max-width: 300px; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; max-width: 480px; width: 100%; }
.modal h2 { font-size: 18px; margin-bottom: 16px; }

/* ── Toast ──────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; right: 24px; z-index: 300; padding: 12px 20px; border-radius: 8px; font-size: 14px; transform: translateY(80px); opacity: 0; transition: all 0.3s; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: #166534; color: var(--green); border: 1px solid var(--green); }
.toast-error { background: #7f1d1d; color: var(--red); border: 1px solid var(--red); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar { width: 60px; }
  .admin-sidebar .sidebar-logo, .admin-sidebar .sidebar-subtitle, .sidebar-nav a span { display: none; }
  .admin-main { margin-left: 60px; padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
