/* Deskless — Admin Dashboard Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0a0f; --bg2: #12121a; --bg3: #1a1a25;
  --primary: #6366f1; --primary-light: #818cf8; --accent: #22c55e;
  --danger: #ef4444; --warning: #f59e0b; --text: #f1f5f9; --text-dim: #94a3b8; --text-muted: #64748b;
  --border: #1e1e2e; --card: #13131c; --card-border: #2a2a3a;
  --radius: 10px; --font: 'Inter', -apple-system, sans-serif;
}
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; min-height: 100vh; }

/* Layout */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: var(--bg2); border-right: 1px solid var(--border); padding: 24px 0; position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; }
.admin-content { margin-left: 240px; flex: 1; padding: 32px; }
.admin-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; padding: 0 24px 24px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.admin-logo svg { flex-shrink: 0; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 24px; color: var(--text-dim); text-decoration: none; font-size: 0.875rem; transition: all 0.2s; border-left: 3px solid transparent; }
.admin-nav a:hover { color: var(--text); background: var(--bg3); }
.admin-nav a.active { color: var(--primary-light); border-left-color: var(--primary); background: rgba(99,102,241,0.08); }
.admin-nav a svg { width: 16px; height: 16px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.admin-topbar h1 { font-size: 1.5rem; font-weight: 700; }
.admin-email { font-size: 0.8rem; color: var(--text-muted); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 20px; }
.stat-card .val { font-size: 2rem; font-weight: 800; }
.stat-card .lbl { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.stat-card .sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 12px 16px; border-bottom: 1px solid var(--card-border); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.data-table tr:hover td { background: var(--bg3); }
.data-table .truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table .sub { font-size: 0.75rem; color: var(--text-muted); }

/* Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 100px; font-size: 0.7rem; font-weight: 600; }
.badge-green { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-yellow { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-red { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-blue { background: rgba(99,102,241,0.15); color: var(--primary-light); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.form-input { width: 100%; padding: 10px 14px; background: var(--bg2); border: 1px solid var(--card-border); border-radius: 8px; color: var(--text); font-size: 0.875rem; outline: none; }
.form-input:focus { border-color: var(--primary); }
textarea.form-input { resize: vertical; min-height: 80px; }
.btn { padding: 8px 20px; border-radius: 8px; font-weight: 600; font-size: 0.875rem; cursor: pointer; border: none; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--card-border); color: var(--text-dim); }
.btn-outline:hover { background: var(--bg3); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }

/* Login page */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 48px; width: 400px; max-width: 90vw; }
.login-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; margin-bottom: 32px; justify-content: center; }
.login-title { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 8px; }
.login-sub { color: var(--text-dim); text-align: center; margin-bottom: 32px; font-size: 0.875rem; }
.login-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); border-radius: 8px; padding: 12px; color: #ef4444; font-size: 0.85rem; margin-bottom: 16px; }

/* Charts placeholder */
.chart-area { background: var(--bg2); border-radius: 8px; padding: 20px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bar { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 4px; transition: all 0.3s; }
.bar:hover { background: var(--primary-light); }
.chart-label { font-size: 0.65rem; color: var(--text-muted); text-align: center; }

/* Search */
.search-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.search-input { flex: 1; padding: 10px 16px; background: var(--bg2); border: 1px solid var(--card-border); border-radius: 8px; color: var(--text); font-size: 0.875rem; outline: none; }
.search-input:focus { border-color: var(--primary); }

/* Pagination */
.pagination { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.pagination a, .pagination span { padding: 6px 14px; background: var(--bg2); border: 1px solid var(--card-border); border-radius: 6px; font-size: 0.8rem; color: var(--text-dim); text-decoration: none; }
.pagination a:hover { background: var(--bg3); color: var(--text); }

/* Misc */
.text-muted { color: var(--text-muted); }
.text-green { color: var(--accent); }
.text-red { color: var(--danger); }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-mono { font-family: monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .admin-sidebar { display: none; }
  .admin-content { margin-left: 0; padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}