/* JAdvice — Global Styles */
:root {
  --bims-primary: #006b5e;
  --bims-primary-rgb: 0,107,94;
  --bims-secondary: #00a388;
  --bims-accent: #e8f5f3;
  --sidebar-width: 260px;
  --topbar-height: 56px;
}

/* ── Sidebar ─────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bims-primary);
  position: fixed;
  left: 0; top: 0;
  transition: transform 0.3s;
  z-index: 1050;
  overflow-y: auto;
  overflow-x: hidden;
}
#sidebar .nav-link {
  color: rgba(255,255,255,0.82);
  border-radius: 6px;
  margin: 1px 8px;
  padding: 8px 12px;
  font-size: 0.875rem;
  transition: background 0.15s;
}
#sidebar .nav-link.active,
#sidebar .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.18);
}
#sidebar .nav-link i { width: 18px; text-align: center; }
#sidebar .sidebar-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.45);
  padding: 12px 20px 4px;
  font-weight: 600;
}
.sidebar-brand {
  background: rgba(0,0,0,.2);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  min-height: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand .brand-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.sidebar-brand .brand-text small { font-size: 0.65rem; opacity: 0.75; }

/* ── Main content area ───────────────────────── */
#main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s;
  width: calc(100% - var(--sidebar-width));
  max-width: 100%;
}
#main-content { padding: 24px; }

/* ── Topbar ──────────────────────────────────── */
#topbar {
  height: var(--topbar-height);
  background: var(--bs-body-bg, #fff);
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky; top: 0; z-index: 1040;
}
.topbar-title { font-weight: 600; font-size: 1rem; flex: 1; }
.notification-badge {
  position: absolute; top: -4px; right: -4px;
  background: #dc3545; color: #fff;
  border-radius: 50%; font-size: 10px; line-height: 16px;
  width: 16px; height: 16px; text-align: center;
}

/* ── Impersonation banner ────────────────────── */
.impersonation-bar {
  position: sticky; top: 0; z-index: 9999;
  border-radius: 0; margin: 0;
}

