/* ═══════════════════════════════════════════════════════
   PDM Gunungkidul — Admin Panel Stylesheet
   Premium dark-first design, consistent with main site
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ─── Design Tokens ─────────────────────────────── */
:root {
  --brand-emerald:   #0f7c43;
  --brand-emerald-l: #1aaa5e;
  --brand-gold:      #c99c37;
  --brand-gold-l:    #dfb249;

  /* Surfaces */
  --bg-base:         #0a0f1e;
  --bg-surface:      #111827;
  --bg-card:         #1a2236;
  --bg-card-hover:   #202d45;
  --bg-input:        #0f1625;
  --bg-sidebar:      #0e1829;

  /* Text */
  --text-primary:    #f1f5f9;
  --text-secondary:  #94a3b8;
  --text-muted:      #64748b;
  --text-accent:     #46df92;

  /* Borders */
  --border-subtle:   rgba(255,255,255,0.06);
  --border-card:     rgba(255,255,255,0.10);
  --border-input:    rgba(255,255,255,0.15);
  --border-focus:    #0f7c43;

  /* Status Colors */
  --status-published:  #22c55e;
  --status-draft:      #64748b;
  --status-pending:    #f59e0b;
  --status-archived:   #6b7280;
  --status-rejected:   #ef4444;

  /* Roles */
  --role-god:        #a855f7;
  --role-editor:     #0ea5e9;
  --role-pcm:        #f59e0b;
  --role-viewer:     #64748b;

  /* Elevation */
  --shadow-card:     0 4px 24px rgba(0,0,0,0.4);
  --shadow-modal:    0 20px 60px rgba(0,0,0,0.7);
  --shadow-glow-em:  0 0 20px rgba(15,124,67,0.25);

  /* Sizing */
  --sidebar-w:       260px;
  --header-h:        64px;
  --radius-sm:       6px;
  --radius-md:       10px;
  --radius-lg:       16px;
  --radius-xl:       24px;

  /* Transition */
  --ease-out:        cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast:          150ms;
  --t-base:          250ms;
}

/* ─── Reset & Base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; display: block; }

/* ─── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ─── Layout ─────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-areas: "sidebar header" "sidebar main";
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────── */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand img { width: 36px; height: 36px; object-fit: contain; }

.sidebar-brand-text { line-height: 1.2; }
.sidebar-brand-text strong { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); display: block; }
.sidebar-brand-text span { font-size: 0.7rem; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 12px 12px; overflow-y: auto; }

.nav-group { margin-bottom: 4px; }
.nav-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 12px 8px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--t-fast) var(--ease-out);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-link.active {
  background: rgba(15,124,67,0.2);
  color: var(--text-accent);
  font-weight: 600;
}

.nav-link .icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-link.active .icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--brand-gold);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-user {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: background var(--t-fast);
}

.user-card:hover { background: var(--bg-card-hover); }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-card);
  background: var(--bg-card-hover);
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 99px;
  letter-spacing: 0.05em;
}

