/* Layout tidy-up: loads after styles.css and only tightens spacing and box sizes. */

/* ---------- Dashboard ---------- */
.secure-dashboard-view .page-head{margin-bottom:16px}
.secure-dashboard-view .page-head h1{font-size:clamp(1.7rem,2.6vw,2.3rem);margin:2px 0 4px}
.secure-dashboard-view .page-head p{font-size:.95rem}
.secure-dashboard-view .dashboard-landing-head{padding-bottom:12px}
.home-dashboard-grid{grid-template-columns:repeat(auto-fill,minmax(330px,1fr));gap:12px;margin-bottom:14px}
.home-dashboard-grid .hub-action-card{min-height:0;padding:14px 16px;gap:14px;grid-template-columns:40px minmax(0,1fr) auto;border-radius:16px;box-shadow:0 6px 20px rgba(23,32,51,.07)}
.home-dashboard-grid .hub-action-card:hover{transform:translateY(-1px);box-shadow:0 10px 26px rgba(50,38,72,.12)}
.home-dashboard-grid .hub-action-icon{width:40px;height:40px;font-size:1rem}
.home-dashboard-grid .hub-action-copy strong{font-size:1rem}
.home-dashboard-grid .hub-action-copy small{font-size:.84rem;line-height:1.35;margin-top:2px}
.home-summary.card{padding:16px 22px;gap:24px;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);border-radius:16px;box-shadow:0 6px 20px rgba(23,32,51,.07)}
.home-summary h2{font-size:1.3rem;margin:2px 0 6px}
.home-summary p:not(.eyebrow){line-height:1.5;font-size:.92rem}

/* ---------- Order dialog (profile completion) ---------- */
#orderDialog .dialog-body,.completion-first-dialog{padding:22px 26px}
.order-dialog-head{margin-bottom:6px}
.order-dialog-head h2{font-size:1.35rem;margin:0}
.secondary-order-actions{margin:8px 0 12px;padding-top:0;border-top:0}
.secondary-order-actions button{padding:7px 14px;min-height:0}
.profile-progress-hero{padding:14px 16px;margin:0 0 12px;border-radius:14px}
.profile-progress-hero .profile-progress-heading h3{font-size:1.05rem;margin:0}
.profile-progress-hero .eyebrow{margin:0 0 2px;font-size:.7rem}
.profile-progress-heading strong{font-size:1.5rem;line-height:1}
.profile-progress-hero .dialog-progress-track{height:8px;margin:10px 0}
.profile-progress-hero .progress-counts{gap:8px}
.profile-progress-hero .progress-counts>div{display:flex;align-items:baseline;gap:8px;padding:6px 12px;border-radius:10px}
.profile-progress-hero .progress-counts strong{font-size:1.1rem}
.profile-progress-hero .progress-counts span{font-size:.8rem}

