/* ============================================================
   DOKUMEN.CSS — Styles untuk halaman Pencarian Dokumen ISO
   ============================================================ */

/* STAT CARDS ROW (reuse pola denah/loker) */
#dok-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
#dok-stats .stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
  transition: transform .2s;
  flex: 1;
  min-width: 0;
}
#dok-stats .stat-card:hover { transform: translateY(-2px); }

/* ============================================================
   TOOLBAR — search + filter tahun + sinkronkan (admin)
   ============================================================ */
.dok-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dok-search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  flex: 1;
  min-width: 220px;
}
.dok-search-wrap input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  width: 100%;
}
.dok-search-wrap > i.bi-search { color: var(--muted); font-size: 14px; }
.dok-search-clear { color: var(--muted); font-size: 14px; cursor: pointer; }
.dok-search-clear:hover { color: var(--danger); }

.dok-filter-select {
  width: auto;
  min-width: 130px;
  flex: 0 0 auto;
}

/* ============================================================
   QUICK CATEGORY CHIPS
   ============================================================ */
.dok-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.dok-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.dok-chip:hover { border-color: var(--primary); color: var(--primary); }
.dok-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.dok-chip .dok-chip-count {
  background: rgba(0,0,0,.08);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10.5px;
}
.dok-chip.active .dok-chip-count { background: rgba(255,255,255,.25); }

/* Info sinkronisasi (admin) */
.dok-sync-info {
  font-size: 11.5px;
  color: var(--muted);
  margin: -8px 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   HASIL PENCARIAN — daftar kartu dokumen
   ============================================================ */
#dok-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dok-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  box-shadow: var(--shadow-card);
  transition: transform .15s, box-shadow .15s;
}
.dok-card:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }

.dok-file-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
}
.dok-file-icon.dok-ic-doc  { background: linear-gradient(135deg,#004A74,#003654); }
.dok-file-icon.dok-ic-xls  { background: linear-gradient(135deg,#059669,#047857); }
.dok-file-icon.dok-ic-ppt  { background: linear-gradient(135deg,#f97316,#c2410c); }
.dok-file-icon.dok-ic-pdf  { background: linear-gradient(135deg,#dc2626,#b91c1c); }
.dok-file-icon.dok-ic-img  { background: linear-gradient(135deg,#7c3aed,#6d28d9); }
.dok-file-icon.dok-ic-other{ background: linear-gradient(135deg,#64748b,#475569); }

.dok-card-body { flex: 1; min-width: 0; }
.dok-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
  margin-bottom: 5px;
}
.dok-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.dok-card-path {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dok-card-path i { font-size: 10px; flex-shrink: 0; }

.dok-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}
@media (max-width: 560px) {
  .dok-card { flex-wrap: wrap; }
  .dok-card-actions { width: 100%; margin-top: 8px; }
  .dok-card-actions .btn { flex: 1; justify-content: center; }
}

/* Highlight kata kunci pencarian yang cocok */
.dok-hl { background: #fef08a; color: #713f12; border-radius: 3px; padding: 0 1px; }

/* ============================================================
   HASIL PENCARIAN (flat list, saat ada filter/kata kunci aktif)
   ============================================================ */
.dok-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
}
.dok-results-head i.bi-search { margin-right: 4px; color: var(--primary); }
.dok-back-explorer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}
.dok-back-explorer:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.dok-cardlist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ============================================================
   EXPLORER — tampilan folder tree (mirip File Explorer)
   ============================================================ */
.dok-explorer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.dok-explorer-path {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: .2px;
}
.dok-explorer-path i { color: var(--primary); }
.dok-explorer-actions { display: flex; gap: 6px; }

.dok-tree {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 6px 4px;
  overflow: hidden;
}

.dok-node { display: flex; flex-direction: column; }

.dok-folder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 9px;
  padding-bottom: 9px;
  padding-right: 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: background .12s;
}
.dok-folder-row:hover { background: var(--primary-faint, rgba(0,74,116,.06)); }
.dok-toggle-ic { font-size: 11px; color: var(--muted); flex: 0 0 auto; width: 12px; text-align: center; }
.dok-folder-ic { font-size: 15px; color: #f59e0b; flex: 0 0 auto; }
.dok-folder-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dok-folder-count {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(0,0,0,.05);
  border-radius: 999px;
  padding: 2px 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.dok-children {
  display: flex;
  flex-direction: column;
  border-left: 1.5px dashed var(--border);
  margin-left: 19px;
}

.dok-file-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-right: 12px;
  border-radius: 8px;
  transition: background .12s;
}
.dok-file-row:hover { background: var(--bg); }
.dok-file-ic { font-size: 14px; flex: 0 0 auto; width: 18px; text-align: center; }
.dok-file-ic.dok-ic-doc  { color: #004A74; }
.dok-file-ic.dok-ic-xls  { color: #059669; }
.dok-file-ic.dok-ic-ppt  { color: #f97316; }
.dok-file-ic.dok-ic-pdf  { color: #dc2626; }
.dok-file-ic.dok-ic-img  { color: #7c3aed; }
.dok-file-ic.dok-ic-other{ color: #64748b; }

.dok-file-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dok-file-badges {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}
.dok-file-badges .badge { font-size: 10px; padding: 2px 8px; white-space: nowrap; }
.dok-file-actions {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}
.dok-file-actions .btn { padding: 4px 8px; }

@media (max-width: 640px) {
  .dok-folder-name { font-size: 12.5px; }
  .dok-file-badges { display: none; } /* hemat ruang di layar sempit */
  .dok-file-name { font-size: 12px; }
}
@media (max-width: 420px) {
  .dok-explorer-actions .btn span,
  .dok-explorer-actions .btn { font-size: 10.5px; padding: 5px 8px; }
}