.user-role-badge.SUPER_ADMIN { background: rgba(168,85,247,0.2); color: #c084fc; }
.user-role-badge.EDITOR      { background: rgba(14,165,233,0.2); color: #38bdf8; }
.user-role-badge.PCM_OPERATOR{ background: rgba(245,158,11,0.2); color: #fbbf24; }
.user-role-badge.VIEWER      { background: rgba(100,116,139,0.2); color: #94a3b8; }

/* ─── Header ─────────────────────────────────────── */
.admin-header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(17,24,39,0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-title small {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 1px;
}

.header-actions { display: flex; align-items: center; gap: 12px; }

/* ─── Main Content ───────────────────────────────── */
.admin-main {
  grid-area: main;
  padding: 28px;
  overflow-x: hidden;
}

/* ─── Page Loader ────────────────────────────────── */
.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  flex-direction: column;
  gap: 16px;
}

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border-card);
  border-top-color: var(--brand-emerald);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Stats Cards ────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

.stat-card.green .stat-icon { background: rgba(15,124,67,0.2); }
.stat-card.green .stat-value { color: var(--text-accent); }
.stat-card.blue  .stat-icon { background: rgba(14,165,233,0.2); }
.stat-card.blue  .stat-value { color: #38bdf8; }
.stat-card.gold  .stat-icon { background: rgba(201,156,55,0.2); }
.stat-card.gold  .stat-value { color: var(--brand-gold-l); }
.stat-card.purple .stat-icon { background: rgba(168,85,247,0.2); }
.stat-card.purple .stat-value { color: #c084fc; }
.stat-card.orange .stat-icon { background: rgba(249,115,22,0.2); }
.stat-card.orange .stat-value { color: #fb923c; }

/* ─── Sections ───────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ─── Cards ──────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body { padding: 20px; }

/* ─── Data Table ─────────────────────────────────── */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.table-search {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.table-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 36px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color var(--t-fast);
}

.table-search input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.table-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px; height: 16px;
}

.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--t-fast);
}

thead th:hover { color: var(--text-primary); }

tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--t-fast);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.03); }

td {
  padding: 12px 16px;
  color: var(--text-secondary);
  vertical-align: middle;
}

td strong { color: var(--text-primary); font-weight: 600; }

/* ─── Status Badges ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.badge-published { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-published .badge-dot { background: #4ade80; }

.badge-draft { background: rgba(100,116,139,0.15); color: #94a3b8; }
.badge-draft .badge-dot { background: #94a3b8; }

.badge-pending { background: rgba(245,158,11,0.15); color: #fbbf24; animation: pulse-badge 2s ease infinite; }
.badge-pending .badge-dot { background: #fbbf24; }

.badge-archived { background: rgba(107,114,128,0.15); color: #9ca3af; }
.badge-archived .badge-dot { background: #9ca3af; }

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ─── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-emerald) 0%, var(--brand-emerald-l) 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(15,124,67,0.3);
}

.btn-primary:hover { box-shadow: 0 4px 20px rgba(15,124,67,0.5); }

.btn-secondary {
  background: var(--bg-card-hover);
  color: var(--text-secondary);
  border-color: var(--border-card);
}

.btn-secondary:hover { color: var(--text-primary); border-color: var(--border-input); }

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border-color: rgba(239,68,68,0.3);
}

.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-ghost { background: none; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-icon { padding: 7px; }

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ─── Forms ──────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .required { color: #f87171; margin-left: 2px; }

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-emerald);
  box-shadow: 0 0 0 3px rgba(15,124,67,0.15);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}

textarea.form-control { min-height: 100px; resize: vertical; }

.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: #f87171; margin-top: 4px; }

.form-control.is-invalid { border-color: #ef4444; }

.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ─── Toggle Switch ──────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative; width: 40px; height: 22px;
  display: inline-block; cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border-input);
  border-radius: 99px;
  transition: background var(--t-base);
}
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%; background: #fff;
  transition: transform var(--t-base) var(--ease-out);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.toggle input:checked + .toggle-track { background: var(--brand-emerald); }
.toggle input:checked ~ .toggle-thumb { transform: translateX(18px); }

/* ─── Pagination ─────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
}

.pagination-info { color: var(--text-muted); }

.pagination-controls { display: flex; gap: 4px; }

.page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 500;
  transition: all var(--t-fast);
}

.page-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.page-btn.active { background: var(--brand-emerald); color: #fff; border-color: var(--brand-emerald); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Modal ──────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--t-base) var(--ease-out);
}

.modal-overlay.open .modal { transform: none; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
}

.modal-title { font-size: 1rem; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ─── Toast ──────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  min-width: 300px; max-width: 400px;
  pointer-events: all;
  animation: toast-in 0.4s var(--ease-out) forwards;
}

.toast.out { animation: toast-out 0.3s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(100%); }
}

.toast-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.toast-content { flex: 1; }
.toast-title { font-size: 0.875rem; font-weight: 700; margin-bottom: 2px; }
.toast-message { font-size: 0.8rem; color: var(--text-secondary); }

.toast-success { border-left: 3px solid #22c55e; }
.toast-success .toast-icon { color: #22c55e; }
.toast-error { border-left: 3px solid #ef4444; }
.toast-error .toast-icon { color: #ef4444; }
.toast-warning { border-left: 3px solid #f59e0b; }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-info { border-left: 3px solid #0ea5e9; }
.toast-info .toast-icon { color: #0ea5e9; }

/* ─── Empty State ────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}

.empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-size: 1rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-desc { font-size: 0.875rem; margin-bottom: 24px; }

/* ─── Analytics Mini Chart ───────────────────────── */
.analytics-bar {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 40px;
}

