/* SISTEM ADMINISTRASI SURAT BUMDes SEJAHTERA - UI */
:root {
  --bsds-hijau-tua: #103b2b;
  --bsds-hijau: #1c6b4b;
  --bsds-hijau-muda: #2f8f66;
  --bsds-emas: #c9a227;
  --bsds-emas-muda: #f3e3b3;
  --bsds-putih: #ffffff;
  --bsds-abu: #f4f6f5;
  --bsds-garis: #e3e9e5;
  --bsds-teks: #24332c;
  --bsds-muda: #6d7d74;
  --bsds-merah: #b33939;
  --bsds-radius: 12px;
  --bsds-bayang: 0 8px 24px rgba(16, 59, 43, .08);
}

#bsds-app { font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--bsds-teks); }
.bsds-app-shell { display: flex; min-height: 92vh; background: var(--bsds-abu); border-radius: var(--bsds-radius); overflow: hidden; }
.bsds-wrap { max-width: none !important; margin: 10px 20px 20px 0 !important; }

/* Sidebar */
.bsds-sidebar { width: 248px; flex: 0 0 248px; background: linear-gradient(175deg, var(--bsds-hijau-tua) 0%, #0d3023 100%); color: #fff; display: flex; flex-direction: column; }
.bsds-brand { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.12); display: flex; gap: 12px; align-items: center; }
.bsds-brand img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px; }
.bsds-brand-icon { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; background: rgba(201,162,39,.18); color: var(--bsds-emas); font-size: 24px; border: 1px solid rgba(201,162,39,.45); }
.bsds-brand strong { display: block; font-size: 13px; letter-spacing: .3px; line-height: 1.35; }
.bsds-brand small { display: block; color: var(--bsds-emas-muda); font-size: 10px; margin-top: 4px; letter-spacing: .6px; }
.bsds-nav { padding: 14px 10px; flex: 1; }
.bsds-nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(255,255,255,.45); padding: 8px 12px; }
.bsds-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin-bottom: 3px; border-radius: 8px; color: rgba(255,255,255,.82); text-decoration: none; font-size: 13px; transition: .18s; }
.bsds-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.bsds-nav a.aktif { background: linear-gradient(90deg, rgba(201,162,39,.26), rgba(201,162,39,.06)); color: #fff; box-shadow: inset 3px 0 0 var(--bsds-emas); }
.bsds-nav a .ico { width: 20px; text-align: center; font-size: 15px; }
.bsds-sidebar-footer { padding: 14px 18px; font-size: 11px; color: rgba(255,255,255,.55); border-top: 1px solid rgba(255,255,255,.1); }

/* Konten utama */
.bsds-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bsds-topbar { background: #fff; border-bottom: 1px solid var(--bsds-garis); padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.bsds-topbar h1 { font-size: 19px; font-weight: 650; margin: 0; color: var(--bsds-hijau-tua); }
.bsds-topbar p { margin: 3px 0 0; font-size: 12px; color: var(--bsds-muda); }
.bsds-user { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.bsds-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--bsds-hijau); color: #fff; display: grid; place-items: center; font-weight: 700; }
.bsds-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.bsds-badge.owner { background: var(--bsds-emas-muda); color: #7a5d05; }
.bsds-badge.operator { background: #e4efe9; color: var(--bsds-hijau); }
.bsds-content { padding: 22px 24px 32px; flex: 1; }
.bsds-menu-toggle { display: none; background: none; border: 0; font-size: 22px; color: var(--bsds-hijau-tua); cursor: pointer; }

/* Kartu & grid */
.bsds-card { background: #fff; border: 1px solid var(--bsds-garis); border-radius: var(--bsds-radius); box-shadow: var(--bsds-bayang); padding: 18px; margin-bottom: 18px; }
.bsds-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.bsds-card-head h2, .bsds-card-head h3 { margin: 0; font-size: 15px; color: var(--bsds-hijau-tua); }
.bsds-card-head p { margin: 3px 0 0; font-size: 12px; color: var(--bsds-muda); }
.bsds-grid { display: grid; gap: 16px; }
.bsds-grid.k4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.bsds-grid.k3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.bsds-grid.k2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.bsds-stat { background: #fff; border: 1px solid var(--bsds-garis); border-radius: var(--bsds-radius); padding: 16px 18px; box-shadow: var(--bsds-bayang); position: relative; overflow: hidden; }
.bsds-stat::after { content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; background: rgba(28,107,75,.07); }
.bsds-stat .label { font-size: 11px; color: var(--bsds-muda); text-transform: uppercase; letter-spacing: .5px; }
.bsds-stat .angka { font-size: 27px; font-weight: 700; color: var(--bsds-hijau-tua); margin-top: 6px; line-height: 1.1; }
.bsds-stat .keterangan { font-size: 11px; color: var(--bsds-muda); margin-top: 5px; }
.bsds-stat.emas { border-color: #ecdfb8; }
.bsds-stat.emas::after { background: rgba(201,162,39,.14); }
.bsds-stat.emas .angka { color: #8c6c0c; }

/* Identitas dashboard */
.bsds-hero { background: linear-gradient(120deg, var(--bsds-hijau-tua), var(--bsds-hijau)); color: #fff; border-radius: var(--bsds-radius); padding: 22px 24px; margin-bottom: 18px; display: flex; align-items: center; gap: 20px; box-shadow: var(--bsds-bayang); position: relative; overflow: hidden; }
.bsds-hero::after { content: ""; position: absolute; width: 260px; height: 260px; border: 1px solid rgba(201,162,39,.25); border-radius: 50%; right: -80px; top: -100px; }
.bsds-hero img { width: 76px; height: 76px; background: #fff; border-radius: 12px; padding: 6px; object-fit: contain; flex: 0 0 auto; }
.bsds-hero-icon { width: 76px; height: 76px; flex: 0 0 auto; border-radius: 12px; background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 36px; color: var(--bsds-emas-muda); }
.bsds-hero h2 { margin: 0; font-size: 21px; }
.bsds-hero p { margin: 7px 0 0; font-size: 12px; line-height: 1.6; color: rgba(255,255,255,.85); }
.bsds-hero .hero-tags { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.bsds-hero .hero-tags span { font-size: 10px; padding: 4px 9px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; }

/* Tombol */
.bsds-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; border-radius: 8px; border: 1px solid transparent; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: none; transition: .16s; background: var(--bsds-hijau); color: #fff; font-family: inherit; }
.bsds-btn:hover { background: var(--bsds-hijau-tua); color: #fff; }
.bsds-btn:disabled { opacity: .55; cursor: not-allowed; }
.bsds-btn.emas { background: var(--bsds-emas); color: #3d2f04; }
.bsds-btn.emas:hover { background: #b28f1d; color: #2b2103; }
.bsds-btn.outline { background: #fff; color: var(--bsds-hijau); border-color: #bfd4c9; }
.bsds-btn.outline:hover { background: #eef6f1; }
.bsds-btn.danger { background: #fff; color: var(--bsds-merah); border-color: #e8c4c4; }
.bsds-btn.danger:hover { background: #fdf0f0; }
.bsds-btn.small { padding: 6px 10px; font-size: 11px; }
.bsds-btn.tiny { padding: 4px 8px; font-size: 10px; border-radius: 6px; }
.bsds-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bsds-quick { display: flex; gap: 12px; flex-wrap: wrap; }
.bsds-quick .bsds-btn { min-width: 172px; padding: 13px 16px; font-size: 13px; }

/* Tabel */
.bsds-table-wrap { overflow-x: auto; }
.bsds-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bsds-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--bsds-muda); background: #f7faf8; padding: 10px 11px; border-bottom: 1px solid var(--bsds-garis); white-space: nowrap; }
.bsds-table td { padding: 10px 11px; border-bottom: 1px solid #eef2ef; vertical-align: middle; }
.bsds-table tbody tr:hover { background: #fafcfb; }
.bsds-table .nomor { font-weight: 700; color: var(--bsds-hijau); white-space: nowrap; }
.bsds-table .perihal { font-weight: 600; }
.bsds-table .sub { display: block; font-size: 10px; color: var(--bsds-muda); margin-top: 2px; }
.bsds-empty { padding: 36px; text-align: center; color: var(--bsds-muda); font-size: 13px; }
.bsds-pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 12px; flex-wrap: wrap; }
.bsds-pagination button { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--bsds-garis); background: #fff; cursor: pointer; font-size: 11px; }
.bsds-pagination button.aktif { background: var(--bsds-hijau); border-color: var(--bsds-hijau); color: #fff; }

/* Status */
.bsds-status { padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.bsds-status.draft { background: #eef1f0; color: #5d6b64; }
.bsds-status.proses { background: #fff2d9; color: #936214; }
.bsds-status.diterbitkan { background: #e2f3e9; color: #176241; }
.bsds-status.diarsipkan { background: #e8ecf6; color: #43558c; }

/* Form */
.bsds-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 18px; }
.bsds-field { display: flex; flex-direction: column; gap: 6px; }
.bsds-field.full { grid-column: 1 / -1; }
.bsds-field label { font-size: 11px; font-weight: 650; color: #44564d; }
.bsds-field label .wajib { color: var(--bsds-merah); }
.bsds-field input[type=text], .bsds-field input[type=date], .bsds-field input[type=number], .bsds-field input[type=email], .bsds-field input[type=password], .bsds-field select, .bsds-field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d6e0da; border-radius: 8px; font-size: 12px; font-family: inherit; color: var(--bsds-teks); background: #fff; box-sizing: border-box;
}
.bsds-field input:focus, .bsds-field select:focus, .bsds-field textarea:focus { outline: none; border-color: var(--bsds-hijau-muda); box-shadow: 0 0 0 3px rgba(47,143,102,.12); }
.bsds-field textarea { min-height: 78px; resize: vertical; }
.bsds-field .hint { font-size: 10px; color: var(--bsds-muda); }
.bsds-field .nomor-box { background: #f5f9f6; border: 1px dashed #b9d3c4; border-radius: 8px; padding: 10px 12px; font-family: Consolas, monospace; font-weight: 700; color: var(--bsds-hijau-tua); font-size: 13px; }
.bsds-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.bsds-filter input, .bsds-filter select { width: 100%; padding: 8px 10px; font-size: 12px; border: 1px solid #d6e0da; border-radius: 8px; font-family: inherit; }
.bsds-form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bsds-garis); }

/* Editor sederhana */
.bsds-editor { border: 1px solid #d6e0da; border-radius: 8px; overflow: hidden; background: #fff; }
.bsds-editor-toolbar { display: flex; gap: 3px; flex-wrap: wrap; padding: 7px; background: #f7faf8; border-bottom: 1px solid var(--bsds-garis); }
.bsds-editor-toolbar button { min-width: 30px; height: 29px; padding: 0 7px; border: 1px solid #dce5df; background: #fff; border-radius: 5px; cursor: pointer; font-size: 12px; color: #40534a; }
.bsds-editor-toolbar button:hover { background: #eaf4ee; }
.bsds-editor-area { min-height: 210px; max-height: 460px; overflow: auto; padding: 14px 16px; font-family: "Times New Roman", Times, serif; font-size: 13px; line-height: 1.6; text-align: justify; outline: none; }
.bsds-editor-area:focus { box-shadow: inset 0 0 0 2px rgba(47,143,102,.14); }
.bsds-editor-area p { margin: 0 0 10px; }

/* Preview kertas A4 */
.bsds-preview-wrap { background: #e9eeeb; padding: 20px; border-radius: 10px; overflow: auto; max-height: 76vh; }
.bsds-paper { width: 210mm; min-height: 297mm; margin: 0 auto 20px; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.13); padding: 25mm 25mm 20mm; box-sizing: border-box; font-family: "Times New Roman", Times, serif; font-size: 12pt; color: #111; line-height: 1.5; position: relative; }
.bsds-kop { text-align: center; margin-bottom: 8px; }
.bsds-header-img { width: 100%; max-width: 165mm; height: auto; display: block; margin: 0 auto; }
.bsds-logo-img { width: 30mm; height: auto; display: block; margin: 0 auto 6px; }
.bsds-header-text .bsds-badan { font-size: 12pt; letter-spacing: 1px; }
.bsds-header-text .bsds-instansi { font-size: 15pt; font-weight: 700; letter-spacing: .6px; }
.bsds-header-text .bsds-kontak { font-size: 9pt; margin-top: 3px; line-height: 1.4; }
.bsds-garis { border-top: 1.5px solid #1c4e38; margin-bottom: 16px; }
.bsds-body p { margin: 0 0 9pt; text-align: justify; }
.bsds-body p[style*="right"], .bsds-body .bsds-align-right { text-align: right !important; }
.bsds-body p[style*="center"], .bsds-body .bsds-align-center { text-align: center !important; }
.bsds-body .bsds-ttd-img { text-align: right; margin-top: -4pt; }
.bsds-body .bsds-ttd-img img { width: 40mm; max-width: 100%; height: auto; display: inline-block; }
.bsds-footer { position: absolute; bottom: 11mm; left: 25mm; right: 25mm; border-top: 1px solid #bbb; padding-top: 5px; font-size: 8pt; text-align: center; color: #555; }
.bsds-page-mark { position: absolute; bottom: 5mm; right: 25mm; font-size: 8pt; color: #888; }

/* Modal & notifikasi */
.bsds-modal { position: fixed; inset: 0; background: rgba(9,28,20,.58); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 18px; }
.bsds-modal-dialog { background: #fff; border-radius: 12px; width: min(980px, 96vw); max-height: 94vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.bsds-modal-head { padding: 14px 18px; border-bottom: 1px solid var(--bsds-garis); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bsds-modal-head h3 { margin: 0; font-size: 15px; color: var(--bsds-hijau-tua); }
.bsds-modal-body { padding: 16px; overflow: auto; }
.bsds-modal-foot { padding: 12px 18px; border-top: 1px solid var(--bsds-garis); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.bsds-close { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--bsds-muda); line-height: 1; }
.bsds-toast { position: fixed; right: 20px; bottom: 20px; z-index: 100000; background: var(--bsds-hijau-tua); color: #fff; padding: 12px 16px; border-radius: 9px; box-shadow: 0 10px 30px rgba(0,0,0,.22); font-size: 12px; max-width: 360px; }
.bsds-toast.gagal { background: var(--bsds-merah); }
.bsds-loading { padding: 46px; text-align: center; color: var(--bsds-muda); font-size: 13px; }
.bsds-spinner { width: 26px; height: 26px; border: 3px solid #d8e5dd; border-top-color: var(--bsds-hijau); border-radius: 50%; animation: bsds-spin .7s linear infinite; margin: 0 auto 10px; }
@keyframes bsds-spin { to { transform: rotate(360deg); } }

/* Grafik */
.bsds-chart { width: 100%; height: 210px; }
.bsds-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 11px; color: var(--bsds-muda); }
.bsds-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.bsds-progress { height: 7px; background: #edf2ef; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bsds-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--bsds-hijau), var(--bsds-emas)); }

/* Media */
@media (max-width: 1100px) {
  .bsds-grid.k4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bsds-grid.k3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .bsds-sidebar { position: fixed; z-index: 1000; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: .22s; box-shadow: 8px 0 30px rgba(0,0,0,.2); }
  .bsds-sidebar.buka { transform: translateX(0); }
  .bsds-menu-toggle { display: block; }
  .bsds-grid.k4, .bsds-grid.k3, .bsds-grid.k2, .bsds-form-grid { grid-template-columns: 1fr; }
  .bsds-content { padding: 16px; }
  .bsds-topbar { padding: 12px 16px; }
  .bsds-quick .bsds-btn { min-width: 100%; }
  .bsds-paper { width: 100%; min-height: auto; padding: 24px 20px; }
  .bsds-footer { left: 20px; right: 20px; }
}
@media print {
  body * { visibility: hidden !important; }
  #bsds-cetak, #bsds-cetak * { visibility: visible !important; }
  #bsds-cetak { position: absolute; left: 0; top: 0; width: 100%; }
  .bsds-paper { box-shadow: none; margin: 0; width: 100%; min-height: 100vh; }
  .bsds-page-mark { display: none; }
  @page { size: A4; margin: 0; }
}
.bsds-login-notice { padding: 18px; border: 1px solid var(--bsds-garis); border-radius: 10px; background: #fff; font-size: 13px; }
