/* Ignotix Project Two — shared visual language for the scaffolded Materials/
   Estimate/Proposal tabs (homogeneity contract rule 2, visual parity).
   Every rule is scoped under .igx-mtab (added by the shared scaffold to those
   panels only) so it CANNOT restyle #tab-design or any other studio UI.
   Palette + rule bodies are flatwork R38.2-WJ43's, hardcoded here so the look
   is identical regardless of each studio's own inline palette. */

.igx-mtab{
  --navy:#14304d;--navy2:#0e2438;--navy3:#1d4068;--gold:#d2a513;--gold2:#e8c14d;--gold3:#8c6e0d;
  --paper:#fbf8f2;--bone:#f4eee2;--bone2:#ece4d5;--ink:#1f2a36;--muted:#5e6a7a;--line:#d3d8e0;
  --shadow:0 8px 26px rgba(20,48,77,.08);
  /* flatwork's base is the browser default 16px (its body sets no size); pin it
     here so every inherited size (panel-head, settings inputs, totalrows) matches
     flatwork regardless of each studio's own smaller root font-size. Explicit
     per-element sizes below (table 11.5, th 9.5, .ix/.right 10, grand 18) win as
     in flatwork, and row inputs still inherit the 11.5 table size via font:inherit. */
  font-family:Outfit,system-ui,-apple-system,Segoe UI,sans-serif;color:var(--ink);font-size:16px;
}

/* Estimate-tab workspace — byte-copied from flatwork R38.2-WJ43: two columns,
   380px settings/totals stack | flexible line-editor stack. Totals live in the
   left stack so they stay in view while lines are edited on the right. */
.igx-mtab .workspace{display:grid;grid-template-columns:380px minmax(0,1fr);gap:18px}
.igx-mtab .stack{display:flex;flex-direction:column;gap:14px}
@media(max-width:1050px){.igx-mtab .workspace{grid-template-columns:1fr}}

