/* ═══════════════════════════════════════════════════════════
   ba-module.css — Berita Acara Digital Module Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Status Badges ───────────────────────────────────────── */
.ba-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px; white-space: nowrap;
}
.ba-badge-draft        { background: #f3f4f6; color: #374151; }
.ba-badge-pending_tl   { background: #fef9c3; color: #854d0e; }
.ba-badge-ai_reviewed  { background: #dbeafe; color: #1e40af; }
.ba-badge-ai_flagged   { background: #fee2e2; color: #991b1b; }
.ba-badge-pending_spv  { background: #ede9fe; color: #5b21b6; }
.ba-badge-signed       { background: #dcfce7; color: #15803d; }
.ba-badge-rejected_tl  { background: #fee2e2; color: #991b1b; }
.ba-badge-rejected_spv { background: #fce7f3; color: #9d174d; }
.ba-badge-archived     { background: #e5e7eb; color: #6b7280; }

/* ── AI Score Ring ────────────────────────────────────────── */
.ai-score-ring {
  display: inline-flex; flex-direction: column; align-items: center;
  justify-content: center; width: 64px; height: 64px;
  border-radius: 50%; border: 4px solid;
  font-size: 18px; font-weight: 900; line-height: 1;
}
.ai-score-ring small { font-size: 9px; font-weight: 400; opacity: .7; }
.ai-score-ok   { border-color: #16a34a; color: #15803d; background: #f0fdf4; }
.ai-score-warn { border-color: #d97706; color: #92400e; background: #fffbeb; }
.ai-score-fail { border-color: #dc2626; color: #991b1b; background: #fff1f2; }

/* ── Progress Timeline ───────────────────────────────────── */
.ba-timeline {
  display: flex; align-items: flex-start; gap: 0; margin: 16px 0;
  overflow-x: auto; padding-bottom: 4px;
}
.ba-tl-step {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; min-width: 80px; position: relative;
}
.ba-tl-step:not(:last-child)::after {
  content: ''; position: absolute; top: 16px; left: calc(50% + 16px);
  right: calc(-50% + 16px); height: 2px; background: #e5e7eb; z-index: 0;
}
.ba-tl-step.done::after  { background: #16a34a; }
.ba-tl-step.active::after{ background: #fbbf24; }
.ba-tl-icon {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid #e5e7eb;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; background: #fff; position: relative; z-index: 1;
  flex-shrink: 0;
}
.ba-tl-step.done   .ba-tl-icon { background: #16a34a; border-color: #16a34a; color: #fff; }
.ba-tl-step.active .ba-tl-icon { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.ba-tl-step.reject .ba-tl-icon { background: #ef4444; border-color: #ef4444; color: #fff; }
.ba-tl-label { font-size: 10px; color: #6b7280; margin-top: 6px; text-align: center; line-height: 1.3; }
.ba-tl-step.done   .ba-tl-label { color: #15803d; font-weight: 600; }
.ba-tl-step.active .ba-tl-label { color: #d97706; font-weight: 600; }

/* ── BA List Table ───────────────────────────────────────── */
.ba-list-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 14px; align-items: center;
}
.ba-list-filters .form-input { height: 36px; font-size: 13px; }
.ba-tbl th, .ba-tbl td { font-size: 13px; }
.ba-tbl .msisdn { font-family: monospace; font-weight: 700; color: #1d4ed8; }
.ba-tbl .nomor  { font-size: 11px; color: #6b7280; font-family: monospace; }
.ba-tbl tr:hover td { background: #fafafa; cursor: pointer; }

/* ── Inbox badge in nav ───────────────────────────────────── */
#ba-inbox-badge {
  display: none;
  background: var(--primary, #e10000); color: #fff;
  border-radius: 10px; font-size: 10px; font-weight: 700;
  padding: 1px 6px; margin-left: auto;
}

/* ── Form BA ─────────────────────────────────────────────── */
.ba-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 600px) { .ba-form-grid { grid-template-columns: 1fr; } }

.ba-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--primary, #e10000);
  border-bottom: 1px solid #fee2e2; padding-bottom: 5px;
  margin: 18px 0 12px; grid-column: 1 / -1;
}

.ott-checkboxes {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
.ott-checkboxes label {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 16px; border: 1.5px solid #e5e7eb;
  font-size: 12px; cursor: pointer; transition: .15s;
}
.ott-checkboxes input[type=checkbox] { display: none; }
.ott-checkboxes label:has(input:checked) {
  background: #fee2e2; border-color: #fca5a5; color: #b91c1c; font-weight: 700;
}

/* ── Lampiran Upload Area ─────────────────────────────────── */
.lampiran-drop-area {
  border: 2px dashed #d1d5db; border-radius: 10px;
  padding: 20px; text-align: center; cursor: pointer;
  transition: .2s; background: #fafafa;
}
.lampiran-drop-area:hover,
.lampiran-drop-area.dragover { border-color: #e10000; background: #fff5f5; }
.lampiran-drop-area i { font-size: 28px; color: #d1d5db; }

.lampiran-preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px; margin-top: 12px;
}
.lampiran-thumb {
  position: relative; border-radius: 8px; overflow: hidden;
  border: 1px solid #e5e7eb; background: #f9f9f9;
}
.lampiran-thumb img {
  width: 100%; height: 90px; object-fit: cover; display: block;
}
.lampiran-thumb-label {
  font-size: 10px; color: #555; text-align: center;
  padding: 3px 4px; background: rgba(255,255,255,.9);
}
.lampiran-thumb-del {
  position: absolute; top: 3px; right: 3px;
  background: rgba(220,38,38,.85); color: #fff;
  border: none; border-radius: 50%; width: 20px; height: 20px;
  font-size: 11px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; line-height: 1;
}

/* ── Detail BA ───────────────────────────────────────────── */
.ba-detail-header {
  display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.ba-detail-nomor { font-size: 22px; font-weight: 900; color: #1a1a1a; line-height: 1; }
.ba-detail-nomor small { font-size: 13px; font-weight: 400; color: #6b7280; display: block; margin-top: 2px; }

.ba-info-table { width: 100%; border-collapse: collapse; }
.ba-info-table td { padding: 5px 8px; font-size: 13px; vertical-align: top; }
.ba-info-table td:first-child { width: 40%; font-weight: 600; color: #374151; }
.ba-info-table td.sep { width: 5%; text-align: center; color: #9ca3af; }
.ba-info-table tr:nth-child(even) td { background: #f9fafb; }

/* ── Sign Panel ──────────────────────────────────────────── */
.ba-sign-panel {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px;
}
.ba-sign-box {
  flex: 1; min-width: 160px; border: 1px solid #e5e7eb;
  border-radius: 10px; padding: 14px; text-align: center;
}
.ba-sign-box.signed-ok  { border-color: #86efac; background: #f0fdf4; }
.ba-sign-box.signed-pending { border-color: #fde68a; background: #fffbeb; }
.ba-sign-role { font-size: 11px; color: #6b7280; font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }
.ba-sign-img  { max-height: 65px; max-width: 100%; object-fit: contain; margin: 4px auto; }
.ba-sign-name { font-size: 13px; font-weight: 700; margin-top: 6px; }
.ba-sign-date { font-size: 11px; color: #6b7280; }

/* ── Checklist Items ─────────────────────────────────────── */
.chk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.chk-row  { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.chk-icon { width: 18px; height: 18px; border-radius: 4px; display: flex;
  align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.chk-icon.ok  { background: #16a34a; color: #fff; }
.chk-icon.no  { background: #dc2626; color: #fff; }
.chk-icon.na  { background: #e5e7eb; color: #9ca3af; }

/* ── Signature Canvas ─────────────────────────────────────── */
.sig-canvas-wrap {
  border: 2px solid #d1d5db; border-radius: 10px; overflow: hidden;
  background: #fff; position: relative; cursor: crosshair;
}
#sig-canvas { display: block; touch-action: none; }
.sig-canvas-hint {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #d1d5db; font-size: 13px;
  pointer-events: none; transition: opacity .2s;
}

/* ── Signature History Cards ─────────────────────────────── */
.sig-history-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; margin-top: 12px;
}
.sig-card {
  border: 2px solid #e5e7eb; border-radius: 10px; padding: 10px;
  text-align: center; cursor: pointer; transition: .15s;
}
.sig-card:hover { border-color: #e10000; }
.sig-card.active { border-color: #16a34a; background: #f0fdf4; }
.sig-card img { max-width: 100%; max-height: 60px; object-fit: contain; margin-bottom: 4px; }
.sig-card-date { font-size: 10px; color: #6b7280; }
.sig-card-label { font-size: 11px; font-weight: 700; color: #15803d; }

/* ── Action Bar ──────────────────────────────────────────── */
.ba-action-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 0; border-top: 1px solid #f3f4f6; margin-top: 16px;
}

/* ── Empty state ─────────────────────────────────────────── */
.ba-empty {
  text-align: center; padding: 48px 20px; color: #9ca3af;
}
.ba-empty i { font-size: 40px; margin-bottom: 12px; display: block; }

/* ── Pagination ──────────────────────────────────────────── */
.ba-pagination {
  display: flex; gap: 4px; justify-content: center; flex-wrap: wrap;
  margin-top: 14px;
}
.ba-page-btn {
  border: 1px solid #e5e7eb; background: #fff; border-radius: 6px;
  padding: 5px 10px; font-size: 12px; cursor: pointer; transition: .15s;
}
.ba-page-btn:hover, .ba-page-btn.active {
  background: #e10000; color: #fff; border-color: #e10000;
}
