
:root{
  --brown:#8A5E3B; --brown-dark:#6B4A2E; --brown-light:#C9A876;
  --cream:#F4EEE1; --cream-deep:#EBE2CC;
  --ink:#241F1A; --ink-dim:#726555;
  --border:#E3D9C3;
  --white:#FFFFFF;
  --sidebar-bg:#211A14; --sidebar-text:#C9BCA6; --sidebar-text-dim:#8B7E6C; --sidebar-active:#3A2A1B;
  --green:#4C6B4F; --green-bg:#E7EEE3;
  --red:#A24437; --red-bg:#F5E4DF;
  --amber:#9C7A2E; --amber-bg:#F3ECD8;
  --gold:#D4AF37;
  --radius:14px;
  --sidebar-w:248px; --sidebar-w-collapsed:72px; --topbar-h:68px;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --cream:#1B1712; --cream-deep:#241E17; --white:#241E17; --border:#3A2E22;
    --ink:#EFE7D8; --ink-dim:#B4A791;
  }
}
:root[data-theme="dark"]{
  --cream:#1B1712; --cream-deep:#241E17; --white:#241E17; --border:#3A2E22;
  --ink:#EFE7D8; --ink-dim:#B4A791;
}
*{ box-sizing:border-box; }
html{ scroll-padding-top: env(safe-area-inset-top, 0px); }
body{
  margin:0; background:var(--cream); color:var(--ink);
  font-family:'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing:antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.font-display{ font-family:'Fraunces', Georgia, serif; }
a{ color:var(--brown); text-decoration:none; }
a:hover{ color:var(--brown-dark); }
::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-thumb{ background:var(--border); border-radius:8px; }
button{ font-family:inherit; }
input, select, textarea{ font-family:inherit; }
.icon-inline{ display:inline-block; vertical-align:-3px; flex-shrink:0; }

/* =====================================================================
   HAND-BUILT UTILITY LAYER (self-contained -- no external framework CSS)
   ===================================================================== */
.d-flex{ display:flex; }
.d-block{ display:block; }
.d-none{ display:none !important; }
.d-inline-flex{ display:inline-flex; }
.flex-wrap{ flex-wrap:wrap; }
.flex-column{ flex-direction:column; }
.flex-grow-1{ flex-grow:1; }
.flex-fill{ flex:1 1 0%; }
.flex-shrink-0{ flex-shrink:0; }
.align-items-center{ align-items:center; }
.align-items-start{ align-items:flex-start; }
.align-items-end{ align-items:flex-end; }
.justify-content-between{ justify-content:space-between; }
.justify-content-end{ justify-content:flex-end; }
.justify-content-center{ justify-content:center; }
.min-w-0{ min-width:0; }
.w-100{ width:100%; }
.text-center{ text-align:center; }
.text-end{ text-align:right; }
.position-relative{ position:relative; }
.position-absolute{ position:absolute; }
.position-fixed{ position:fixed; }
.top-0{ top:0; }
.end-0{ right:0; }
.start-0{ left:0; }
.bottom-0{ bottom:0; }
.translate-middle{ transform:translate(40%,-40%); }
.rounded-circle{ border-radius:50%; }
.border{ border:1px solid var(--border); }
.bg-danger{ background:var(--red); }

.gap-1{ gap:.25rem; } .gap-2{ gap:.5rem; } .gap-3{ gap:1rem; } .gap-4{ gap:1.5rem; }
.mb-1{ margin-bottom:.25rem; } .mb-2{ margin-bottom:.5rem; } .mb-3{ margin-bottom:1rem; } .mb-4{ margin-bottom:1.5rem; }
.mt-1{ margin-top:.25rem; } .mt-3{ margin-top:1rem; } .mt-4{ margin-top:1.5rem; }
.me-1{ margin-right:.25rem; } .me-2{ margin-right:.5rem; }
.ms-1{ margin-left:.25rem; } .ms-2{ margin-left:.5rem; }
.ps-2{ padding-left:.5rem; }
.pt-1{ padding-top:.25rem; }
.p-0{ padding:0; } .p-1{ padding:.25rem; } .p-2{ padding:.5rem; } .p-3{ padding:1rem; } .p-4{ padding:1.5rem; }
.py-2{ padding-top:.5rem; padding-bottom:.5rem; }
.m-auto{ margin:auto; }

.row{ display:flex; flex-wrap:wrap; margin:-.5rem; }
.row > [class*="col"]{ padding:.5rem; box-sizing:border-box; }
.col-12{ width:100%; } .col-6{ width:50%; }
@media (min-width:768px){
  .col-md-4{ width:33.3333%; } .col-md-6{ width:50%; }
  .d-md-flex{ display:flex !important; } .d-md-block{ display:block !important; }
}
@media (min-width:992px){
  .col-lg-4{ width:33.3333%; } .col-lg-5{ width:41.6667%; }
  .col-lg-7{ width:58.3333%; } .col-lg-8{ width:66.6667%; }
  .d-lg-block{ display:block !important; }
  .d-lg-none{ display:none !important; }
  .flex-lg-nowrap{ flex-wrap:nowrap !important; }
}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:9px 16px; border-radius:8px; border:1px solid transparent;
  font-size:13.5px; font-weight:600; line-height:1.3; cursor:pointer; background:transparent;
  white-space:nowrap;
}
.btn-sm{ padding:7px 12px; font-size:12.5px; }
.btn-brand{ background:var(--brown); border-color:var(--brown); color:#fff; }
.btn-brand:hover{ background:var(--brown-dark); border-color:var(--brown-dark); }
.btn-outline-brand{ background:var(--white); border-color:var(--border); color:var(--ink); }
.btn-outline-brand:hover{ background:var(--cream); }
.btn-plain{ border:none; background:transparent; color:var(--ink-dim); padding:6px 8px; }
.btn-close{
  width:18px; height:18px; border:none; background:transparent; position:relative; cursor:pointer;
  border-radius:4px; flex-shrink:0;
}
.btn-close:hover{ background:var(--cream); }
.btn-close::before, .btn-close::after{
  content:""; position:absolute; top:50%; left:50%; width:12px; height:1.6px; background:var(--ink-dim); border-radius:2px;
}
.btn-close::before{ transform:translate(-50%,-50%) rotate(45deg); }
.btn-close::after{ transform:translate(-50%,-50%) rotate(-45deg); }

.form-control, .form-select{
  display:block; width:100%; box-sizing:border-box; padding:9px 13px;
  border:1px solid var(--border); border-radius:8px; font-size:13.5px;
  background:var(--white); color:var(--ink);
}
.form-control:focus, .form-select:focus{ outline:none; border-color:var(--brown-light); box-shadow:0 0 0 3px rgba(138,94,59,.15); }
.form-control-sm, .form-select-sm{ padding:6px 10px; font-size:12.5px; }
.form-label{ display:block; margin-bottom:6px; font-size:12px; font-weight:600; }
.form-check{ display:flex; align-items:center; gap:8px; }
.form-check-input{ width:16px; height:16px; accent-color:var(--brown); }
.form-check-label{ font-size:12.5px; color:var(--ink-dim); }
.input-group{ display:flex; align-items:stretch; }
.input-group-text{ display:flex; align-items:center; padding:0 12px; border:1px solid var(--border); border-right:none; background:var(--cream); border-radius:8px 0 0 8px; font-size:12.5px; white-space:nowrap; }
.input-group .form-control{ border-radius:0 8px 8px 0; }

.badge-soft{ display:inline-flex; align-items:center; font-weight:600; font-size:11px; padding:4px 10px; border-radius:6px; white-space:nowrap; }
.badge-success{ background:var(--green-bg); color:var(--green); }
.badge-danger{ background:var(--red-bg); color:var(--red); }
.badge-warning{ background:var(--amber-bg); color:var(--amber); }
.badge-neutral{ background:var(--cream-deep); color:var(--ink-dim); }

/* =====================================================================
   APP SHELL
   ===================================================================== */
#app-shell{ display:flex; height:100vh; overflow:hidden; }
.sidebar{
  width:var(--sidebar-w); flex-shrink:0; height:100%; background:var(--sidebar-bg);
  display:flex; flex-direction:column; padding:18px 0; transition:width .18s ease;
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
}
.sidebar.collapsed{ width:var(--sidebar-w-collapsed); }
.sidebar-brand{ display:flex; align-items:center; gap:10px; padding:0 18px; margin-bottom:22px; overflow:hidden; }
.sidebar.collapsed .sidebar-brand{ justify-content:center; padding:0 8px; }
.brand-mark{ width:38px; height:38px; border-radius:10px; background:#2B2119; border:1px solid #3A2E22; flex-shrink:0; display:flex; align-items:center; justify-content:center; padding:5px; }
.brand-logo{ display:block; width:100%; height:100%; background:var(--logo-url) center/contain no-repeat; }
.brand-text{ color:#fff; font-family:'Fraunces',serif; font-size:17px; font-weight:600; white-space:nowrap; letter-spacing:1.5px; }
.sidebar.collapsed .brand-text, .sidebar.collapsed .nav-label, .sidebar.collapsed .sidebar-foot-label{ display:none; }
.sidebar-nav{ flex:1; overflow-y:auto; overflow-x:hidden; display:flex; flex-direction:column; gap:2px; padding:0 8px; }
.side-link{
  position:relative; display:flex; align-items:center; gap:12px; height:42px; padding:0 12px;
  border-radius:9px; color:var(--sidebar-text); text-decoration:none; white-space:nowrap; overflow:hidden; cursor:pointer;
}
.sidebar.collapsed .side-link{ justify-content:center; padding:0; }
.side-link:hover{ background:rgba(255,255,255,.06); color:#fff; }
.side-link.active{ background:var(--sidebar-active); color:#fff; font-weight:600; }
.side-link.active::before{ content:""; position:absolute; left:0; top:8px; bottom:8px; width:3px; border-radius:0 3px 3px 0; background:var(--brown-light); }
.sidebar-collapse-btn{ width:100%; display:flex; justify-content:flex-end; padding:0 18px 14px; }
.sidebar.collapsed .sidebar-collapse-btn{ justify-content:center; padding:0 0 14px; }
.collapse-icon{ transition:transform .18s ease; }
.sidebar.collapsed .collapse-icon{ transform:rotate(180deg); }
.icon-btn-ghost{
  width:30px; height:30px; border-radius:7px; border:1px solid #3A2E22; background:transparent; color:var(--gold);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.icon-btn-ghost:hover{ border-color:var(--gold); }
.sidebar-divider{ height:1px; background:#3A2E22; margin:4px 18px 12px; }
.sidebar.collapsed .sidebar-divider{ margin:4px 12px 12px; }
.logout-link{ display:flex; align-items:center; gap:12px; padding:0 18px; color:var(--sidebar-text-dim); text-decoration:none; height:38px; cursor:pointer; }
.logout-link:hover{ color:var(--red); }
.sidebar.collapsed .logout-link{ justify-content:center; padding:0; }

.mobile-backdrop{ display:none; }
@media (max-width: 991.98px){
  .sidebar{ position:fixed; top:0; left:0; z-index:1045; transform:translateX(-100%); width:var(--sidebar-w) !important; box-shadow:0 0 40px rgba(0,0,0,.3); }
  .sidebar.mobile-open{ transform:translateX(0); }
  .mobile-backdrop.show{ display:block; position:fixed; inset:0; background:rgba(20,15,10,.5); z-index:1040; }
  .hamburger-btn{ display:inline-flex !important; }
  .sidebar-collapse-btn{ display:none; }
}

.main-col{ flex:1; min-width:0; height:100%; display:flex; flex-direction:column; }
.topbar{
  height:var(--topbar-h); flex-shrink:0; background:var(--white); border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between; padding:0 20px; gap:14px;
}
.hamburger-btn{ display:none; }
.page-content{ flex:1; min-height:0; overflow-y:auto; padding:22px 22px 60px; }
.crumb{ font-size:11.5px; color:var(--ink-dim); margin-bottom:1px; }
.page-title{ font-family:'Fraunces',serif; font-size:20px; font-weight:600; color:var(--ink); }

/* =====================================================================
   COMPONENTS
   ===================================================================== */
.card{ background:var(--white); border:1px solid var(--border); border-radius:var(--radius); }
.search-box{ position:relative; }
.search-box .icon-inline{ position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--ink-dim); }
.search-box input{ padding-left:34px; }

table.tbl{ width:100%; border-collapse:collapse; }
table.tbl thead th{
  text-align:left; padding:11px 14px; font-size:11px; font-weight:700; color:var(--ink-dim);
  text-transform:uppercase; letter-spacing:.4px; border-bottom:1px solid var(--border); white-space:nowrap;
}
table.tbl thead th.sortable{ cursor:pointer; user-select:none; }
table.tbl thead th.sortable:hover{ color:var(--ink); }
table.tbl thead th .sort-arrow{ margin-left:5px; font-size:9px; opacity:.4; display:inline-block; }
table.tbl thead th.sort-asc .sort-arrow, table.tbl thead th.sort-desc .sort-arrow{ opacity:1; color:var(--brown); }
table.tbl tbody td{ padding:12px 14px; font-size:13px; color:var(--ink); border-bottom:1px solid var(--border); vertical-align:middle; }
table.tbl tbody tr:last-child td{ border-bottom:none; }
.table-responsive-wrap{ overflow-x:auto; }
.row-thumb{ width:36px; height:36px; border-radius:8px; background:var(--cream-deep); display:flex; align-items:center; justify-content:center; color:var(--ink-dim); flex-shrink:0; }
.stock-name-link{ font-weight:600; color:var(--ink); text-decoration:none; }
.stock-name-link:hover{ color:var(--brown); text-decoration:underline; }
.avatar-circle{ width:32px; height:32px; border-radius:50%; background:var(--brown-light); color:#fff; display:flex; align-items:center; justify-content:center; font-family:'Fraunces',serif; font-weight:600; font-size:12px; flex-shrink:0; }
.icon-btn-sm{ width:30px; height:30px; border-radius:7px; border:1px solid var(--border); background:var(--white); display:flex; align-items:center; justify-content:center; color:var(--ink-dim); cursor:pointer; }
.icon-btn-sm:hover{ background:var(--cream); }
.icon-btn-sm.danger{ border-color:var(--red-bg); color:var(--red); }

.kpi-card{ background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; display:flex; flex-direction:column; gap:10px; flex:1; min-width:190px; }
.kpi-icon{ width:32px; height:32px; border-radius:8px; background:var(--cream); display:flex; align-items:center; justify-content:center; color:var(--brown); }
.kpi-value{ font-family:'Fraunces',serif; font-size:24px; font-weight:600; }
.kpi-delta{ font-size:11px; font-weight:700; padding:2px 7px; border-radius:5px; display:inline-flex; align-items:center; gap:2px; }
.kpi-delta.up{ background:var(--green-bg); color:var(--green); }
.kpi-delta.down{ background:var(--red-bg); color:var(--red); }

.tabpill{ display:inline-flex; gap:3px; background:var(--cream-deep); padding:4px; border-radius:11px; flex-wrap:wrap; }
.tabpill .seg{ padding:8px 16px; border-radius:8px; font-size:12.5px; font-weight:700; color:var(--ink-dim); cursor:pointer; border:none; background:transparent; }
.tabpill .seg.active{ background:var(--white); color:var(--ink); box-shadow:0 1px 2px rgba(20,15,10,.08); }

.underline-tabs{ display:flex; gap:26px; border-bottom:1px solid var(--border); overflow-x:auto; flex-wrap:nowrap; }
.underline-tabs .seg{ white-space:nowrap; flex-shrink:0; padding:10px 2px; font-size:13px; font-weight:700; color:var(--ink-dim); border:none; background:transparent; border-bottom:2.5px solid transparent; cursor:pointer; }
.underline-tabs .seg.active{ color:var(--ink); border-bottom-color:var(--brown); }

.location-pill{ display:flex; align-items:center; gap:7px; background:var(--brown); color:#fff; border:1px solid var(--brown); border-radius:9px; padding:8px 12px; font-size:12.5px; font-weight:600; cursor:pointer; white-space:nowrap; }

.user-menu{ position:relative; }
.user-menu-dropdown{
  position:absolute; top:calc(100% + 10px); right:0; width:220px; background:var(--white);
  border:1px solid var(--border); border-radius:12px; box-shadow:0 16px 34px rgba(20,15,10,.16);
  opacity:0; visibility:hidden; transform:translateY(-6px); transition:opacity .15s ease, transform .15s ease, visibility .15s;
  z-index:60; overflow:hidden;
}
.user-menu:hover .user-menu-dropdown, .user-menu.open .user-menu-dropdown{
  opacity:1; visibility:visible; transform:translateY(0);
}
.user-menu-item{ display:flex; align-items:center; gap:10px; padding:11px 14px; font-size:12.5px; font-weight:600; color:var(--ink); text-decoration:none; }
.user-menu-item:hover{ background:var(--cream); color:var(--ink); }
.user-menu-item.danger{ color:var(--red); }
.user-menu-item.danger:hover{ background:var(--red-bg); color:var(--red); }

.toggle-sw{ width:34px; height:19px; border-radius:10px; background:var(--border); position:relative; cursor:pointer; flex-shrink:0; border:none; padding:0; }
.toggle-sw .knob{ position:absolute; top:2px; left:2px; width:15px; height:15px; border-radius:50%; background:#fff; transition:left .15s; }
.toggle-sw.on{ background:var(--brown); }
.toggle-sw.on .knob{ left:17px; }

.product-card{ width:calc(25% - 9px); background:var(--white); border:1px solid var(--border); border-radius:12px; overflow:hidden; cursor:pointer; text-align:left; padding:0; display:block; }
.product-card:hover{ border-color:var(--brown-light); }
.product-card .thumb{ height:82px; background:var(--cream-deep); display:flex; align-items:center; justify-content:center; color:var(--ink-dim); }
.product-card .info{ padding:9px 11px; text-align:left; }
.product-card .pname{ font-size:12px; font-weight:600; color:var(--ink); line-height:1.3; margin-bottom:2px; }
.product-card .pvar{ font-size:10.5px; color:var(--ink-dim); margin-bottom:5px; }
.product-card .pprice{ font-size:12.5px; font-weight:700; color:var(--brown); }
@media (max-width: 767.98px){ .product-card{ width:calc(50% - 6px); } }

.qty-btn{ width:24px; height:24px; border-radius:6px; border:1px solid var(--border); background:var(--white); display:flex; align-items:center; justify-content:center; cursor:pointer; font-weight:700; color:var(--ink-dim); padding:0; }

.pagination-bar{ display:flex; align-items:center; justify-content:space-between; padding-top:14px; flex-wrap:wrap; gap:10px; }
.page-num{ width:30px; height:30px; border-radius:7px; border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:12.5px; font-weight:600; color:var(--ink-dim); background:transparent; cursor:pointer; padding:0; }
.page-num.active{ background:var(--brown); border-color:var(--brown); color:#fff; }

/* Foto Produk: tampilan utama besar + 4 thumbnail slot di bawahnya */
.photo-main-box{
  position:relative; width:100%; aspect-ratio:16/9; background:var(--cream);
  border:1.5px dashed var(--border); border-radius:16px; overflow:hidden;
  display:flex; align-items:center; justify-content:center; margin-bottom:10px;
}
.photo-main-box.has-image{ border-style:solid; background:var(--cream-deep); }
.photo-main-badge{
  position:absolute; top:10px; left:10px; z-index:2; display:flex; align-items:center; gap:6px;
  background:rgba(33,26,20,.82); color:#fff; font-size:11px; font-weight:700; padding:5px 10px; border-radius:8px;
}
.photo-main-badge .dot{ width:7px; height:7px; border-radius:50%; background:var(--gold); flex-shrink:0; }
#photoMainImg{ width:100%; height:100%; object-fit:contain; cursor:zoom-in; }
.photo-main-zoom-hint{
  position:absolute; bottom:10px; left:10px; z-index:2; display:none; align-items:center; gap:5px;
  background:rgba(33,26,20,.75); color:#fff; font-size:10.5px; font-weight:600; padding:5px 9px; border-radius:7px;
  pointer-events:none;
}
.photo-main-box.has-image .photo-main-zoom-hint{ display:flex; }
.photo-main-empty{ display:flex; flex-direction:column; align-items:center; gap:6px; color:var(--ink-dim); text-align:center; padding:20px; }
.photo-main-empty-title{ font-size:13px; font-weight:700; color:var(--ink); margin-top:4px; }
.photo-main-empty-subtitle{ font-size:11.5px; color:var(--ink-dim); margin-bottom:8px; }
.photo-main-toolbar{
  position:absolute; bottom:10px; right:10px; z-index:2; display:none; gap:8px;
  background:rgba(33,26,20,.75); padding:6px; border-radius:10px;
}
.photo-main-toolbar button{
  display:flex; align-items:center; gap:6px; padding:7px 12px; border-radius:7px; border:none; cursor:pointer;
  background:var(--white); color:var(--ink); font-size:11.5px; font-weight:700;
}
.photo-main-toolbar button:last-child:hover{ background:var(--red); color:#fff; }
.photo-main-toolbar button:first-child:hover{ background:var(--brown); color:#fff; }

.photo-thumb-grid{ display:grid; grid-template-columns:repeat(4, 1fr); gap:10px; }
.photo-thumb{
  position:relative; aspect-ratio:1/1; border-radius:12px; background:var(--cream);
  border:2px solid var(--border); cursor:pointer; overflow:hidden; transition:border-color .15s ease, opacity .15s ease;
  opacity:.75;
}
.photo-thumb:hover{ border-color:var(--brown-light); opacity:1; }
.photo-thumb.active{ border-color:var(--brown); box-shadow:0 0 0 3px rgba(138,94,59,.15); opacity:1; }
.photo-thumb img{ width:100%; height:100%; object-fit:cover; }
.photo-thumb-empty{
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:3px; color:var(--ink-dim); font-size:10px; font-weight:700;
}
.photo-thumb-badge{
  position:absolute; bottom:4px; left:4px; background:rgba(33,26,20,.75); color:#fff;
  font-size:9px; font-weight:700; padding:1px 6px; border-radius:5px;
}

/* Kartu produk ringkas (bergambar) untuk pemilih item di modal Transfer/SO/PO */
.picker-grid{ display:flex; flex-wrap:wrap; gap:8px; max-height:230px; overflow-y:auto; padding:2px; }
.picker-card{
  width:104px; background:var(--white); border:1px solid var(--border); border-radius:10px; overflow:hidden;
  cursor:pointer; text-align:left; padding:0;
}
.picker-card:hover{ border-color:var(--brown-light); }
.picker-card .thumb{ height:64px; background:var(--cream-deep); display:flex; align-items:center; justify-content:center; color:var(--ink-dim); overflow:hidden; }
.picker-card .thumb img{ width:100%; height:100%; object-fit:cover; }
.picker-card .info{ padding:6px 7px; }
.picker-card .pname{ font-size:11px; font-weight:600; color:var(--ink); line-height:1.25; margin-bottom:2px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.picker-card .pcode{ font-size:9.5px; color:var(--ink-dim); margin-bottom:3px; }
.picker-card .pprice{ font-size:10.5px; font-weight:700; color:var(--brown); }
.picker-card .pstock{ font-size:9.5px; color:var(--ink-dim); }
.picker-empty{ width:100%; padding:18px 10px; text-align:center; font-size:12px; color:var(--ink-dim); }

.cart-panel{ width:380px; flex-shrink:0; }
@media (max-width: 991.98px){ .cart-panel{ width:100%; } }

.txn-layout{ display:flex; gap:18px; align-items:flex-start; }
.txn-main{ flex:1.4; min-width:0; }
.txn-cart{
  width:340px; flex-shrink:0; background:var(--cream); border:1px solid var(--border); border-radius:12px;
  display:flex; flex-direction:column; overflow:hidden;
}
.txn-cart-header{
  display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--border);
  font-family:'Fraunces',serif; font-size:14px; font-weight:600; background:var(--white);
}
.txn-cart-items{ max-height:280px; overflow-y:auto; padding:8px; display:flex; flex-direction:column; gap:6px; }
.txn-cart-row{
  display:flex; align-items:center; gap:8px; background:var(--white); border:1px solid var(--border); border-radius:9px; padding:8px 10px;
}
.txn-cart-row .thumb{ width:34px; height:34px; border-radius:7px; background:var(--cream-deep); flex-shrink:0; overflow:hidden; display:flex; align-items:center; justify-content:center; color:var(--ink-dim); }
.txn-cart-row .thumb img{ width:100%; height:100%; object-fit:cover; }
.txn-cart-row .meta{ flex:1; min-width:0; }
.txn-cart-row .pname{ font-size:12px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.txn-cart-row .pdetail{ font-size:10.5px; color:var(--ink-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.txn-cart-empty{ padding:24px 10px; text-align:center; font-size:12.5px; color:var(--ink-dim); }
.txn-cart-footer{ padding:12px 14px; border-top:1px solid var(--border); background:var(--white); display:flex; flex-direction:column; gap:8px; }
@media (max-width: 767.98px){
  .txn-layout{ flex-direction:column; }
  .txn-cart{ width:100%; }
}
.label-size-opt{ padding:8px 14px; border-radius:8px; border:1px solid var(--border); font-size:12px; font-weight:600; color:var(--ink-dim); cursor:pointer; }
.label-size-opt.active{ border-color:var(--brown); background:var(--cream); color:var(--brown); font-weight:700; }

/* =====================================================================
   MODAL / TOAST (custom -- no framework dependency)
   ===================================================================== */
.modal{ position:fixed; inset:0; z-index:1055; display:none; align-items:center; justify-content:center; padding:20px; overflow-y:auto; }
#imageLightboxModal{ z-index:1075; }
.modal.show{ display:flex; }
.modal-backdrop{ position:fixed; inset:0; background:rgba(28,23,19,.55); z-index:1050; }
.modal-dialog{ position:relative; z-index:1056; width:100%; max-width:460px; margin:auto; }
.modal-dialog.modal-lg{ max-width:760px; }
.modal-dialog.modal-xl{ max-width:980px; }
.modal-content{ background:var(--white); border-radius:16px; box-shadow:0 30px 60px rgba(20,15,10,.28); overflow:hidden; }
.modal-header{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:18px 22px; border-bottom:1px solid var(--border); }
.modal-body{ padding:20px 22px; max-height:65vh; overflow-y:auto; display:flex; flex-direction:column; gap:14px; }
.modal-footer{ display:flex; align-items:center; justify-content:flex-end; gap:10px; padding:14px 22px; border-top:1px solid var(--border); background:var(--cream); }

.toast-container{ position:fixed; top:16px; right:16px; z-index:1080; display:flex; flex-direction:column; gap:8px; max-width:340px; }
.toast{
  background:var(--white); border:1px solid var(--border); border-radius:12px;
  box-shadow:0 12px 30px rgba(20,15,10,.18); opacity:0; transform:translateY(-10px);
  transition:opacity .2s ease, transform .2s ease; overflow:hidden;
}
.toast.show{ opacity:1; transform:translateY(0); }
.toast-body{ display:flex; align-items:center; gap:10px; padding:12px 14px; font-size:13px; color:var(--ink); }

.lightbox-nav-btn{
  position:absolute; top:50%; transform:translateY(-50%); width:40px; height:40px; border-radius:50%;
  background:rgba(0,0,0,.5); color:#fff; border:none; display:none; align-items:center; justify-content:center;
  cursor:pointer; z-index:3;
}
.lightbox-nav-btn:hover{ background:rgba(0,0,0,.75); }

.lightbox-img-wrap{
  position:relative; width:100%; max-height:75vh; aspect-ratio:4/3; overflow:hidden; border-radius:14px;
  background:#000; touch-action:none;
}
#lightboxImage{
  width:100%; height:100%; object-fit:contain; display:block; transform-origin:center center;
  transition:transform .12s ease-out; cursor:zoom-in; user-select:none;
}
#lightboxImage.zoomed{ cursor:grab; }
#lightboxImage.dragging{ cursor:grabbing; transition:none; }
.lightbox-zoom-controls{
  position:absolute; bottom:10px; left:50%; transform:translateX(-50%); z-index:3;
  display:flex; align-items:center; gap:4px; background:rgba(0,0,0,.6); padding:5px; border-radius:10px;
}
.lightbox-zoom-controls button{
  width:30px; height:30px; border-radius:7px; border:none; background:rgba(255,255,255,.1); color:#fff;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.lightbox-zoom-controls button:hover{ background:rgba(255,255,255,.22); }
.lightbox-zoom-label{
  min-width:46px; font-size:11px; font-weight:700; width:auto !important; padding:0 6px;
}

/* =====================================================================
   LOGIN
   ===================================================================== */
.login-screen{ display:flex; height:100vh; }
.login-visual{ width:44%; background:var(--sidebar-bg); position:relative; overflow:hidden; display:flex; flex-direction:column; justify-content:space-between; padding:52px; color:#fff; box-sizing:border-box; }
.login-visual .ring{ position:absolute; border-radius:50%; border:1px solid #3A2E22; }
.login-form-col{ flex:1; display:flex; align-items:center; justify-content:center; padding:24px; }
.mobile-login-brand{ display:flex; align-items:center; justify-content:center; gap:12px; margin-bottom:28px; }
@media (min-width: 768px){ .mobile-login-brand{ display:none; } }
@media (max-width: 767.98px){ .login-visual{ display:none; } }
