/* PTPN V12 Sertifikasi - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

:root {
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;
  --gold-400: #fbbf24;
  --gold-500: #f59e0b;
  --gold-600: #d97706;
  --dark-900: #0a0f0a;
  --dark-800: #111811;
  --dark-700: #1a2a1a;
  --dark-600: #1f331f;
  --dark-500: #243d24;
  --surface: #162416;
  --surface-2: #1e301e;
  --border: rgba(34, 197, 94, 0.12);
  --border-hover: rgba(34, 197, 94, 0.28);
  --text-primary: #f0fdf4;
  --text-secondary: #86efac;
  --text-muted: #4ade80;
  --text-dim: rgba(134, 239, 172, 0.5);
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.5);
  --glow: 0 0 20px rgba(34, 197, 94, 0.15);
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--dark-900);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── SCROLLBAR ─────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--dark-800); }
::-webkit-scrollbar-thumb { background: var(--green-800); border-radius: 10px; }

/* ─── LAYOUT ────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ─── SIDEBAR ───────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--dark-800);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

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

.brand-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--green-600), var(--green-700));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
  color: white;
  box-shadow: 0 0 12px rgba(22,163,74,0.4);
  flex-shrink: 0;
}

.brand-text { flex: 1; overflow: hidden; }
.brand-title { font-size: 13px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.brand-sub { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

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

.nav-section { padding: 8px 16px 4px; }
.nav-section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-dim);
}

.nav-item { padding: 2px 10px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13.5px; font-weight: 500;
  transition: all 0.2s;
  position: relative;
}

.nav-link:hover {
  background: var(--surface);
  color: var(--text-primary);
}

.nav-link.active {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green-400);
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--green-500);
  border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--green-700);
  color: var(--green-200);
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
}

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

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-600), var(--green-800));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: white; flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 11px; color: var(--text-muted); }

.btn-logout {
  margin-left: auto;
  background: none; border: none;
  color: var(--text-dim);
  cursor: pointer; font-size: 16px;
  padding: 4px; border-radius: 6px;
  transition: color 0.2s;
}
.btn-logout:hover { color: #f87171; }

/* ─── MAIN CONTENT ──────────────────────── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── HEADER ────────────────────────────── */
.header {
  height: var(--header-height);
  background: var(--dark-800);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
}

.header-title { font-size: 16px; font-weight: 700; flex: 1; }
.header-sub { font-size: 12px; color: var(--text-muted); }

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

.btn-icon {
  width: 36px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary);
  font-size: 15px; text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

.btn-icon:hover {
  background: var(--surface-2);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--green-500);
  border-radius: 50%;
  border: 1.5px solid var(--dark-800);
}

/* ─── PAGE CONTENT ──────────────────────── */
.content { flex: 1; padding: 24px; }

.page-header { margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.page-breadcrumb { font-size: 12px; color: var(--text-dim); }
.page-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.page-breadcrumb a:hover { color: var(--green-400); }

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

.stat-card {
  background: var(--dark-800);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-color, var(--green-600));
  opacity: 0.7;
}

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

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

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

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-change {
  font-size: 11px; font-weight: 600;
  margin-top: 8px;
}
.stat-change.up { color: var(--green-400); }
.stat-change.down { color: #f87171; }

/* ─── CARDS ─────────────────────────────── */
.card {
  background: var(--dark-800);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.card-title {
  font-size: 14px; font-weight: 700;
  flex: 1;
}

.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}

/* ─── TABLES ─────────────────────────────── */
.table-container { overflow-x: auto; }

table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: var(--surface);
  padding: 11px 14px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface); }

tbody td {
  padding: 12px 14px;
  color: var(--text-primary);
}

/* ─── BADGES ─────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
}

.badge-success { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-danger  { background: rgba(248,113,113,0.15); color: #f87171; }
.badge-warning { background: rgba(251,191,36,0.15); color: #fbbf24; }
.badge-info    { background: rgba(96,165,250,0.15); color: #60a5fa; }
.badge-secondary { background: rgba(148,163,184,0.15); color: #94a3b8; }

/* ─── BUTTONS ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  cursor: pointer; border: none;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green-600);
  color: white;
}
.btn-primary:hover { background: var(--green-700); box-shadow: 0 0 14px rgba(22,163,74,0.35); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); color: var(--text-primary); }

.btn-danger {
  background: rgba(248,113,113,0.15);
  color: #f87171;
  border: 1px solid rgba(248,113,113,0.2);
}
.btn-danger:hover { background: rgba(248,113,113,0.25); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ─── FORMS ──────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-control {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  transition: all 0.2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

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

select.form-control { cursor: pointer; }
select.form-control option { background: var(--dark-800); }

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

/* ─── SEARCH BAR ──────────────────────────── */
.search-bar {
  display: flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  gap: 10px;
  transition: all 0.2s;
}
.search-bar:focus-within {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.1);
}
.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text-primary);
  font-family: inherit; font-size: 13px;
  padding: 9px 0; flex: 1;
}
.search-bar input::placeholder { color: var(--text-dim); }
.search-icon { color: var(--text-dim); font-size: 14px; }

/* ─── TOOLBAR ──────────────────────────────── */
.toolbar {
  display: flex; align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ─── PROGRESS ──────────────────────────────── */
.progress { height: 6px; background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green-600), var(--green-400));
  border-radius: 10px;
  transition: width 0.6s ease;
}

/* ─── GRID ──────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ─── ALERTS ──────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); color: #4ade80; }
.alert-danger   { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.2); color: #f87171; }
.alert-warning  { background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.2); color: #fbbf24; }

/* ─── MODAL ──────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: var(--dark-800);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s;
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.modal-title { font-size: 15px; font-weight: 700; flex: 1; }
.modal-close {
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  font-size: 20px; line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: #f87171; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ─── EMPTY STATE ──────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-dim);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state p { font-size: 13px; }

/* ─── CHART PLACEHOLDER ─────────────────────── */
.chart-container { position: relative; width: 100%; }

/* ─── MOBILE ──────────────────────────────── */
.menu-toggle {
  display: none;
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 20px; cursor: pointer;
}

@media (max-width: 768px) {
  .menu-toggle { display: flex; align-items: center; }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── UTILITIES ──────────────────────────────── */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-success { color: var(--green-400); }
.text-danger { color: #f87171; }
.text-warning { color: #fbbf24; }
.font-mono { font-family: 'Fira Code', monospace; }
.mb-0 { margin-bottom: 0 !important; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ─── PAGINATION ──────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 4px;
  justify-content: center;
  padding-top: 16px;
}
.page-btn {
  min-width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.2s;
  padding: 0 8px;
}
.page-btn:hover { border-color: var(--green-600); color: var(--green-400); }
.page-btn.active { background: var(--green-700); border-color: var(--green-600); color: white; }

/* ─── CERTIFICATE CARD ──────────────────────── */
.cert-card {
  background: var(--dark-800);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.cert-card::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(34,197,94,0.05);
}
.cert-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--glow);
}
.cert-number {
  font-family: 'Fira Code', monospace;
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.cert-name { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.cert-type { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.cert-meta {
  display: flex; justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