.priority-checklist{margin-top:0;padding:14px 16px;border-radius:14px}
.priority-checklist .delegate-section-head{margin-bottom:8px;align-items:center}
.priority-checklist .delegate-section-head h3{font-size:1.05rem;margin:0}
.priority-checklist .delegate-section-head .help{margin:2px 0 0;font-size:.85rem}
.delegate-progress-actions{gap:8px;margin-top:0}
.delegate-progress-actions button{padding:7px 14px;min-height:0}
.delegate-group{margin-top:10px;padding:10px 12px;border-radius:12px}
.delegate-group h4{margin:0 0 6px;font-size:.95rem}
.delegate-group h4 span{padding:0 .45rem;font-size:.8rem}
.delegate-checklist .delegate-row,.delegate-row{display:grid;grid-template-columns:28px minmax(0,1fr) auto;grid-template-areas:"icon who choice";gap:4px 12px;align-items:center;min-height:0;padding:7px 10px;border-radius:10px;border-bottom:0}
.delegate-row .delegate-status-icon{grid-area:icon;width:24px;height:24px;font-size:.8rem}
.delegate-row .delegate-identity{grid-area:who;display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 12px;min-width:0}
.delegate-row .delegate-identity strong{font-size:.95rem}
.delegate-row .delegate-identity small{font-size:.82rem}
.delegate-row .delegate-state-label{display:none}
.delegate-row .completion-choice{grid-area:choice;grid-column:auto;display:flex;gap:4px;margin:0;padding:3px;border:1px solid var(--line);border-radius:10px;background:#fff;width:auto;min-width:0}
.delegate-row .completion-choice legend{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.delegate-row .completion-choice label{padding:4px 10px;border-radius:8px;font-size:.84rem;white-space:nowrap;display:flex;align-items:center;gap:6px}
.delegate-invitation-note{flex-basis:100%;font-size:.78rem;font-weight:600;display:flex;align-items:center;gap:8px;margin:0}
.delegate-invitation-note.is-sent{color:#16834b}
.delegate-invitation-note.is-failed{color:#b42318}
.delegate-invitation-note.is-none{color:#6b6b76}
.delegate-invitation-note .resend-one-invitation{padding:1px 8px;min-height:0;font-size:.78rem;border-radius:8px}
.invitation-resend-panel{padding:12px 16px!important;margin-top:10px!important;border-radius:14px!important}
.invitation-resend-panel .help{margin:2px 0 8px}
@media (max-width:640px){
  .delegate-checklist .delegate-row,.delegate-row{grid-template-columns:28px minmax(0,1fr);grid-template-areas:"icon who" "choice choice"}
  .delegate-row .completion-choice{justify-self:start}
}

/* ---------- Estimate form ---------- */
#estimateFormView .page-head.card,#estimateFormView .page-head{padding:16px 22px;margin-bottom:12px;border-radius:16px}
#estimateFormView .page-head h1{font-size:clamp(1.6rem,2.4vw,2.1rem);margin:2px 0 4px}
#estimateFormView .page-head p{font-size:.92rem}
#estimateForm.card{padding:20px 24px;gap:10px 16px;border-radius:16px}
#estimateForm label{font-size:.88rem}
#estimateForm input:not([type=checkbox]):not([type=radio]),#estimateForm select{padding:9px 12px;min-height:0;height:40px;border-radius:10px}
#estimateForm .help{margin:-4px 0 0;font-size:.82rem}
#estimateForm .estimate-type-selector{margin:2px 0}
#estimateForm .estimate-section{padding:12px 14px;margin:2px 0;border-radius:12px}
#estimateForm .estimate-section h3{margin:0 0 8px;font-size:1rem}
#estimateForm .estimate-section .form-grid{gap:8px 14px}
#estimateForm .chapter-checkboxes{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:4px 16px;margin-top:8px}
#estimateForm .chapter-checkboxes .choice{margin:0;font-size:.9rem}
#estimateForm .estimate-preview-panel,#estimatePreviewPanel{padding:10px 14px;border-radius:12px}
#estimatePreviewPanel table{font-size:.92rem}
#estimateForm .form-actions{margin-top:4px;padding-bottom:0}
#estimateForm .form-actions button{padding:8px 18px;min-height:0}

/* ---------- Estimate dialog & list ---------- */
#estimateDialog .dialog-body{padding:22px 26px}
#estimateDialog h2{font-size:1.4rem;margin:2px 0 10px}
#estimateDialog dl{grid-template-columns:130px 1fr;gap:5px 12px;margin:0 0 12px;font-size:.93rem}
#estimateDialog .estimate-preview-panel{padding:8px 14px;border-radius:12px}
#estimateDialog .estimate-preview-panel td{padding:3px 0}
#estimateDialog .estimate-preview-total{margin-top:6px;padding-top:4px;border-top:0;font-size:1rem}
#estimateDialog .estimate-preview-total table{width:100%;max-width:340px;margin-left:auto;border-collapse:collapse}
#estimateDialog .estimate-preview-total td{padding:4px 0;border-bottom:1px solid var(--line)}
#estimateDialog .estimate-preview-total td:last-child{text-align:right;font-variant-numeric:tabular-nums}
#estimateDialog .estimate-preview-total tr:last-child td{border-bottom:0;font-weight:800}
#estimateDialog .estimate-dialog-actions{gap:8px;margin:12px 0 4px}
#estimateDialog .estimate-dialog-actions button{padding:8px 16px;min-height:0}

.home-summary .home-summary-steps>div,.home-summary [class*=step]{padding:10px 14px}

/* ---------- Order dialog: lower panels ---------- */
#orderDialog .order-details-panel{margin-top:10px;padding:0;border-radius:12px}
#orderDialog .order-details-panel>summary{padding:10px 14px;font-size:.95rem}
#orderDialog .order-details-panel[open]>*:not(summary){margin-left:14px;margin-right:14px}
#orderDialog .order-details-panel[open]{padding-bottom:10px}
#orderDialog .order-details-panel dl{gap:4px 14px;font-size:.9rem}
#orderDialog .estimate-panel .table-wrap{margin:0 14px;overflow-x:auto}
#orderDialog .estimate-panel table.review-delegates{width:100%;table-layout:auto;font-size:.88rem}
#orderDialog .estimate-panel table.review-delegates th{padding:6px 10px;text-align:left}
#orderDialog .estimate-panel table.review-delegates td{padding:6px 10px;text-align:left;vertical-align:middle}
#orderDialog .estimate-panel table.review-delegates td:first-child{width:52%}
#orderDialog .estimate-panel table.review-delegates td:nth-child(n+3),#orderDialog .estimate-panel table.review-delegates th:nth-child(n+3){text-align:right}
#orderDialog .estimate-panel .estimate-totals{display:grid;grid-template-columns:1fr auto;max-width:260px;margin:8px 14px 4px auto;gap:2px 24px;font-size:.9rem}
#orderDialog .estimate-panel .estimate-totals dt{color:var(--muted)}
#orderDialog .estimate-panel .estimate-totals dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}
#orderDialog .estimate-panel .form-actions,#orderDialog .fulfilment-panel .form-actions{margin:6px 14px;justify-content:flex-start;gap:8px}
#orderDialog .order-details-panel .form-actions button{padding:6px 14px;min-height:0}
#orderDialog .order-details-panel .help{margin:6px 14px;font-size:.82rem}
#orderDialog .fulfilment-panel>.card{padding:10px 12px;gap:8px 14px;box-shadow:none;border-radius:10px;margin-top:4px}
#orderDialog .fulfilment-panel input:not([type=checkbox]){height:38px;padding:6px 12px}
#orderDialog .team-notes-add{display:flex;gap:8px;align-items:flex-start;margin-top:6px}
#orderDialog .team-notes-add textarea{flex:1;min-height:0;height:44px;padding:8px 12px}
#orderDialog .team-notes-add button{padding:8px 16px;min-height:0}
#orderDialog .empty-group{margin:4px 14px;font-size:.88rem}
.order-dialog-head{padding-right:44px}
.invitation-resend-panel h3{margin:0;font-size:1.05rem}
.invitation-resend-panel #openInvitationPanelBtn{padding:6px 14px;min-height:0}
#estimateForm{padding-bottom:16px}
#estimateForm .message:empty{display:none}
#estimateForm .form-actions{margin:2px 0 0;padding:0}
@media (max-width:640px){
  .delegate-invitation-note{flex-wrap:wrap}
  .delegate-row .completion-choice{flex-direction:row;flex-wrap:wrap}
}