/* ── Views / Pages ───────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ── Status badges ───────────────────────────── */
.badge-draft       { background-color: #6c757d; }
.badge-baharu      { background-color: #0d6efd; }
.badge-diterima    { background-color: #0dcaf0; color: #000; }
.badge-on_going    { background-color: #ffc107; color: #000; }
.badge-selesai     { background-color: #198754; }
.badge-ditolak     { background-color: #dc3545; }
.badge-pending     { background-color: #6f42c1; }
.badge-completed   { background-color: #198754; }

/* ── Cards ───────────────────────────────────── */
.stat-card {
  border-radius: 12px;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.stat-card .card-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}

/* ── Tables ──────────────────────────────────── */
.table th { white-space: nowrap; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.table td { vertical-align: middle; }
.search-box { max-width: 260px; }

/* ── Workflow timeline ───────────────────────── */
.workflow-step {
  position: relative;
  padding-left: 36px;
  margin-bottom: 20px;
}
.workflow-step::before {
  content: '';
  position: absolute;
  left: 12px; top: 28px;
  width: 2px;
  height: calc(100% + 8px);
  background: #dee2e6;
}
.workflow-step:last-child::before { display: none; }
.workflow-dot {
  position: absolute;
  left: 0; top: 4px;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.workflow-dot.done  { background: #198754; color: #fff; }
.workflow-dot.active{ background: #0d6efd; color: #fff; }
.workflow-dot.pending{ background: #dee2e6; color: #6c757d; }
.workflow-dot.blocked{ background: #dc3545; color: #fff; }

/* ── Forensic blocking banner ────────────────── */
.forensik-block-banner {
  background: #fff3cd;
  border: 1px solid #ffd60a;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* ── Notification items ──────────────────────── */
.notif-item {
  border-left: 3px solid transparent;
  transition: background 0.1s;
}
.notif-item.unread { border-left-color: var(--bims-primary); background: var(--bims-accent); }
.notif-item:hover { background: #f8f9fa; }

/* ── Star rating ─────────────────────────────── */
.star-rating { display: flex; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
.star-rating input { display: none; }
.star-rating label { font-size: 28px; color: #dee2e6; cursor: pointer; transition: color 0.1s; }
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label { color: #ffc107; }

/* ── Login page ──────────────────────────────── */
#page-login {
  background: linear-gradient(135deg, #006b5e 0%, #00a388 100%);
  min-height: 100vh;
}
.login-card { width: 420px; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.quick-login-btn {
  font-size: 0.75rem; padding: 4px 10px;
  border-radius: 20px; transition: all 0.15s;
  white-space: nowrap;
}

/* ── Sidebar overlay (mobile) ───────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1049;
}
.sidebar-overlay.show { display: block; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 767.98px) {
  #sidebar {
    transform: translateX(-100%);
    position: fixed;
  }
  #sidebar.show {
    transform: translateX(0);
  }
  #main-wrapper {
    margin-left: 0;
    width: 100%;
  }
  #main-content { padding: 16px; }
  .search-box { max-width: 100%; }
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (min-width: 768px) {
  .sidebar-overlay { display: none !important; }
}

/* ── Dark mode overrides ─────────────────────── */
[data-bs-theme="dark"] .stat-card { box-shadow: 0 2px 8px rgba(0,0,0,.4); }
[data-bs-theme="dark"] #topbar { background: #212529; border-color: #373b3e; }
[data-bs-theme="dark"] .notif-item.unread { background: rgba(0,107,94,0.15); }

/* ── Progress bars ───────────────────────────── */
.progress { height: 6px; border-radius: 3px; }

/* ── Misc helpers ────────────────────────────── */
.clickable { cursor: pointer; }
.link-action { cursor: pointer; text-decoration: underline; color: var(--bims-primary); }
.required::after { content: ' *'; color: #dc3545; }
.slaid-brif-content { background: #f8f9fa; border-radius: 8px; padding: 16px; }
[data-bs-theme="dark"] .slaid-brif-content { background: #2b2d2f; }
.chart-container { position: relative; height: 260px; }
.empty-state { text-align: center; padding: 48px 24px; color: #6c757d; }
.empty-state i { font-size: 48px; display: block; margin-bottom: 12px; }
.file-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #e8f4ff; color: #0d6efd;
  padding: 4px 10px; border-radius: 6px; font-size: 0.8rem;
  cursor: pointer;
}
[data-bs-theme="dark"] .file-badge { background: #1a2b3c; }

/* ── Workflow timeline (horizontal) ─────────── */
.workflow-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.workflow-step {
  flex: 1;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-bottom: 4px;
}
.workflow-step::before {
  content: '';
  position: absolute;
  top: 11px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #dee2e6;
  z-index: 0;
}
.workflow-step.done::before  { background: #198754; }
.workflow-step.active::before{ background: #0d6efd; }
.workflow-step:last-child::before { display: none; }
.workflow-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; z-index: 1; position: relative;
  background: #dee2e6;
}
.workflow-step.done   .workflow-dot { background: #198754; }
.workflow-step.active .workflow-dot { background: #0d6efd; }
.workflow-label {
  font-size: .7rem; text-align: center; margin-top: 4px; color: #6c757d;
  max-width: 90px;
}
.workflow-step.done   .workflow-label { color: #198754; font-weight: 600; }
.workflow-step.active .workflow-label { color: #0d6efd; font-weight: 600; }

/* ── Impersonation banner ────────────────────── */
.impersonation-banner {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: #1a1a1a;
  text-align: center;
  padding: 8px 16px;
  font-weight: 600;
  font-size: .9rem;
  position: sticky;
  top: 0;
  z-index: 1050;
}

/* ── Dashed border card ──────────────────────── */
.border-dashed { border-style: dashed !important; }

/* ── Sidebar responsive overlay ─────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
}
.sidebar.show ~ .sidebar-overlay { display: block; }
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -260px; top: 0; height: 100vh; z-index: 1000; transition: left .2s; }
  .sidebar.show { left: 0; }
  #app-shell > .d-flex { padding-left: 0; }
}
