/* ============================================================
   LENTERA DIGITAL BTIKP - CSS Utama
   ============================================================ */

:root {
  --primary: #2B6A4D;
  --primary-dark: #1B5E3B;
  --primary-light: #E6F4EC;
  --accent: #27835A;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: rgba(0,0,0,0.1);
  --border-strong: rgba(0,0,0,0.18);
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --nav-h: 60px;
  --bottom-h: 64px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  padding-top: var(--nav-h);
  padding-bottom: var(--bottom-h);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--primary);
  box-shadow: var(--shadow-md);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; padding: 0 16px; max-width: 1200px; margin: 0 auto;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none;
}
.brand-logo { font-size: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 15px; font-weight: 600; color: #fff; }
.brand-sub { font-size: 10px; color: rgba(255,255,255,0.7); }
.navbar-right { display: flex; align-items: center; gap: 8px; }

.notif-btn {
  position: relative; color: rgba(255,255,255,0.85);
  padding: 8px; border-radius: 8px;
  display: flex; align-items: center;
  transition: background 0.15s;
}
.notif-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  background: #EF4444; color: #fff; font-size: 10px; font-weight: 600;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff; border-radius: 10px;
  padding: 6px 12px 6px 8px; cursor: pointer;
  transition: background 0.15s;
}
.user-btn:hover { background: rgba(255,255,255,0.25); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.user-name-short { font-size: 13px; font-weight: 500; }

.user-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 220px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12); z-index: 200; overflow: hidden;
}
.user-dropdown.show { display: block; }
.dropdown-header {
  padding: 14px 16px; background: var(--primary-light);
  border-bottom: 1px solid var(--border);
}
.dh-name { font-size: 14px; font-weight: 600; color: var(--primary-dark); }
.dh-role { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; color: var(--text); font-size: 14px;
  transition: background 0.12s;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item svg { opacity: 0.6; flex-shrink: 0; }
.dropdown-item-danger { color: #DC2626; }
.dropdown-item-danger svg { opacity: 0.7; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ============================================================
   BOTTOM NAV
   ============================================================ */
.bottom-nav {
  display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--bottom-h); background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.bn-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: var(--text-muted); font-size: 10px; padding: 8px 0;
  transition: color 0.15s;
}
.bn-item.active { color: var(--primary); }
.bn-item svg { transition: transform 0.15s; }
.bn-item.active svg { transform: scale(1.1); }

@media (min-width: 768px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

/* ============================================================
   FLASH MESSAGE
   ============================================================ */
.flash-msg {
  position: fixed; top: calc(var(--nav-h) + 10px); right: 12px; z-index: 300;
  max-width: 360px; padding: 12px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.25s ease;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } }
.flash-sukses { background: #DCFCE7; color: #14532D; border: 1px solid #86EFAC; }
.flash-error   { background: #FEE2E2; color: #7F1D1D; border: 1px solid #FCA5A5; }
.flash-info    { background: #DBEAFE; color: #1E3A5F; border: 1px solid #93C5FD; }
.flash-close { background: none; border: none; cursor: pointer; font-size: 18px; opacity: 0.6; }

/* ============================================================
   LAYOUT
   ============================================================ */
.main-content { min-height: calc(100vh - var(--nav-h)); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.page-body { padding: 24px 16px; max-width: 1100px; margin: 0 auto; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1 { font-size: clamp(20px, 4vw, 28px); font-weight: 700; line-height: 1.25; }
h2 { font-size: clamp(17px, 3vw, 22px); font-weight: 600; line-height: 1.3; }
h3 { font-size: 17px; font-weight: 600; }
h4 { font-size: 15px; font-weight: 600; }
p { margin-bottom: 12px; }
p:last-child { margin-bottom: 0; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-center { text-align: center; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 20px; border-radius: 10px; font-size: 15px; font-weight: 500;
  border: none; cursor: pointer; text-decoration: none;
  min-height: 46px; transition: all 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); color: var(--primary); }
.btn-danger { background: #DC2626; color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 8px 14px; font-size: 13px; min-height: 36px; border-radius: 8px; }
.btn-lg { padding: 15px 28px; font-size: 16px; min-height: 52px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ============================================================
   FORM
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.form-label .req { color: #EF4444; margin-left: 2px; }
.form-control {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border-strong);
  border-radius: 10px; font-size: 15px; color: var(--text);
  background: var(--surface); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 46px;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43,106,77,0.12);
}
.form-control::placeholder { color: var(--text-light); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea.form-control { min-height: 120px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: #DC2626; margin-top: 5px; }
.input-group { display: flex; gap: 0; }
.input-group .form-control { border-radius: 10px 0 0 10px; }
.input-group .btn { border-radius: 0 10px 10px 0; }

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg); }

/* ============================================================
   BADGE / TAG
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-green  { background: #DCFCE7; color: #14532D; }
.badge-blue   { background: #DBEAFE; color: #1E3A5F; }
.badge-amber  { background: #FEF3C7; color: #78350F; }
.badge-red    { background: #FEE2E2; color: #7F1D1D; }
.badge-purple { background: #EDE9FE; color: #3B0764; }
.badge-gray   { background: #F3F4F6; color: #374151; }

/* ============================================================
   HERO / BANNER
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--accent) 100%);
  color: #fff; padding: 32px 20px;
}
.hero-title { font-size: clamp(18px, 4vw, 26px); font-weight: 700; margin-bottom: 6px; }
.hero-sub { font-size: 14px; opacity: 0.85; }

/* ============================================================
   PELATIHAN CARD
   ============================================================ */
.course-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .course-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .course-grid { grid-template-columns: 1fr 1fr 1fr; } }

.course-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.course-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.course-thumb {
  height: 150px; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; overflow: hidden;
}
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.course-cat { margin-bottom: 8px; }
.course-title { font-size: 15px; font-weight: 600; line-height: 1.35; margin-bottom: 8px; flex: 1; }
.course-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; flex-wrap: wrap; }
.course-meta span { display: flex; align-items: center; gap: 4px; }
.course-footer { padding: 12px 16px; border-top: 1px solid var(--border); }

/* Progress bar */
.progress { background: #E5E7EB; border-radius: 8px; height: 7px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 8px; background: var(--primary); transition: width 0.4s; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* ============================================================
   STATS
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 600px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 12px; text-align: center;
}
.stat-num { font-size: 26px; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

/* ============================================================
   TUGAS
   ============================================================ */
.task-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 10px;
}
.task-deadline { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; margin-bottom: 8px; display: inline-block; }
.task-deadline-danger  { background: #FEE2E2; color: #B91C1C; }
.task-deadline-warning { background: #FEF3C7; color: #92400E; }
.task-deadline-ok      { background: #DCFCE7; color: #14532D; }

/* ============================================================
   SERTIFIKAT CARD
   ============================================================ */
.sertifikat-card {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  color: #fff; border-radius: var(--radius-lg); padding: 20px;
  margin-bottom: 12px;
}
.sert-header { font-size: 10px; opacity: 0.75; letter-spacing: 0.08em; text-transform: uppercase; }
.sert-nama { font-size: 17px; font-weight: 700; margin-top: 6px; }
.sert-kursus { font-size: 13px; opacity: 0.85; margin-top: 3px; }
.sert-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.sert-date { font-size: 11px; opacity: 0.65; }
.sert-dl {
  background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.35);
  color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 12px;
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: background 0.15s;
}
.sert-dl:hover { background: rgba(255,255,255,0.3); color: #fff; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); padding: 20px;
}
.auth-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 32px 28px; width: 100%; max-width: 420px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .logo-icon { font-size: 44px; display: block; margin-bottom: 8px; }
.auth-logo .logo-title { font-size: 20px; font-weight: 700; color: var(--primary); }
.auth-logo .logo-sub { font-size: 12px; color: var(--text-muted); }
.auth-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.auth-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  min-height: calc(100vh - var(--nav-h));
}
.admin-layout { display: flex; }
.admin-main { flex: 1; padding: 24px; min-width: 0; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px; color: var(--text); font-size: 14px;
  transition: background 0.12s;
}
.admin-nav-item:hover { background: var(--bg); }
.admin-nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; border-right: 3px solid var(--primary); }

/* Table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
thead th { background: var(--bg); padding: 11px 14px; font-size: 12px; font-weight: 600; text-align: left; color: var(--text-muted); border-bottom: 1px solid var(--border); }
tbody td { padding: 13px 14px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }

/* ============================================================
   MODUL / MATERI VIEWER
   ============================================================ */
.modul-list { list-style: none; }
.modul-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.12s;
}
.modul-item:hover { background: var(--bg); }
.modul-item.done .modul-num { background: var(--primary); color: #fff; }
.modul-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.modul-info { flex: 1; min-width: 0; }
.modul-title { font-size: 14px; font-weight: 500; }
.modul-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title { font-size: 15px; font-weight: 600; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; }
.empty-state p { font-size: 14px; color: var(--text-muted); }

/* ============================================================
   CHIPS / FILTER
   ============================================================ */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  color: var(--text-muted); cursor: pointer; white-space: nowrap;
  transition: all 0.12s;
}
.chip.active, .chip:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--primary-dark); color: rgba(255,255,255,0.75);
  padding: 16px 20px; margin-top: 40px;
  display: none;
}
@media (min-width: 768px) { .footer { display: block; } }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.footer-brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 500; }
.footer-sep { opacity: 0.4; }

/* ============================================================
   UTILITIES
   ============================================================ */
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.p-16 { padding: 16px; } .p-20 { padding: 20px; }
.flex { display: flex; } .flex-center { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none; }
.rounded { border-radius: var(--radius); }
.shadow { box-shadow: var(--shadow); }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
