/* MAKA GROSIR v3.8.2 - Order Button Above Bottom Menu Fix
   Area Buat Pesanan lebih lega, offline tetap aktif tanpa banner, aman dari status bar/notch/navigation bar. */
:root{
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --mobile-bottom-space: calc(68px + var(--safe-bottom));
}
html,body{min-height:100%;}
@supports (height: 100dvh){.app-shell{min-height:100dvh;}}
@media (max-width: 900px){
  .topbar{
    min-height:46px !important;
    padding-top:max(6px, var(--safe-top)) !important;
    padding-bottom:6px !important;
    padding-left:max(10px, var(--safe-left)) !important;
    padding-right:max(10px, var(--safe-right)) !important;
    gap:8px !important;
  }
  .mobile-header-brand{min-height:34px !important;gap:8px !important;}
  .mobile-header-brand img,.topbar .app-logo{width:28px !important;height:28px !important;object-fit:contain !important;}
  .topbar .desktop-title h1{font-size:17px !important;line-height:1.15 !important;margin:0 !important;}
  .topbar .desktop-title small{font-size:11px !important;}
  .profile-button{min-height:34px !important;padding:4px 8px !important;border-radius:12px !important;}
  .profile-avatar{width:28px !important;height:28px !important;font-size:12px !important;}
  .content{padding-top:10px !important;padding-bottom:var(--mobile-bottom-space) !important;}
  .bottom-nav{
    bottom:0 !important;
    min-height:calc(50px + var(--safe-bottom)) !important;
    height:calc(50px + var(--safe-bottom)) !important;
    padding:4px max(6px, var(--safe-left)) max(4px, var(--safe-bottom)) max(6px, var(--safe-right)) !important;
    border-radius:16px 16px 0 0 !important;
  }
  .bottom-nav button,.bottom-nav a{
    min-height:42px !important;
    padding:3px 4px !important;
    border-radius:12px !important;
    font-size:10px !important;
    line-height:1.05 !important;
  }
  .bottom-nav svg,.bottom-nav .ui-icon{width:18px !important;height:18px !important;}
  .mobile-menu-panel{padding-bottom:calc(12px + var(--safe-bottom));max-height:calc(96dvh - var(--safe-top));}
  .modal-card{max-height:calc(100dvh - var(--safe-top) - var(--safe-bottom) - 20px) !important;}
  .login-view{min-height:100dvh;padding-top:max(10px, var(--safe-top));padding-bottom:max(10px, var(--safe-bottom));}
}
/* Kalau dibuka dari APK Android, safe-area utama sudah ditangani native agar tidak dobel jarak. */
html.android-native-insets .topbar{padding-top:6px !important;min-height:46px !important;}
html.android-native-insets .bottom-nav{padding-bottom:4px !important;min-height:50px !important;height:50px !important;}
html.android-native-insets .content{padding-bottom:62px !important;}


/* v3.8.2: Offline tetap aktif, tetapi indikator besar disembunyikan agar tidak mengganggu. */
.network-bar,.offline-order-notice{display:none !important;visibility:hidden !important;height:0 !important;min-height:0 !important;padding:0 !important;margin:0 !important;overflow:hidden !important;}

