/* ============================================================
   PSHT Ogan Ilir - Custom Stylesheet
   ============================================================ */

:root {
  --psht-red:    #c0392b;
  --psht-dark:   #1a1a2e;
  --psht-gold:   #f39c12;
  --psht-light:  #fdf6f0;
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --radius:      12px;
  --shadow:      0 4px 20px rgba(0,0,0,.08);
  --transition:  .25s ease;
}

/* ---- Base ---- */
* { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: #f4f6fb; color: #2d3748; }
[data-bs-theme="dark"] body { background: #0f1117; color: #e2e8f0; }

a { color: var(--psht-red); text-decoration: none; }
a:hover { color: #922b21; }

/* ---- Sidebar ---- */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--psht-dark);
  display: flex; flex-direction: column;
  z-index: 1040; transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.sidebar-brand .brand-text { line-height: 1.2; }
.sidebar-brand .brand-name { font-size: .85rem; font-weight: 700; color: #fff; }
.sidebar-brand .brand-sub  { font-size: .7rem; color: rgba(255,255,255,.5); }

.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-section-label {
  font-size: .65rem; font-weight: 700; letter-spacing: .08em;
  color: rgba(255,255,255,.35); padding: 16px 20px 6px; text-transform: uppercase;
}
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; color: rgba(255,255,255,.65);
  border-radius: 0; font-size: .875rem; font-weight: 500;
  transition: all var(--transition); position: relative;
}
.sidebar-nav .nav-link i { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .nav-link.active {
  background: linear-gradient(90deg, rgba(192,57,43,.9), rgba(192,57,43,.4));
  color: #fff;
}
.sidebar-nav .nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 3px;
  background: var(--psht-gold); border-radius: 0 3px 3px 0;
}
.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.5); font-size: .8rem; }
.sidebar-footer a:hover { color: #fff; }

/* ---- Main Wrapper ---- */
.main-wrapper { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

/* ---- Topbar ---- */
.topbar {
  position: sticky; top: 0; z-index: 1030;
  height: var(--topbar-h);
  background: #fff; border-bottom: 1px solid #e9ecef;
  display: flex; align-items: center; padding: 0 24px; gap: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
[data-bs-theme="dark"] .topbar { background: #1a1d27; border-bottom-color: #2d3141; }
.topbar .page-title { font-size: 1.05rem; font-weight: 600; margin: 0; flex: 1; }
.topbar .btn-sidebar-toggle { display: none; }

/* ---- Content ---- */
.content-area { padding: 24px; flex: 1; }

/* ---- Cards ---- */
.card {
  border: none; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
[data-bs-theme="dark"] .card { background: #1e2130; }
.card-header {
  background: #fff; border-bottom: 1px solid #f0f0f0;
  padding: 16px 20px; font-weight: 600;
}
[data-bs-theme="dark"] .card-header { background: #1e2130; border-bottom-color: #2d3141; }

/* ---- Stat Cards ---- */
.stat-card {
  border-radius: var(--radius); padding: 20px;
  color: #fff; position: relative; overflow: hidden;
}
.stat-card .stat-icon {
  position: absolute; right: 16px; top: 16px;
  font-size: 3rem; opacity: .2;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .8rem; opacity: .85; margin-top: 4px; }
.stat-card .stat-footer { margin-top: 12px; font-size: .75rem; opacity: .75; }

.bg-gradient-red    { background: linear-gradient(135deg, #c0392b, #e74c3c); }
.bg-gradient-green  { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.bg-gradient-orange { background: linear-gradient(135deg, #e67e22, #f39c12); }
.bg-gradient-blue   { background: linear-gradient(135deg, #2980b9, #3498db); }
.bg-gradient-purple { background: linear-gradient(135deg, #8e44ad, #9b59b6); }
.bg-gradient-dark   { background: linear-gradient(135deg, #2c3e50, #34495e); }

/* ---- Badges ---- */
.badge { font-size: .72rem; font-weight: 600; padding: 4px 10px; border-radius: 6px; }

/* ---- Progress ---- */
.progress { border-radius: 50px; }
.progress-bar { border-radius: 50px; }
.progress-psht .progress-bar { background: linear-gradient(90deg, var(--psht-red), var(--psht-gold)); }

/* ---- Tables ---- */
.table { font-size: .875rem; }
.table th { font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table-hover tbody tr:hover { background: rgba(192,57,43,.04); }
[data-bs-theme="dark"] .table { color: #e2e8f0; }
[data-bs-theme="dark"] .table-hover tbody tr:hover { background: rgba(255,255,255,.04); }

/* ---- Forms ---- */
.form-control, .form-select {
  border-radius: 8px; border-color: #e2e8f0;
  font-size: .875rem; padding: 10px 14px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--psht-red); box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}
.form-label { font-weight: 500; font-size: .875rem; }

/* ---- Buttons ---- */
.btn { border-radius: 8px; font-weight: 500; font-size: .875rem; padding: 8px 18px; }
.btn-psht {
  background: linear-gradient(135deg, var(--psht-red), #e74c3c);
  color: #fff; border: none;
}
.btn-psht:hover { background: linear-gradient(135deg, #922b21, var(--psht-red)); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }

/* ---- Auth Pages ---- */
.auth-page { min-height: 100vh; background: linear-gradient(135deg, var(--psht-dark) 0%, #16213e 50%, #0f3460 100%); }
.auth-card {
  background: #fff; border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden; max-width: 480px; width: 100%;
}
.auth-header {
  background: linear-gradient(135deg, var(--psht-dark), #16213e);
  padding: 32px; text-align: center; color: #fff;
}
.auth-header .logo-circle {
  width: 80px; height: 80px; background: var(--psht-red);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; margin: 0 auto 16px; font-size: 2rem;
}
.auth-header h4 { font-weight: 700; margin: 0; }
.auth-header small { opacity: .7; font-size: .8rem; }
.auth-body { padding: 32px; }

/* ---- Notification Bell ---- */
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--psht-red); color: #fff;
  font-size: .6rem; width: 18px; height: 18px;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; border: 2px solid #fff;
}

/* ---- Alert Flash ---- */
.alert { border-radius: var(--radius); border: none; font-size: .875rem; }
.alert-success { background: #d4edda; color: #155724; }
.alert-danger   { background: #f8d7da; color: #721c24; }
.alert-warning  { background: #fff3cd; color: #856404; }
.alert-info     { background: #d1ecf1; color: #0c5460; }

/* ---- Timeline Riwayat ---- */
.payment-timeline { position: relative; padding-left: 24px; }
.payment-timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px; background: #e9ecef;
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute; left: -20px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 2px currentColor;
}
.timeline-dot.success { color: #27ae60; background: #27ae60; }
.timeline-dot.warning { color: #f39c12; background: #f39c12; }
.timeline-dot.danger  { color: #c0392b; background: #c0392b; }

/* ---- Upload Area ---- */
.upload-area {
  border: 2px dashed #ced4da; border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  transition: all var(--transition);
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--psht-red); background: rgba(192,57,43,.04);
}
.upload-area i { font-size: 2.5rem; color: #ced4da; }

/* ---- Bukti Modal Image Zoom ---- */
.img-zoom-container { overflow: hidden; border-radius: 8px; }
.img-zoom-container img { transition: transform .3s; cursor: zoom-in; width: 100%; }
.img-zoom-container img:active { transform: scale(2); cursor: zoom-out; }

/* ---- Print Bukti ---- */
@media print {
  .no-print { display: none !important; }
  .print-area { width: 210mm; margin: 0 auto; }
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .topbar .btn-sidebar-toggle { display: flex; }
  .sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 1035; display: none;
  }
  .sidebar-overlay.show { display: block; }
}

/* ---- Dark Mode Overrides ---- */
[data-bs-theme="dark"] {
  --bs-body-bg: #0f1117;
  --bs-body-color: #e2e8f0;
}
[data-bs-theme="dark"] .auth-card { background: #1e2130; }
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select { background: #252836; border-color: #353849; color: #e2e8f0; }
[data-bs-theme="dark"] .topbar { background: #1a1d27; }
[data-bs-theme="dark"] .upload-area { border-color: #353849; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 3px; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: #353849; }

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp .4s ease both; }
.fade-in-up-delay-1 { animation-delay: .1s; }
.fade-in-up-delay-2 { animation-delay: .2s; }
.fade-in-up-delay-3 { animation-delay: .3s; }
