/* =============================================
   Platform Komunitas Lari Digital – Admin CSS
   ============================================= */

:root {
  --bg-dark:       #080c14;
  --bg-card:       #0f1623;
  --bg-sidebar:    #0b1220;
  --bg-hover:      rgba(255,255,255,0.04);
  --border:        rgba(255,255,255,0.08);
  --border-light:  rgba(255,255,255,0.04);

  --cyan:          #00c6ff;
  --cyan-dark:     #0072ff;
  --green:         #43e97b;
  --orange:        #ff8c42;
  --red:           #ff6b6b;
  --yellow:        #ffd700;
  --purple:        #b87eff;

  --text-primary:  #f0f4ff;
  --text-secondary:#a8b8cc;
  --text-muted:    #5a6a7e;

  --sidebar-width: 260px;
  --header-height: 64px;
  --radius:        14px;
  --radius-sm:     10px;
}

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

html, body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

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

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform .3s;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 16px rgba(0,198,255,0.3);
}
.sidebar-logo .logo-text h2 { font-size: 13px; font-weight: 800; letter-spacing: .5px; }
.sidebar-logo .logo-text p  { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

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

.nav-label {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  letter-spacing: 1px; text-transform: uppercase;
  padding: 8px 8px 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all .18s; color: var(--text-secondary);
  font-size: 13.5px; font-weight: 500; text-decoration: none;
  margin-bottom: 2px;
}
.nav-item .nav-icon { font-size: 17px; width: 22px; text-align: center; }
.nav-item:hover    { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active   { background: rgba(0,198,255,0.1); color: var(--cyan); }
.nav-item .badge   {
  margin-left: auto; background: var(--red); color: white;
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 10px; min-width: 18px; text-align: center;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #0a0e1a;
  flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 12px; font-weight: 600; truncate: true; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: 10px; color: var(--cyan); font-weight: 600; }
.sidebar-user .logout-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: all .2s; flex-shrink: 0;
}
.sidebar-user .logout-btn:hover { background: rgba(255,80,80,0.1); border-color: var(--red); }

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

/* ── Top Header ── */
.topbar {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 90;
  gap: 16px;
}
.topbar-title { flex: 1; }
.topbar-title h1 { font-size: 18px; font-weight: 700; }
.topbar-title .breadcrumb { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions .icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: all .2s; position: relative;
}
.topbar-actions .icon-btn:hover { background: var(--bg-hover); }
.topbar-actions .notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan); border: 1.5px solid var(--bg-card);
}

.role-badge {
  padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 700;
  background: rgba(0,198,255,0.12); color: var(--cyan);
  border: 1px solid rgba(0,198,255,0.3);
}

