/* SmartQuote v5: project-centred workspace, accessible workflows, local-only prototype */
:root { --sq-purple:#6257d5; --sq-soft:#f1f5fe; --sq-radius:16px; }
body {font-size:14px}
.sidebar {width:250px}
.brand {padding-bottom:16px}
.v5-project-switch {padding:10px;margin:0 1px 13px;border:1px solid #3d5472;border-radius:12px;background:#182d49;color:#f1f6ff}
.v5-project-switch label{display:block;font-size:10px;letter-spacing:1.1px;text-transform:uppercase;color:#93accd;margin-bottom:6px;font-weight:800}
.v5-project-switch select {background:#223a59;color:#fff;border-color:#45607d;min-height:35px;font-size:12px;padding:6px 8px}
.v5-nav-group{color:#8ba9ca;font-size:10px;letter-spacing:1.2px;font-weight:800;text-transform:uppercase;padding:13px 12px 6px}
.nav-item{margin-bottom:1px;padding:10px 12px}
.v5-stagebar{display:flex;align-items:stretch;gap:6px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:7px;margin-bottom:20px;overflow:auto;box-shadow:var(--shadow)}
.v5-stage{min-width:105px;flex:1;padding:9px 8px;border:0;border-radius:9px;background:transparent;color:#708098;font-size:11px;font-weight:750;display:flex;align-items:center;gap:8px;justify-content:center;white-space:nowrap}
.v5-stage .stepdot{background:#edf1f8;color:#596d90;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;font-size:10px;flex:none}
.v5-stage:hover{background:#f1f5fd;color:#1a345d}
.v5-stage.active{background:#eaf0ff;color:#2449af}.v5-stage.active .stepdot{color:#fff;background:#3567ed}
.v5-stage.done .stepdot{background:#e2f5ec;color:#137754}
.v5-alert{display:flex;gap:12px;align-items:flex-start;background:#f5f8ff;border:1px solid #dbe5f7;border-radius:13px;padding:15px;color:#334e73;font-size:12px}
.v5-alert.urgent{background:#fff8ed;border-color:#f6d99e;color:#835b1b}
.v5-alert.good{background:#edf9f3;border-color:#ccebdc;color:#19684f}
.v5-hero{background:linear-gradient(115deg,#122940,#254778);color:white;border-radius:18px;padding:23px 27px;margin-bottom:18px}
.v5-hero h1{font-size:26px;line-height:1.25;letter-spacing:-.7px;margin:4px 0 7px}.v5-hero p{color:#cad8ea;max-width:700px;margin:0 0 15px;font-size:13px}
.v5-hero .btn{position:relative}
.v5-status{display:inline-block;border-radius:20px;padding:5px 9px;background:#edf1fa;color:#506887;font-weight:800;font-size:10px;white-space:nowrap}
.v5-status.review{background:#fff3dc;color:#976217}.v5-status.ready{background:#e1f4eb;color:#12694b}.v5-status.archived{background:#e7eaf0;color:#707f91}.v5-status.draft{background:#eaf0ff;color:#3154ba}
.v5-searchrow{display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:space-between;margin:18px 0}
.v5-searchrow input{width:min(330px,100%)}.v5-filter{border:1px solid #dbe3ef;background:#fff;padding:7px 12px;font-size:11px;color:#5c6c84;border-radius:20px;font-weight:750}.v5-filter.active{background:#eaf0ff;border-color:#afc4fb;color:#2e59c8}
.v5-project-card{position:relative;display:flex;flex-direction:column;gap:10px;min-height:192px}.v5-project-card .card-head{display:flex;align-items:start;justify-content:space-between;gap:10px}.v5-project-card h3{font-size:16px;margin:0}.v5-project-card .card-meta{color:#75869d;font-size:11px}.v5-project-card p{font-size:12px;color:#5d6f85;margin:0;min-height:44px}.v5-card-actions{display:flex;justify-content:space-between;margin-top:auto;align-items:center;gap:8px}
.v5-progress{height:7px;border-radius:20px;background:#ebf0f7;overflow:hidden}.v5-progress>span{display:block;background:linear-gradient(90deg,#4c7ded,#43a794);height:100%;border-radius:20px}
.v5-section-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}.v5-section-header h1{font-size:28px;letter-spacing:-1px;margin:4px 0 5px}.v5-section-header p{color:var(--muted);margin:0}
.v5-formblock{display:grid;gap:15px}.v5-formblock label{font-size:12px;font-weight:800;color:#455974;display:block;margin-bottom:7px}.v5-formblock input,.v5-formblock textarea,.v5-formblock select{min-width:0}
.v5-split{display:grid;grid-template-columns:minmax(300px,1.05fr) minmax(360px,1fr);gap:15px;align-items:stretch}
.v5-pdf{min-height:650px;border:1px solid var(--line);border-radius:12px;width:100%;background:#f4f5f9}
.v5-pdf-missing{min-height:390px;display:flex;justify-content:center;align-items:center;text-align:center;flex-direction:column;gap:14px;background:#f7f9fd;border:1px dashed #ced8e8;border-radius:12px;padding:25px;color:#687990}
.v5-tabs{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:16px}.v5-tabs button{border:1px solid #dce5f1;background:#fff;color:#65768e;border-radius:9px;padding:8px 11px;font-size:11px;font-weight:800}.v5-tabs button.active{color:#2457c5;background:#ebf1ff;border-color:#b7cafd}
.v5-fieldline{display:grid;grid-template-columns:1fr 1fr;gap:10px}.v5-fieldline .field{min-width:0}
.v5-evidence{padding:10px 12px;border-radius:9px;border:1px solid #e1e8f4;margin:8px 0;font-size:11px}.v5-evidence small{color:#718198}.v5-evidence blockquote{margin:6px 0;color:#52647e}
.v5-table-scroll{overflow:auto;border:1px solid var(--line);border-radius:12px}.v5-table{min-width:630px;width:100%;border-collapse:collapse}.v5-table th{background:#f5f8fc;color:#59708e;font-size:11px;text-align:left;white-space:nowrap}.v5-table td,.v5-table th{padding:11px 12px;border-bottom:1px solid #e8edf3;font-size:12px;vertical-align:middle}.v5-table tr:last-child td{border:0}.v5-table .minor{font-size:10px;color:#8190a4}
.v5-compare-filters{display:flex;flex-wrap:wrap;gap:7px;margin:14px 0}.v5-chip{display:inline-flex;align-items:center;gap:5px;background:#f1f4f9;color:#526985;border-radius:7px;padding:5px 8px;font-weight:700;font-size:11px}
.v5-issue{border:1px solid #e2e8f1;border-radius:12px;background:#fff;padding:16px;margin:12px 0}.v5-issue header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}.v5-issue p{color:#64748b;font-size:12px;margin:6px 0}.v5-issue.critical{border-left:4px solid #c34747}.v5-issue.warning{border-left:4px solid #d9a147}.v5-issue.resolved{border-left:4px solid #2f9d78}
.v5-counts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:15px 0}.v5-counts .card{padding:15px}.v5-counts strong{display:block;font-size:23px}.v5-counts small{font-size:11px;color:#7889a1}
.v5-actionbar{display:flex;gap:9px;justify-content:flex-end;align-items:center;flex-wrap:wrap;border-top:1px solid var(--line);margin-top:18px;padding-top:14px}
.v5-helpmark{font-size:11px;color:#77869d;margin:8px 0}.v5-bubble{border:1px solid #e2e9f3;border-radius:13px;padding:14px 16px;margin-bottom:12px;background:#f9fbff;color:#43566e;font-size:12px}
.v5-empty{padding:34px;border:1px dashed #ced8e8;border-radius:12px;color:#65748a;text-align:center}
.v5-delta{font-size:11px;padding:4px 7px;border-radius:5px;background:#edf3ff;color:#375fb0}
.v5-notification{position:fixed;bottom:25px;right:24px;background:#18334f;color:white;padding:13px 17px;border-radius:11px;box-shadow:0 14px 35px #0a24403b;z-index:700;font-size:12px;max-width:350px}
/* Dark theme support for new surfaces */
:root[data-theme='dark'] .v5-stagebar,:root[data-theme='dark'] .v5-project-card,:root[data-theme='dark'] .v5-issue,:root[data-theme='dark'] .v5-tabs button,:root[data-theme='dark'] .v5-filter {background:#1d2d46;color:#d7e1f1;border-color:#3d4f6c}
:root[data-theme='dark'] .v5-stage.active,:root[data-theme='dark'] .v5-filter.active,:root[data-theme='dark'] .v5-tabs button.active{background:#334b72;color:white}
:root[data-theme='dark'] .v5-pdf-missing,:root[data-theme='dark'] .v5-bubble,:root[data-theme='dark'] .v5-alert{background:#1c304e;color:#d3e0f2;border-color:#3f5475}
:root[data-theme='dark'] .v5-table th{background:#263a58;color:#e0e9fb}
:root[data-theme='dark'] .v5-table td,:root[data-theme='dark'] .v5-table th{border-color:#3d4c67}
@media(max-width:1050px){.v5-split{grid-template-columns:1fr}.v5-pdf{min-height:410px}.v5-counts{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){.sidebar{display:none}.v5-stagebar{margin:0 -6px 18px;gap:2px;padding:5px}.v5-stage{font-size:10px;flex:none;min-width:94px;padding:7px 6px}.v5-stage .stepdot{height:21px;width:21px}.v5-section-header{flex-direction:column}.v5-section-header h1{font-size:23px}.v5-fieldline,.v5-counts{grid-template-columns:1fr}.v5-pdf{min-height:360px}.v5-searchrow{align-items:stretch}.v5-searchrow input{width:100%}.v5-hero{padding:19px}.v5-hero h1{font-size:22px}.mobile-nav{overflow-x:auto;justify-content:flex-start;gap:4px}.mobile-nav button{min-width:75px}}
@media print {.v5-stagebar,.v5-notification{display:none!important}}
/* v5 final layout refinements */
.sidebar{overflow-y:auto;scrollbar-width:thin;scrollbar-color:#456384 #0e2038}
.side-foot{margin-top:16px;flex:none}
.sidebar>.side-section{display:none}
.v5-project-switch{margin-top:4px}

/* v5.2 pre-release: stop wide tables and grids from widening the page on phones.
   Grid and flex children default to min-width:auto, so a 680 px table inside a card pushed the
   whole layout to about 740 px on a 375 px screen. Let them shrink and scroll inside their card. */
@media(max-width:760px){
  .main,main,.content,.card,.grid2>*,.settings-grid>*,.v5-grid>*,.doc-grid>*,.stack>*{min-width:0;max-width:100%}
  .comparisontable,.report-table,.table-wrap{max-width:100%;overflow-x:auto}
  .report-table{display:block}
  .mobile-nav{max-width:100vw}
  .grid2,.settings-grid{grid-template-columns:minmax(0,1fr)}
}
