/* Dicatat! - Maganghub Mode: mobile overrides for the Maganghub-specific UI */

/* ==========================================================================
   MOBILE WEB-APP SPECIFIC POLISH (:root[data-mobile="1"])
   ========================================================================== */
:root[data-mobile="1"] .brand-cluster{display:flex;align-items:center;justify-content:space-between;width:100%;gap:8px;flex-wrap:nowrap}
:root[data-mobile="1"] .brand{flex:0 1 auto;min-width:0}
:root[data-mobile="1"] .mh-hdr-sep,:root[data-mobile="1"] .mh-brand .mh-logo{display:none!important}
:root[data-mobile="1"] .mh-brand{margin-left:auto;background:none;border:0;padding:0;box-shadow:none;cursor:pointer}
:root[data-mobile="1"] .mh-cls-pill{display:inline-flex;align-items:center;gap:6px;padding:6px 13px;border-radius:99px;background:var(--acc-soft);border:1.5px solid var(--acc);color:var(--acc);font-size:11.5px;font-weight:800;box-shadow:0 2px 8px rgba(0,112,201,.18);white-space:nowrap}
:root[data-mobile="1"] .mh-cls-pill i{width:6px;height:6px;border-radius:50%;background:var(--acc)}
:root[data-mobile="1"] .mh-cls-mob{display:inline}
:root[data-mobile="1"] .mh-cls-desk{display:none}

/* Compact + Button for Loans & Receivables (Perfect Centered Blue Box / Pill) */
:root[data-mobile="1"] .btn-add-compact{
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  max-width:36px!important;
  padding:0!important;
  margin:0!important;
  border-radius:11px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex-shrink:0!important;
  background:var(--acc)!important;
  color:#fff!important;
  border:0!important;
  box-shadow:0 2px 8px rgba(0,112,201,.28)!important;
  box-sizing:border-box!important;
  line-height:1!important;
  cursor:pointer;
}
:root[data-mobile="1"] .btn-add-compact .btn-lbl{
  display:none!important;
}
:root[data-mobile="1"] .btn-add-compact .btn-plus{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  height:100%!important;
  margin:0!important;
  padding:0!important;
  line-height:1!important;
}
:root[data-mobile="1"] .btn-add-compact .btn-plus svg{
  width:17px!important;
  height:17px!important;
  display:block!important;
  stroke:currentColor!important;
  stroke-width:2.8!important;
}

/* ==========================================================================
   OVERVIEW · Risk & Responsibilities actions
   Two equal, labelled, centered buttons inside the card (no Manage on mobile)
   ========================================================================== */
:root[data-mobile="1"]{
  --soft-btn-bg:rgba(0,112,201,.075);
  --soft-btn-bd:rgba(0,112,201,.22);
  --soft-btn-ink:#005da8;
  --soft-btn-bg-h:rgba(0,112,201,.13);
}
@media (prefers-color-scheme:dark){
  :root[data-mobile="1"]:not([data-theme="light"]){
    --soft-btn-bg:rgba(102,178,255,.11);
    --soft-btn-bd:rgba(102,178,255,.28);
    --soft-btn-ink:#8ec6ff;
    --soft-btn-bg-h:rgba(102,178,255,.18);
  }
}
:root[data-mobile="1"][data-theme="dark"]{
  --soft-btn-bg:rgba(102,178,255,.11);
  --soft-btn-bd:rgba(102,178,255,.28);
  --soft-btn-ink:#8ec6ff;
  --soft-btn-bg-h:rgba(102,178,255,.18);
}
:root[data-mobile="1"] .mob-desk-only{display:none!important}