/* ── Page Content ── */
.page-content {
  padding: 24px;
  flex: 1;
  animation: fadeUp 0.35s ease;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 14px;
}
.stat-card .stat-value { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-card .stat-change { font-size: 11px; margin-top: 6px; }
.stat-card .stat-change.up   { color: var(--green); }
.stat-card .stat-change.down { color: var(--red); }

.color-cyan   { background: rgba(0,198,255,0.12); color: var(--cyan); }
.color-green  { background: rgba(67,233,123,0.12); color: var(--green); }
.color-orange { background: rgba(255,140,66,0.12); color: var(--orange); }
.color-red    { background: rgba(255,107,107,0.12); color: var(--red); }
.color-yellow { background: rgba(255,215,0,0.12);  color: var(--yellow); }
.color-purple { background: rgba(184,126,255,0.12); color: var(--purple); }

/* ── Grid Layout ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 24px; }

/* ── Card ── */
.card {
  background: var(--bg-card);
  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; justify-content: space-between;
}
.card-header h3 { font-size: 14px; font-weight: 700; }
.card-body { padding: 20px; }

/* =============================================
   TABLE
   ============================================= */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
}
thead th {
  text-align: left; padding: 10px 16px;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
tbody td {
  padding: 13px 16px; border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

/* =============================================
   BADGES & CHIPS
   ============================================= */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.chip-cyan   { background: rgba(0,198,255,0.12);   color: var(--cyan);   border: 1px solid rgba(0,198,255,0.25); }
.chip-green  { background: rgba(67,233,123,0.12);  color: var(--green);  border: 1px solid rgba(67,233,123,0.25); }
.chip-orange { background: rgba(255,140,66,0.12);  color: var(--orange); border: 1px solid rgba(255,140,66,0.25); }
.chip-red    { background: rgba(255,107,107,0.12); color: var(--red);    border: 1px solid rgba(255,107,107,0.25); }
.chip-yellow { background: rgba(255,215,0,0.12);   color: var(--yellow); border: 1px solid rgba(255,215,0,0.25); }
.chip-purple { background: rgba(184,126,255,0.12); color: var(--purple); border: 1px solid rgba(184,126,255,0.25); }
.chip-muted  { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; font-size: 13px;
  font-weight: 600; font-family: 'Inter', sans-serif;
  transition: all .18s; text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, var(--cyan), var(--cyan-dark)); color: #0a0e1a; }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(0,198,255,0.35); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger  { background: rgba(255,107,107,0.12); color: var(--red); border: 1px solid rgba(255,107,107,0.25); }
.btn-danger:hover  { background: rgba(255,107,107,0.2); }
.btn-success { background: rgba(67,233,123,0.12); color: var(--green); border: 1px solid rgba(67,233,123,0.25); }
.btn-success:hover { background: rgba(67,233,123,0.2); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-icon { padding: 8px; border-radius: 8px; }

/* =============================================
   FORMS
   ============================================= */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 11px 14px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-primary); font-size: 13px; font-family: 'Inter', sans-serif;
  transition: border-color .2s; box-sizing: border-box;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--cyan); }
.form-group select option { background: #1a2535; }
.form-group textarea { resize: vertical; min-height: 90px; }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  animation: fadeUp .3s ease;
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  cursor: pointer; font-size: 16px; display: flex;
  align-items: center; justify-content: center;
  color: var(--text-muted); transition: all .2s;
}
.modal-close:hover { background: rgba(255,80,80,0.1); color: var(--red); border-color: var(--red); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* =============================================
   SEARCH & FILTER
   ============================================= */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.search-box {
  position: relative; flex: 1; min-width: 200px;
}
.search-box input {
  width: 100%; padding: 9px 14px 9px 36px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-primary); font-size: 13px; font-family: 'Inter', sans-serif;
}
.search-box input:focus { outline: none; border-color: var(--cyan); }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px;
}

/* =============================================
   PROGRESS
   ============================================= */
.progress-bar {
  height: 6px; background: rgba(255,255,255,0.08);
  border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--cyan-dark));
  transition: width .5s ease;
}

/* =============================================
   AVATAR
   ============================================= */
.avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}

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

/* =============================================
   TOAST NOTIFICATION
   ============================================= */
#toast-container {
  position: fixed; top: 80px; right: 20px;
  z-index: 999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  min-width: 280px; padding: 14px 18px; border-radius: 12px;
  border-left: 3px solid; backdrop-filter: blur(10px);
  animation: fadeUp .3s ease; font-size: 13px;
  display: flex; align-items: center; gap: 10px;
}
.toast-success { background: rgba(67,233,123,0.12); border-color: var(--green); color: var(--green); }
.toast-error   { background: rgba(255,107,107,0.12); border-color: var(--red);   color: var(--red);   }
.toast-info    { background: rgba(0,198,255,0.12);   border-color: var(--cyan);  color: var(--cyan);  }

/* =============================================
   LOADING SPINNER
   ============================================= */
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--cyan);
  animation: spin 0.7s linear infinite; display: inline-block;
}

/* =============================================
   SECTION TABS
   ============================================= */
.tabs {
  display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 18px; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  background: transparent; border-left: none; border-right: none; border-top: none;
  font-family: 'Inter', sans-serif; transition: all .2s;
}
.tab-btn.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.tab-btn:hover  { color: var(--text-primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* =============================================
   CHART CONTAINER
   ============================================= */
.chart-container {
  position: relative; width: 100%; height: 220px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); width: 260px; }
  .main { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
