/* =====================================================================
   Finance Master — tambahan di atas app.css (mockup v40)
   1. Dashboard: kartu Funds & Reserves
   2. Kenyamanan HP: ukuran huruf, tombol mudah disentuh, isian tanpa zoom, scroll halus
   ===================================================================== */

/* ---------- 1. Dashboard: Funds & Reserves ---------- */
.dash-funds{margin-bottom:17px}
.dash-funds .card-head{margin-bottom:14px}
.df-body{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:18px;align-items:start}
.df-summary{min-width:0}
.df-stats{display:grid;gap:10px;margin-bottom:14px}
.df-stats.n2{grid-template-columns:repeat(2,minmax(0,1fr))}
.df-stats.n1{grid-template-columns:minmax(0,1fr)}
.df-stat{min-width:0;padding:12px 13px;border:1px solid rgba(71,92,132,.42);border-radius:13px;background:rgba(8,17,31,.42)}
.df-stat-label{display:block;color:#a8b4c6;font-size:11px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.df-stat b{display:block;margin:6px 0 4px;color:#fff;font-size:19px;font-weight:800;letter-spacing:-.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.df-stat small{display:block;color:#8fa0b8;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.df-stat.res b{color:#b9adff}
.df-stat.avail b{color:#57e5a2}
.df-stat.neg b{color:#ff8194}
.df-bar{margin:0}
.df-bar[hidden]{display:none}
.df-list{display:grid;gap:8px;min-width:0}
.df-row{display:grid;gap:7px;width:100%;padding:11px 13px;border:1px solid rgba(71,92,132,.38);border-radius:12px;background:rgba(8,17,31,.32);color:inherit;text-align:left;cursor:pointer;transition:border-color .15s,background .15s}
.df-row:hover{border-color:rgba(122,107,255,.6);background:rgba(91,72,255,.08)}
.df-row-top{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}
.df-name{display:flex;align-items:center;gap:8px;min-width:0;font-size:13px;font-weight:700;color:#eef2f8}
.df-name i{flex:none;width:10px;height:10px;border-radius:3px}
.df-name span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.df-row-top b{flex:none;font-size:13px;font-weight:800;color:#fff}
.df-prog{display:block;height:6px;overflow:hidden;border-radius:999px;background:#1d2a42}
.df-prog span{display:block;height:100%;border-radius:inherit}
.df-meta{display:flex;justify-content:space-between;gap:10px;color:#8fa0b8;font-size:11px}
.df-more{justify-self:start;padding:6px 2px;border:0;background:none;color:#a99dff;font-size:12px;font-weight:700;cursor:pointer}
.df-empty{display:grid;gap:12px;justify-items:start;padding:14px;border:1px dashed rgba(86,111,165,.45);border-radius:12px;color:#a8b4c6;font-size:12px;line-height:1.5}
.df-empty p{margin:0}
@media(max-width:1150px){
  .df-body{grid-template-columns:minmax(0,1fr)}
}

/* ---------- 2. Kenyamanan HP ---------- */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media (hover:none){
  body{-webkit-tap-highlight-color:transparent}
  button,a,label,[role=button],[role=switch],.chip,input,select,textarea{touch-action:manipulation}   /* tanpa jeda tap 300ms / zoom dobel-tap */
  .df-row:hover{border-color:rgba(71,92,132,.38);background:rgba(8,17,31,.32)}
}

@media(max-width:700px){
  /* isian: 16px supaya iOS tidak memperbesar layar saat diketik */
  input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px !important}
  input::placeholder,textarea::placeholder{font-size:15px}
  /* tanggal di iOS punya lebar bawaan sendiri → paksa ikut lebar kotak */
  input[type=date],input[type=time],input[type=month]{-webkit-appearance:none;appearance:none;display:block;width:100%;min-width:0;min-height:24px;background:transparent;text-align:left}
  input[type=date]::-webkit-date-and-time-value,input[type=time]::-webkit-date-and-time-value{text-align:left}
  .control{min-height:46px}
  .text-control input,.amount-control input,.date-control input{min-height:44px}
  textarea{line-height:1.45}

  /* scroll halus: pop up & panel tidak ikut menggulir halaman di belakangnya */
  .tx-modal,.side-panel,.rep-preview,.notif-panel,.float-menu,.amenu-menu,.fsheet{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  .page{overflow-wrap:anywhere}

  /* ukuran huruf: tidak ada teks di bawah 11px, keterangan 12px */
  .card-title{font-size:16px}
  .card-sub,.kpi-foot,.stat-foot,.m-sub,.field-helper,.card-sub span{font-size:12px !important;line-height:1.45}
  .kpi-label,.stat-label,.tgt-label,.df-stat-label,label,.field-head label{font-size:12px !important}
  .tag,.tgt-chip,.act-tag,.pill{font-size:10px !important;padding:3px 8px}
  #txTable td:nth-child(6) .tag{font-size:9.5px !important;padding:3px 7px}
  .view-btn,.link-btn,.load-more,.budget-more{font-size:12.5px !important}
  .btn,.phone-dd,.seg-dd,.fsheet-btn{font-size:13px !important}
  .seg button,.chips .chip,.chip{font-size:12.5px !important}
  .plot-y,.plot-x{font-size:10px !important}
  small{font-size:11.5px}
  .bn-item span,.bottom-nav span{font-size:11px !important}

  /* daftar & kartu */
  .cat-item-desc,.aud-item-meta,.us-mail,.role-card-sum,.rsv-desc,.act-sub,.counted-sub,.rep-row-sub{font-size:12px !important}
  .aud-item-desc,.act-title,.rep-row-name,.rep-row-amt,.breakdown-name,.breakdown-amount,.breakdown-pct,.counted-main,.counted-amt{font-size:13px !important}
  .rsv-meta,.lg{font-size:12px !important}
  .lg small,.lg-val small{font-size:11px !important}
  #txTable td{font-size:13.5px !important}
  #txTable td:nth-child(1),#txTable td:nth-child(4){font-size:12px !important}
  .rep-callout,.rep-insights p,.rep-insight,.rep-insights li{font-size:13px !important;line-height:1.5}
  .tgt-chip{font-size:9.5px !important}

  .tgt-foot span,.budget-foot span,.budget-top span,.legend span,.tx-foot span,.day-head span,#txpCount,#catCount,#audCount,
  .bg-item-meta span,.bg-legend span,.bg-legend-note,#lvWarn,#lvHigh,.cat-item-meta span,.rep-row-meta span,.rep-period,
  .br-blk span,.br-blk small,.rc-schedule-label,.us-item-meta span,.role-card-top small,.aud-item-top small,
  .lg-val small,.rsv-amt small,.act-amt,.bg-item-amt small,.today-mark span,.kpi-note,
  #txpCount b,#catCount b,#audCount b{font-size:12px !important}
  .budget-top strong,.tgt-val span{font-size:13px !important}
  .ins i,.ins div,.rc-steps li,.rc-alert div,.rc-diff p,.info-note div,.rep-insights-title,.rep-insights b{font-size:13px !important;line-height:1.5}
  .you{font-size:10px !important}
  .kpi-note{padding-bottom:12px}

  .tx-foot{flex-direction:column;align-items:flex-start;gap:4px}
  .rep-row-meta{flex-wrap:wrap;row-gap:2px}
  .rep-row-meta span:last-child{margin-left:auto}
  .rsv-meta{flex-direction:column;align-items:flex-start;gap:3px}
  .rsv-meta span{text-align:left !important}

  #usFormOverlay .form-grid,#bookOverlay .form-grid{grid-template-columns:minmax(0,1fr)}
  .th-preview span{font-size:9.5px}

  .amount-prefix{font-size:13px !important;white-space:nowrap;min-width:44px;justify-content:center}

  /* tombol mudah disentuh (min. ±40px) */
  .btn,.phone-dd,.seg-dd,.fsheet-btn{min-height:42px}
  .view-btn{min-height:36px;padding:8px 12px}
  .rsv-tools .btn,.rsv-actions .btn,.bg-tools .btn,#addCategoryBtn,.link-row .btn,.roles-tools .btn,#addUserBtn,#addRoleBtn{min-height:40px}
  .rsv-actions .btn,.link-row .btn{font-size:13px !important}
  .tx-card .seg button{min-height:38px}
  #txpImport{min-height:36px}
  .seg button{min-height:38px}
  .chips .chip,.chip{min-height:38px;padding:0 14px}
  .info-close{width:36px;height:36px}
  .combo-toggle{min-width:40px;min-height:40px}
  .amenu-btn{min-width:38px;min-height:38px}
  .amenu-item{min-height:44px;font-size:14px !important}
  .float-menu .amenu-item small{font-size:12px !important}
  .drop-item{min-height:44px;font-size:14px !important}
  .close-btn{width:40px;height:40px;font-size:22px}
  #repPrevM,#repNextM{width:40px;height:40px}
  .link-btn{padding:8px 0}
  .perm-toggle{min-width:46px;min-height:28px}

  /* Reports: pilihan jenis laporan 2×2, tombol Export & Kirim rapi */
  .rep-modes,.rep-settings .seg{display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .rep-settings .seg button{width:100%}
  #rpMoreBtn{align-items:center}
  #rpMoreBtn span{line-height:1.2}
  .rep-preview .doc{font-size:12.5px}
  .rep-preview .doc table{font-size:11.5px}
  .rep-preview .doc th{font-size:10px}

  /* Dashboard: Funds & Reserves */
  .dash-funds{order:2}
  .df-stat b{font-size:18px}
  .df-stat small,.df-meta{font-size:12px}
  .df-row{padding:12px 13px}
  .df-name,.df-row-top b{font-size:14px}
  .dash-funds .card-head{align-items:center}

  /* buku */
  .book-switch-copy small{font-size:10px}
  .book-switch-copy span{font-size:11.5px}
  .book-switch-copy b{font-size:14px}
}

/* HP kecil (≤ 380px): Reports & daftar tetap muat */
@media(max-width:380px){
  .form-grid:not(#txForm .form-grid){grid-template-columns:minmax(0,1fr)}
  .df-stat b{font-size:17px}
  h1{font-size:20px}
}
