/*
|--------------------------------------------------------------------------
| Stage 148C - Mobile Dashboard Repair + Website WhatsApp Position
|--------------------------------------------------------------------------
| Fokus:
| - Dashboard HP tidak berantakan/overflow.
| - Gambar kanan atas pada dashboard disembunyikan di HP/tablet kecil.
| - Ikon/tombol WhatsApp tidak tampil di dashboard.
| - Tombol WhatsApp website publik menjadi floating kecil di pojok kanan bawah.
*/
:root{
  --ys148c-blue:#075FEA;
  --ys148c-navy:#071D49;
  --ys148c-green:#22C55E;
  --ys148c-bg:#F4F8FD;
  --ys148c-line:#DBE7F6;
}

html,body{max-width:100%;overflow-x:hidden!important;}
img,svg,video,canvas{max-width:100%;height:auto;}

/* Dashboard tidak perlu ikon/float WhatsApp. */
body.ys-dashboard-unified .wa-float,
body.ys-dashboard-unified .floating-whatsapp,
body.ys-dashboard-unified .whatsapp-float,
body.ys-dashboard-unified .wa-floating,
body.ys-dashboard-unified [class*="whatsapp-float"],
body.ys-dashboard-unified [class*="wa-float"]{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

/* Website publik: WhatsApp kecil di pojok kanan bawah, tidak melebar penuh di HP. */
body.ys-public-unified .wa-float,
body.ys-technician-public .wa-float,
a.wa-float{
  position:fixed!important;
  left:auto!important;
  right:16px!important;
  bottom:16px!important;
  width:auto!important;
  min-width:54px!important;
  height:54px!important;
  max-width:calc(100vw - 32px)!important;
  padding:0 16px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:999px!important;
  background:linear-gradient(135deg,#16A34A,#22C55E)!important;
  color:#fff!important;
  font-size:13px!important;
  line-height:1!important;
  font-weight:950!important;
  text-align:center!important;
  white-space:nowrap!important;
  box-shadow:0 14px 34px rgba(22,163,74,.34)!important;
  z-index:95!important;
  border:2px solid rgba(255,255,255,.92)!important;
}
body.ys-public-unified .wa-float::before,
body.ys-technician-public .wa-float::before,
a.wa-float::before{
  content:"💬";
  display:inline-flex;
  margin-right:7px;
  font-size:17px;
}

@media(max-width:1024px){
  /* Gambar visual kanan atas dashboard sering merusak layout HP/tablet. */
  body.ys-dashboard-unified .ys123-dashboard-hero{
    display:block!important;
    grid-template-columns:1fr!important;
    margin-bottom:12px!important;
  }
  body.ys-dashboard-unified .ys123-dashboard-hero .ys123-tech-visual,
  body.ys-dashboard-unified .ys123-tech-visual.compact,
  body.ys-dashboard-unified figure.ys123-tech-visual{
    display:none!important;
    visibility:hidden!important;
    height:0!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    box-shadow:none!important;
    overflow:hidden!important;
  }
  body.ys-dashboard-unified .ys123-dashboard-hero .ys118-head{
    margin:0!important;
    width:100%!important;
  }

  /* Card identitas yang berisi gambar besar di dashboard teknisi disederhanakan. */
  body.ys-dashboard-unified .ys123-dashboard-mini{
    grid-template-columns:1fr!important;
    padding:12px!important;
    min-height:auto!important;
  }
  body.ys-dashboard-unified .ys123-dashboard-mini img{
    display:none!important;
  }

  /* Topbar dibuat ringkas agar tidak meluber. */
  body.ys-dashboard-unified .topbar{
    align-items:flex-start!important;
    gap:8px!important;
  }
  body.ys-dashboard-unified .topbar h1,
  body.ys-dashboard-unified .topbar p{
    max-width:100%!important;
    overflow-wrap:anywhere!important;
  }
  body.ys-dashboard-unified .topbar-actions{
    max-width:100%!important;
  }
}

@media(max-width:800px){
  body.ys-dashboard-unified{
    background:var(--ys148c-bg)!important;
  }
  body.ys-dashboard-unified .content{
    margin-left:0!important;
    width:100%!important;
    max-width:100%!important;
    padding:0 0 98px!important;
    overflow-x:hidden!important;
  }
  body.ys-dashboard-unified .ys118-page{
    width:100%!important;
    max-width:100%!important;
    padding:10px 10px 0!important;
    overflow-x:hidden!important;
  }

  /* Dashboard header: satu kolom, tidak ada gambar, tombol tidak saling tindih. */
  body.ys-dashboard-unified .ys118-head{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    padding:14px!important;
    border-radius:22px!important;
    overflow:hidden!important;
  }
  body.ys-dashboard-unified .ys118-title h1{
    font-size:20px!important;
    line-height:1.15!important;
    letter-spacing:-.03em!important;
    margin:4px 0!important;
    overflow-wrap:anywhere!important;
  }
  body.ys-dashboard-unified .ys118-title p{
    font-size:12px!important;
    line-height:1.45!important;
    margin:0!important;
  }
  body.ys-dashboard-unified .ys118-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
    width:100%!important;
  }
  body.ys-dashboard-unified .ys118-actions a,
  body.ys-dashboard-unified .ys118-actions button,
  body.ys-dashboard-unified .ys118-btn,
  body.ys-dashboard-unified .btn-primary,
  body.ys-dashboard-unified .btn-secondary,
  body.ys-dashboard-unified .btn-success,
  body.ys-dashboard-unified .btn-warning,
  body.ys-dashboard-unified .btn-danger{
    width:100%!important;
    min-width:0!important;
    min-height:42px!important;
    padding:10px 10px!important;
    font-size:12px!important;
    text-align:center!important;
    justify-content:center!important;
    border-radius:14px!important;
    white-space:normal!important;
    line-height:1.2!important;
  }

  /* KPI agar tidak melebar karena nominal rupiah panjang. */
  body.ys-dashboard-unified .ys118-kpi{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
  }
  body.ys-dashboard-unified .ys118-card{
    min-width:0!important;
    padding:12px!important;
    border-radius:18px!important;
    overflow:hidden!important;
  }
  body.ys-dashboard-unified .ys118-card .value,
  body.ys-dashboard-unified .ys118-money-in,
  body.ys-dashboard-unified .ys118-money-out{
    font-size:15px!important;
    line-height:1.15!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    letter-spacing:-.02em!important;
  }

  /* Panel/list/form/tabel dibuat tidak menyebabkan layar melebar. */
  body.ys-dashboard-unified .ys118-grid,
  body.ys-dashboard-unified .ys118-grid.equal,
  body.ys-dashboard-unified .grid,
  body.ys-dashboard-unified .mobile-action-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    width:100%!important;
  }
  body.ys-dashboard-unified .ys118-panel,
  body.ys-dashboard-unified .card,
  body.ys-dashboard-unified .hero,
  body.ys-dashboard-unified .ys146-section-card{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    padding:13px!important;
    border-radius:20px!important;
    overflow:hidden!important;
  }
  body.ys-dashboard-unified .ys118-panel-head{
    display:flex!important;
    align-items:flex-start!important;
    gap:8px!important;
    flex-wrap:wrap!important;
  }
  body.ys-dashboard-unified .ys118-panel-head h2{
    font-size:15px!important;
    line-height:1.2!important;
  }
  body.ys-dashboard-unified .ys118-list,
  body.ys-dashboard-unified .ys118-row{
    min-width:0!important;
    max-width:100%!important;
  }
  body.ys-dashboard-unified .ys118-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:8px!important;
    padding:10px!important;
    border-radius:16px!important;
  }
  body.ys-dashboard-unified .ys118-row > div,
  body.ys-dashboard-unified .ys118-row span,
  body.ys-dashboard-unified .ys118-row strong,
  body.ys-dashboard-unified .ys118-row small{
    min-width:0!important;
    max-width:100%!important;
    overflow-wrap:anywhere!important;
  }
  body.ys-dashboard-unified .ys118-pill,
  body.ys-dashboard-unified .badge{
    max-width:112px!important;
    white-space:normal!important;
    text-align:center!important;
    line-height:1.15!important;
    padding:6px 8px!important;
    font-size:10.5px!important;
  }
  body.ys-dashboard-unified table,
  body.ys-dashboard-unified .table,
  body.ys-dashboard-unified [class*="tbl"],
  body.ys-dashboard-unified .tablewrap{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
  body.ys-dashboard-unified input,
  body.ys-dashboard-unified select,
  body.ys-dashboard-unified textarea{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    font-size:14px!important;
  }

  /* Quick action teknisi/pelanggan: 2 kolom supaya teks tidak saling tabrak. */
  body.ys-dashboard-unified .ys118-quick{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  body.ys-dashboard-unified .ys118-quick a{
    min-width:0!important;
    min-height:64px!important;
    padding:9px!important;
    font-size:11px!important;
    line-height:1.2!important;
    overflow-wrap:anywhere!important;
  }

  /* Customer mobile home juga dijaga supaya tidak ada overflow. */
  .ys146-wallet-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  .ys146-shortcuts{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  .ys146-wallet-actions a,
  .ys146-shortcut{
    min-width:0!important;
    overflow-wrap:anywhere!important;
  }

  /* Bottom nav tidak menutup konten terlalu banyak. */
  .mobile-bottom-nav,
  .ys118-bottom-nav{
    left:10px!important;
    right:10px!important;
    bottom:10px!important;
    max-width:calc(100vw - 20px)!important;
    z-index:120!important;
  }
}

@media(max-width:420px){
  body.ys-dashboard-unified .ys118-actions{grid-template-columns:1fr!important;}
  body.ys-dashboard-unified .ys118-kpi{grid-template-columns:1fr 1fr!important;}
  body.ys-dashboard-unified .ys118-card .value{font-size:14px!important;}
  body.ys-dashboard-unified .ys118-quick{grid-template-columns:1fr 1fr!important;}
  .ys146-shortcuts{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;}
  .ys146-shortcut{font-size:10px!important;min-height:70px!important;border-radius:16px!important;}
  .ys146-shortcut i{width:30px!important;height:30px!important;font-size:17px!important;}
  body.ys-public-unified .wa-float,
  body.ys-technician-public .wa-float,
  a.wa-float{
    right:12px!important;
    bottom:12px!important;
    min-width:50px!important;
    height:50px!important;
    padding:0 13px!important;
    font-size:12px!important;
  }
}
