/* AMSA ERP v4.4.4 - Tablet/Desktop Responsive Fix
   Patch khusus setelah v4.4.3: tablet landscape tidak lagi dibaca sebagai mobile.
   Tidak mengubah database, API, upload, atau storage. */
:root{
  --sidebar-w-v444:196px;
  --sidebar-w-v444-wide:210px;
  --page-pad-v444:12px;
  --surface-shadow-v444:0 6px 18px rgba(15,23,42,.055);
}
body.v444-responsive{overflow-x:hidden;background:#f5f8fc!important}
body.v444-responsive *{box-sizing:border-box}

/* DEFAULT DESKTOP/TABLET: sidebar tetap tampil */
@media (min-width:701px){
  body.v444-responsive.v443-compact .app{display:block!important}
  body.v444-responsive.v443-compact .sidebar{
    display:block!important;position:fixed!important;left:0!important;top:0!important;bottom:0!important;
    width:var(--sidebar-w-v444)!important;transform:none!important;z-index:30!important;
    padding:12px 12px!important;overflow-y:auto!important;overflow-x:hidden!important;
  }
  body.v444-responsive.v443-compact .sidebar.show{transform:none!important}
  body.v444-responsive.v443-compact .sidebar-overlay,
  body.v444-responsive.v443-compact .sidebar-overlay.show{display:none!important}
  body.v444-responsive.v443-compact .mobile-header{display:none!important;height:0!important;margin:0!important;padding:0!important;overflow:hidden!important}
  body.v444-responsive.v443-compact .main{
    margin-left:var(--sidebar-w-v444)!important;max-width:calc(100vw - var(--sidebar-w-v444))!important;
    width:calc(100vw - var(--sidebar-w-v444))!important;padding:12px 14px 22px!important;overflow-x:hidden!important;
  }
  body.v444-responsive.v443-compact .brand{gap:8px!important;margin-bottom:10px!important;padding-bottom:9px!important}
  body.v444-responsive.v443-compact .brand-logo{width:34px!important;height:34px!important;border-radius:10px!important;font-size:13px!important;flex:0 0 34px!important}
  body.v444-responsive.v443-compact .brand b{font-size:13.2px!important;line-height:1.08!important}
  body.v444-responsive.v443-compact .brand small{font-size:9.5px!important;line-height:1.1!important}
  body.v444-responsive.v443-compact .nav{padding:2px!important;gap:0!important}
  body.v444-responsive.v443-compact .nav-section{margin:8px 4px 3px!important;font-size:9px!important;letter-spacing:.09em!important}
  body.v444-responsive.v443-compact .nav button{min-height:31px!important;padding:6px 8px!important;border-radius:10px!important;font-size:11.4px!important;line-height:1.12!important;margin:1px 0!important;gap:6px!important}
  body.v444-responsive.v443-compact .nav button::before{font-size:12px!important;width:14px!important}
}
@media (min-width:1181px){
  body.v444-responsive.v443-compact .sidebar{width:var(--sidebar-w-v444-wide)!important;padding:13px!important}
  body.v444-responsive.v443-compact .main{margin-left:var(--sidebar-w-v444-wide)!important;max-width:calc(100vw - var(--sidebar-w-v444-wide))!important;width:calc(100vw - var(--sidebar-w-v444-wide))!important;padding:13px 16px 24px!important}
}

/* HP kecil saja yang benar-benar mobile */
@media (max-width:700px){
  body.v444-responsive.v443-compact .main{margin-left:0!important;max-width:100vw!important;width:100vw!important;padding:9px 10px 24px!important}
  body.v444-responsive.v443-compact .mobile-header{display:flex!important;position:sticky!important;top:0!important;z-index:45!important;margin-bottom:8px!important;padding:7px 0!important;background:rgba(245,248,252,.96)!important;backdrop-filter:blur(8px)!important}
  body.v444-responsive.v443-compact .sidebar{width:min(86vw,280px)!important;transform:translateX(-110%)!important;z-index:60!important}
  body.v444-responsive.v443-compact .sidebar.show{transform:translateX(0)!important}
}

/* Header halaman lebih padat */
body.v444-responsive.v443-compact .topbar{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:start!important;gap:10px 12px!important;margin:0 0 9px!important}
body.v444-responsive.v443-compact .topbar h1{font-size:clamp(21px,1.85vw,27px)!important;line-height:1.06!important;margin:0 0 4px!important;letter-spacing:.003em!important}
body.v444-responsive.v443-compact .topbar p{font-size:12.3px!important;line-height:1.28!important;max-width:720px!important;margin:0!important;color:#5f6f84!important}
body.v444-responsive.v443-compact .topbar-actions{display:flex!important;flex-wrap:wrap!important;justify-content:flex-end!important;align-items:center!important;gap:7px!important;margin:0!important;max-width:520px!important}
body.v444-responsive.v443-compact .topbar-actions .btn,
body.v444-responsive.v443-compact .topbar .btn{min-height:30px!important;padding:6px 10px!important;border-radius:10px!important;font-size:11.8px!important;line-height:1.1!important;white-space:nowrap!important;min-width:0!important}
@media (max-width:900px) and (min-width:701px){
  body.v444-responsive.v443-compact .topbar{grid-template-columns:1fr!important}
  body.v444-responsive.v443-compact .topbar-actions{justify-content:flex-start!important;max-width:none!important}
}
@media (max-width:700px){
  body.v444-responsive.v443-compact .topbar{grid-template-columns:1fr!important;gap:8px!important}
  body.v444-responsive.v443-compact .topbar h1{font-size:22px!important}
  body.v444-responsive.v443-compact .topbar-actions{justify-content:flex-start!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important}
  body.v444-responsive.v443-compact .topbar-actions .btn{width:100%!important;text-align:center!important}
}

/* Card global lebih hemat ruang */
body.v444-responsive.v443-compact .grid,
body.v444-responsive.v443-compact .dashboard-grid-v23,
body.v444-responsive.v443-compact .dashboard-grid-v42,
body.v444-responsive.v443-compact .dashboard-grid-v44{gap:8px!important;margin:8px 0 10px!important;grid-template-columns:repeat(auto-fit,minmax(145px,1fr))!important}
body.v444-responsive.v443-compact .card,
body.v444-responsive.v443-compact .v44-card,
body.v444-responsive.v443-compact .dash-card-v42,
body.v444-responsive.v443-compact .admin-card-v42{padding:10px 12px!important;border-radius:14px!important;min-height:auto!important;box-shadow:var(--surface-shadow-v444)!important}
body.v444-responsive.v443-compact .card small,
body.v444-responsive.v443-compact .v44-card small{font-size:10px!important;line-height:1.12!important;letter-spacing:.055em!important;margin:0 0 4px!important}
body.v444-responsive.v443-compact .card b,
body.v444-responsive.v443-compact .v44-card b{font-size:clamp(16px,1.45vw,21px)!important;line-height:1.02!important;margin:0!important}

/* Neraca Tabung v4.4.2: proporsional untuk tablet */
body.v444-responsive.v443-compact.v442-ready .v442-summary-grid,
body.v444-responsive.v443-compact.v442-ready .balance-summary-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important;margin:8px 0 10px!important}
body.v444-responsive.v443-compact.v442-ready .v442-card{min-height:50px!important;padding:9px 11px!important;border-radius:13px!important;text-align:left!important;box-shadow:var(--surface-shadow-v444)!important}
body.v444-responsive.v443-compact.v442-ready .v442-card small{font-size:9.8px!important;line-height:1.12!important;letter-spacing:.065em!important;margin-bottom:4px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;display:block!important}
body.v444-responsive.v443-compact.v442-ready .v442-card b{font-size:20px!important;line-height:1!important}
@media (min-width:1100px){
  body.v444-responsive.v443-compact.v442-ready .v442-summary-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}
@media (max-width:760px){
  body.v444-responsive.v443-compact.v442-ready .v442-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  body.v444-responsive.v443-compact.v442-ready .v442-card{min-height:48px!important;padding:8px 10px!important}
  body.v444-responsive.v443-compact.v442-ready .v442-card b{font-size:18px!important}
}

/* Panel/filter/tabel lebih padat */
body.v444-responsive.v443-compact .panel{border-radius:14px!important;margin-top:8px!important;box-shadow:var(--surface-shadow-v444)!important}
body.v444-responsive.v443-compact .panel-head{padding:9px 12px!important;gap:8px!important;min-height:auto!important}
body.v444-responsive.v443-compact .panel-head h2{font-size:15.5px!important;line-height:1.12!important;margin:0!important}
body.v444-responsive.v443-compact .panel-head small,
body.v444-responsive.v443-compact .panel-head span{font-size:11.2px!important;line-height:1.18!important}
body.v444-responsive.v443-compact .v442-note{font-size:11.5px!important;line-height:1.28!important;margin:6px 12px 0!important}
body.v444-responsive.v443-compact.v442-ready .v442-toolbar{grid-template-columns:1.35fr .75fr .7fr .7fr auto!important;gap:7px!important;margin:7px 12px 10px!important;align-items:end!important}
body.v444-responsive.v443-compact .field{margin:5px 0!important}
body.v444-responsive.v443-compact .field label{font-size:10.8px!important;line-height:1.14!important;margin-bottom:3px!important}
body.v444-responsive.v443-compact .input,
body.v444-responsive.v443-compact select.input,
body.v444-responsive.v443-compact textarea.input{min-height:31px!important;padding:6px 9px!important;border-radius:10px!important;font-size:12px!important;line-height:1.16!important}
body.v444-responsive.v443-compact .btn{min-height:30px!important;padding:6px 10px!important;border-radius:10px!important;font-size:11.8px!important;line-height:1.1!important}
body.v444-responsive.v443-compact .btn-sm{min-height:25px!important;padding:4px 7px!important;border-radius:8px!important;font-size:10.8px!important}
body.v444-responsive.v443-compact .v44-actions{gap:6px!important;display:flex!important;flex-wrap:wrap!important;align-items:center!important}
@media (max-width:980px){
  body.v444-responsive.v443-compact.v442-ready .v442-toolbar{grid-template-columns:1fr 1fr 1fr!important}
  body.v444-responsive.v443-compact.v442-ready .v442-toolbar .v44-actions{grid-column:1/-1!important}
}
@media (max-width:700px){
  body.v444-responsive.v443-compact.v442-ready .v442-toolbar{grid-template-columns:1fr!important;margin:7px 10px 10px!important}
}

body.v444-responsive.v443-compact .table-wrap,
body.v444-responsive.v443-compact .v442-table-wrap{overflow:auto!important;border-radius:0 0 14px 14px!important;-webkit-overflow-scrolling:touch!important}
body.v444-responsive.v443-compact table{min-width:680px!important;width:100%!important}
body.v444-responsive.v443-compact table.v442-table{min-width:650px!important}
body.v444-responsive.v443-compact table.v442-detail-table{min-width:900px!important}
body.v444-responsive.v443-compact th,
body.v444-responsive.v443-compact table.v442-table th{font-size:10.2px!important;padding:7px 9px!important;line-height:1.12!important;letter-spacing:.05em!important;white-space:nowrap!important}
body.v444-responsive.v443-compact td,
body.v444-responsive.v443-compact table.v442-table td{font-size:11.6px!important;padding:7px 9px!important;line-height:1.18!important;vertical-align:middle!important}
body.v444-responsive.v443-compact td b{font-size:11.8px!important;line-height:1.12!important}
body.v444-responsive.v443-compact td small,
body.v444-responsive.v443-compact .v442-sku-sub{font-size:10.2px!important;line-height:1.1!important}
body.v444-responsive.v443-compact.v442-ready .v442-party-name{min-width:185px!important;max-width:280px!important;font-size:11.8px!important;line-height:1.15!important}
body.v444-responsive.v443-compact.v442-ready .v442-count{min-width:32px!important;padding:4px 8px!important;border-radius:10px!important;font-size:11.5px!important}
body.v444-responsive.v443-compact.v442-ready .v442-panel-grid{gap:9px!important;margin-top:9px!important}
body.v444-responsive.v443-compact.v442-ready .v442-tabs{gap:6px!important;margin:8px 0!important}
body.v444-responsive.v443-compact.v442-ready .v442-tabs button{padding:7px 11px!important;border-radius:11px!important;font-size:11.8px!important}

/* Print tetap bersih */
@media print{
  body.v444-responsive .sidebar,body.v444-responsive .mobile-header,body.v444-responsive .topbar-actions{display:none!important}
  body.v444-responsive.v443-compact .main{margin:0!important;width:100%!important;max-width:100%!important;padding:0!important}
}