:root[data-mobile="1"] .risk-acts{
  display:grid!important;
  grid-template-columns:1fr 1fr;
  gap:9px;
  width:100%;
  justify-content:stretch;
  margin:14px 0 0!important;
}
:root[data-mobile="1"] .risk-acts .btn-add-compact{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:44px!important;
  padding:0 12px!important;
  margin:0!important;
  border-radius:12px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:var(--soft-btn-bg)!important;
  border:1px solid var(--soft-btn-bd)!important;
  color:var(--soft-btn-ink)!important;
  box-shadow:none!important;
  font-size:12.5px!important;
  font-weight:700!important;
  letter-spacing:0;
  transition:background .15s ease,border-color .15s ease,transform .12s ease;
}
:root[data-mobile="1"] .risk-acts .btn-add-compact:active{transform:scale(.975)}
:root[data-mobile="1"] .risk-acts .btn-add-compact:hover{background:var(--soft-btn-bg-h)!important}
:root[data-mobile="1"] .risk-acts .btn-add-compact .btn-lbl{
  display:inline!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  line-height:1;
}
:root[data-mobile="1"] .risk-acts .btn-add-compact .btn-plus{display:none!important}

/* ==========================================================================
   OVERVIEW · Recent transactions actions
   Balanced, centered action stack: [Report] [View all] / [ + Add entry ]
   ========================================================================== */
:root[data-mobile="1"] .tx-acts{
  display:grid!important;
  grid-template-columns:1fr 1fr;
  gap:8px;
  width:100%;
  justify-content:stretch;
  margin:14px 0 0!important;
}
:root[data-mobile="1"] .tx-acts .btn{
  width:100%;
  min-width:0;
  height:38px;
  padding:0 10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:700;
  border-radius:11px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  transition:background .15s ease,border-color .15s ease,transform .12s ease;
}
:root[data-mobile="1"] .tx-acts .btn:active{transform:scale(.975)}
:root[data-mobile="1"] .tx-acts .btn:last-child{
  grid-column:1 / -1;
  height:44px;
  font-size:12.5px;
  color:#fff;
  background:var(--acc);
  border-color:transparent;
  box-shadow:0 3px 10px rgba(0,112,201,.26);
}
:root[data-mobile="1"] .tx-acts .btn:last-child:hover{background:var(--acc-h);border-color:transparent}

