:root {
  --ink: #1e2624;
  --muted: #66706d;
  --soft: #f3f6f4;
  --line: #dde5e1;
  --white: #fff;
  --lime: #b8dc43;
  --lime-dark: #789919;
  --forest: #183d34;
  --teal: #296f61;
  --gold: #d7a33f;
  --red: #b94a4a;
  --shadow: 0 18px 50px rgba(21, 45, 38, .09);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #edf2ef; font-family: "DM Sans", sans-serif; overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; max-width: 100vw; overflow-x: hidden; }
.sidebar { background: #000; color: white; padding: 26px 16px; display: flex; flex-direction: column; gap: 24px; }
.brand { padding: 0 8px; }
.brand-logo-box { display: grid; place-items: center; width: 88px; height: 98px; padding: 6px; background: #000; border-radius: 12px; }
.brand-logo-box img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.brand h1 { margin: 12px 0 3px; font: 800 19px Manrope; letter-spacing: -.02em; }
.brand p { margin: 0; color: #abc2bb; font-size: 12px; }
.nav { display: grid; gap: 6px; }
.nav button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; color: #c7d8d2; background: transparent; border: 0; border-radius: 11px; text-align: left; }
.nav button:hover, .nav button.active { color: white; background: rgba(255,255,255,.1); }
.nav button.active::before { content: ""; width: 5px; height: 20px; border-radius: 5px; background: var(--lime); }
.sidebar-foot { margin-top: auto; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.07); }
.sidebar-foot small { color: #abc2bb; }

.main { min-width: 0; max-width: 100%; overflow-x: hidden; }
.topbar { min-height: 74px; height: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px clamp(16px, 2.2vw, 34px); background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; box-sizing: border-box; }
.topbar > div:first-child { min-width: 0; flex: 1 1 auto; }
.eyebrow { color: var(--teal); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(480px, 40vw); }
.topbar h2 { margin: 2px 0 0; font: 800 clamp(20px, 2vw, 24px) Manrope; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: nowrap; }
.user-tools select { border: 1px solid var(--line); background: white; border-radius: 10px; padding: 8px 12px; font-size: 13px; max-width: 180px; text-overflow: ellipsis; white-space: nowrap; }
.user-tools .btn { white-space: nowrap; flex-shrink: 0; padding: 8px 13px; font-size: 13px; font-weight: 700; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #0f172a; color: #4ade80; font-weight: 800; border: 1.5px solid #cbd5e1; flex-shrink: 0; }
.user-avatar-photo { object-fit:cover; border:2px solid #cbd5e1; }
.staff-person,.staff-photo-editor { display:flex; align-items:center; gap:12px; }
.staff-photo { width:44px; height:44px; flex:0 0 44px; border-radius:50%; object-fit:cover; border:2px solid #cbd5e1; background:#f8fafc; }
.staff-photo-placeholder { display:grid; place-items:center; background:#0f172a; color:#4ade80; font-weight:800; border:1.5px solid #cbd5e1; font-size:13px; }
.staff-photo-editor .staff-photo { width:72px; height:72px; flex-basis:72px; }
.staff-photo-editor [data-photo-preview] { display:flex; flex:0 0 72px; }
.staff-photo-editor input[type="file"] { max-width:100%; }
.photo-upload-status { margin-top:7px; color:var(--muted); font-size:12px; font-weight:700; }
.content { padding: 24px clamp(16px, 2.2vw, 34px) 60px; max-width: 1500px; margin: auto; box-sizing: border-box; }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.hero h3 { margin: 0; font: 800 clamp(24px, 2.8vw, 34px) Manrope; letter-spacing: -.04em; }
.hero p { margin: 6px 0 0; color: var(--muted); }
.btn { border: 0; border-radius: 10px; padding: 10px 15px; font-weight: 700; white-space: nowrap; }
.btn.primary { color: #173027; background: var(--lime); }
.btn.secondary { color: var(--forest); background: white; border: 1px solid var(--line); }
.btn.danger { color: var(--red); background: #fff2f2; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.stat, .panel { background: white; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); contain: layout style; }
.fitter-job-card { contain: layout style; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat strong { display: block; margin-top: 6px; font-family: 'Manrope', sans-serif; font-size: clamp(20px, 2vw, 28px); font-weight: 800; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.stat .delta { margin-top: 7px; color: var(--teal); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.panel { padding: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.panel h4 { margin: 0; font: 800 18px Manrope; }
.muted { color: var(--muted); }

.dept-bars { display: grid; gap: 18px; }
.dept-row { display: grid; grid-template-columns: 120px 1fr 85px; gap: 14px; align-items: center; }
.bar { height: 10px; border-radius: 10px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--teal),var(--lime)); }
.activity { display: grid; gap: 13px; }
.activity-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 11px; align-items: start; }
.activity-item i { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--lime); }
.activity-item p { margin: 0; font-size: 13px; }
.activity-item time { color: var(--muted); font-size: 11px; }
.quote-performance { margin-bottom:22px; }
.quote-performance .panel-head select { padding:9px 12px; border:1px solid var(--line); border-radius:9px; background:white; }
.performance-stats { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin-bottom:18px; }
.performance-stats div { padding:12px; border-radius:11px; background:var(--soft); }
.performance-stats span { display:block; color:var(--muted); font-size:11px; }
.performance-stats strong { display:block; margin-top:5px; font:800 18px Manrope; }
.performance-legend { display:flex; justify-content:flex-end; gap:18px; margin-bottom:8px; font-size:11px; font-weight:700; }
.performance-legend span::before { content:""; display:inline-block; width:9px; height:9px; margin-right:6px; border-radius:2px; }
.accepted-key::before { background:var(--teal); }.rejected-key::before { background:var(--red); }
.performance-chart { display:grid; grid-template-columns:repeat(auto-fit,minmax(48px,1fr)); gap:10px; height:220px; padding:12px 8px 0; border-left:1px solid var(--line); border-bottom:1px solid var(--line); }
.performance-column { min-width:0; display:grid; grid-template-rows:1fr auto auto; gap:4px; text-align:center; }
.performance-bars { display:flex; align-items:flex-end; justify-content:center; gap:4px; min-height:145px; }
.performance-bars i { display:block; width:min(18px,38%); border-radius:5px 5px 0 0; }
.accepted-bar { background:linear-gradient(180deg,var(--lime),var(--teal)); }.rejected-bar { background:var(--red); opacity:.82; }
.performance-column b { overflow:hidden; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }.performance-column small { font-size:9px; }
.performance-note { margin:10px 0 0; color:var(--muted); font-size:10px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.search { flex: 1; max-width: 460px; border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; background: white; }
.filters { display: flex; gap: 9px; }
.filters select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.table-wrap { overflow: auto; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.active-jobs-table { max-height: 560px; }
.active-jobs-table thead { position: sticky; top: 0; z-index: 2; }
.active-jobs-table .row-actions { flex-wrap: wrap; min-width: 230px; }
.active-jobs-table td { vertical-align: middle; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); background: #f7f9f8; padding: 13px 16px; font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: .06em; }
td { padding: 15px 16px; border-top: 1px solid var(--line); font-size: 13px; }
tr:hover td { background: #fbfcfb; }
.name { font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 5px 9px; font-size: 11px; font-weight: 700; background: var(--soft); color: var(--teal); }
.badge.yorkshire { background: #edf6d6; color: #5b7418; }
.badge.hertfordshire { background: #e3f1ed; color: #1f6658; }
.badge.draft { background: #fff4d8; color: #8b6415; }
.badge.active { background: #e4f4e9; color: #237343; }
.row-actions { display: flex; gap: 7px; }
.historic-job-option { padding: 13px 14px; border: 1px solid #dbe8b2; border-radius: 12px; background: #f5fadf; }
.historic-job-option label { display: flex; align-items: center; gap: 9px; }
.historic-job-option small { display: block; margin: 7px 0 0 25px; color: var(--muted); }
.icon-btn { border: 1px solid var(--line); background: white; border-radius: 8px; padding: 6px 9px; cursor: pointer; transition: all .15s ease; }
.icon-btn:hover { border-color: var(--teal); background: #f7faf8; }
.icon-btn.duplicate-line { color: var(--teal); font-weight: bold; }
.icon-btn.duplicate-line:hover { background: #e6f3ee; border-color: var(--teal); }
.icon-btn.danger-action { color: var(--red); border-color: #efb5b5; background: #fff7f7; }
.icon-btn.danger-action:hover { background: #ffecec; }

/* Sortable Table Headers */
.sortable-th { cursor: pointer; user-select: none; transition: background .15s ease, color .15s ease; white-space: nowrap; }
.sortable-th:hover { background: #edf4f0; color: var(--forest); }
.sortable-th.sorted { background: #e3ede7; color: var(--forest); font-weight: 800; }
.th-content { display: inline-flex; align-items: center; gap: 6px; }
.sort-indicator { display: inline-block; font-size: 10px; opacity: .35; transition: opacity .15s, transform .15s; }
.sort-indicator.active { opacity: 1; color: var(--teal); font-weight: 900; }

/* Document Register Table (10 columns with Date) */
.document-register-table { overflow-x: auto; }
.document-register-table table { table-layout: fixed; min-width: 1080px; }
.document-register-table th, .document-register-table td { padding-left: 8px; padding-right: 8px; overflow-wrap: anywhere; vertical-align: middle; }
.document-register-table th:nth-child(1) { width: 9%; }   /* Date */
.document-register-table th:nth-child(2) { width: 10%; }  /* Reference */
.document-register-table th:nth-child(3) { width: 8%; }   /* Type */
.document-register-table th:nth-child(4) { width: 12%; }  /* Customer */
.document-register-table th:nth-child(5) { width: 9%; }   /* Department */
.document-register-table th:nth-child(6) { width: 8%; }   /* Total */
.document-register-table th:nth-child(7) { width: 8%; }   /* Balance */
.document-register-table th:nth-child(8) { width: 9%; }   /* Due / Valid */
.document-register-table th:nth-child(9) { width: 8%; }   /* Status */
.document-register-table th:nth-child(10) { width: 19%; } /* Actions */
.document-register-table td:last-child > .row-actions,
.document-register-table td:last-child > .row-actions > .row-actions { flex-wrap: wrap; gap: 4px; }
.document-register-table td:last-child .icon-btn { padding: 5px 7px; font-size: 11px; line-height: 1.15; white-space: normal; }

/* Document Type Filter Chips */
.doc-type-filters { display: flex; gap: 6px; align-items: center; }
.filter-chip { border: 1px solid var(--line); background: white; border-radius: 20px; padding: 7px 14px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; transition: all .15s ease; }
.filter-chip:hover { border-color: var(--teal); color: var(--forest); background: #f7faf8; }
.filter-chip.active { background: var(--forest); color: white; border-color: var(--forest); box-shadow: 0 2px 6px rgba(24,61,52,.2); }
.hero-actions { display: flex; gap: 8px; align-items: center; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(13,31,26,.62); }
.modal { width: min(700px,100%); max-height: 90vh; overflow: auto; background: white; border-radius: 19px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.document-modal { width: calc(100vw - 48px); height: calc(100vh - 48px); max-height: none; }
.document-modal .modal-head { position: sticky; top: 0; z-index: 3; background: white; }
.document-modal .form { grid-template-columns: repeat(4,minmax(180px,1fr)); align-items: start; }
.document-modal .form > .full, .document-modal .form > .form-actions { grid-column: 1 / -1; }
.document-modal .field { align-self: start; }
.document-modal .document-builder { overflow-x: auto; }
.document-modal .line-head, .document-modal .document-line { grid-template-columns: minmax(300px,3fr) 85px 90px 125px 95px 85px 120px 145px; }
.document-new-customer-action .btn { width:100%; }
.quick-customer-panel { padding:16px; border:1px solid #dbe8b2; border-radius:13px; background:#f7faeb; }
.quick-customer-panel[hidden] { display:none!important; }
.quick-customer-head,.quick-customer-actions { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.quick-customer-head h4 { margin:0; }
.quick-customer-head p { margin:4px 0 0; color:var(--muted); font-size:12px; }
.quick-customer-grid { display:grid; grid-template-columns:repeat(5,minmax(150px,1fr)); gap:12px; margin-top:14px; }
.quick-customer-actions { margin-top:14px; }
.quick-customer-actions small { color:var(--muted); }
.payment-modal { width: min(920px,100%); }
.payment-modal .modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 21px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font: 800 21px Manrope; }
.close { border: 0; background: var(--soft); width: 34px; height: 34px; border-radius: 50%; }
.form { padding: 22px 24px 25px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: white; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.document-builder { border: 1px solid var(--line); border-radius: 13px; padding: 16px; background: #fafcfb; }
.line-head, .document-line { display: grid; grid-template-columns: minmax(180px,2fr) 65px 75px 100px 85px 75px 105px 145px; gap: 8px; align-items: center; }
.line-head { padding: 0 5px 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.document-line { padding: 8px 0; border-top: 1px solid var(--line); }
.document-line input, .document-line select { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: white; }
.document-line strong { text-align: right; font-size: 12px; }
.line-order-actions { display:flex; justify-content:flex-end; gap:4px; }
.line-order-actions .icon-btn { min-width:30px; padding:6px 5px; font-weight:800; }
.document-line-section + .document-line-section { margin-top:24px; }
.document-line-section h4 { margin:0 0 10px; padding:9px 12px; color:#0f172a; background:#f1f5f9; border-left:4px solid var(--teal); border-radius:6px; font:800 14px Manrope,sans-serif; letter-spacing:.02em; }
.section-add { margin-top:10px; }
@media (max-width: 760px) {
  .modal-backdrop { padding: 8px; }
  .document-modal { width: calc(100vw - 16px); height: calc(100vh - 16px); }
  .document-modal .form { grid-template-columns: 1fr; padding: 16px; }
  .document-modal .line-head, .document-modal .document-line { min-width: 1120px; }
  .quick-customer-grid { grid-template-columns:1fr; }
  .quick-customer-head,.quick-customer-actions { align-items:stretch; flex-direction:column; }
  .performance-stats { grid-template-columns:1fr 1fr; }
  .performance-chart { overflow-x:auto; grid-template-columns:repeat(12,minmax(46px,1fr)); }
}
.document-totals { margin-left: auto; width: min(390px,100%); display: grid; gap: 8px; padding: 16px; border-radius: 13px; background: var(--soft); }
.document-totals span { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); }
.document-totals b { color: var(--ink); }
.document-totals .section-total { color:var(--ink); font-weight:700; }
.document-totals .grand { padding-top: 9px; border-top: 1px solid var(--line); color: var(--ink); font-size: 16px; font-weight: 800; }
.document-totals .balance { color: var(--teal); font-weight: 800; }
.acceptance { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.acceptance-head { padding: 15px 17px; color: white; background: #000; }
.acceptance-head h4, .acceptance-head p { margin: 0; }
.acceptance-head h4 { font: 800 17px Manrope; color: var(--lime); }
.acceptance-head p { margin-top: 4px; color: #cbd2ce; font-size: 12px; }
.signature-columns { display: grid; grid-template-columns: 1fr 1fr; }
.signature-columns > div { display: grid; gap: 12px; padding: 17px; }
.signature-columns > div + div { border-left: 1px solid var(--line); }
.signature-columns h5 { margin: 0 0 2px; font: 800 14px Manrope; }
.acceptance-note { margin: 0; padding: 12px 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.signature-pad-field { grid-column:1 / -1; }
.admin-signature-canvas { display:block; width:100%; height:110px; border:1px solid var(--line); border-radius:10px; background:#fff; cursor:crosshair; touch-action:none; }
.signature-pad-field small { color:var(--muted); font-size:11px; }
.clear-signature { justify-self:start; padding:7px 10px; }
.legal-review-note { margin: -7px 0 0; padding: 10px 12px; border-left: 3px solid #9fc928; border-radius: 7px; background: #f4f8e9; color: #53613c; font-size: 11px; line-height: 1.45; }
.email-attachments { display:grid; gap:10px; padding:14px; border:1px solid var(--line); border-radius:12px; background:#fbfcfb; }
.email-attachments-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.email-attachments-head h4,.email-attachments-head p { margin:0; }
.email-attachments-head p { margin-top:4px; color:var(--muted); font-size:12px; }
.email-attachment-list { display:grid; gap:7px; }
.email-attachment-default,.email-attachment-item { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 11px; border:1px solid #dce3df; border-radius:9px; background:#fff; }
.email-attachment-default { display:grid; }
.email-attachment-default small,.email-attachment-item small { display:block; margin-top:2px; color:var(--muted); font-size:11px; }
.pdf-preview-overlay { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: auto 1fr; padding: 14px; background: #17201ded; }
.pdf-preview-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-radius: 12px 12px 0 0; background: white; }
.pdf-preview-toolbar strong { font: 800 15px Manrope; }
.pdf-preview-toolbar span { margin-right: auto; color: var(--muted); font-size: 12px; }
.pdf-preview-frame { width: 100%; height: 100%; border: 0; border-radius: 0 0 12px 12px; background: white; }
.notice { padding: 13px 15px; border-radius: 11px; background: #eff7df; color: #536a19; font-size: 13px; }
.cloud-banner { display:flex; align-items:center; gap:10px; margin-bottom:16px; padding:10px 13px; border-radius:10px; font-size:12px; }
.cloud-banner b { font:800 12px Manrope; }
.cloud-banner span { margin-right:auto; }
.cloud-banner.cloud { color:#275c1e; background:#eaf7e4; }
.cloud-banner.local { color:#674f0d; background:#fff5d5; }
.cloud-banner.connecting { color:#315d6b; background:#e9f4f7; }
.cloud-banner.error { color:#862b26; background:#fff0ef; }
.calendar-actions,.calendar-legend { display:flex; align-items:center; gap:9px; }
.upcoming-assigned { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:0 0 14px; padding:14px 16px; border:1px solid #d9e3de; border-left:4px solid var(--lime); border-radius:12px; background:#fff; }
.upcoming-assigned h4,.upcoming-assigned p { margin:0; }
.upcoming-assigned p { margin-top:3px; color:var(--muted); font-size:12px; }
.upcoming-assigned-list { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.upcoming-assigned-list button { display:grid; gap:2px; min-width:190px; padding:9px 11px; border:1px solid #cfdad5; border-radius:9px; background:#f6faf8; color:var(--ink); text-align:left; cursor:pointer; }
.upcoming-assigned-list button:hover { border-color:#7da311; background:#f1f8dc; }
.upcoming-assigned-list button span { color:var(--muted); font-size:11px; }
.calendar-legend { flex-wrap:wrap; margin:0 0 12px; color:var(--muted); font-size:12px; }
.calendar-legend span { display:flex; align-items:center; gap:6px; }
.calendar-legend i { width:10px; height:10px; border-radius:3px; background:#dff0ab; }
.calendar-legend i.fitter { background:var(--fitter-color,#82a918); }
.calendar-legend i.leave { background:#d92d20; }
.calendar { overflow:hidden; border:1px solid var(--line); border-radius:14px; background:white; }
.calendar-weekdays,.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.calendar-weekdays b { padding:11px; border-bottom:1px solid var(--line); color:var(--muted); text-align:center; font-size:11px; }
.calendar-day { min-height:122px; padding:8px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.calendar-day:nth-child(7n) { border-right:0; }
.calendar-day.outside { background:#f7f9f8; color:#9da8a2; }
.calendar-day.today .calendar-date { display:grid; place-items:center; width:26px; height:26px; border-radius:50%; color:#ffffff; background:#15803d; font-weight:800; }
.calendar-date { margin-bottom:6px; font-weight:800; font-size:12px; color:#0f172a; }
.calendar-events { display:grid; gap:5px; }
.calendar-event { display:grid; gap:2px; width:100%; padding:6px 8px; border:1px solid #e2e8f0; border-left:3.5px solid var(--fitter-color,#15803d); border-radius:7px; background:#ffffff; color:#0f172a; text-align:left; transition:transform 0.15s ease, box-shadow 0.15s ease; cursor:pointer; }
.calendar-event:hover { transform:translateY(-1px); box-shadow:0 4px 10px rgba(0,0,0,0.06); }
.calendar-event.job { border-left-color:var(--fitter-color,#15803d); background:#f8fafc; }
.calendar-event.leave {
  border-left-color:#ef4444;
  background:#fef2f2;
  color:#991b1b;
  border-color:#fecaca;
  box-shadow:inset 0 0 0 1px #fecaca;
}
.calendar-event.leave small { color:#b91c1c; }
.calendar-event b,.calendar-event small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.calendar-event b { font-size:11px; }
.calendar-event small { color:var(--muted); font-size:9px; }
.fitter-job-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(290px,1fr)); gap:16px; }
.fitter-job-card { overflow:hidden; padding:18px; border:1px solid var(--line); border-top:5px solid var(--fitter-color,#82a918); border-radius:16px; background:#fff; box-shadow:var(--shadow); }
.fitter-job-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.fitter-job-card-head h4 { margin:9px 0 3px; font:800 18px Manrope,sans-serif; }
.fitter-job-card-head p { margin:0; color:var(--muted); font-size:12px; }
.fitter-job-card-head > strong { color:var(--fitter-color,#16845b); font:800 22px Manrope,sans-serif; }
.job-progress { height:8px; margin:14px 0; overflow:hidden; border-radius:20px; background:#edf1ef; }
.job-progress i { display:block; height:100%; border-radius:inherit; background:var(--fitter-color,#82a918); }
.fitter-job-card dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0; }
.fitter-job-card dl div { min-width:0; padding:9px; border-radius:9px; background:#f6f8f7; }
.fitter-job-card dt { color:var(--muted); font-size:10px; font-weight:700; text-transform:uppercase; }
.fitter-job-card dd { margin:4px 0 0; font-size:12px; font-weight:700; }
.fitter-job-note { margin-top:12px; padding:11px 12px; border-left:3px solid var(--fitter-color,#82a918); border-radius:8px; background:color-mix(in srgb,var(--fitter-color,#82a918) 8%,white); }
.fitter-job-note p { margin:5px 0 0; color:var(--muted); font-size:12px; white-space:pre-wrap; }
.fitter-job-actions { display:flex; gap:8px; margin-top:14px; }
.fitter-job-detail { padding:20px 24px 24px; }
.job-detail-status { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.job-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.job-detail-grid section { min-width:0; padding:15px; border:1px solid var(--line); border-radius:12px; background:#fbfcfb; }
.job-detail-grid section:last-child { grid-column:1 / -1; }
.job-detail-grid h4 { margin:0 0 10px; font:800 15px Manrope,sans-serif; }
.job-detail-grid p { line-height:1.55; }
.job-instructions { white-space:pre-wrap; }
.job-history-item { display:grid; gap:2px; padding:9px 0; border-top:1px solid var(--line); }
.job-history-item span { color:var(--muted); font-size:11px; }
.job-history-item p { margin:3px 0 0; }
.job-time-overview { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.job-time-overview h4 { margin-bottom:5px; }
.job-time-overview h5 { margin:16px 0 8px; font:800 13px Manrope,sans-serif; color:var(--ink); }
.job-time-overview .table-wrap { box-shadow:none; border-radius:10px; }
.job-time-overview table { min-width:650px; }
.fitter-job-tool-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin-top:16px; }
.fitter-job-tool-grid .btn { white-space:normal; }
.checklist-list { display:grid; gap:10px; }
.checklist-item { display:flex; gap:12px; align-items:flex-start; padding:13px 14px; border:1px solid var(--line); border-radius:10px; background:#fff; cursor:pointer; }
.checklist-item input { width:20px; height:20px; margin-top:1px; accent-color:#84ad18; }
.checklist-item span { display:grid; gap:3px; }
.checklist-item small { color:var(--muted); }
.work-task-item:has(input:checked) { border-color:#a7cf35; background:#f5fae8; }
.work-task-item:has(input:checked) b { text-decoration:line-through; color:#526057; }
.assignment-work-list textarea { min-height:230px; line-height:1.5; }
.assignment-work-actions { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-top:8px; }
.assignment-work-actions small { max-width:620px; }
.working-day-options { display:flex; flex-wrap:wrap; gap:9px 16px; padding:12px; border:1px solid var(--line); border-radius:10px; background:#f8faf9; }
.working-day-options label { display:flex; align-items:center; gap:6px; font-weight:600; }
.working-day-options input { width:18px; height:18px; accent-color:#84ad18; }
.fitter-team-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; margin-top:6px; }
.fitter-team-option { display:flex; align-items:center; gap:10px; border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:#fff; }
.fitter-team-option input { width:auto; }
.fitter-team-option span { display:flex; flex-direction:column; gap:2px; }
.fitter-team-option small { color:var(--muted); }
.payroll-controls { margin:0 0 18px; padding:20px; border:1px solid var(--line); border-radius:18px; background:#fff; box-shadow:var(--shadow); display:grid; gap:16px; }
.payroll-date-range { display:grid; grid-template-columns:repeat(2,minmax(0,220px)); gap:12px; }
.payroll-date-range label { display:grid; gap:6px; color:var(--muted); font-size:13px; font-weight:800; }
.payroll-date-range input { width:100%; padding:12px; border:1px solid var(--line); border-radius:10px; background:#fff; color:var(--ink); font:inherit; }
.payroll-fitter-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }
.payroll-fitter-head small,.payroll-fitter-options small { display:block; margin-top:3px; color:var(--muted); }
.payroll-fitter-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:10px; }
.payroll-fitter-options label { display:flex; align-items:center; gap:10px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--soft); cursor:pointer; min-width:0; }
.payroll-fitter-options input { width:20px; height:20px; accent-color:var(--lime); flex:0 0 auto; }
.payroll-fitter-options span { min-width:0; overflow-wrap:anywhere; }
.payroll-controls > .btn { justify-self:start; }

@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .dashboard-visual-grid { grid-template-columns: 1fr !important; gap: 18px; }
  .grid-2 { grid-template-columns: 1fr; gap: 18px; }
  .topbar { padding: 10px 20px; }
  .eyebrow { max-width: 320px; }
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: 210px 1fr; }
  .sidebar { padding: 22px 14px; gap: 20px; }
  .brand-logo-box { width: 78px; height: 88px; }
  .brand h1 { font-size: 17px; }
  .nav button { padding: 9px 10px; font-size: 13px; }
  .content { padding: 20px 18px 60px; }
  .eyebrow { max-width: 220px; }
  .user-tools select { max-width: 155px; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 86px 1fr; }
  .brand h1, .brand p, .nav button span, .sidebar-foot { display:none; }
  .brand { padding:0; text-align:center; }
  .nav button { justify-content:center; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0,1fr); }
  .dashboard-visual-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  html, body { width:100%; max-width:100%; overflow-x:hidden; }
  .shell { display:block; }
  .sidebar { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; padding: 8px; overflow-x:auto; overflow-y:hidden; }
  .brand, .sidebar-foot { display:none; }
  .nav { display:grid; width:100%; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; }
  .nav button { min-width:0; width:100%; height:40px; justify-content:center; padding:6px 2px; font-size:18px; }
  .nav button.active::before { width:4px; height:18px; }
  .topbar {
    min-height:72px;
    height:auto;
    align-items:stretch;
    flex-direction:column;
    padding:10px 16px;
    gap:9px;
  }
  .topbar > div:first-child { min-width:0; width:100%; }
  .eyebrow { display:none; }
  .topbar h2 { margin:0; font-size:20px; white-space:normal; }
  .user-tools { min-width:0; width:100%; gap:6px; }
  .user-tools select { min-width:0; width:auto; flex:1 1 145px; padding:8px; }
  .signed-in-label { min-width:0; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .user-tools .btn { padding:8px; font-size:12px; }
  .user-tools .avatar { display:none; }
  .user-tools .avatar.fitter-avatar { display:block; width:38px; height:38px; flex:0 0 38px; }
  .content { width:100%; max-width:100%; padding:18px 16px 130px; overflow:hidden; }
  .cloud-banner { align-items:flex-start; flex-wrap:wrap; }
  .cloud-banner span { min-width:0; flex:1 1 180px; overflow-wrap:anywhere; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat { min-width:0; padding:16px; overflow:hidden; }
  .stat strong { font-size:24px; }
  .grid-2 > *, .panel, .table-wrap { min-width:0; max-width:100%; }
  .panel { padding:16px; }
  .panel-head { align-items:flex-start; flex-direction:column; }
  .table-wrap {
    width:100%;
    overflow:visible;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
  }
  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td { display:block; width:100%; }
  .table-wrap thead { display:none; }
  .table-wrap tbody { display:grid; gap:12px; }
  .table-wrap tr {
    overflow:hidden;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
    box-shadow:0 8px 24px rgba(21,45,38,.06);
  }
  .table-wrap td {
    min-width:0;
    padding:10px 12px;
    border-top:1px solid #edf1ef;
    overflow-wrap:anywhere;
    word-break:normal;
  }
  .table-wrap td:first-child { border-top:0; }
  .table-wrap td:not([data-label=""]) {
    display:grid;
    grid-template-columns:minmax(82px,32%) minmax(0,1fr);
    align-items:start;
    gap:10px;
  }
  .table-wrap td:not([data-label=""])::before {
    content:attr(data-label);
    color:var(--muted);
    font-size:10px;
    font-weight:800;
    letter-spacing:.04em;
    line-height:1.35;
    text-transform:uppercase;
  }
  .table-wrap td[data-label=""] { padding-top:12px; }
  .table-wrap .row-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    min-width:0;
    width:100%;
    gap:7px;
  }
  .table-wrap .row-actions > .row-actions { display:contents; }
  .table-wrap .icon-btn,
  .table-wrap .row-actions .btn,
  .table-wrap .row-actions a {
    min-width:0;
    width:100%;
    padding:9px 7px;
    white-space:normal;
    text-align:center;
  }
  .table-wrap .empty-row td,
  .table-wrap td.empty { display:block; padding:30px 16px; text-align:center; }
  .document-register-table { overflow:visible; }
  .document-register-table table { table-layout:auto; }
  .document-register-table th:nth-child(n) { width:auto; }
  .document-register-table th,
  .document-register-table td { padding-left:12px; padding-right:12px; }
  .document-register-table td:last-child .icon-btn { padding:9px 7px; font-size:12px; }
  .active-jobs-table { max-height:none; }
  .hero { align-items:flex-start; flex-direction:column; }
  .hero h3 { font-size:29px; line-height:1.08; }
  .hero > .btn { width:100%; }
  .toolbar { align-items:stretch; flex-direction:column; }
  .search { max-width:none; }
  .filters { width:100%; }
  .filters select { min-width:0; width:100%; }
  .form { grid-template-columns:1fr; }
  .field.full { grid-column:auto; }
  .line-head { display:none; }
  .document-line { grid-template-columns: 1fr 1fr; }
  .document-line input[name="description"] { grid-column:1 / -1; }
  .signature-columns { grid-template-columns:1fr; }
  .signature-columns > div + div { border-left:0; border-top:1px solid var(--line); }
  .pdf-preview-overlay { padding: 0; }
  .pdf-preview-toolbar { flex-wrap: wrap; border-radius: 0; }
  .pdf-preview-toolbar span { display: none; }
  .pdf-preview-frame { border-radius: 0; }
  .upcoming-assigned { align-items:stretch; flex-direction:column; }
  .upcoming-assigned-list { justify-content:stretch; }
  .upcoming-assigned-list button { width:100%; min-width:0; }
  .calendar-actions {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    width:100%;
    gap:7px;
  }
  .calendar-actions .btn {
    min-width:0;
    padding:9px 5px;
    font-size:11px;
    line-height:1.2;
    white-space:normal;
  }
  .calendar {
    width:100%;
    max-width:100%;
    overflow:hidden;
  }
  .calendar-weekdays,.calendar-grid {
    width:100%;
    min-width:0;
    grid-template-columns:repeat(7,minmax(0,1fr));
  }
  .calendar-weekdays b { min-width:0; padding:8px 1px; font-size:9px; }
  .calendar-day { min-width:0; min-height:84px; padding:3px 2px; overflow:hidden; }
  .calendar-date { margin-bottom:3px; font-size:10px; }
  .calendar-day.today .calendar-date { width:20px; height:20px; }
  .calendar-events { gap:3px; min-width:0; }
  .calendar-event { min-width:0; padding:4px 2px; border-left-width:2px; }
  .calendar-event b { font-size:8px; }
  .calendar-event small { display:none; }
  .fitter-job-grid { grid-template-columns:1fr; }
  .fitter-job-card { padding:15px; }
  .fitter-job-card dl { grid-template-columns:1fr; }
  .fitter-job-actions { display:grid; grid-template-columns:1fr 1fr; }
  .fitter-job-detail { padding:16px; }
  .job-detail-grid { grid-template-columns:1fr; }
  .job-detail-grid section:last-child { grid-column:auto; }
  .fitter-job-tool-grid { grid-template-columns:1fr; }
  .assignment-work-actions { align-items:stretch; flex-direction:column; }
  .assignment-work-actions .btn { width:100%; }
  .fitter-job-modal { max-height:calc(100vh - 16px); }

  /* One phone-safe layout shared by owners, PAs and fitters. */
  .modal-backdrop {
    display:block;
    padding:6px;
    overflow:hidden;
  }
  .modal,
  .payment-modal,
  .fitter-job-modal,
  .document-modal {
    width:100%;
    max-width:100%;
    height:auto;
    max-height:calc(100dvh - 12px);
    margin:0;
    overflow-x:hidden;
    overflow-y:auto;
    border-radius:14px;
  }
  .modal-head {
    position:sticky;
    top:0;
    z-index:4;
    min-width:0;
    padding:15px 16px;
    background:#fff;
  }
  .modal-head > div { min-width:0; }
  .modal-head h3,
  .modal-head p { overflow-wrap:anywhere; }
  .form { min-width:0; padding:16px; gap:13px; }
  .form-actions {
    align-items:stretch;
    flex-direction:column-reverse;
    width:100%;
  }
  .form-actions .btn { width:100%; }
  .field,
  .field input,
  .field select,
  .field textarea,
  .notice { min-width:0; max-width:100%; }
  .field textarea { resize:vertical; }
  .fitter-job-detail { min-width:0; max-width:100%; padding:15px; overflow:hidden; }
  .job-detail-status { align-items:flex-start; flex-wrap:wrap; }
  .job-detail-grid section,
  .job-instructions,
  .job-history-item,
  .checklist-item span { min-width:0; overflow-wrap:anywhere; }
  .job-time-overview { min-width:0; max-width:100%; overflow:hidden; }
  .job-time-overview table { min-width:0; }
  .job-time-overview .table-wrap { width:100%; overflow:visible; }
  .fitter-job-tool-grid .btn { width:100%; }
.staff-photo-editor { align-items:flex-start; flex-direction:column; }
.time-correction-panel { margin-top:18px; }
.time-correction-list { display:grid; gap:10px; padding:0 20px 20px; }
.time-correction-card { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.time-correction-card div { min-width:0; }
.time-correction-card b,.time-correction-card small { display:block; overflow-wrap:anywhere; }
.time-correction-card small { margin-top:4px; color:var(--muted); }
.time-correction-card .btn { flex:0 0 auto; }
  .document-modal .document-builder { width:100%; overflow:visible; }
  .time-correction-list { padding:0 14px 14px; }
  .time-correction-card { align-items:stretch; flex-direction:column; }
  .time-correction-card .btn,.time-correction-card .badge { width:100%; text-align:center; }
  .payroll-controls { padding:14px; border-radius:14px; }
  .payroll-date-range { grid-template-columns:1fr 1fr; }
  .payroll-fitter-head { align-items:stretch; flex-direction:column; }
  .payroll-fitter-head > div:last-child { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
  .payroll-fitter-options { grid-template-columns:1fr; }
  .payroll-controls > .btn { width:100%; }
  .document-modal .line-head { display:none; }
  .document-modal .document-line {
    min-width:0;
    width:100%;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  }
  .document-modal .document-line input[name="description"],
  .document-modal .document-line select[name="description"],
  .document-modal .document-line .line-order-actions { grid-column:1 / -1; }
  .document-totals { width:100%; margin-left:0; }
}
.document-line-section .section-help{margin:-4px 0 12px;color:#66736c;font-size:13px}
.supply-only-section{border-color:#cddf9b;background:#fbfff2}

/* Dashboard Modern Visualizations & Quick Actions */
.dashboard-quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.dashboard-quick-actions .btn { display: inline-flex; align-items: center; gap: 7px; padding: 11px 18px; font-size: 13px; font-weight: 700; border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.04); }
.dashboard-quick-actions .btn-quote { background: #0f172a; color: white; border: 1px solid #0f172a; }
.dashboard-quick-actions .btn-quote:hover { background: #1e293b; }
.dashboard-quick-actions .btn-invoice { background: var(--forest); color: white; border: 1px solid var(--forest); }
.dashboard-quick-actions .btn-invoice:hover { background: #14473c; }

/* Enhanced KPI Stat Cards */
.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; margin-bottom: 12px; background: rgba(255,255,255,.8); border: 1px solid var(--line); }
.stat-tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 12px; display: inline-block; margin-top: 6px; }
.stat-tag.success { background: #dcfce7; color: #15803d; }
.stat-tag.warning { background: #fef3c7; color: #b45309; }
.stat-tag.info { background: #e0f2fe; color: #0369a1; }
.stat-tag.neutral { background: #f1f5f9; color: #475569; }

/* Visual Chart Grid */
.dashboard-visual-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; margin: 22px 0; }
@media (max-width: 1280px) {
  .dashboard-visual-grid { grid-template-columns: 1fr !important; }
}
.viz-card { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.viz-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.viz-card-head h4 { margin: 0; font: 800 17px Manrope; color: var(--ink); }
.viz-card-head .subtitle { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

/* Pipeline Donut */
.donut-container { display: flex; align-items: center; justify-content: flex-start; gap: 32px; flex-wrap: wrap; margin: auto 0; padding: 10px 0; }
.donut-svg-wrap { position: relative; width: 170px; height: 170px; flex: 0 0 170px; }
.donut-center-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center-pct { font: 800 28px Manrope; color: #0f172a; line-height: 1; }
.donut-center-sub { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.donut-legend { display: flex; flex-direction: column; gap: 12px; min-width: 200px; flex: 1; }
.donut-legend-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.donut-legend-val { font-weight: 700; color: #0f172a; }

/* Revenue & Quote Flow Chart */
.flow-chart-wrap { width: 100%; overflow-x: auto; margin-top: auto; }
.flow-bars-chart { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; height: 160px; padding-top: 20px; border-bottom: 2px solid var(--line); min-width: 320px; }
.flow-column { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; position: relative; cursor: pointer; }
.flow-bar-group { display: flex; align-items: flex-end; gap: 5px; height: 100%; width: 100%; max-width: 44px; }
.flow-bar { width: 50%; border-radius: 4px 4px 0 0; transition: height .3s cubic-bezier(.4,0,.2,1), opacity .15s; }
.flow-bar:hover { opacity: .85; }
.flow-bar.quote { background: #3b82f6; }
.flow-bar.invoice { background: #10b981; }
.flow-col-label { margin-top: 8px; font-size: 11px; font-weight: 700; color: var(--muted); }
.flow-chart-legend { display: flex; gap: 18px; margin-top: 14px; font-size: 12px; font-weight: 600; }
.flow-legend-item { display: flex; align-items: center; gap: 6px; }
.flow-legend-item span { width: 12px; height: 12px; border-radius: 3px; }

/* ==========================================================================
   Modernized Executive Theme & Component Deck
   ========================================================================== */

/* Universal KPI Summary Deck */
.kpi-deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
.kpi-card .kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-card .kpi-val, .kpi-value {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 800;
  color: #0f172a;
  margin: 6px 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-card .kpi-sub {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.kpi-card.emerald { border-left: 4px solid #16a34a; }
.kpi-card.blue { border-left: 4px solid #2563eb; }
.kpi-card.amber { border-left: 4px solid #f59e0b; }
.kpi-card.purple { border-left: 4px solid #7c3aed; }
.kpi-card.slate { border-left: 4px solid #0f172a; }

/* Filter Chips Bar */
.filter-chips-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.filter-chips-bar .filter-chip {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-chips-bar .filter-chip:hover {
  border-color: #0f172a;
  color: #0f172a;
  background: #f8fafc;
}
.filter-chips-bar .filter-chip.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

/* Category & Type Badges */
.badge.item-service {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-weight: 700;
}
.badge.item-material {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 700;
}
.badge.item-supply {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
  font-weight: 700;
}
.badge.unit-badge {
  background: #f1f5f9;
  color: #475569;
  font-family: monospace;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

/* Action Pills */
.action-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1;
  user-select: none;
  transition: all 0.12s ease;
  text-decoration: none;
  white-space: nowrap;
}
.action-pill:hover {
  background: #f8fafc;
  border-color: #0f172a;
  color: #0f172a;
  transform: translateY(-1px);
}
.action-pill.primary {
  background: #15803d;
  color: #ffffff;
  border-color: #15803d;
}
.action-pill.primary:hover {
  background: #166534;
  border-color: #166534;
  color: #ffffff;
}
.action-pill.blue {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.action-pill.blue:hover {
  background: #1d4ed8;
  color: #ffffff;
}
.action-pill.amber {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
.action-pill.amber:hover {
  background: #fef3c7;
  border-color: #f59e0b;
}
.action-pill.danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.action-pill.danger:hover {
  background: #fee2e2;
  border-color: #f87171;
}

/* Customer Avatar Circle */
.customer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  font-weight: 800;
  font-size: 11px;
  flex: 0 0 32px;
  margin-right: 8px;
}
.customer-cell {
  display: flex;
  align-items: center;
}

/* Modern Document Modal Builder */
.document-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  margin-bottom: 18px;
}
.document-builder-header b {
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  color: #4ade80;
}
.document-builder-header span {
  font-size: 12px;
  color: #cbd5e1;
}
.document-line-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}
.document-line-section.fitting { border-top: 4px solid #16a34a; }
.document-line-section.materials { border-top: 4px solid #2563eb; }
.document-line-section.supply { border-top: 4px solid #7c3aed; }
.document-line-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.document-line-section-header h4 {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-subtotal-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
/* Room Dimension Estimator & Magicplan Companion */
.room-estimator-card {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  margin-bottom: 22px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.room-estimator-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  gap: 14px;
}
.room-estimator-banner-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.room-estimator-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #dcfce7;
  color: #166534;
  padding: 3px 8px;
  border-radius: 9999px;
}
.room-estimator-title {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.room-estimator-desc {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}
.room-estimator-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #f8fafc;
}
.room-estimator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.room-estimator-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.metric-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.metric-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.metric-value {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.room-estimator-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  background: #ffffff;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.toggle-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #334155;
  cursor: pointer;
  user-select: none;
}
.toggle-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #16a34a;
}
.room-estimator-plan-box {
  background: #ffffff;
  border: 1.5px dashed #94a3b8;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.plan-box-info b {
  display: block;
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 2px;
}
.plan-box-info p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}
.plan-upload-status {
  font-size: 12px;
  color: #16a34a;
  font-weight: 600;
  margin-left: 8px;
}
.room-estimator-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}
.room-estimator-preview-totals {
  font-size: 13px;
  color: #475569;
}
.room-estimator-preview-totals b {
  color: #0f172a;
}
.room-estimator-preview-totals strong {
  color: #16a34a;
  font-size: 14px;
}
.room-estimator-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.document-totals {
  background: #ffffff;
  border: 2px solid #0f172a;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  width: min(440px, 100%);
  margin-left: auto;
}
.document-totals-head {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: #0f172a;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.document-totals .grand {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  padding-top: 10px;
  border-top: 2px solid #0f172a;
}
.document-totals .balance {
  font-size: 16px;
  font-weight: 800;
  color: #15803d;
}

/* Duration Pill */
.duration-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-weight: 700;
  font-size: 12px;
  color: #0f172a;
}
.duration-pill.active {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

/* Calendar Legend Chip */
.calendar-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.calendar-legend-chip i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 9px;
}

/* Audit Trail Badges */
.audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.audit-badge.document { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.audit-badge.payment { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.audit-badge.delete { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.audit-badge.bank { background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.audit-badge.system { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }

/* Staff Profile Highlights */
.staff-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.hourly-rate-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-weight: 800;
  font-size: 12.5px;
}

/* ==========================================================================
   LIVE SHIFT & FITTER CLOCK IN / OUT MOBILE STYLES
   ========================================================================== */
.live-shift-hero {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px -5px rgba(5, 150, 105, 0.3), 0 4px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid #10b981;
}
@media (min-width: 681px) {
  .live-shift-hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
  }
}
.live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.live-pulse-dot {
  width: 9px;
  height: 9px;
  background: #34d399;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: live-pulse-anim 1.8s infinite;
}
@keyframes live-pulse-anim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.live-shift-address {
  margin: 6px 0 2px;
  font-size: 19px;
  font-weight: 800;
  font-family: 'Manrope', sans-serif;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.live-shift-timer-box {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 4px;
}
.live-shift-timer-value {
  font-size: 24px;
  font-weight: 800;
  font-family: 'DM Sans', monospace;
  color: #a7f3d0;
  background: rgba(0, 0, 0, 0.22);
  padding: 4px 12px;
  border-radius: 8px;
}
/* Fitter Punch Clock Station (Large Tactile Push Buttons) */
.fitter-punch-station {
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
@media (min-width: 681px) {
  .fitter-punch-station {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
  }
}
.fitter-punch-station.shift-active {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
  border: 2px solid #10b981;
  color: #ffffff;
  box-shadow: 0 12px 30px -5px rgba(5, 150, 105, 0.4);
}
.fitter-punch-station.shift-idle {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1.5px solid #cbd5e1;
  border-left: 6px solid #16a34a;
}
.fitter-punch-station-info h4 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  font-family: 'Manrope', sans-serif;
  color: #0f172a;
}
.fitter-punch-station-info p {
  margin: 0;
  font-size: 13.5px;
  color: #64748b;
}

/* Master Tactile Punch Button */
.punch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 26px;
  border-radius: 16px;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.12s ease;
  position: relative;
  text-decoration: none;
  border: none;
  min-height: 62px;
  width: 100%;
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 681px) {
  .punch-btn {
    width: auto;
    min-width: 250px;
  }
}

/* Green PUNCH IN state */
.punch-btn.punch-in, .btn-clock-in {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 60%, #15803d 100%);
  color: #ffffff;
  box-shadow: 0 6px 0 #14532d, 0 12px 22px rgba(22, 163, 74, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.12s ease;
  min-height: 56px;
}
.punch-btn.punch-in:hover, .btn-clock-in:hover {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 60%, #15803d 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #14532d, 0 16px 26px rgba(22, 163, 74, 0.4);
}
.punch-btn.punch-in:active, .btn-clock-in:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #14532d, 0 4px 10px rgba(22, 163, 74, 0.3);
}

/* Red PUNCH OUT state */
.punch-btn.punch-out, .btn-clock-out {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(180deg, #f87171 0%, #ef4444 55%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 6px 0 #991b1b, 0 12px 22px rgba(239, 68, 68, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.12s ease;
  min-height: 56px;
  animation: punch-pulse 2s infinite ease-in-out;
}
.punch-btn.punch-out:hover, .btn-clock-out:hover {
  background: linear-gradient(180deg, #fca5a5 0%, #ef4444 55%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #991b1b, 0 16px 26px rgba(239, 68, 68, 0.45);
}
.punch-btn.punch-out:active, .btn-clock-out:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #991b1b, 0 4px 10px rgba(239, 68, 68, 0.3);
}

@keyframes punch-pulse {
  0%, 100% { box-shadow: 0 6px 0 #991b1b, 0 10px 20px rgba(239, 68, 68, 0.35); }
  50% { box-shadow: 0 6px 0 #991b1b, 0 15px 28px rgba(239, 68, 68, 0.6); }
}

/* Inner elements for punch button */
.punch-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}
.punch-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.punch-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
}
.punch-subtitle {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.92;
  letter-spacing: 0.01em;
  margin-top: 2px;
}
.punch-btn.punch-loading {
  opacity: 0.8;
  cursor: wait;
}

/* Dedicated Fitter Job Card Punch Bar */
.fitter-job-punch-bar {
  margin: 14px 0 12px;
}
.fitter-job-punch-bar .punch-btn {
  width: 100%;
  padding: 14px 20px;
  min-height: 52px;
}
.fitter-job-punch-bar .punch-title {
  font-size: 14px;
}

/* Dedicated Modal Punch Station */
.modal-punch-station {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  padding: 14px 16px;
  margin: 12px 0 18px;
}
.modal-punch-station .punch-btn {
  width: 100%;
  padding: 15px 22px;
  min-height: 58px;
}

/* PA Live On-Site Attendance Widget */
.pa-live-attendance {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #15803d;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pa-live-attendance-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.live-fitter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: #15803d;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

/* Mobile Calendar Agenda View */
.mobile-agenda-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.agenda-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 5px solid var(--fitter-color, #15803d);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agenda-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.agenda-card-date {
  font-size: 11.5px;
  font-weight: 800;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.agenda-card h4 {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.agenda-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* Mobile & Touch Improvements (iPhone Safari & Android Chrome) */
@media (max-width: 680px) {
  .sidebar {
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }
  .content {
    padding-bottom: calc(115px + env(safe-area-inset-bottom)) !important;
  }
  .fitter-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
  .fitter-nav button {
    height: 48px !important;
    padding: 6px 2px !important;
    font-size: 20px !important;
  }
  /* Enforce 16px on inputs to prevent iOS Safari auto-zoom */
  input[type="text"], input[type="email"], input[type="date"], input[type="time"], input[type="number"], select, textarea {
    font-size: 16px !important;
  }
  /* Touch target sizes */
  .btn, .action-pill, .filter-chip {
    min-height: 44px;
    touch-action: manipulation;
  }
  .calendar-actions .btn {
    min-height: 42px;
  }
  /* Horizontal scroll for grid so it doesn't squish unreadably */
  .calendar {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .calendar-weekdays, .calendar-grid {
    min-width: 580px;
  }
}

/* Staff Directory Modern Contractor Cards */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.staff-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  transition: all 0.2s ease;
  position: relative;
}
.staff-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}
.staff-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.staff-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.staff-avatar-wrap .staff-photo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.staff-avatar-wrap .staff-photo-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #f8fafc;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.staff-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ffffff;
}
.staff-status-dot.active { background: #16a34a; }
.staff-status-dot.inactive { background: #94a3b8; }
.staff-info h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.staff-info .staff-role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 3px;
  color: #64748b;
}
.staff-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.staff-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.staff-detail-label {
  color: #64748b;
  font-weight: 600;
}
.staff-cal-swatch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
.staff-cal-swatch i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.staff-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.staff-card-actions .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  min-height: 38px;
  text-align: center;
  justify-content: center;
}

/* Timesheet Weekly Progress Widget */
.timesheet-progress-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.timesheet-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.timesheet-progress-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.timesheet-progress-metric {
  font-family: 'DM Sans', monospace;
  font-size: 16px;
  font-weight: 800;
  color: #16a34a;
}
.timesheet-progress-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.timesheet-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.timesheet-progress-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
  margin-top: 8px;
}

/* Fitter Mobile Daily Shift Cards */
.timesheet-shift-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timesheet-shift-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}
.timesheet-shift-card.active-shift {
  border-color: #10b981;
  background: #f0fdf4;
}
.timesheet-shift-card.warning-shift {
  border-color: #fca5a5;
  background: #fef2f2;
}
.timesheet-shift-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.timesheet-shift-date {
  font-size: 11.5px;
  font-weight: 800;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.timesheet-shift-address {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.timesheet-shift-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
}
.timesheet-shift-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

/* PA Fitter Payroll Summary Cards */
.payroll-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.payroll-fitter-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}
.payroll-fitter-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.payroll-fitter-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 10px;
}
.payroll-fitter-stats div {
  display: flex;
  flex-direction: column;
}
.payroll-fitter-stats span {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
}
.payroll-fitter-stats b {
  font-size: 15px;
  color: #0f172a;
}