.igx-mtab .panel{background:var(--paper);border:1px solid var(--line);border-radius:14px;overflow:hidden;box-shadow:var(--shadow);margin-bottom:16px}
.igx-mtab .stack>.panel{margin-bottom:0}
.igx-mtab .panel-head{padding:11px 15px;background:var(--bone);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:8px;color:var(--navy);font-family:Fraunces,Georgia,serif;font-size:16px;font-weight:650}
.igx-mtab .panel-head .ix{font:700 10px/1 ui-monospace,SFMono-Regular,Consolas,monospace;background:rgba(210,165,19,.15);color:var(--gold3);padding:4px 7px;border-radius:5px}
.igx-mtab .panel-head .right{margin-left:auto;font:500 10px/1.3 Outfit,system-ui;color:var(--muted)}
.igx-mtab .panel-body{padding:14px 15px}
.igx-mtab .callout{border-left:4px solid var(--gold);background:#fff9e9;padding:10px 12px;border-radius:8px;font-size:11.5px;line-height:1.5}

.igx-mtab .tablewrap{overflow:auto;border:1px solid var(--line);border-radius:10px}
.igx-mtab table{width:100%;border-collapse:collapse;font-size:11.5px;background:#fff}
.igx-mtab thead th{position:sticky;top:0;background:var(--bone);color:var(--navy);font-size:9.5px;text-transform:uppercase;letter-spacing:.65px;z-index:1}
.igx-mtab th,.igx-mtab td{padding:8px 9px;border-bottom:1px solid var(--line);vertical-align:top;text-align:left}
.igx-mtab td.num,.igx-mtab th.num{text-align:right;font-variant-numeric:tabular-nums}
.igx-mtab .muted{color:var(--muted)}

.igx-mtab .tag{display:inline-flex;padding:3px 6px;border-radius:999px;font-size:9px;font-weight:750;text-transform:uppercase;letter-spacing:.5px}
.igx-mtab .tag.ovr{background:#fff3d8;color:#8c6e0d}
.igx-mtab .tag.usr{background:#e8eef5;color:#14304d}
.igx-mtab .tag.det{background:#e6f1e8;color:#2f6e3f}
.igx-mtab .tag.prod{background:#eaf0f6;color:#2d668c}
.igx-mtab .tag.field{background:#fff3d8;color:#8c6e0d}
.igx-mtab .tag.ext{background:#f5e8e8;color:#8c2f2f}
.igx-mtab .tag.learn{background:#eee7f7;color:#6a4589}

.igx-mtab .mq-meta{font-size:10px;color:var(--muted);margin-top:3px;white-space:nowrap}
.igx-mtab .mq-drift{color:#a33;font-weight:700}
.igx-mtab .linklike{border:0;background:transparent;color:#8c6e0d;text-decoration:underline;cursor:pointer;font-size:10px;padding:0}

.igx-mtab input,.igx-mtab select,.igx-mtab textarea{font:inherit;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink);padding:6px 8px;min-height:30px}
.igx-mtab #materialRows input[data-mq],.igx-mtab #estimateRows input{width:96px;min-width:0;text-align:right}
.igx-mtab #estimateRows input[data-cu]{text-align:left;width:100%}
.igx-mtab input:focus,.igx-mtab select:focus{outline:none;border-color:var(--gold)}

.igx-mtab .btn{border:1px solid var(--gold);background:#fff;color:var(--gold3);border-radius:7px;padding:8px 11px;font-size:12px;font-weight:700;cursor:pointer}
.igx-mtab .btn:hover{background:var(--gold);color:var(--navy2)}
.igx-mtab .btn.small{padding:5px 8px;font-size:10px}
.igx-mtab .btn.danger{border-color:#a84646;color:#a84646}
.igx-mtab .btnrow{display:flex;gap:7px;flex-wrap:wrap}

.igx-mtab .totalbox{background:var(--navy2);color:#fff;border-radius:10px;padding:14px}
.igx-mtab .totalrow{display:flex;justify-content:space-between;gap:12px;padding:5px 0;border-bottom:1px solid rgba(255,255,255,.12)}
.igx-mtab .totalrow.grand{color:var(--gold2);font-size:18px;font-weight:800;border-bottom:0}

.igx-mtab .field{display:flex;flex-direction:column;gap:4px;margin-bottom:10px}
.igx-mtab .field label,.igx-mtab .mini-label{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.75px;color:var(--muted)}
.igx-mtab .row2{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.igx-mtab .field input,.igx-mtab .field select,.igx-mtab .field textarea{width:100%;min-width:0}

/* Editable CATALOG panel — byte-copied from flatwork R38.2-WJ43 (.seg dest
   toggle, .hint, .catdet category disclosure, .cat-row reference rows). Scoped
   under .igx-mtab so it only styles the shared Estimate-tab catalog. */
.igx-mtab .seg{display:inline-flex;border:1px solid #8c6e0d;border-radius:8px;overflow:hidden}
.igx-mtab .seg button{border:0;background:transparent;color:#e8c14d;font:700 11px JetBrains Mono,monospace;padding:6px 11px;cursor:pointer}
.igx-mtab .seg button.active{background:#d2a513;color:#14304d}
.igx-mtab .seg-light{border-color:#b39114;background:#fff}
.igx-mtab .seg-light button{color:#8c6e0d}
.igx-mtab .seg-light button.active{background:#d2a513;color:#14304d}
.igx-mtab .hint{font-size:11px;line-height:1.45;color:var(--muted)}
.igx-mtab .catdet{border:1px solid var(--line);border-radius:9px;background:#fff;margin-bottom:7px;padding:0 10px}
.igx-mtab .catdet summary{cursor:pointer;font:700 12.5px Outfit,sans-serif;color:#14304d;padding:9px 2px}
.igx-mtab .cat-row{display:flex;align-items:center;gap:8px;padding:6px 2px;border-top:1px dashed var(--line);font-size:12.5px}
.igx-mtab .cat-row .grow{flex:1}
.igx-mtab .cat-row input{width:74px}
.igx-mtab .cat-row .cu{color:#5e6a7a;min-width:44px;font-size:11px}
