<div class="pbrb-shell">
    <div class="pbrb-panel">

        <div class="pbrb-head">
            <div class="pbrb-ico">🏭</div>
            <div class="pbrb-ttl">
                <h2>PANTAU BARBER</h2>
                <p>Pantauan Produksi · bill yang harus dikerjakan &amp; dikeluarkan</p>
            </div>
            <div class="pbrb-date"><span>Hari ini</span><b><?php echo $today_label; ?></b></div>
        </div>

        <div class="pbrb-chips">
            <span class="pbrb-chip c-teal">🆕 BARU — hanya express</span>
            <span class="pbrb-chip c-grey">🚚 DIJEMPUT — hanya express</span>
            <span class="pbrb-chip c-blue">🫧 DIPROSES — semua</span>
            <span class="pbrb-chip c-red">✖ DIANTAR / END PROCESS — tidak ikut</span>
        </div>

        <div class="pbrb-body">
            <label class="pbrb-label">FILTER OUTLET</label>
            <div class="pbrb-outlet"><?php echo $outlet; ?></div>

            <div class="pbrb-actions">
                <button type="button" id="pbrb_open" class="pbrb-btn go">🧺 Barber <span class="arr">→</span></button>
                <button type="button" id="pbrb_exit" class="pbrb-btn exit">↩ Keluar</button>
            </div>

            <div class="pbrb-hint">💡 Laporan dibuka di <b>tab baru</b>. Pilih outlet tertentu, atau biarkan kosong untuk memantau <b>semua outlet</b>.</div>
        </div>

    </div>
</div>

<style type="text/css">
.pbrb-shell{max-width:760px;margin:10px auto 30px;font-family:'Segoe UI',Arial,sans-serif;}
.pbrb-panel{background:#fff;border:1px solid #dfe7e2;border-radius:14px;overflow:hidden;
box-shadow:0 4px 18px rgba(15,60,52,.08);animation:pbrbIn .45s ease both;}
@keyframes pbrbIn{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

.pbrb-head{display:flex;align-items:center;gap:14px;padding:18px 22px;color:#fff;
background:linear-gradient(120deg,#0c3b36,#138074);position:relative;overflow:hidden;}
.pbrb-head::after{content:"";position:absolute;inset:0;
background:repeating-linear-gradient(-55deg,rgba(255,255,255,.05) 0 14px,transparent 14px 30px);
animation:pbrbStripe 14s linear infinite;}
@keyframes pbrbStripe{to{background-position:420px 0}}
.pbrb-ico{font-size:34px;position:relative;z-index:1;filter:drop-shadow(0 2px 4px rgba(0,0,0,.25));}
.pbrb-ttl{position:relative;z-index:1;flex:1;}
.pbrb-ttl h2{margin:0;font-family:'Trebuchet MS','Segoe UI',sans-serif;font-size:21px;letter-spacing:1px;color:#fff;}
.pbrb-ttl p{margin:3px 0 0;font-size:12px;opacity:.85;}
.pbrb-date{position:relative;z-index:1;text-align:right;background:rgba(255,255,255,.14);
border:1px solid rgba(255,255,255,.25);border-radius:10px;padding:7px 12px;line-height:1.25;}
.pbrb-date span{display:block;font-size:9.5px;text-transform:uppercase;letter-spacing:.6px;opacity:.8;}
.pbrb-date b{font-size:14px;}

.pbrb-chips{display:flex;flex-wrap:wrap;gap:7px;padding:14px 22px 0;}
.pbrb-chip{font-size:10.5px;font-weight:700;padding:4px 10px;border-radius:20px;border:1px solid transparent;}
.pbrb-chip.c-teal{background:#e3f3f0;color:#0f766e;border-color:#bfe3dc;}
.pbrb-chip.c-grey{background:#eef1f5;color:#56657a;border-color:#d7dde6;}
.pbrb-chip.c-blue{background:#eaf2fa;color:#2f6fb0;border-color:#c8dcf0;}
.pbrb-chip.c-red{background:#fdecea;color:#d6453f;border-color:#f5c6c2;}

.pbrb-body{padding:18px 22px 22px;}
.pbrb-label{display:block;font-size:11px;font-weight:800;letter-spacing:.8px;color:#69748a;margin:0 0 7px;}
.pbrb-outlet select{width:100%;padding:10px 12px;font-size:14px;border:2px solid #dfe7e2;border-radius:10px;
background:#fbfdfc;transition:border-color .15s,box-shadow .15s;}
.pbrb-outlet select:focus{outline:none;border-color:#138074;box-shadow:0 0 0 3px rgba(19,128,116,.15);}
.pbrb-outlet .select2-container{width:100% !important;}

.pbrb-actions{display:flex;gap:12px;margin-top:20px;}
.pbrb-btn{border:0;border-radius:11px;padding:13px 26px;font-size:15px;font-weight:800;cursor:pointer;
display:inline-flex;align-items:center;gap:9px;transition:transform .13s,box-shadow .13s,filter .13s;}
.pbrb-btn.go{flex:1;justify-content:center;color:#fff;background:linear-gradient(120deg,#0f766e,#1f9d63);
box-shadow:0 4px 14px rgba(15,118,110,.35);}
.pbrb-btn.go .arr{transition:transform .15s;}
.pbrb-btn.go:hover{transform:translateY(-2px);box-shadow:0 9px 22px rgba(15,118,110,.42);filter:brightness(1.06);}
.pbrb-btn.go:hover .arr{transform:translateX(4px);}
.pbrb-btn.go:active{transform:translateY(0);}
.pbrb-btn.exit{background:#eef1f5;color:#56657a;border:1px solid #d7dde6;}
.pbrb-btn.exit:hover{background:#e2e7ee;transform:translateY(-2px);}

.pbrb-hint{margin-top:16px;font-size:11.5px;color:#69748a;line-height:1.55;background:#f6faf8;
border:1px dashed #cfe2db;border-radius:9px;padding:9px 12px;}

@media (max-width:640px){ .pbrb-actions{flex-direction:column;} .pbrb-date{display:none;} }
</style>

<script type="text/javascript">
(function(){
    var REPORT_URL    = '<?php echo $report_url; ?>';
    var DASHBOARD_URL = '<?php echo $dashboard_url; ?>';

    function ambilOutlet(){
        var el = document.getElementById('idoutlet') || document.getElementById('outlet');
        if (!el) el = document.querySelector('.pbrb-outlet select');
        return el ? (el.value || '') : '';
    }

    document.getElementById('pbrb_open').addEventListener('click', function(){
        window.open(REPORT_URL + '?idoutlet=' + encodeURIComponent(ambilOutlet()), '_blank');
    });

    document.getElementById('pbrb_exit').addEventListener('click', function(){
        location.href = DASHBOARD_URL;
    });
})();
</script>