.analytics-bar-item {
  flex: 1;
  background: rgba(15,124,67,0.3);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: background var(--t-fast);
}

.analytics-bar-item:hover { background: var(--brand-emerald); }

.analytics-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--text-secondary);
}

.analytics-meta-item { display: flex; align-items: center; gap: 6px; }
.analytics-meta-item strong { color: var(--text-primary); font-weight: 700; }

/* ─── Pending Approval Banner ────────────────────── */
.pending-banner {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
  animation: pulse-border 3s ease infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(245,158,11,0.3); }
  50% { border-color: rgba(245,158,11,0.7); }
}

.pending-banner-icon { color: #fbbf24; font-size: 1.2rem; }
.pending-banner-text { flex: 1; font-size: 0.875rem; }
.pending-banner-text strong { color: #fbbf24; }

/* ─── Audit Log ──────────────────────────────────── */
.audit-entry {
  display: flex; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.audit-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-card-hover); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; }

.audit-content { flex: 1; min-width: 0; }
.audit-text { font-size: 0.875rem; color: var(--text-secondary); }
.audit-text strong { color: var(--text-primary); }
.audit-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.action-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; }
.action-CREATE { background: rgba(34,197,94,0.15); color: #4ade80; }
.action-UPDATE { background: rgba(14,165,233,0.15); color: #38bdf8; }
.action-DELETE { background: rgba(239,68,68,0.15); color: #f87171; }
.action-APPROVE { background: rgba(15,124,67,0.15); color: #46df92; }
.action-REJECT  { background: rgba(239,68,68,0.15); color: #fca5a5; }
.action-LOGIN   { background: rgba(168,85,247,0.15); color: #c084fc; }
.action-LOGOUT  { background: rgba(100,116,139,0.15); color: #94a3b8; }

/* ─── Login Page ─────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(15,124,67,0.15) 0%, transparent 60%), var(--bg-base);
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%; max-width: 420px;
  text-align: center;
  box-shadow: var(--shadow-modal);
}

.login-logo { width: 72px; height: 72px; margin: 0 auto 20px; }
.login-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.login-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 32px; }

.login-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--text-muted); font-size: 0.8rem; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-subtle); }

.btn-google {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 20px;
  background: #fff;
  color: #3c4043;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: all var(--t-fast);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.btn-google:hover { background: #f8f9fa; box-shadow: 0 4px 16px rgba(0,0,0,0.4); transform: translateY(-1px); }
.btn-google img { width: 20px; }

.login-note {
  margin-top: 24px;
  padding: 12px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: #fbbf24;
  line-height: 1.5;
}

.login-error {
  margin-bottom: 20px;
  padding: 12px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #fca5a5;
}

/* ─── Kontak Valid Toggle ────────────────────────── */
.kontak-invalid-warning {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-sm);
  font-size: 0.8rem; color: #fbbf24;
  margin-top: 8px;
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
}

@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "main";
  }

  .sidebar {
    position: fixed; left: -100%; top: 0; height: 100vh;
    width: 280px; z-index: 200;
    transition: left var(--t-base) var(--ease-out);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .sidebar.open { left: 0; }

  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 199;
  }

  .sidebar.open ~ .sidebar-overlay { display: block; }

  .admin-main { padding: 16px; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; }
}