/* Mobile Calendar (Fit Flush to Body Without Cutoff) */
:root[data-mobile="1"] .mh-cal-card{
  padding:0!important;
  margin:0!important;
  border-radius:16px;
  overflow:hidden;
  width:100%!important;
  box-sizing:border-box;
}
:root[data-mobile="1"] .mh-cal-hd{
  padding:12px 14px!important;
  box-sizing:border-box;
}
:root[data-mobile="1"] .mh-cal-hd h3{
  font-size:14.5px!important;
  display:flex;
  align-items:center;
  gap:6px;
}
:root[data-mobile="1"] .mh-cal-hd .pill{
  font-size:10px!important;
  padding:2px 7px!important;
}
:root[data-mobile="1"] .mh-cal-hd .mh-k-sub{
  font-size:11px!important;
  color:var(--mute);
  margin-top:2px;
}
:root[data-mobile="1"] .mh-cal-wrap{
  padding:8px 6px 12px!important;
  width:100%!important;
  box-sizing:border-box;
  overflow:hidden;
}
:root[data-mobile="1"] .mh-cal-tbl{
  width:100%!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
  border:1px solid var(--line);
  box-sizing:border-box;
}
:root[data-mobile="1"] .mh-cal-tbl thead th{
  padding:6px 1px!important;
  font-size:10.5px!important;
  font-weight:700;
  text-align:center;
  box-sizing:border-box;
}
:root[data-mobile="1"] .mh-cal-tbl tbody td{
  height:44px!important;
  width:14.285%!important;
  max-width:14.285%!important;
  padding:0!important;
  box-sizing:border-box;
  overflow:hidden;
}
:root[data-mobile="1"] .mh-cal-cell{
  width:100%!important;
  height:100%!important;
  min-height:42px!important;
  max-width:100%!important;
  padding:2px 1px!important;
  gap:1px!important;
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
:root[data-mobile="1"] .mh-cal-d{
  font-size:11px!important;
  font-weight:700;
  line-height:1;
  display:flex;
  align-items:baseline;
  justify-content:center;
  gap:1px;
}
:root[data-mobile="1"] .mh-cal-d small{
  font-size:8px!important;
  font-weight:600;
  color:var(--mute);
  margin-left:1px;
}
:root[data-mobile="1"] .mh-cal-mk{
  height:11px!important;
  font-size:9.5px!important;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
:root[data-mobile="1"] .mh-cal-mk.dot{
  width:4px!important;
  height:4px!important;
}
:root[data-mobile="1"] .mh-cal-amt{
  font-size:7.5px!important;
  font-weight:800;
  max-width:96%!important;
  line-height:1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  display:block;
}

/* Mobile Salary Schedule */
:root[data-mobile="1"] .mh-sal-g{grid-template-columns:1fr 1fr;gap:9px}
:root[data-mobile="1"] .mh-sal-i{padding:10px 11px;border-radius:13px;gap:6px}
:root[data-mobile="1"] .mh-sal-d{font-size:12.5px}
:root[data-mobile="1"] .mh-sal-sub{font-size:11.5px}
:root[data-mobile="1"] .mh-sal-btn{width:100%;height:30px;padding:0 8px;font-size:11px;border-radius:8px;justify-content:center}
:root[data-mobile="1"] .mh-sal-a{font-size:12px}

/* Mobile Batch Selection Gate (Proper & Fit in Pop-up Box) */
:root[data-mobile="1"] #mh-gate,
:root[data-mobile="1"] #pf-gate{
  position:fixed;
  inset:0;
  z-index:9995;
  padding:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
}
:root[data-mobile="1"] .mh-gate-card{
  width:100%!important;
  max-width:390px!important;
  margin:auto!important;
  padding:18px 16px 20px!important;
  border-radius:20px!important;
  box-sizing:border-box!important;
  max-height:92dvh;
  overflow-y:auto;
  box-shadow:0 16px 48px rgba(0,0,0,.5);
}
:root[data-mobile="1"] .mh-gate-top{margin-bottom:14px;padding-bottom:12px}
:root[data-mobile="1"] .mh-gate-top .mh-logo{height:22px}
:root[data-mobile="1"] .mh-gate-card h2{font-size:18px!important;line-height:1.25;margin:0 0 5px}
:root[data-mobile="1"] .mh-gate-sub{font-size:12px!important;line-height:1.45;margin:0 0 14px}
:root[data-mobile="1"] .mh-opts{grid-template-columns:1fr!important;gap:10px!important;margin-bottom:14px!important}
:root[data-mobile="1"] .mh-opt{padding:12px 14px!important;border-radius:14px!important;gap:4px!important;width:100%!important;box-sizing:border-box!important}
:root[data-mobile="1"] .mh-opt-badge{font-size:10px!important}
:root[data-mobile="1"] .mh-opt-n{font-size:15px!important}
:root[data-mobile="1"] .mh-opt-r{font-size:12px!important}
:root[data-mobile="1"] .mh-opt-m{font-size:11px!important;margin-top:2px}
:root[data-mobile="1"] .mh-opt-c{top:12px!important;right:12px!important;width:20px!important;height:20px!important}
:root[data-mobile="1"] .mh-opt-c svg{width:12px!important;height:12px!important}
:root[data-mobile="1"] .mh-gate-act{margin-top:14px!important}
:root[data-mobile="1"] .mh-gate-act.pair{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important;width:100%!important}
:root[data-mobile="1"] .mh-gate-act .btn{height:44px!important;font-size:13.5px!important}

/* The profile gate always sits above the batch gate */
:root[data-mobile="1"] #pf-gate{z-index:9996}

/* ==========================================================================
   Mobile Profile Gate & personalisation (name + institution)
   ========================================================================== */
:root[data-mobile="1"] .pf-card{
  max-width:390px!important;
  padding:18px 16px 20px!important;
  border-radius:20px!important;
  max-height:92dvh;
  overflow-y:auto;
  box-sizing:border-box!important;
}
:root[data-mobile="1"] .pf-card h2{font-size:18px!important;line-height:1.25;margin:0 0 5px}
:root[data-mobile="1"] .pf-badge{margin:0 0 10px}
:root[data-mobile="1"] .pf-av{width:46px;height:46px;border-radius:14px;font-size:17px}
:root[data-mobile="1"] .pf-av-lg{width:42px;height:42px;border-radius:12px;font-size:15px}
:root[data-mobile="1"] .pf-fields{gap:9px;margin-bottom:11px}
:root[data-mobile="1"] .pf-inp{height:48px;font-size:16px;border-radius:13px}
:root[data-mobile="1"] .pf-priv{font-size:10.5px;padding:9px 11px;line-height:1.42;border-radius:11px}
:root[data-mobile="1"] .pf-hero{display:flex;padding:12px 13px;border-radius:15px}
:root[data-mobile="1"] .pf-hero-t strong{font-size:13px}
:root[data-mobile="1"] .pf-hero-t small{font-size:11.5px}
:root[data-mobile="1"] .pf-hero-ed{width:32px;height:32px;border-radius:10px}
:root[data-mobile="1"] .pf-set-btn{height:36px}
:root[data-mobile="1"] .pf-foot-priv{
  display:block;
  margin:7px auto 0;
  font-size:10.5px;
  line-height:1.5;
  font-weight:500;
  color:var(--mute);
  opacity:.9;
  text-align:center;
}

/* Short phones (iPhone SE and other <620px tall viewports):
   keep the primary CTA visible without scrolling */
@media (max-height:620px){
  :root[data-mobile="1"] .pf-card{max-height:96dvh;padding:14px 14px 16px!important}
  :root[data-mobile="1"] .pf-badge{margin:0 0 6px}
  :root[data-mobile="1"] .pf-av{width:38px;height:38px;border-radius:12px;font-size:14px}
  :root[data-mobile="1"] .pf-av svg{width:19px;height:19px}
  :root[data-mobile="1"] .pf-card h2{font-size:16px!important;margin:0 0 3px}
  :root[data-mobile="1"] .pf-card .mh-gate-sub{font-size:11px!important;margin:0 0 10px;line-height:1.4}
  :root[data-mobile="1"] .pf-fields{gap:7px;margin-bottom:9px}
  :root[data-mobile="1"] .pf-lbl{font-size:10px}
  :root[data-mobile="1"] .pf-inp{height:44px;font-size:16px}
  :root[data-mobile="1"] .pf-priv{font-size:9.5px;padding:8px 10px;line-height:1.38}
  :root[data-mobile="1"] .pf-card .mh-gate-act{margin-top:11px!important}
}

/* Mobile Reports Page & KPI Grid */
:root[data-mobile="1"] .rep-ctrl-row{flex-direction:column;align-items:stretch;gap:8px;margin-bottom:12px}
:root[data-mobile="1"] .rep-scope-toggle{width:100%}
:root[data-mobile="1"] .rep-scope-toggle .btn{width:100%;height:38px;justify-content:center;font-weight:700}
:root[data-mobile="1"] .rep-export-group{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;width:100%}
:root[data-mobile="1"] .rep-export-group .btn{width:100%;height:38px;padding:0 6px;font-size:12px;font-weight:700;justify-content:center}
:root[data-mobile="1"] .rep-sheet .g4{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:16px!important}
:root[data-mobile="1"] .rep-sheet .rep-kpi{padding:12px 14px}
:root[data-mobile="1"] .rep-sheet .rep-kpi .v{font-size:18px;margin:3px 0 6px}
:root[data-mobile="1"] .view-stack > .g4{grid-template-columns:1fr 1fr;gap:10px}
:root[data-mobile="1"] .view-stack > .g4 .card{padding:12px 14px}
:root[data-mobile="1"] .view-stack > .g4 .card .v{font-size:18px;margin:3px 0 6px}
