/* Admin panel — dark theme, matches the public site's palette */

:root {
  --bg: #06070d;
  --surface: #0d0f1a;
  --surface-2: #12142266;
  --border: rgba(255,255,255,0.09);
  --text: #eef0f7;
  --text-dim: #9aa1b8;
  --text-faint: #666e88;
  --accent: #7c5cff;
  --accent-2: #35e0c9;
  --accent-grad: linear-gradient(135deg, #7c5cff 0%, #4f8bff 50%, #35e0c9 100%);
  --danger: #ff6b81;
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

a { color: inherit; text-decoration: none; }
h1, h2 { font-family: 'Sora', 'Inter', sans-serif; margin: 0; }

/* ---------- login ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, rgba(124,92,255,0.15), transparent 40%),
              radial-gradient(circle at 80% 80%, rgba(53,224,201,0.12), transparent 40%),
              var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  backdrop-filter: blur(16px);
}
.login-brand { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.3rem; margin-bottom: 6px; }
.login-brand span { color: var(--accent-2); }
.login-sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 20px; }
.login-hint { text-align: center; font-size: 0.78rem; color: var(--text-faint); margin-top: 14px; }
.login-hint code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px; }

/* ---------- shell ---------- */
.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-brand { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.15rem; padding: 0 10px 24px; }
.admin-brand span { color: var(--accent-2); }

.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav a {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s ease, color 0.2s ease;
}
.admin-nav a:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.admin-nav a.active { background: rgba(124,92,255,0.15); color: var(--text); }

.badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.admin-sidebar-footer { display: flex; flex-direction: column; gap: 4px; padding-top: 16px; border-top: 1px solid var(--border); }
.admin-sidebar-footer a { padding: 10px 14px; font-size: 0.85rem; color: var(--text-dim); border-radius: var(--radius-sm); }
.admin-sidebar-footer a:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.logout-link:hover { color: var(--danger) !important; }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
}
.admin-user { font-size: 0.85rem; color: var(--text-dim); }
.admin-content { padding: 28px 32px 60px; max-width: 1100px; }

/* ---------- stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card-accent { border-color: rgba(124,92,255,0.4); background: rgba(124,92,255,0.08); }
.stat-value { font-size: 1.9rem; font-weight: 800; font-family: 'Sora', sans-serif; }
.stat-label { font-size: 0.8rem; color: var(--text-dim); }

/* ---------- panels ---------- */
.panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.panel-narrow { max-width: 480px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h2 { font-size: 1.05rem; }

.link-btn { color: var(--accent-2); font-size: 0.85rem; font-weight: 600; background: none; border: none; cursor: pointer; padding: 0; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
.link-btn-danger { color: var(--danger); }

.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- tables ---------- */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }

.proj-row { display: flex; align-items: center; gap: 12px; }
.proj-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.proj-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  background: rgba(124,92,255,0.15); color: var(--accent-2);
  font-weight: 700; font-family: 'Sora', sans-serif;
}

.row-actions { display: flex; gap: 14px; align-items: center; }

.pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
}
.pill-new { background: rgba(53,224,201,0.15); color: var(--accent-2); border: 1px solid rgba(53,224,201,0.35); }
.pill-muted { background: rgba(255,255,255,0.06); color: var(--text-dim); border: 1px solid var(--border); }
.pill-btn { border: none; cursor: pointer; font-family: inherit; }

/* ---------- messages ---------- */
.message-list { display: flex; flex-direction: column; gap: 14px; }
.message-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; }
.message-card-new { border-color: rgba(53,224,201,0.4); background: rgba(53,224,201,0.04); }
.message-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.message-head strong { margin-right: 8px; }
.message-meta { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 10px; }
.message-meta a:hover { color: var(--accent-2); }
.message-body { font-size: 0.92rem; color: var(--text); margin-bottom: 12px; white-space: pre-wrap; }
.message-actions { display: flex; gap: 16px; }

/* ---------- forms ---------- */
.admin-form { max-width: 720px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); }
.optional { color: var(--text-faint); font-weight: 400; }
.field-checkbox label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }

.field input[type=text], .field input[type=url], .field input[type=number],
.field input[type=password], .field input[type=email], .field input[type=file],
.field textarea, .field select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(124,92,255,0.06);
}
.current-image { width: 100%; max-width: 260px; border-radius: var(--radius-sm); margin-bottom: 10px; }

.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.inline-form { display: inline; }

.muted { color: var(--text-dim); }
.small { font-size: 0.8rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}
.btn-primary { background: var(--accent-grad); color: #07080f; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(124,92,255,0.3); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); }
.btn-small { padding: 9px 16px; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* ---------- alerts ---------- */
.form-alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 18px; font-weight: 500; }
.form-alert.success { background: rgba(53,224,201,0.12); border: 1px solid rgba(53,224,201,0.35); color: #b7f5ec; }
.form-alert.error { background: rgba(255,107,129,0.12); border: 1px solid rgba(255,107,129,0.35); color: #ffc4cd; }

@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
