/* Build 124: modern look for the rebar calculator page only (loaded by rebar-calculator.html and nothing else).
   Appearance only: same colours (orange / navy / warm grey), no changes to behaviour, markup or other pages.
   The left navigation and the PDF takeoff window keep their own styles. */

:root{
  --bqm-line:#e3e0d8; --bqm-line-soft:#efede7; --bqm-ink2:#3a3d44; --bqm-muted:#6f737d;
  --bqm-ring:0 0 0 3px rgba(255,90,31,.20);
  --bqm-lift:0 6px 18px rgba(20,22,26,.09), 0 2px 4px rgba(20,22,26,.04);
  --bqm-chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23666b76' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------- page heading ---------- */
.wrap{ max-width:1500px; padding-top:40px; }
.page-head h1{ font-size:2.15rem; font-weight:700; letter-spacing:-.02em; line-height:1.15; margin-bottom:10px; }
.page-head h1::after{ content:''; display:block; width:52px; height:4px; border-radius:4px; background:var(--primary); margin-top:12px; }
.page-head p{ max-width:72ch; font-size:1.02rem; line-height:1.65; margin-bottom:28px; }

/* ---------- panels ---------- */
.wrap .panel{ border-radius:18px; padding:26px 28px; border-color:var(--bqm-line); box-shadow:0 1px 2px rgba(20,22,26,.04), 0 4px 14px rgba(20,22,26,.04); margin-bottom:22px; }
.wrap .panel > h2, .wrap .panel > div > h2{ display:flex; align-items:center; gap:10px; font-size:1.08rem; font-weight:700; letter-spacing:-.01em; margin-bottom:18px; }
.wrap .panel > h2::before, .wrap .panel > div > h2::before{ content:''; flex:0 0 auto; width:4px; height:18px; border-radius:4px; background:var(--primary); }
.note{ color:#7a7e88; line-height:1.6; }
.wrap .panel .note{ max-width:90ch; }

/* ---------- form controls ---------- */
.settings-row{ gap:18px 22px; }
.settings-field label{ font-size:.74rem; font-weight:600; letter-spacing:.02em; color:var(--bqm-muted); text-transform:uppercase; margin-bottom:7px; }
.settings-field input, .settings-field select, .cell-input, .cell-select, #quickEntryInput, .wrap .cost-grid input, .wrap .cost-grid select{
  border-color:var(--bqm-line); transition:border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.settings-field input, .settings-field select{ height:42px; border-radius:10px; background-color:#fff; }
.settings-field select, .cell-select, .wrap .cost-grid select{
  appearance:none; -webkit-appearance:none; background-image:var(--bqm-chev); background-repeat:no-repeat; background-position:right 10px center; background-size:11px; padding-right:28px;
}
.cell-select{ background-position:right 6px center; background-size:10px; padding-right:20px; }
.settings-field input:hover, .settings-field select:hover, .cell-input:hover:not(:disabled), .cell-select:hover{ border-color:#cfcbc1; }
.settings-field input:focus, .settings-field select:focus, .cell-input:focus, .cell-select:focus, #quickEntryInput:focus,
.wrap .cost-grid input:focus, .wrap .cost-grid select:focus{ outline:none; border-color:var(--primary); box-shadow:var(--bqm-ring); background-color:#fff; }
.wrap button:focus-visible, .wrap a:focus-visible, .wrap summary:focus-visible, .wrap [tabindex]:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; border-radius:8px; }

.toggle-row{ background:#eceae4; padding:4px; border-radius:12px; box-shadow:inset 0 1px 2px rgba(20,22,26,.06); }
.toggle-btn{ padding:9px 18px; border-radius:9px; transition:background-color .15s ease, color .15s ease, box-shadow .15s ease; }
.toggle-btn.active{ box-shadow:0 2px 6px rgba(22,28,45,.28); }

/* ---------- the schedule table ---------- */
.table-scroll{ border:1px solid var(--bqm-line); border-radius:14px; background:#fff; }
.wrap table{ font-size:.78rem; }
.wrap th{ background:#faf9f6; color:#5f636d; font-size:.64rem; font-weight:700; letter-spacing:.04em; padding:11px 6px; border-bottom:1px solid var(--bqm-line); border-right:1px solid var(--bqm-line-soft); }
.wrap th:last-child{ border-right:none; }
.wrap td{ padding:6px 6px; border-bottom:1px solid var(--bqm-line-soft); border-right:1px solid var(--bqm-line-soft); }
.wrap td:last-child{ border-right:none; }
.wrap .th-unit{ color:#8b8f98; }
#bbsBody tr{ transition:background-color .12s ease; }
#bbsBody tr:hover td{ background:#fffaf6; }
#bbsBody tr:focus-within td{ background:#fff7f1; }
.cell-input{ height:32px; padding:4px 7px; border-radius:8px; background:#fff; font-size:.74rem; }
.cell-input:disabled{ background:#f5f3ee; border-color:var(--bqm-line-soft); color:#bdb9ae; }
.cell-select{ height:32px; border-radius:8px; background-color:#fff; font-size:.72rem; }
.dim-input{ width:76px; }
.shape-select{ max-width:172px; }
#bbsBody td:first-child{ box-shadow:1px 0 0 var(--bqm-line-soft); }

/* results: never break a figure in the middle (this is what squeezed the Cut Length column) */
#bbsTable td.computed{ word-break:normal; overflow-wrap:normal; font-size:.76rem; }
#bbsTable td.totallen-out, #bbsTable td.wtunit-out, #bbsTable td.totalwt-out, #bbsTable td.stockwt-out{ white-space:nowrap; }
#bbsTable td.cutlen-out{ min-width:76px; font-weight:700; background:rgba(255,90,31,.045); }
#bbsTable td.totalwt-out{ min-width:74px; }
#bbsTable td.stockqty-out, #bbsTable td.stocklen-out{ min-width:150px; font-size:.7rem; line-height:1.45; }
#bbsTable td:last-child{ min-width:96px; text-align:center; }
#bbsTable tfoot td{ border-top:2px solid var(--navy); }
.dup-row-btn, .del-row-btn, .save-row-btn, .template-row-btn{ border-radius:8px; padding:3px 6px; }
.bqw-inspect{
  display:block; margin:5px auto 0; padding:3px 10px; white-space:nowrap; font:600 .66rem/1.5 'Inter',system-ui,sans-serif;
  color:var(--bqm-muted); background:#fff; border:1px solid var(--bqm-line); border-radius:999px; cursor:pointer; transition:all .15s ease;
}
.bqw-inspect:hover{ color:var(--primary-dark); border-color:var(--primary); background:var(--accent-soft); }

/* ---------- buttons ---------- */
.add-row-btn, .clear-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:40px; margin:14px 8px 0 0; padding:9px 16px;
  border-radius:11px; font-size:.86rem; line-height:1.2; vertical-align:top;
}
.add-row-btn{ font-weight:700; letter-spacing:.005em; box-shadow:0 2px 8px rgba(255,90,31,.32); }
.add-row-btn:hover{ box-shadow:0 6px 16px rgba(255,90,31,.38); }
.clear-btn{ color:var(--bqm-ink2); background:#fff; border-color:var(--bqm-line); font-weight:600; box-shadow:0 1px 2px rgba(20,22,26,.04); }
.clear-btn:hover{ color:var(--primary-dark); border-color:var(--primary); background:var(--accent-soft); transform:translateY(-1px); box-shadow:var(--bqm-lift); }
.clear-btn.takeoff-open-btn{ box-shadow:0 2px 8px rgba(22,28,45,.25); }
.clear-btn.takeoff-open-btn:hover{ background:#232b43 !important; border-color:#232b43 !important; color:#fff !important; }
.wrap .panel .clear-btn[onclick*="clearAllRows"]{ color:#b3261e; border-color:#f0c4bd; background:#fff; }
.wrap .panel .clear-btn[onclick*="clearAllRows"]:hover{ background:#fdecea; border-color:#e8a79d; color:#a5301f; }
.paid-locked, .paid-locked:hover{ opacity:.6; }
.wrap button:disabled{ cursor:default; }

/* the Rebar Operations button is added by script with no class: give it the same look as the other action buttons */
.wrap .panel > button:not([class]):not([id]){
  display:inline-flex; align-items:center; gap:6px; min-height:40px; margin:14px 8px 0 0; padding:9px 16px; border:1px solid var(--bqm-line); border-radius:11px;
  background:#fff; color:var(--bqm-ink2); font:600 .86rem/1.2 'Inter',system-ui,sans-serif; cursor:pointer; box-shadow:0 1px 2px rgba(20,22,26,.04); transition:all .15s ease;
}
.wrap .panel > button:not([class]):not([id])::before{ content:'\2699'; color:var(--primary); font-size:1rem; }
.wrap .panel > button:not([class]):not([id]):hover{ color:var(--primary-dark); border-color:var(--primary); background:var(--accent-soft); transform:translateY(-1px); box-shadow:var(--bqm-lift); }

/* ---------- start card, messages, legend ---------- */
#startCard{ border-radius:16px; border:1px dashed #f2c3ad; padding:24px; }
.start-tiles{ gap:14px; }
.start-tile{ padding:16px 18px; border-radius:14px; border-color:var(--bqm-line); transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.start-tile:hover{ transform:translateY(-2px); box-shadow:var(--bqm-lift); }
#sanityPanel{ border-radius:14px; }
.legend-card{ border-radius:14px; border-color:var(--bqm-line); transition:box-shadow .15s ease, border-color .15s ease; }
.legend-card:hover{ border-color:#f2c3ad; box-shadow:var(--bqm-lift); }
.disclaimer{ border-radius:12px; }
.wrap details > summary{ cursor:pointer; }

/* ---------- summary tables (stock, waste, cost, cutting list) ---------- */
#stockSummaryTable tbody tr:hover td, #nuSummaryTable tbody tr:hover td, #cuttingListTable tbody tr:hover td{ background:#fffaf6; }
.wrap .table-scroll table{ border-radius:14px; }

/* ---------- smaller screens ---------- */
@media (max-width:900px){
  .wrap{ padding:26px 16px 70px; }
  .page-head h1{ font-size:1.7rem; }
}
@media (max-width:600px){
  .wrap .panel{ padding:18px 16px; border-radius:16px; }
  .add-row-btn, .clear-btn{ min-height:44px; padding:9px 13px; font-size:.84rem; margin-right:6px; }
  .settings-field{ min-width:100%; }
  .toggle-btn{ padding:10px 14px; }
}
@media (prefers-reduced-motion:reduce){
  .add-row-btn, .clear-btn, .start-tile, .legend-card, .bqw-inspect, .toggle-btn{ transition:none; }
  .clear-btn:hover, .start-tile:hover{ transform:none; }
}