/* v3.8.2: Halaman Buat Pesanan dibuat lebih lega dan tidak tertutup dock. */
@media (max-width: 900px){
  .selected-order-customer{
    margin:4px 8px 8px !important;
    padding:8px 10px !important;
    border-radius:14px !important;
    min-height:auto !important;
    gap:8px !important;
    align-items:center !important;
  }
  .selected-order-customer .step-label{font-size:9px !important;letter-spacing:.08em !important;margin-bottom:1px !important;}
  .selected-order-customer strong{font-size:14px !important;line-height:1.15 !important;}
  .selected-order-customer small{font-size:11px !important;line-height:1.2 !important;display:-webkit-box !important;-webkit-line-clamp:1 !important;-webkit-box-orient:vertical !important;overflow:hidden !important;}
  .selected-order-customer .actions{gap:4px !important;flex-wrap:nowrap !important;}
  .selected-order-customer .btn{min-height:30px !important;padding:5px 8px !important;font-size:11px !important;border-radius:10px !important;white-space:nowrap !important;}
  .order-product-stage{margin:0 8px 8px !important;border-radius:16px !important;}
  .order-product-stage .card-head{padding:8px 10px 4px !important;min-height:0 !important;}
  .order-product-stage .card-head h3{font-size:15px !important;margin:0 !important;}
  .order-product-stage .card-head .step-label{font-size:9px !important;margin-bottom:0 !important;}
  .product-stage-body{padding:8px !important;}
  .catalog-toolbar.clean{margin:0 0 8px !important;gap:6px !important;}
  .catalog-toolbar .search-field.large{min-height:36px !important;border-radius:12px !important;}
  .catalog-toolbar .search-field.large input{font-size:13px !important;min-height:34px !important;}
  .order-product-list{gap:8px !important;padding-bottom:142px !important;}
  .order-product-card{border-radius:14px !important;min-height:auto !important;}
  .order-product-visual{padding:9px 10px !important;gap:4px !important;min-height:auto !important;}
  .order-product-visual-icon{width:28px !important;height:28px !important;min-width:28px !important;}
  .order-product-card-name{font-size:13px !important;line-height:1.18 !important;}
  .order-product-card-price{font-size:12px !important;line-height:1.15 !important;}
  .order-product-meta{font-size:10px !important;gap:4px !important;line-height:1.15 !important;}
  .order-product-unitrow{padding:6px 10px !important;gap:6px !important;}
  .order-product-unitrow select{min-height:30px !important;font-size:12px !important;padding:4px 7px !important;border-radius:9px !important;}
  .order-product-stepper{padding:6px 10px 8px !important;min-height:42px !important;}
  .order-product-step-btn{width:32px !important;height:32px !important;min-width:32px !important;border-radius:11px !important;font-size:18px !important;}
  .order-product-quantity{font-size:12px !important;min-height:30px !important;display:flex !important;align-items:center !important;justify-content:center !important;}
  .order-process-dock{
    left:8px !important;right:8px !important;bottom:calc(58px + var(--safe-bottom)) !important;
    padding:7px 8px !important;min-height:52px !important;border-radius:16px !important;
    gap:8px !important;box-shadow:0 8px 22px rgba(0,0,0,.14) !important;
  }
  .process-summary{gap:3px !important;min-width:0 !important;}
  .order-dock-metric{gap:3px !important;}
  .order-dock-label{font-size:10px !important;line-height:1.1 !important;}
  .order-dock-count{font-size:9px !important;line-height:1 !important;}
  #builderTotal,#builderProfit{font-size:14px !important;line-height:1.1 !important;}
  .process-order{min-height:38px !important;padding:8px 10px !important;border-radius:12px !important;font-size:12px !important;white-space:nowrap !important;}
  .builder-stock-warning.show{font-size:10px !important;line-height:1.1 !important;}
}
html.android-native-insets .order-product-list{padding-bottom:142px !important;}
html.android-native-insets .content{padding-bottom:128px !important;}
html.android-native-insets .order-process-dock{bottom:56px !important;}


/* v3.8.2: Tombol Buat Pesanan dipaksa naik di atas bottom menu agar tidak tertutup. */
@media (max-width: 900px){
  body:has(.order-process-dock) .content,
  body.order-builder-active .content{
    padding-bottom:calc(132px + var(--safe-bottom)) !important;
  }
  .order-process-dock{
    bottom:calc(58px + var(--safe-bottom)) !important;
    z-index:70 !important;
  }
  .bottom-nav{z-index:60 !important;}
  .order-product-list{padding-bottom:150px !important;}
  .order-product-stage{margin-bottom:78px !important;}
}
html.android-native-insets .order-process-dock,
html.android-compact-bars .order-process-dock{bottom:56px !important;z-index:70 !important;}
html.android-native-insets .bottom-nav,
html.android-compact-bars .bottom-nav{z-index:60 !important;}
html.android-native-insets .order-product-list,
html.android-compact-bars .order-product-list{padding-bottom:150px !important;}
html.android-native-insets .content,
html.android-compact-bars .content{padding-bottom:128px !important;}


/* v3.8.6 - Produk: tombol Katalog PDF + Tambah Produk gandeng 1 baris di HP */
.product-page-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    flex-wrap:nowrap;
}
.product-page-actions .btn{
    white-space:nowrap;
}
@media (max-width: 640px){
    .page-head .actions:has(.product-page-actions),
    .page-head-actions:has(.product-page-actions),
    .header-actions:has(.product-page-actions){
        width:100%;
    }
    .product-page-actions{
        width:100%;
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:8px;
    }
    .product-page-actions .btn{
        width:100%;
        min-height:38px;
        padding:8px 10px;
        font-size:12.5px;
        line-height:1.1;
        justify-content:center;
    }
    .product-page-actions .btn svg{
        width:15px;
        height:15px;
        flex:0 0 auto;
    }
}
