/* ============================================================
   EMMA — Clean Base Theme (LOCKED FALLBACK)
   Locked: 05 Feb 2026
   ============================================================ */

/* =========================
   CSS VARIABLES
   ========================= */
:root{
  --bg:#0e141b;
  --bg2:#121a24;
  --card:#141d28;
  --card2:#182233;

  --text:#e9edf3;
  --muted:#9aa7b8;

  --accent:#3ddc97;
  --border:rgba(255,255,255,.08);
  --line:rgba(255,255,255,.06);

  --radius:16px;
  --radiusSm:10px;

  --fsH1:20px;
  --fsH2:18px;
  --fsBody:16px;
  --fsSmall:12px;
  --fsNum:12.5px;
}

/* =========================
   BASE
   ========================= */
*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; background:var(--bg); color:var(--text); font-family:Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }

.app{ min-height:100vh; }

/* =========================
   HEADER
   ========================= */
.topbar{
  background:linear-gradient(180deg,#0f1620,#0b1017);
  border-bottom:1px solid var(--border);
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.estimateIdDisplay{
  text-align:right;
  font-size:11px;
  color:var(--muted);
  line-height:1.5;
}
.estimateIdDisplay .eid-job{
  font-weight:600;
  color:#c8d0da;
  font-size:12px;
}
.estimateIdDisplay .eid-uuid{
  font-family:monospace;
  font-size:10px;
  opacity:0.55;
  word-break:break-all;
}
.brandMark{
  width:28px;
  height:28px;
  border-radius:8px;
  background:linear-gradient(135deg,#3ddc97,#2bbf83);
}
.brandName{ font-weight:800; letter-spacing:.06em; }
.brandSub{ font-size:12px; color:var(--muted); }
.cardHd .muted{ font-size:12px; }
/* =========================
   LAYOUT
   ========================= */
.container{
  max-width:1000px;
  margin:0 auto;
  padding:18px;
}

/* =========================
   CARDS
   ========================= */
.card{
  background:linear-gradient(180deg,var(--card),var(--card2));
  border:1px solid var(--border);
  border-radius:var(--radius);

  margin-bottom:18px;overflow:hidden;
}
.cardHd{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 18px;
  border-bottom:1px solid var(--line);
}
.cardHd h2{
  margin:0;
  font-size:var(--fsH1);
}
.cardBd{
  padding:8px;
}

/* =========================
   BUTTONS
   ========================= */
.btn{
  border-radius:999px;
  padding:8px 14px;
  font-weight:600;
  border:1px solid var(--border);
  background:#1a2432;
  color:var(--text);
  cursor:pointer;
}
.btn.primary{
  background:linear-gradient(135deg,#3ddc97,#2bbf83);
  color:#08140f;
  border:none;
}
.btn.ghost{
  background:transparent;
}

/* =========================
   FORMS
   ========================= */
.field{ display:flex; flex-direction:column; gap:6px; }
label{ font-size:var(--fsSmall); color:var(--muted); }

input, select{
  background:#0f1620;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  color:var(--text);
  font-size:var(--fsBody);
}

select:disabled,
input:disabled{
  opacity:.55;
}

/* =========================
   GRIDS
   ========================= */
.grid2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.metaRow{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  margin-top:14px;
}

.pill{
  background:#0f1620;
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
}
.pillLbl{ font-size:var(--fsSmall); color:var(--muted); }
.pillVal{ font-size:16px; font-weight:700; }

/* =========================
   DIMENSIONS
   ========================= */
.dims{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:10px;
  margin-top:16px;
}
.dims input{
  min-width:0;
  width:100%;
  box-sizing:border-box;
}

/* =========================
   TABLE WRAPPER
   ========================= */
.tablewrap{
  overflow-x:auto;
}

/* =========================
   ESTIMATE TABLE
   ========================= */
.lines-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
  table-layout:fixed;
}

.lines-table thead th{
  text-align:left;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  padding:8px 10px;
}

.lines-table .thNum{ text-align:right; }

.lines-table col.col-item{ width:150px; }
.lines-table col.col-qty{ width:50px; }
.lines-table col.col-unit{ width:50px; }
.lines-table col.col-rate{ width:60px; }
.lines-table col.col-total{ width:70px; }
.lines-table col.col-action{ width:70px; }

.lines-table tbody tr{
  background:rgba(255,255,255,.04);
}
.lines-table td{
  padding:10px;
  font-size:var(--fsBody);
}

.lines-table .row-main td{
  background:linear-gradient(135deg,rgba(61,220,151,.18),rgba(61,220,151,.06));
  font-weight:800;
}

.lines-table .row-sub td{
  background:rgba(0,0,0,.25);
}
.lines-table .sub-qty,
.lines-table .sub-rate,
.lines-table .sub-total{
  text-align:right;
  font-size:var(--fsNum);
}

.lines-table button[data-line-action="delete"]{
  border-radius:999px;
  padding:8px 12px;
}

#structuralTbody [data-open-action="remove"]{
  border-radius:999px;
  padding:8px 12px;
}

[data-open-action="remove"]{
  border-radius:999px;
  padding:8px 12px;
}

/* =========================
   OPENINGS / STRUCTURAL
   ========================= */
#openingsPanel .openings__head{
  display:flex;
  justify-content:space-between;
padding-left: 15px;
padding-right: 20px;
  align-items:center;
}
.openingsTable{
  width:100%;
  border-collapse:collapse;
}
.openingsTable th,
.openingsTable td{
  padding:8px;
  font-size:14px;
  border-bottom:1px solid var(--line);
}
.structuralTable{
  width:100%;
  border-collapse:collapse;
 
}
.structuralTable th,
.structuralTable td{
  padding:8px;
  font-size:14px;
  border-bottom:1px solid var(--line);
}
  /*#structuralTbody td,
  #structuralPanel th{
    padding:8px !important;
    border-bottom:1px solid var(--line);
}*/
  
.open-input{ font-size:14px; }
.open-select{ font-size:14px; }
.beam-ref-label{ font-size:14px; width:40px; }
.beam-hint{ font-size:12px; color:var(--muted); }
.beam-length-input{ font-size:14px; width:80px; }
.beam-section-select{ font-size:14px; width:300px;}
.beam-notes-input{ font-size:14px; width:350px;}
.openings__tableWrap{ overflow-x:auto; }
.openingsTable{ table-layout:fixed; min-width: 700px; }
.open-input, .open-select{ width:100%; box-sizing:border-box; }
.thCode{ width:40px; }
.thSmall{ width:50px; }
.thArea{ width:35px; }
.thProduct{ width:125px; }
.thMake{ width:50px; }
.thType{ width:100px; }
.thAction{ width:50px; }
.beam-ref-cell{ width:20px; }
.beam-length-cell{ width:40px; }
.beam-section-cell{ width:150px; }
.beam-notes-cell{ width:250px; }

/* =========================
   SUMMARY HEADER
   ========================= */
.grand{
  display:flex;
  align-items:center;
  gap:16px;
  justify-content:flex-end;
}
.grandLbl{
  font-size:12px;
  color:var(--muted);
}
.grandVal{
  font-size:20px;
  font-weight:800;
}

/* =========================
   RESPONSIVE BASELINE
   ========================= */
@media (max-width:720px){
   .container{ padding:10px; }
  .grid2{ grid-template-columns:1fr; }
  .metaRow{ grid-template-columns:1fr 1fr; }
  .dims{ grid-template-columns:0.5fr 0.5fr 0.5fr; }
  .cardHd h2{ font-size:16px; }
  .lines-table col.col-item{ width:165px; }
  .lines-table col.col-qty{ width:30px; }
  .lines-table col.col-unit{ width:30px; }
  .lines-table col.col-rate{ width:40px; }
  .lines-table col.col-total{ width:60px; }
  .lines-table col.col-action{ width:80px; }
  .lines-table td{ font-size:0.8rem; padding:4px 2px; }
  .openingsTable th,
  .openingsTable td{ font-size:12px; padding:4px; }
  .open-input{ font-size:12px; }
  .open-select{ font-size:12px; }
  .beam-ref-label{ font-size:12px; }
  .beam-hint{ font-size:10px; }
  .beam-length-input{ font-size:12px; }
  .beam-section-select{ font-size:12px; }
  .beam-notes-input{ font-size:12px; }
  .thCode{ width:55px; }
  .thSmall{ width:60px; }
  .thArea{ width:35px; }
  .thProduct{ width:200px; }
  .thMake{ width:100px; }
  .thType{ width:150px; }
  .thAction{ width:50px;}
  .beam-ref-cell{ width:30px; }
  .beam-length-cell{ width:30px; }
  .beam-section-cell{ width:120px; }
  .beam-notes-cell{ width:90px; }
}

/* =========================
   CALCULATOR POPUP
   ========================= */
.calcToggle{
  font-size:18px;
  padding:4px 8px;
  line-height:1;
  align-self:flex-end;
  margin-bottom:2px;
}
.calcOverlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9000;
}
.calcPopup{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  width:280px;
  box-shadow:0 8px 32px rgba(0,0,0,.5);
}
.calcHeader{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
}
.calcTitle{
  font-weight:700;
  font-size:var(--fsBody);
  color:var(--text);
}
.calcTargetLabel{
  font-size:var(--fsSmall);
  color:var(--accent);
  margin-left:auto;
}
.calcCloseBtn{
  background:none;
  border:none;
  color:var(--muted);
  font-size:22px;
  cursor:pointer;
  line-height:1;
  padding:0 4px;
}
.calcCloseBtn:hover{ color:var(--text); }
.calcDisplay{
  width:100%;
  background:var(--bg2);
  border:1px solid var(--border);
  border-radius:var(--radiusSm);
  color:var(--text);
  font-size:20px;
  text-align:right;
  padding:10px 12px;
  margin-bottom:10px;
  box-sizing:border-box;
}
.calcGrid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:6px;
}
.calcBtn{
  padding:12px 0;
  border:1px solid var(--border);
  border-radius:var(--radiusSm);
  background:var(--bg2);
  color:var(--text);
  font-size:16px;
  font-weight:600;
  cursor:pointer;
  transition:background .15s;
}
.calcBtn:hover{ background:var(--card2); }
.calcBtn.cOp{
  background:var(--card2);
  color:var(--accent);
}
.calcBtn.cOp:hover{ background:#1e2d40; }
.calcBtn.cAc{
  background:#3a1a1a;
  color:#f87171;
}
.calcBtn.cAc:hover{ background:#4a2222; }
.calcBtn.cEq{
  background:linear-gradient(135deg,#3ddc97,#2bbf83);
  color:#08140f;
  grid-column:span 2;
}
.calcBtn.cEq:hover{ filter:brightness(1.1); }
.calcBtn.cUse{
  background:linear-gradient(135deg,#3b82f6,#2563eb);
  color:#fff;
  grid-column:span 2;
}
.deleteEstimateWrap{
  padding:16px 18px;
  border-top:1px solid var(--border);
  display:flex;
  align-items:center;
  gap:14px;
}
.btn-delete-estimate{
  background:#c0392b;
  color:#fff;
  border:none;
  border-radius:var(--radius);
  padding:9px 20px;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  white-space:nowrap;
}
.btn-delete-estimate:hover{ background:#a93226; }
.deleteEstimateNote{
  font-size:11px;
  color:var(--muted);
}
