/* =============================================
   DANA KEGIATAN - MAIN STYLESHEET
   ============================================= */

:root {
  --sidebar-width: 260px;
  --sidebar-bg: #1a2744;
  --sidebar-text: rgba(255,255,255,0.75);
  --sidebar-active: #ffffff;
  --sidebar-active-bg: rgba(255,255,255,0.12);
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --body-bg: #f1f5f9;
  --card-border: #e2e8f0;
}

body { background: var(--body-bg); font-family: 'Segoe UI', sans-serif; }

/* ---- SIDEBAR ---- */
#sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  transition: transform .3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.brand-icon {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; flex-shrink: 0;
}
.brand-title { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--sidebar-text); }

.sidebar-nav { list-style: none; padding: 12px 0; margin: 0; flex: 1; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  transition: all .2s;
  border-radius: 0;
  position: relative;
}
.sidebar-nav li a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.sidebar-nav li a.active {
  color: var(--sidebar-active);
  background: var(--sidebar-active-bg);
  font-weight: 600;
}
.sidebar-nav li a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--primary);
  border-radius: 0 2px 2px 0;
}
.sidebar-nav li a i { font-size: 16px; width: 20px; }
.nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
  padding: 16px 20px 6px;
  text-transform: uppercase;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-info { flex: 1; display: flex; align-items: center; gap: 10px; overflow: hidden; }
.user-avatar {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--sidebar-text); }
.btn-logout {
  color: rgba(255,255,255,0.5);
  font-size: 18px; padding: 4px; flex-shrink: 0;
  text-decoration: none; transition: color .2s;
}
.btn-logout:hover { color: #f87171; }

/* ---- MAIN CONTENT ---- */
#mainContent {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 24px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-size: 22px; font-weight: 700; color: #0f172a; margin: 0; }
.page-subtitle { font-size: 13px; color: #64748b; margin: 2px 0 0; }

/* ---- METRIC CARDS ---- */
.metric-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  padding: 20px;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.metric-card .mc-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 16px;
}
.mc-blue  { background: #dbeafe; color: #1d4ed8; }
.mc-red   { background: #fee2e2; color: #b91c1c; }
.mc-green { background: #dcfce7; color: #15803d; }
.mc-amber { background: #fef3c7; color: #b45309; }

.metric-card .mc-label { font-size: 13px; color: #64748b; margin-bottom: 4px; }
.metric-card .mc-value { font-size: 24px; font-weight: 700; color: #0f172a; }
.metric-card .mc-change { font-size: 12px; margin-top: 6px; }
.mc-up   { color: var(--success); }
.mc-down { color: var(--danger); }
.metric-card::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(0,0,0,0.03);
}

/* ---- CARDS ---- */
.card { border: 1px solid var(--card-border); border-radius: 12px; box-shadow: none; }
.card-header { background: #fff; border-bottom: 1px solid var(--card-border); font-weight: 600; padding: 16px 20px; border-radius: 12px 12px 0 0 !important; }
.card-body { padding: 20px; }

/* ---- TABLES ---- */
.table th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #64748b; background: #f8fafc; }
.table td { font-size: 14px; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ---- BADGES ---- */
.badge-pending   { background: #fef3c7; color: #92400e; font-size: 12px; }
.badge-disetujui { background: #dcfce7; color: #166534; font-size: 12px; }
.badge-ditolak   { background: #fee2e2; color: #991b1b; font-size: 12px; }
.badge-aktif     { background: #dbeafe; color: #1e40af; font-size: 12px; }
.badge-draft     { background: #f1f5f9; color: #475569; font-size: 12px; }
.badge-selesai   { background: #d1fae5; color: #065f46; font-size: 12px; }
.badge-ditutup   { background: #fce7f3; color: #9d174d; font-size: 12px; }

/* ---- FORMS ---- */
.form-label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-control, .form-select { font-size: 14px; border-color: #d1d5db; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* ---- BUTTONS ---- */
.btn { border-radius: 8px; font-size: 14px; font-weight: 500; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ---- UPLOAD AREA ---- */
.upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #f8fafc;
}
.upload-area:hover { border-color: var(--primary); background: #eff6ff; }
.upload-area i { font-size: 32px; color: #94a3b8; display: block; margin-bottom: 8px; }

/* ---- ALERTS ---- */
.alert { border-radius: 10px; font-size: 14px; }

/* ---- LOGIN ---- */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a2744 0%, #2563eb 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 400px;
  max-width: 95vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-logo {
  width: 60px; height: 60px;
  background: var(--primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff; margin: 0 auto 20px;
}

/* ---- MOBILE SIDEBAR ---- */
.sidebar-toggle {
  position: fixed; top: 12px; left: 12px; z-index: 1100;
  background: var(--sidebar-bg); color: #fff;
  border: none; border-radius: 8px;
  padding: 8px 12px; font-size: 18px; display: none;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 999;
}

@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.show { transform: translateX(0); }
  #mainContent { margin-left: 0; padding: 16px; padding-top: 56px; }
  .sidebar-toggle { display: block; }
  .sidebar-overlay.show { display: block; }
  .metric-card .mc-value { font-size: 20px; }
  .page-title { font-size: 18px; }
}

/* ---- TOAST ---- */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }

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

/* ---- PROGRESS BAR ---- */
.progress { height: 8px; border-radius: 4px; background: #e2e8f0; }
.progress-bar { border-radius: 4px; }
