
  :root{
    --bg:#f5f6f8;
    --panel:#ffffff;
    --ink:#1c2430;
    --muted:#6b7280;
    --line:#e5e7eb;
    --soft:#f8fafc;
    --brand:#243447;
    --brand2:#34495e;
    --ok:#16794a;
    --warn:#9a6700;
    --danger:#a23a3a;
    --shadow:0 10px 30px rgba(28,36,48,.08);
    --radius:16px;
  }
  *{box-sizing:border-box}
  body{
    margin:0;
    font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:var(--bg);
    color:var(--ink);
  }
  .app{min-height:100vh; display:grid; grid-template-columns:280px 1fr}
  aside{
    background:#182333;
    color:#fff;
    padding:26px 22px;
    position:sticky;
    top:0;
    height:100vh;
  }
  .brand{display:flex; gap:12px; align-items:center; margin-bottom:28px}
  .logo{
    width:42px; height:42px; border-radius:12px; background:#fff; color:#182333;
    display:grid; place-items:center; font-weight:800; letter-spacing:.3px; font-size:11px
  }
  .brand h1{font-size:16px; margin:0}
  .brand p{margin:3px 0 0; font-size:12px; color:#b9c2ce}
  .demo-tag{
    border:1px solid rgba(255,255,255,.18); color:#dce4ec; padding:8px 10px; border-radius:10px;
    font-size:11px; text-transform:uppercase; letter-spacing:.12em; margin-bottom:24px
  }
  .brand-nav{display:flex; flex-direction:column; gap:10px}
  .brand-accordion{
    border:1px solid rgba(255,255,255,.10);
    border-radius:13px;
    overflow:hidden;
    background:rgba(255,255,255,.025);
  }
  .brand-toggle{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:12px;
    border:0;
    border-radius:0;
    background:transparent;
    color:#fff;
    cursor:pointer;
  }
  .brand-toggle:hover{background:rgba(255,255,255,.055)}
  .brand-toggle-left{display:flex;align-items:center;gap:10px;min-width:0}
  .brand-mark{
    width:30px;height:30px;border-radius:9px;
    display:grid;place-items:center;
    background:#fff;color:#182333;
    font-size:12px;font-weight:800;
    flex:0 0 auto;
  }
  .brand-copy{text-align:left;min-width:0}
  .brand-copy strong{display:block;font-size:13px;line-height:1.2}
  .brand-copy small{display:block;color:#91a0b1;font-size:10px;margin-top:3px}
  .brand-chevron{color:#aeb9c6;font-size:15px;transition:transform .2s ease}
  .brand-accordion.open .brand-chevron{transform:rotate(180deg)}
  .brand-menu{
    display:none;
    padding:4px 8px 9px;
    border-top:1px solid rgba(255,255,255,.07);
  }
  .brand-accordion.open .brand-menu{display:block}
  .brand-menu .steps{gap:5px}
  .brand-menu .step-item{padding:9px 8px}
  .unica-step{
    display:flex;gap:11px;align-items:center;
    padding:9px 8px;border-radius:10px;
    color:#7f8d9d;font-size:13px;
    cursor:not-allowed;
  }
  .unica-step .step-dot{
    background:rgba(255,255,255,.05);
    color:#7f8d9d;
  }
  .future-badge{
    display:inline-block;
    margin-left:auto;
    padding:3px 6px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:999px;
    color:#8291a2;
    font-size:8px;
    text-transform:uppercase;
    letter-spacing:.08em;
  }

  .steps{display:flex; flex-direction:column; gap:9px}
  .step-item{
    display:flex; gap:11px; align-items:center; padding:11px 10px; border-radius:11px;
    color:#aeb9c6; font-size:13px; cursor:pointer;
  }
  .step-item.active{background:rgba(255,255,255,.10); color:#fff}
  .step-item.done{color:#dfe8f1}
  .step-dot{
    width:26px; height:26px; border-radius:50%; display:grid; place-items:center;
    background:rgba(255,255,255,.08); font-size:12px; flex:0 0 auto;
  }
  .step-item.active .step-dot{background:#fff; color:#182333; font-weight:700}
  .step-item.done .step-dot{background:#2b7653; color:#fff}
  .aside-foot{position:absolute; bottom:24px; left:22px; right:22px; color:#93a1b1; font-size:11px; line-height:1.5}

  main{padding:28px 34px 50px}
  .topbar{display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:22px}
  .topbar h2{font-size:25px; margin:0 0 6px}
  .topbar p{margin:0; color:var(--muted); font-size:13px}
  .status-pill{
    background:#fff8db; color:#775b00; border:1px solid #f0df9e;
    padding:8px 12px; border-radius:999px; font-size:12px; white-space:nowrap
  }

  .layout{display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:22px}
  .card{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow)}
  .workspace{padding:26px}
  .summary-card{padding:20px; height:max-content; position:sticky; top:28px; color:var(--ink)}
  .summary-card h3{font-size:14px; margin:0 0 14px}
  .style-code{
    padding:18px; border-radius:14px; background:#182333; color:white; margin-bottom:17px
  }
  .style-code small{color:#b9c2ce; display:block; margin-bottom:5px}
  .style-code strong{font-size:27px; letter-spacing:.08em}
  .summary-row{padding:10px 0; border-bottom:1px solid var(--line)}
  .summary-row:last-child{border-bottom:0}
  .summary-row span{display:block; font-size:11px; color:var(--muted); margin-bottom:3px; text-transform:uppercase; letter-spacing:.06em}
  .summary-row b{
    display:block;
    min-height:18px;
    font-size:13px;
    font-weight:700;
    color:var(--ink);
    transition:background .25s ease, color .25s ease, padding .25s ease;
  }
  .summary-row b.pending{color:#a0a8b3; font-weight:500}
  .summary-row b.updated{
    background:#eef4f8;
    padding:4px 6px;
    border-radius:6px;
  }
  .hierarchy{
    margin-top:15px; padding:13px; border-radius:12px; background:var(--soft); font-size:12px; line-height:1.65
  }
  .hierarchy strong{display:block; margin-bottom:5px}
  .notice{
    margin-top:14px; background:#f3f8f5; color:#2c5e45; border:1px solid #d9e9df;
    padding:12px; border-radius:11px; font-size:11.5px; line-height:1.5
  }

  .step-panel{display:none}
  .step-panel.active{display:block}
  .section-title{margin-bottom:22px}
  .section-title .eyebrow{font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.12em; margin-bottom:6px}
  .section-title h3{margin:0 0 7px; font-size:20px}
  .section-title p{margin:0; color:var(--muted); font-size:13px; line-height:1.55}
  .grid2{display:grid; grid-template-columns:1fr 1fr; gap:16px}
  .grid3{display:grid; grid-template-columns:repeat(3,1fr); gap:16px}
  .field{margin-bottom:16px}
  label{display:block; font-size:12px; font-weight:650; margin-bottom:7px}
  .hint{font-weight:400; color:var(--muted)}
  input, select, textarea{
    width:100%; border:1px solid #d8dde4; border-radius:10px; padding:11px 12px;
    font:inherit; font-size:13px; color:var(--ink); background:#fff; outline:none;
  }
  input:focus, select:focus, textarea:focus{border-color:#8090a3; box-shadow:0 0 0 3px rgba(52,73,94,.08)}
  input[readonly]{background:#f6f8fa; color:#52606d}
  textarea{min-height:90px; resize:vertical}
  .inline-code{
    display:flex; align-items:stretch; border:1px solid #d8dde4; border-radius:11px; overflow:hidden;
    background:#fff
  }
  .inline-code span{padding:12px 14px; background:#eef2f6; font-weight:800; min-width:64px; text-align:center}
  .inline-code input{border:0; border-radius:0; box-shadow:none}
  .generated{
    margin-top:12px; display:flex; justify-content:space-between; gap:12px; align-items:center;
    padding:14px; border-radius:11px; background:#f7f9fb; border:1px solid var(--line)
  }
  .generated span{font-size:12px; color:var(--muted)}
  .generated b{font-size:18px; letter-spacing:.08em}
  .taxonomy-map{
    display:grid; grid-template-columns:repeat(5,1fr); gap:8px; margin-top:15px
  }
  .tax-chip{
    border:1px solid var(--line); border-radius:10px; padding:9px; background:#fbfcfd;
    font-size:11px; color:#536171
  }
  .tax-chip b{display:block; color:var(--ink); margin-bottom:3px}

  .subcard{border:1px solid var(--line); border-radius:13px; padding:16px; background:#fcfdfe; margin-bottom:16px}
  .subcard-head{display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:13px}
  .subcard-head h4{margin:0; font-size:14px}
  button{
    border:0; border-radius:10px; padding:11px 15px; font:inherit; font-size:13px; cursor:pointer
  }
  .btn-primary{background:#182333; color:#fff}
  .btn-secondary{background:#eef2f6; color:#263646}
  .btn-ghost{background:transparent; border:1px solid var(--line); color:#465463}
  .btn-danger{background:#fff2f2; color:#9d3030; padding:8px 10px}
  .color-row{display:grid; grid-template-columns:1fr 1.2fr auto; gap:10px; align-items:end; margin-bottom:10px}
  .swatch-wrap{display:flex; align-items:center; gap:8px}
  input[type="color"]{width:48px; height:42px; padding:3px}
  .sizes{display:flex; flex-wrap:wrap; gap:8px}
  .size-chip input{display:none}
  .size-chip label{
    margin:0; min-width:48px; text-align:center; padding:9px 11px; border:1px solid #d8dde4;
    border-radius:9px; cursor:pointer; background:white; font-weight:600
  }
  .size-chip input:checked + label{background:#182333; color:white; border-color:#182333}

  .variant-table{width:100%; border-collapse:collapse; margin-top:15px; font-size:12px}
  .variant-table th,.variant-table td{padding:10px 9px; border-bottom:1px solid var(--line); text-align:left}
  .variant-table th{color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.06em; background:#fafbfc}
  .variant-table td code{font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:11px}
  .badge{display:inline-block; padding:4px 7px; border-radius:999px; background:#eef4ff; color:#335c9b; font-size:10px}

  .review-section{margin-bottom:20px}
  .review-section h4{font-size:13px; margin:0 0 10px}
  .review-grid{display:grid; grid-template-columns:1fr 1fr; border:1px solid var(--line); border-radius:12px; overflow:hidden}
  .review-cell{padding:12px 14px; border-bottom:1px solid var(--line)}
  .review-cell:nth-child(odd){border-right:1px solid var(--line)}
  .review-cell span{display:block; color:var(--muted); font-size:10px; text-transform:uppercase; margin-bottom:4px}
  .review-cell b{font-size:12.5px}
  .approval-box{
    border:1px dashed #9ba8b6; background:#f8fafc; padding:16px; border-radius:12px;
    display:flex; align-items:flex-start; gap:10px; font-size:12px; line-height:1.5
  }
  .approval-box input{width:auto; margin-top:3px}

  .actions{
    display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:24px;
    padding-top:18px; border-top:1px solid var(--line)
  }
  .action-right{display:flex; gap:10px}
  .created{
    text-align:center; padding:38px 18px
  }
  .created-icon{
    width:64px; height:64px; border-radius:50%; display:grid; place-items:center;
    background:#e9f6ef; color:var(--ok); font-size:28px; margin:0 auto 16px
  }
  .created h3{font-size:22px; margin:0 0 8px}
  .created p{color:var(--muted); max-width:480px; margin:0 auto 20px; font-size:13px; line-height:1.6}
  .created-code{font-size:26px; letter-spacing:.1em; font-weight:800; margin-bottom:22px}
  .footer-note{font-size:11px; color:var(--muted); margin-top:16px}

  @media(max-width:1050px){
    .app{grid-template-columns:220px 1fr}
    .layout{grid-template-columns:1fr}
    .summary-card{position:static}
    .taxonomy-map{grid-template-columns:repeat(3,1fr)}
  }
  @media(max-width:760px){
    .app{display:block}
    aside{height:auto; position:static}
    .aside-foot{display:none}
    .brand-nav{gap:8px}
    .brand-menu .steps{display:flex; flex-direction:column}
    .brand-menu .step-item{padding:8px; justify-content:flex-start}
    .brand-menu .step-item span:last-child{display:inline}
    .unica-step{padding:8px}
    .future-badge{display:none}
    main{padding:20px 14px 35px}
    .grid2,.grid3,.review-grid{grid-template-columns:1fr}
    .review-cell:nth-child(odd){border-right:0}
    .layout{display:block}
    .summary-card{margin-top:18px}
    .color-row{grid-template-columns:1fr}
    .taxonomy-map{grid-template-columns:repeat(2,1fr)}
  }

/* Shared application foundation: preserve the supplied visual direction. */
:root { --sidebar:#182333; --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:20px; --space-6:24px; --space-8:32px; }
main { min-width:0; }
.app > aside { display:flex; flex-direction:column; overflow-y:auto; background:var(--sidebar); }
.aside-foot { position:static; margin-top:auto; padding-top:28px; }
.nav-label { color:#b9c2ce; text-transform:uppercase; letter-spacing:.1em; font-size:10px; }
.brand-select { font-weight:700; margin-bottom:24px; }
.module-nav { display:grid; gap:6px; }
.module-link { display:flex; justify-content:space-between; text-align:left; background:transparent; color:#dce4ec; }
.module-link span { font-size:10px; opacity:.7; }
.module-link.selected { background:rgba(255,255,255,.1); color:white; }
.module-link:disabled { color:#93a1b1; cursor:default; }
.foundation-note { color:var(--muted); font-size:12px; margin-bottom:18px; line-height:1.6; }
.workflow { display:flex; gap:8px; margin-bottom:20px; overflow-x:auto; }
.workflow .step-item { color:var(--muted); white-space:nowrap; background:transparent; }
.workflow .step-item.active { background:var(--sidebar); color:white; }
.workflow .step-item.done { color:var(--ok); }
.workflow .step-dot { background:#e5e7eb; color:var(--ink); }
.workflow .step-item.done .step-dot { background:var(--ok); color:white; }
.feedback { padding:14px 16px; background:#fff8db; border:1px solid #f0df9e; border-radius:10px; margin-bottom:18px; font-size:13px; }
button:focus-visible, select:focus-visible, a:focus-visible { outline:3px solid #8090a3; outline-offset:3px; }
button:disabled { cursor:default; }
.actions, .action-right { flex-wrap:wrap; }
.summary-card { overflow-wrap:anywhere; }
@media(max-width:760px) { .app > aside { padding:20px; } .app > aside .brand { margin-bottom:16px; } .module-nav { display:flex; overflow-x:auto; } .module-link { white-space:nowrap; gap:14px; } .brand-select { margin-bottom:16px; } .workspace { padding:18px; } .topbar { flex-wrap:wrap; } .workflow .step-item { padding:9px; } }
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { transition:none !important; scroll-behavior:auto !important; } }

.color-swatch { display:block; width:36px; height:36px; flex:0 0 36px; border:1px solid #aeb9c6; border-radius:8px; }
.swatch-wrap select { min-width:0; }

.reservation-status { display:inline-block; padding:7px 12px; border-radius:999px; background:#fff8db; color:#775b00; font-size:12px; margin-bottom:16px; }
.reservation-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; padding:18px; margin:0 auto 24px; max-width:620px; border:1px solid var(--line); border-radius:12px; background:var(--soft); }
.reservation-summary dt { color:var(--muted); font-size:11px; margin-bottom:6px; }
.reservation-summary dd { margin:0; font-size:14px; font-weight:700; overflow-wrap:anywhere; }
@media(max-width:760px) { .reservation-summary { grid-template-columns:1fr; } }

.srp-panel { padding:24px; margin-bottom:24px; background:#f3f8f5; border:2px solid #2b7653; border-radius:16px; }
.srp-panel label { font-size:16px; }
.srp-panel p { font-size:13px; line-height:1.5; color:var(--muted); }
.srp-input { display:flex; align-items:center; gap:12px; font-size:30px; }
.srp-input input { min-width:0; font-size:28px; font-weight:700; }
.srp-amount { font-size:36px; font-weight:800; margin-top:24px; overflow-wrap:anywhere; }
.srp-panel .srp-error { color:var(--danger); font-weight:600; }

.receipt-guidance{margin:0 0 28px;padding:14px 16px;border:1px solid #d9e9df;border-radius:11px;background:#f3f8f5;color:#2c5e45;font-size:12px;line-height:1.55}
.receipt-lines-title{padding-top:2px}
.receipt-table-wrap{overflow:auto;border:1px solid var(--line);border-radius:12px}
.receipt-table{margin:0;min-width:850px}
.receipt-table tfoot{background:#f3f8f5}.receipt-table tfoot th{color:var(--ink);font-size:12px;text-transform:none;letter-spacing:0}
.receipt-table input{min-width:78px;padding:8px;font-size:12px}.receipt-table .line-cost{font-weight:700;white-space:nowrap}
.receipt-bottom-grid{margin-top:20px;align-items:start}.receipt-bottom-grid textarea{min-height:144px}
.commit-panel{padding:18px;border:1px solid #d9e9df;border-radius:13px;background:#f8fcf9}.commit-panel h4{margin:10px 0 7px;font-size:16px}.commit-panel p{margin:0 0 14px;color:var(--muted);font-size:12px;line-height:1.55}.check-label{display:flex;gap:9px;align-items:flex-start;font-weight:500;line-height:1.4}.check-label input{width:auto;margin-top:2px}.commit-panel .btn-primary{margin-top:16px;width:100%}


/* Goods Receiving actions: use native disabled state without changing workflow logic. */
#goodsReceiptView .btn-primary,
#goodsReceiptView .btn-secondary {
  border:2px solid #182333;
  font-weight:600;
  transition:background-color .15s, border-color .15s;
}
#goodsReceiptView .btn-primary { background:#182333; color:#fff; }
#goodsReceiptView .btn-secondary { background:#fff; color:#182333; }
#goodsReceiptView .btn-primary:hover:not(:disabled) { background:#34495e; border-color:#34495e; }
#goodsReceiptView .btn-secondary:hover:not(:disabled) { background:#e1eaf3; }
#goodsReceiptView button:focus-visible {
  outline:3px solid #356da5;
  outline-offset:3px;
}
#goodsReceiptView button:disabled {
  background:#e2e6eb;
  color:#626d7a;
  border:2px solid #a4aeba;
  cursor:not-allowed;
  box-shadow:none;
  opacity:1;
}
#goodsReceiptView .commit-panel button { width:100%; margin-top:12px; }

/* ==========================================================
   BRANCH INVENTORY
   ========================================================== */

.inventory-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 20px;
}

.inventory-metric {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 14px 16px;
}

.inventory-metric small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
}

.inventory-metric strong {
  display: block;
  font-size: 21px;
  color: var(--navy);
}

.inventory-table td {
  vertical-align: top;
}

.inventory-table {
  min-width: 1180px;
}

.inventory-table td:nth-child(7),
.inventory-table td:nth-child(8),
.inventory-table td:nth-child(9),
.inventory-table td:nth-child(10) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.inventory-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

#inventoryPageLabel {
  min-width: 130px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .inventory-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .inventory-metrics {
    grid-template-columns: 1fr;
  }
}
/* Receiving variant selection and quantity entry. */
#goodsReceiptView .receipt-table { min-width:1550px; }
#goodsReceiptView .receipt-style { min-width:190px; white-space:nowrap; }
#goodsReceiptView .receipt-barcode { min-width:140px; white-space:nowrap; }
#goodsReceiptView .receipt-style code,
#goodsReceiptView .receipt-barcode code { font-weight:800; color:#182333; }
#goodsReceiptView .receipt-description { min-width:320px; width:380px; white-space:normal; overflow-wrap:anywhere; line-height:1.5; color:var(--ink); }
#goodsReceiptView .receipt-variant-detail { font-weight:700; color:#182333; }
#goodsReceiptView .receipt-table select { min-width:180px; }
#goodsReceiptView .receipt-table output { display:block; padding:8px; font-weight:700; background:#eef2f6; border-radius:6px; }


/* Goods Receiving simplified review + GR Lookup */
.receipt-module-actions{display:flex;justify-content:flex-end;margin:-8px 0 18px}
.receipt-lookup-panel{margin-bottom:20px;padding:22px}
.receipt-lookup-search{display:grid;grid-template-columns:minmax(280px,1fr) auto auto;gap:10px;margin-bottom:16px}
.receipt-history-table{min-width:1180px}
.receipt-history-table .receipt-history-number{font-weight:800;color:#182333;white-space:nowrap}
.receipt-history-status{display:inline-block;padding:5px 8px;border:1px solid var(--line);border-radius:999px;background:#f7f9fb;font-weight:700;white-space:nowrap}
.receipt-lookup-detail{margin-top:18px;padding:18px;border:1px solid var(--line);border-radius:12px;background:#fcfdfe}
.receipt-detail-head{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:16px}
.receipt-detail-cell{padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:white}
.receipt-detail-cell small{display:block;color:var(--muted);margin-bottom:4px}
.receipt-detail-cell strong{overflow-wrap:anywhere}
.receipt-modal-backdrop{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:24px;background:rgba(10,18,29,.62)}
.receipt-modal-backdrop[hidden]{display:none}
.receipt-review-modal{width:min(1480px,96vw);max-height:90vh;overflow:auto;padding:24px;border-radius:16px;background:white;box-shadow:0 24px 70px rgba(0,0,0,.28)}
.receipt-review-table{min-width:1500px}
.receipt-review-table td:first-child,.receipt-review-table td:nth-child(2),.receipt-review-table td:nth-child(3){font-weight:800;color:#182333}
.receipt-review-table td:nth-child(4){min-width:300px}
.receipt-modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
@media(max-width:900px){.receipt-lookup-search{grid-template-columns:1fr}.receipt-detail-head{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.receipt-detail-head{grid-template-columns:1fr}}

/* ============================================================
   MASTER LIST
   Product identity/detail truth only. Quantity belongs to
   inventory balances by location + variant.
   ============================================================ */

#masterListView .master-list-card {
  padding: 18px;
}

#masterListView .master-list-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

#masterListView .master-list-search-field {
  flex: 1 1 520px;
  margin: 0;
}

#masterListView .master-list-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#masterListView .btn-primary,
#masterListView .btn-secondary {
  min-height: 42px;
  border: 2px solid #182333;
  font-weight: 600;
}

#masterListView .btn-primary {
  background: #182333;
  color: #fff;
}

#masterListView .btn-secondary {
  background: #fff;
  color: #182333;
}

#masterListView .master-list-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

#masterListView .master-list-summary strong {
  color: var(--text);
}

#masterListView .master-list-table-wrap {
  max-height: calc(100vh - 310px);
  overflow: auto;
}

#masterListView .master-list-table {
  min-width: 1500px;
}

#masterListView .master-list-table td,
#masterListView .master-list-table th {
  vertical-align: top;
}

#masterListView .master-list-description {
  min-width: 260px;
  max-width: 360px;
  white-space: normal;
}

#masterListView .master-list-origin {
  white-space: nowrap;
}

@media (max-width: 900px) {
  #masterListView .master-list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #masterListView .master-list-actions {
    width: 100%;
  }

  #masterListView .master-list-actions button {
    flex: 1 1 140px;
  }

  #masterListView .master-list-summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

#masterListView .master-list-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

#masterListView .master-list-pagination strong {
  min-width: 90px;
  text-align: center;
  color: var(--text);
}

#masterListView .master-list-pagination button:disabled {
  background: #e2e6eb;
  color: #626d7a;
  border: 2px solid #a4aeba;
  cursor: not-allowed;
  opacity: 1;
}

/* STYLES MANAGEMENT */
.styles-management-tabs{display:flex;gap:8px;margin:14px 0}
.styles-mode-tab{min-width:120px;border:2px solid #182333;border-radius:8px;background:#fff;color:#182333;padding:10px 16px;font-weight:700;cursor:pointer}
.styles-mode-tab.active{background:#182333;color:#fff}
.styles-edit-card{padding:18px;margin-bottom:16px}
.styles-edit-search-row{display:flex;gap:10px;align-items:center}
.styles-edit-search-row input{flex:1 1 auto}
.styles-edit-origin-banner{display:flex;gap:12px;align-items:center;padding:13px 16px;border-radius:8px;margin-bottom:16px;border:1px solid #b9c1ca;background:#f5f7f9}
.styles-edit-origin-banner strong{white-space:nowrap}
.styles-edit-origin-banner.legacy{border-left:5px solid #9b6c18}
.styles-edit-origin-banner.native{border-left:5px solid #182333}
.styles-identity-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.styles-identity-grid>div{border:1px solid #d8dde3;border-radius:7px;padding:10px 12px;background:#fafbfc}
.styles-identity-grid small{display:block;color:var(--muted);margin-bottom:4px}
.styles-identity-grid strong{display:block}
.styles-edit-actions{display:flex;justify-content:flex-end;margin-top:12px}
.styles-add-variant{margin-top:16px;padding-top:16px;border-top:1px solid #d8dde3}
.styles-edit-history{display:grid;gap:8px}
.styles-history-row{display:grid;grid-template-columns:150px minmax(0,1fr);gap:4px 12px;border-bottom:1px solid #e3e7eb;padding:8px 0}
.styles-history-row small{grid-column:1/-1;color:var(--muted)}
.styles-history-empty{color:var(--muted);padding:8px 0}
#editStylePanel .btn-primary,#editStylePanel .btn-secondary{border:2px solid #182333;font-weight:600}
#editStylePanel .btn-primary{background:#182333;color:#fff}
#editStylePanel .btn-secondary{background:#fff;color:#182333}
#editStylePanel button:disabled,#editStylePanel select:disabled,#editStylePanel input:disabled{cursor:not-allowed}
@media (max-width:900px){.styles-identity-grid{grid-template-columns:1fr}.styles-edit-search-row{align-items:stretch;flex-direction:column}}

/* ============================================================
   STYLES MANAGEMENT — CONTROLLED EDIT + REVIEW
   ============================================================ */

#editStylePanel .field select {
  width: 100%;
}

.styles-variant-description {
  min-width: 220px;
  max-width: 340px;
  white-space: normal;
  line-height: 1.4;
}

.styles-review-modal {
  width: min(920px, calc(100vw - 40px));
}

.styles-review-table th:first-child,
.styles-review-table td:first-child {
  width: 180px;
}

.styles-review-table td {
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

.styles-review-reason {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #d8dde3;
  border-radius: 7px;
  background: #fafbfc;
}

.styles-review-reason small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
}

.styles-review-reason strong {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}

#styleReviewModal .approval-box {
  margin-top: 14px;
}

#styleReviewModal .receipt-modal-actions {
  margin-top: 16px;
}

/* ============================================================
   TRANSFERS
   ============================================================ */

#transferView .transfer-card{padding:18px;margin-bottom:16px}
#transferView .btn-primary,#transferView .btn-secondary{border:2px solid #182333;font-weight:600}
#transferView .btn-primary{background:#182333;color:#fff}
#transferView .btn-secondary{background:#fff;color:#182333}
#transferView button:disabled{background:#e2e6eb;color:#626d7a;border-color:#a4aeba;cursor:not-allowed;opacity:1}
.transfer-tabs{flex-wrap:wrap}
.transfer-integration-banner{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:11px 14px;margin-bottom:14px;border:1px solid #c9d0d8;border-left:5px solid #182333;border-radius:8px;background:#f8fafc;font-size:12px}
.transfer-integration-banner span{color:var(--muted);text-align:right}
.transfer-draft-identity{display:flex;align-items:center;gap:12px;padding:11px 14px;margin-bottom:16px;border:1px solid #c9d0d8;border-radius:8px;background:#fafbfc}
.transfer-draft-identity small{color:var(--muted)}
.transfer-draft-identity strong{font-size:16px}
.transfer-draft-identity span{margin-left:auto;font-size:11px;font-weight:700}
.transfer-search-card{margin-top:8px}
.transfer-search-row{display:flex;gap:10px;align-items:center}
.transfer-search-row input{flex:1 1 auto}
.transfer-search-results-wrap{max-height:300px;overflow:auto}
.transfer-lines-heading{margin-top:22px}
.transfer-lines-table,.transfer-incoming-table,.transfer-queue-table{min-width:1120px}
.transfer-qty-input,.transfer-incoming-qty{width:92px;min-width:92px}
.transfer-action-bar{display:flex;justify-content:space-between;gap:14px;align-items:center;margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.transfer-action-bar small{color:var(--muted)}
.transfer-action-buttons{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.transfer-status-badge{display:inline-block;padding:4px 8px;border-radius:999px;border:1px solid #bcc5cf;background:#f5f7f9;color:#273444;font-size:10px;font-weight:700;white-space:nowrap}
.transfer-status-badge.status-in-transit,.transfer-status-badge.status-partially-received{border-left:4px solid #9b6c18}
.transfer-status-badge.status-received{border-left:4px solid #28704a}
.transfer-pfi-cell{max-width:220px;white-space:normal;line-height:1.35;color:var(--muted)}
.transfer-incoming-workspace{scroll-margin-top:20px}
.transfer-detail-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:12px 0 18px}
.transfer-detail-metrics>div{padding:11px 12px;border:1px solid #d8dde3;border-radius:7px;background:#fafbfc}
.transfer-detail-metrics small{display:block;color:var(--muted);margin-bottom:4px}
.transfer-detail-metrics strong{display:block;overflow-wrap:anywhere}
.transfer-incoming-tools{display:flex;justify-content:flex-end;gap:8px;margin-bottom:10px}
.transfer-review-modal{width:min(980px,calc(100vw - 40px))}
.transfer-review-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:14px}
.transfer-review-meta>div{padding:10px 12px;border:1px solid #d8dde3;border-radius:7px;background:#fafbfc}
.transfer-review-meta small{display:block;color:var(--muted);margin-bottom:4px}
.transfer-review-meta strong{display:block}
.transfer-review-approval{margin-top:16px}
.transfer-history-detail{margin-top:20px;padding-top:18px;border-top:1px solid var(--line)}
.transfer-history-audit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:18px}
.transfer-history-audit-grid h4{margin:0 0 10px}
.transfer-audit-row{display:grid;gap:3px;padding:9px 0;border-bottom:1px solid #e3e7eb}
.transfer-audit-row span,.transfer-muted{color:var(--muted);font-size:12px}

@media(max-width:900px){
  .transfer-integration-banner,.transfer-action-bar{align-items:stretch;flex-direction:column}
  .transfer-integration-banner span{text-align:left}
  .transfer-action-buttons{justify-content:stretch}
  .transfer-action-buttons button{flex:1 1 160px}
  .transfer-detail-metrics,.transfer-review-meta,.transfer-history-audit-grid{grid-template-columns:1fr}
  .transfer-search-row{align-items:stretch;flex-direction:column}
}


/* NONMERCH_FINAL_CONFIRMATION_V1 */
.nonmerch-confirmation-summary{
  margin:18px 0 24px;
  padding:18px;
  border:1px solid #d9e0e8;
  border-radius:12px;
  background:#fbfcfe;
}
.nonmerch-confirmation-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin-bottom:18px;
}
.nonmerch-confirmation-grid > div{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}
.nonmerch-confirmation-grid small{
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.nonmerch-confirmation-grid strong{
  overflow-wrap:anywhere;
}
.nonmerch-confirmation-description{
  grid-column:span 2;
}
.nonmerch-confirmation-heading{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
}
.nonmerch-confirmation-heading span{
  font-size:12px;
}
@media (max-width:760px){
  .nonmerch-confirmation-grid{
    grid-template-columns:1fr;
  }
  .nonmerch-confirmation-description{
    grid-column:auto;
  }
}


/* NONMERCH_UI_HIDDEN_FIX_V1 */
/* Style Creation uses hidden when switching Merchandise vs GWP/Packaging. */
#masterfileView [hidden]{
  display:none !important;
}


/* STYLE_CATEGORY_SEQUENCE_ALIGNMENT_V1 */
#masterfileView .nonmerch-category-only{
  grid-template-columns:1fr;
}


/* GOODS_RECEIVING_STYLE_ID_COLUMNS_V2 */
#goodsReceiptView .receipt-table{
  min-width:1780px;
}
#goodsReceiptView .receipt-legacy-style{
  min-width:150px;
  white-space:nowrap;
}
#goodsReceiptView .receipt-native-style{
  min-width:185px;
  white-space:nowrap;
}

/* ==========================================================
   AUTHENTICATION GATE
   ========================================================== */
[hidden]{display:none !important}

body.auth-loading,
body.auth-login{
  min-height:100vh;
  background:#eef1f5;
}

.auth-shell{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:32px 20px;
  background:
    radial-gradient(circle at top left, rgba(36,52,71,.10), transparent 34%),
    linear-gradient(135deg,#f7f8fa 0%,#edf1f5 100%);
}

.auth-card{
  width:min(100%,440px);
  background:#fff;
  border:1px solid #dfe4ea;
  border-radius:20px;
  box-shadow:0 24px 70px rgba(28,36,48,.13);
  padding:32px;
}

.auth-brand{
  display:flex;
  align-items:center;
  gap:13px;
  padding-bottom:24px;
  border-bottom:1px solid var(--line);
}

.auth-logo{
  width:48px;
  height:48px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:#182333;
  color:#fff;
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
}

.auth-brand h1{margin:0;font-size:17px;letter-spacing:.02em}
.auth-brand p{margin:4px 0 0;color:var(--muted);font-size:12px}
.auth-copy{padding:28px 0 22px}
.auth-kicker{display:block;margin-bottom:8px;color:var(--brand2);font-size:10px;font-weight:800;letter-spacing:.14em;text-transform:uppercase}
.auth-copy h2{margin:0 0 8px;font-size:25px}
.auth-copy p{margin:0;color:var(--muted);font-size:13px;line-height:1.65}

.auth-google-button{
  width:100%;
  min-height:48px;
  border:1px solid #cfd6df;
  border-radius:11px;
  background:#fff;
  color:var(--ink);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font:inherit;
  font-size:13px;
  font-weight:750;
  cursor:pointer;
  box-shadow:0 2px 4px rgba(28,36,48,.04);
}
.auth-google-button:hover:not(:disabled){background:#f8fafc;border-color:#aeb8c4}
.auth-google-button:disabled{opacity:.58;cursor:wait}

.auth-google-mark{
  width:25px;
  height:25px;
  border:1px solid #d8dde4;
  border-radius:50%;
  display:grid;
  place-items:center;
  font-weight:800;
  font-size:12px;
  background:#fff;
}

.auth-message{
  margin:16px 0 0;
  border-radius:10px;
  padding:10px 12px;
  background:#f4f6f8;
  color:#44505e;
  font-size:12px;
  line-height:1.5;
}
.auth-message[data-kind="error"]{background:#fff1f1;border:1px solid #f0cccc;color:#8d3030}

.auth-security-note{
  margin:18px 0 0;
  padding-top:16px;
  border-top:1px solid var(--line);
  color:#7b8490;
  font-size:10.5px;
  line-height:1.55;
}

.auth-user-panel{
  position:absolute;
  left:22px;
  right:22px;
  bottom:58px;
  padding:11px;
  border:1px solid rgba(255,255,255,.13);
  border-radius:11px;
  background:rgba(255,255,255,.045);
}
.auth-user-copy{min-width:0;margin-bottom:9px}
.auth-user-copy strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#fff;font-size:11px;font-weight:700}
.auth-user-copy span{display:block;margin-top:3px;color:#94a5b7;font-size:9px;font-weight:700;letter-spacing:.08em}

.auth-logout-button{
  width:100%;
  border:1px solid rgba(255,255,255,.17);
  border-radius:8px;
  background:transparent;
  color:#d8e0e8;
  padding:7px 8px;
  font:inherit;
  font-size:10px;
  cursor:pointer;
}
.auth-logout-button:hover{background:rgba(255,255,255,.07)}
.auth-user-panel + .aside-foot{bottom:24px}

@media (max-width:640px){.auth-card{padding:24px}}

