* { box-sizing: border-box; }
body { margin: 0; background: #f4f4f5; color: #18181b; font-family: Arial, sans-serif; }
body.menu-open { overflow: hidden; }
body.modal-open { overflow: hidden; }
[hidden] { display: none !important; }
a { color: inherit; }
.sidebar { background: #000; color: white; min-height: 100vh; padding: 20px; position: fixed; width: 250px; }
.menu-toggle, .menu-close { display: none; }
.nav-backdrop { background: rgba(0, 0, 0, .5); inset: 0; position: fixed; z-index: 39; }
.brand { display: block; font-size: 20px; font-weight: 700; margin-bottom: 24px; text-decoration: none; }
.brand-logo { background: #000; border-radius: 6px; display: flex; height: 112px; margin-bottom: 24px; overflow: hidden; padding: 6px; }
.brand-logo img { display: block; height: 100%; object-fit: contain; width: 100%; }
.nav-heading { color: #a1a1aa; font-size: 11px; font-weight: 700; letter-spacing: .08em; margin: 18px 12px 8px; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 8px; margin-bottom: 24px; }
.sidebar a { border-radius: 6px; color: #d4d4d8; padding: 10px 12px; text-decoration: none; }
.sidebar a:hover { background: #27272a; color: white; }
.main { margin-left: 250px; min-height: 100vh; }
.topbar { align-items: center; background: white; border-bottom: 1px solid #e4e4e7; display: flex; justify-content: space-between; padding: 16px 28px; }
.topbar p { color: #71717a; font-size: 12px; margin: 0 0 4px; text-transform: uppercase; }
.topbar h1 { font-size: 24px; margin: 0; }
.topbar-user { align-items: center; display: flex; gap: 8px; }
.topbar-avatar { border-radius: 999px; display: inline-flex; flex: 0 0 28px; height: 28px; object-fit: cover; width: 28px; }
.topbar-avatar-initial { align-items: center; background: #18181b; color: white; font-size: 12px; font-weight: 700; justify-content: center; }
.mail-link { align-items: center; border: 1px solid #d4d4d8; border-radius: 999px; color: #3f3f46; display: inline-flex; height: 34px; justify-content: center; position: relative; text-decoration: none; width: 34px; }
.mail-link svg { fill: none; height: 18px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 18px; }
.mail-link.has-mail { background: #18181b; border-color: #18181b; color: white; }
.mail-link span { align-items: center; background: #b91c1c; border: 2px solid white; border-radius: 999px; color: white; display: inline-flex; font-size: 10px; font-weight: 700; height: 18px; justify-content: center; min-width: 18px; padding: 0 4px; position: absolute; right: -7px; top: -7px; }
.content { padding: 28px; }
.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }
.two { grid-template-columns: 360px 1fr; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: white; border: 1px solid #e4e4e7; border-radius: 8px; min-width: 0; padding: 20px; }
.stat strong { display: block; font-size: 34px; margin-top: 8px; }
.detail-list p { margin: 0 0 8px; }
label { display: block; font-size: 14px; font-weight: 700; margin-top: 12px; }
.readonly-field { display: block; font-size: 14px; font-weight: 700; margin-top: 12px; }
.readonly-field strong { background: #f4f4f5; border: 1px solid #d4d4d8; border-radius: 6px; display: block; font-weight: 500; margin-top: 6px; padding: 10px; }
input, select, textarea { border: 1px solid #d4d4d8; border-radius: 6px; display: block; margin-top: 6px; max-width: 100%; min-width: 0; padding: 10px; width: 100%; }
textarea { min-height: 90px; }
button, .button, .actions a { background: #18181b; border: 0; border-radius: 6px; color: white; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; line-height: 1.2; margin-top: 14px; min-height: 40px; padding: 10px 14px; text-align: center; text-decoration: none; transition: background .15s ease, box-shadow .15s ease, transform .15s ease; }
button:hover, .button:hover, .actions a:hover { background: #27272a; box-shadow: 0 2px 8px rgba(24, 24, 27, .18); transform: translateY(-1px); }
.actions a, .secondary, .button.secondary { background: #52525b; transition: background .15s ease, box-shadow .15s ease, transform .15s ease; }
.actions a:hover, .secondary:hover, .button.secondary:hover { background: #3f3f46; box-shadow: 0 2px 8px rgba(24, 24, 27, .18); transform: translateY(-1px); }
.ghost-button { background: transparent; border: 1px solid #3f3f46; width: 100%; }
.success { background: #047857; }
.danger { background: #b91c1c; }
.danger:hover { background: #991b1b; }
table { border-collapse: collapse; width: 100%; }
.balanced-table { table-layout: fixed; }
.balanced-table th, .balanced-table td { min-width: 0; overflow-wrap: anywhere; }
table td, table th { min-width: 90px; }
th { color: #71717a; font-size: 12px; text-align: left; text-transform: uppercase; }
td, th { border-bottom: 1px solid #e4e4e7; padding: 10px; vertical-align: top; }
.nowrap { white-space: nowrap; }
.pill { background: #f4f4f5; border-radius: 999px; display: inline-block; font-size: 12px; padding: 4px 8px; }
.pill.check-success { background: #16a34a; color: white; }
.pill.check-fail { background: #dc2626; color: white; }
.pill.mot-pass { background: #16a34a !important; color: white !important; }
.pill.mot-fail { background: #dc2626 !important; color: white !important; }
.work-status-green { background: #dcfce7 !important; color: #166534 !important; }
.work-status-orange { background: #ffedd5 !important; color: #9a3412 !important; }
.work-status-yellow { background: #fef3c7 !important; color: #92400e !important; }
.work-status-red { background: #fee2e2 !important; color: #991b1b !important; }
.quote-status-green { background: #dcfce7 !important; color: #166534 !important; }
.quote-status-yellow { background: #fef3c7 !important; color: #92400e !important; }
.health-green { background: #dcfce7 !important; color: #166534 !important; }
.health-amber { background: #fef3c7 !important; color: #92400e !important; }
.health-red { background: #fee2e2 !important; color: #991b1b !important; }
.health-row { align-items: end; display: grid; gap: 10px; grid-template-columns: 150px minmax(0, 1fr); }
.health-report-layout { align-items: start; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); }
.health-report-form { overflow: visible; }
.health-report-details { background: #f9fafb; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 16px; padding: 14px; }
.health-report-details label { margin-top: 12px; }
.health-report-meta { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.health-check-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.health-check-card { background: #fff; border: 1px solid #e4e4e7; border-radius: 8px; padding: 14px; }
.health-check-head { align-items: center; display: grid; gap: 12px; grid-template-columns: minmax(90px, .35fr) minmax(0, 1fr); }
.health-check-head strong { font-size: 16px; }
.health-status-toggle { display: grid; gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.health-choice { margin: 0; }
.health-choice input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.health-choice span { align-items: center; border: 1px solid #d4d4d8; border-radius: 6px; display: flex; font-size: 13px; font-weight: 700; justify-content: center; min-height: 44px; padding: 9px; text-align: center; }
.health-choice-green input:checked + span { background: #dcfce7; border-color: #86efac; color: #166534; }
.health-choice-amber input:checked + span { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.health-choice-red input:checked + span { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.health-check-card textarea { min-height: 76px; }
.health-upload-box { background: #f9fafb; border: 1px dashed #a1a1aa; border-radius: 8px; padding: 14px; }
.health-action-bar { align-items: center; background: white; border-top: 1px solid #e4e4e7; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; margin: 18px -20px -20px; padding: 12px 20px; position: sticky; z-index: 5; }
.health-action-bar button, .health-action-bar .button { margin-top: 0; }
.health-report-list-card { overflow-x: auto; }
.health-report-table { table-layout: auto; }
.health-report-table th, .health-report-table td { min-width: 0; overflow-wrap: anywhere; }
.health-report-table th:last-child, .health-report-table td:last-child { width: 430px; }
.health-report-table td.actions { align-items: center; flex-wrap: nowrap; }
.health-report-table td.actions a { min-width: 0; padding-left: 12px; padding-right: 12px; }
.health-report-table td.actions form { flex: 0 0 auto; }
.mot-defects { display: grid; gap: 5px; line-height: 1.45; }
.mot-defect { display: block; font-size: 13px; line-height: 1.45; }
.mot-defect span { padding: 1px 3px; }
.mot-defect-advisory { background: #fde68a; box-decoration-break: clone; -webkit-box-decoration-break: clone; color: #18181b; }
.mot-defect-fail { background: #fecaca; box-decoration-break: clone; -webkit-box-decoration-break: clone; color: #18181b; }
.status-select { margin-top: 0; min-width: 150px; padding: 8px; }
.notice { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 6px; color: #065f46; margin-bottom: 18px; padding: 12px; }
.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.page-actions { align-items: center; display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-actions form { margin: 0; }
.page-actions .button, .page-actions button { margin-top: 0; }
.page-actions-right { align-items: center; display: flex; gap: 8px; }
.dashboard-period-toolbar { margin-bottom: 16px; }
.dashboard-latest-update { color: #3f3f46; font-size: 14px; }
.dashboard-period-form { align-items: end; display: flex; gap: 8px; }
.dashboard-period-form label { align-items: center; display: flex; gap: 8px; margin-top: 0; }
.dashboard-period-form select { margin-top: 0; min-width: 150px; width: auto; }
.login { align-items: center; display: flex; min-height: 100vh; justify-content: center; padding: 20px; }
.login .card { max-width: 380px; width: 100%; }
.login-logo { background: #000; border-radius: 6px; display: block; margin: 0 auto 20px; max-width: 260px; width: 100%; }
.modern-login { background: #09090b; min-height: 100vh; overflow: hidden; padding: 28px; position: relative; }
.modern-login::before { background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,0) 42%); content: ""; height: 420px; left: -160px; position: absolute; top: -180px; transform: rotate(-10deg); width: 620px; }
.modern-login::after { background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,0)); bottom: -220px; content: ""; height: 460px; position: absolute; right: -180px; transform: rotate(12deg); width: 620px; }
.login-card { border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 28px 70px rgba(0, 0, 0, .42); max-width: 430px !important; overflow: hidden; padding: 0; position: relative; z-index: 1; }
.login-brand-panel { background: #000; padding: 28px 28px 22px; }
.login-brand-panel .login-logo { background: transparent; border-radius: 0; margin: 0 auto; max-width: 300px; }
.login-heading { padding: 26px 28px 4px; text-align: center; }
.login-heading h1 { font-size: 28px; margin: 0 0 8px; }
.login-heading p { color: #52525b; line-height: 1.45; margin: 0; }
.login-card .notice { margin: 18px 28px 0; }
.login-card label { margin: 18px 28px 0; }
.login-card input { background: #fafafa; border-color: #d4d4d8; min-height: 48px; }
.login-card input:focus { border-color: #18181b; box-shadow: 0 0 0 3px rgba(24, 24, 27, .12); outline: none; }
.login-submit { margin: 22px 28px 0; width: calc(100% - 56px); }
.login-footer { color: #71717a; font-size: 12px; margin: 18px 28px 24px; text-align: center; }
.two-factor-title { margin: 0 0 6px; text-align: center; }
.two-factor-intro { margin: 0 0 12px; text-align: center; }
.two-factor-code-input { font-size: 22px; font-weight: 700; letter-spacing: 4px; text-align: center; }
.two-factor-setup { align-items: center; background: #f9fafb; border: 1px solid #e4e4e7; border-radius: 8px; display: grid; gap: 14px; grid-template-columns: 220px minmax(0, 1fr); margin-top: 12px; padding: 14px; }
.two-factor-setup img { background: white; border: 1px solid #e4e4e7; border-radius: 6px; display: block; height: 220px; width: 220px; }
.two-factor-setup code, .recovery-code-grid code { background: #18181b; border-radius: 6px; color: white; display: block; font-size: 14px; font-weight: 700; padding: 10px; text-align: center; }
.recovery-code-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.two-factor-admin-reset { border-top: 1px solid #e4e4e7; margin-top: 16px; padding-top: 16px; }
.two-factor-admin-reset button { margin-top: 0; }
.portal-page { margin: 0 auto; max-width: 1100px; }
.portal-hero { text-align: center; }
.portal-hero h1 { margin: 0 0 8px; }
.portal-hero p { margin: 0; }
.actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { margin: 0; }
.actions .delete-action { margin-left: 0; order: 99; }
.actions button, .actions .button, .actions a { margin-top: 0; min-width: 64px; white-space: nowrap; }
.actions select, .actions input { margin-top: 0; }
.portal-quote-actions { align-items: stretch; display: inline-flex; gap: 8px; min-width: 0; }
.portal-quote-actions > a { width: auto; }
.portal-quote-form { align-items: stretch; display: flex; gap: 8px; margin: 0; }
.portal-quote-form button { margin-top: 0; }
.portal-decline-form input { flex: 1 1 150px; margin-top: 0; min-width: 0; }
.portal-page td.actions { min-width: 240px; }
.portal-page td.actions .portal-quote-actions { width: auto; }
.portal-page td.actions .portal-quote-actions > a,
.portal-page td.actions .portal-quote-form,
.portal-page td.actions .portal-quote-form button,
.portal-page td.actions .portal-quote-form input { width: auto; }
.portal-page td.actions .portal-decline-form { display: grid; gap: 8px; }
.photo-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.photo-grid img { border: 1px solid #e4e4e7; border-radius: 6px; height: 100px; object-fit: cover; width: 100%; }
.photo-button { background: transparent; border: 0; margin: 0; padding: 0; width: 100%; }
.photo-section { margin-top: 18px; }
.photo-section h3 { margin-bottom: 10px; }
.photo-upload-form { align-items: end; display: flex; gap: 8px; margin-top: 12px; width: 100%; }
.photo-upload-form input { margin-top: 0; max-width: 260px; }
.photo-upload-form button { margin-top: 0; }
.photo-card { position: relative; }
.photo-delete-form { margin: 0; position: absolute; right: 4px; top: 4px; }
.photo-delete { background: #b91c1c; border: 1px solid white; border-radius: 4px; color: white; font-size: 13px; height: 22px; line-height: 1; margin-top: 0; min-height: 22px; min-width: 22px; padding: 0; width: 22px; }
.image-modal { align-items: center; background: rgba(0, 0, 0, .82); display: flex; inset: 0; justify-content: center; padding: 24px; position: fixed; z-index: 50; }
.image-modal[hidden] { display: none; }
.image-modal img { background: white; border-radius: 8px; max-height: 88vh; max-width: 88vw; object-fit: contain; }
.modal-close { background: #b91c1c; color: white; font-size: 24px; height: 42px; line-height: 1; margin: 0; padding: 0; position: fixed; right: 24px; top: 24px; width: 42px; }
.delete-confirm-modal { align-items: center; background: rgba(0, 0, 0, .62); display: flex; inset: 0; justify-content: center; padding: 20px; position: fixed; z-index: 80; }
.delete-confirm-modal[hidden] { display: none; }
.delete-confirm-box { background: white; border-radius: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); max-width: 380px; padding: 22px; text-align: center; width: 100%; }
.delete-confirm-box p { font-size: 18px; font-weight: 700; margin: 0 0 18px; }
.delete-confirm-actions { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.delete-confirm-actions button { margin-top: 0; width: 100%; }
.user-modal { align-items: center; background: rgba(0, 0, 0, .62); display: flex; inset: 0; justify-content: center; padding: 20px; position: fixed; z-index: 75; }
.user-modal[hidden] { display: none; }
.user-modal-box { background: white; border-radius: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); max-height: 90vh; max-width: 860px; overflow-y: auto; padding: 22px; width: 100%; }
.work-order-create-box { max-width: 980px; }
.table-card { overflow-x: auto; }
.modal-header { align-items: center; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 8px; }
.modal-header h2 { margin: 0; }
.modal-close-inline { background: #b91c1c; color: white; font-size: 24px; height: 40px; margin: 0; min-height: 40px; padding: 0; width: 40px; }
.two-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.permission-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }
.permission-group { border: 1px solid #e4e4e7; border-radius: 8px; padding: 12px; }
.permission-group strong { display: block; margin-bottom: 8px; }
.toggle-row { align-items: center; display: flex; gap: 10px; justify-content: space-between; margin: 0; padding: 7px 0; }
.toggle-row input { height: 20px; margin: 0; width: 20px; }
.toggle-row.is-disabled { color: #a1a1aa; }
.modal-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal-actions button, .modal-actions .button { margin-top: 0; }
.parts-editor { margin-top: 12px; }
.field-title { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.part-row { align-items: center; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) 76px 32px; margin-bottom: 8px; width: 100%; }
.part-row-internal { grid-template-columns: minmax(0, 1fr) 78px 78px 32px; }
.parts-editor[data-part-number="1"] .part-row { grid-template-columns: minmax(95px, .55fr) minmax(0, 1fr) 76px 32px; }
.parts-editor[data-part-number="1"] .part-row-internal { grid-template-columns: minmax(95px, .55fr) minmax(0, 1fr) 78px 78px 32px; }
.part-row input, .part-row select { margin-top: 0; min-width: 0; padding: 8px; }
.parts-editor-footer { align-items: end; display: grid; gap: 10px; grid-template-columns: auto minmax(180px, 1fr); margin-top: 10px; }
.parts-editor-footer button { margin-top: 0; min-width: 120px; }
.parts-editor-footer label { margin-top: 0; min-width: 0; }
.parts-editor-footer .parts-discount-label { align-items: center; display: grid; gap: 8px; grid-template-columns: auto minmax(90px, 140px); justify-content: end; }
.parts-editor-footer .parts-discount-label input { margin-top: 0; }
.icon-delete { background: #b91c1c; border-radius: 4px; color: white; flex: 0 0 32px; font-size: 20px; height: 32px; line-height: 1; margin: 0; min-height: 32px; min-width: 32px !important; padding: 0; width: 32px !important; }
.icon-delete:hover, .photo-delete:hover { background: #991b1b; }
.muted { color: #52525b; font-size: 13px; }
.labour-estimate-line { margin: 6px 0 0; }
.edit-lower-grid { align-items: start; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
.edit-lower-grid .parts-editor { margin-top: 12px; min-width: 0; }
.edit-side-controls { min-width: 0; }
.edit-side-controls label { margin-top: 12px; }
.work-order-log { border-top: 1px solid #e4e4e7; margin-top: 20px; padding-top: 16px; width: 100%; }
.work-order-history-card { border-top: 0; display: flex; flex-direction: column; height: 100%; margin-top: 0; overflow: hidden; padding-top: 20px; }
.internal-profit-box { border-top: 1px solid #e4e4e7; margin-top: 18px; padding-top: 16px; }
.internal-profit-box h3 { margin: 0 0 8px; }
.work-order-attachments-grid { align-items: stretch; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 16px; }
.attachment-stack { display: grid; gap: 16px; min-width: 0; }
.attachment-panel { min-width: 0; }
.attachment-panel-header { align-items: center; display: flex; gap: 10px; justify-content: space-between; margin-bottom: 12px; }
.attachment-panel-header h3 { margin: 0; }
.attachment-upload-form { align-items: end; background: #f9fafb; border: 1px solid #e4e4e7; border-radius: 8px; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 14px; padding: 14px; }
.attachment-upload-form label { margin-top: 0; min-width: 0; }
.attachment-upload-form input { margin-top: 6px; }
.attachment-upload-form .muted { align-self: center; grid-column: 1 / -1; }
.attachment-upload-form button { margin-top: 0; min-width: 120px; white-space: nowrap; }
.supplier-invoice-panel { border-top: 1px solid #e4e4e7; margin-top: 18px; padding-top: 16px; }
.supplier-invoice-panel h3 { margin: 0 0 12px; }
.supplier-invoice-form { background: #f9fafb; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 16px; padding: 14px; }
.supplier-invoice-form button { margin-top: 10px; }
.profit-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.profit-grid p { background: #f9fafb; border: 1px solid #e4e4e7; border-radius: 6px; margin: 0; padding: 10px; }
.profit-grid span { color: #52525b; display: block; font-size: 12px; margin-bottom: 5px; }
.profit-grid strong { display: block; font-size: 16px; }
.work-order-log h3 { margin: 0 0 12px; }
.log-list { display: grid; gap: 8px; }
.work-order-history-card .log-list { overflow: hidden; }
.history-pagination { margin-top: auto; padding-top: 12px; }
.log-entry { background: #f9fafb; border: 1px solid #e4e4e7; border-radius: 6px; padding: 10px; }
.log-entry strong { display: block; font-size: 14px; line-height: 1.35; }
.log-entry span { color: #71717a; display: block; font-size: 12px; margin-top: 4px; }
.form-pair { align-items: end; display: grid; gap: 12px; grid-template-columns: 130px minmax(150px, 220px); }
.form-pair label { margin-top: 12px; }
.even-pair { align-items: start; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
.even-pair label { min-width: 0; }
.even-pair textarea { min-height: 140px; }
.compact-controls input, .compact-controls select { min-height: 40px; }
.compact-form { align-items: end; display: grid; gap: 10px; grid-template-columns: 110px 1fr 140px 100px 120px auto; margin-bottom: 12px; }
.compact-form label { margin-top: 0; }
.compact-form button { margin-top: 0; }
.filter-form { align-items: end; display: grid; gap: 10px; grid-template-columns: minmax(220px, 420px) auto; max-width: 680px; }
.filter-form label { margin-top: 0; }
.filter-form button { margin-top: 0; }
.parts-database-search { margin-bottom: 16px; }
.parts-database-search .filter-form { max-width: 760px; }
.bulk-update-bar { align-items: center; background: #f8fafc; border-bottom: 1px solid #e4e4e7; display: flex; gap: 12px; justify-content: space-between; padding: 14px 18px; }
.bulk-update-bar strong, .bulk-update-bar span { display: block; }
.bulk-update-bar button { margin-top: 0; white-space: nowrap; }
.bulk-update-bar-bottom { border-bottom: 0; border-top: 1px solid #e4e4e7; }
.inbox-layout { align-items: start; grid-template-columns: minmax(340px, .85fr) minmax(460px, 1.15fr); }
.message-compose textarea { min-height: 170px; }
.inbox-list-card { min-height: 520px; padding: 0; overflow: hidden; }
.inbox-card-head { align-items: center; background: #f8fafc; border-bottom: 1px solid #e4e4e7; display: flex; gap: 14px; justify-content: space-between; padding: 16px; }
.inbox-card-head h3 { margin: 0 0 4px; }
.inbox-card-head p { color: #64748b; font-size: 13px; margin: 0; }
.inbox-counts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.inbox-counts span { background: white; border: 1px solid #dbe4ee; border-radius: 999px; color: #475569; font-size: 12px; font-weight: 700; padding: 5px 9px; }
.message-list { display: grid; gap: 0; }
.message-row { align-items: center; background: white; border: 0; border-bottom: 1px solid #edf2f7; border-radius: 0; display: grid; gap: 12px; grid-template-columns: 42px minmax(0, 1fr) auto; padding: 14px 16px; text-decoration: none; }
.message-row:hover { background: #f8fbfe; border-color: #edf2f7; }
.message-row.is-selected { background: #eef7ff; box-shadow: inset 4px 0 0 var(--wa-blue); }
.message-row.is-unread { background: #f4f9ff; border-color: #dbeafe; }
.message-row.is-unread strong::before { content: ""; }
.message-row.is-flagged { border-left: 0; }
.message-avatar { align-items: center; background: #dbeafe; border-radius: 999px; color: #075985; display: inline-flex; font-size: 14px; font-weight: 800; height: 38px; justify-content: center; margin: 0; width: 38px; }
.message-avatar.large { font-size: 18px; height: 52px; width: 52px; }
.message-row-main { min-width: 0; }
.message-row-main strong { color: #1f2937; display: block; font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-row-main small { color: #64748b; display: block; font-size: 12px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-row-side { align-items: flex-end; display: flex; flex-direction: column; gap: 5px; min-width: 88px; }
.message-row-side time { color: #64748b; font-size: 11px; white-space: nowrap; }
.message-row-side em { background: #dcfce7; border-radius: 999px; color: #166534; font-size: 11px; font-style: normal; font-weight: 800; padding: 3px 7px; text-transform: uppercase; }
.message-row-side em.flagged { background: #fef3c7; color: #92400e; }
.message-read-card { min-height: 520px; }
.message-read-head { align-items: start; border-bottom: 1px solid #e4e4e7; display: grid; gap: 14px; grid-template-columns: 52px minmax(0, 1fr); margin: -2px 0 18px; padding-bottom: 16px; }
.message-read-head h2 { font-size: 22px; line-height: 1.25; margin: 0 0 8px; }
.message-read-head p { color: #475569; font-size: 13px; margin: 0 0 5px; }
.message-read-head time { color: #64748b; display: block; font-size: 12px; }
.message-body { background: #ffffff; border: 1px solid #e4e4e7; border-radius: 6px; color: #1f2937; line-height: 1.6; margin: 0 0 16px; min-height: 180px; padding: 18px; white-space: normal; }
.message-actions { border-top: 1px solid #e4e4e7; justify-content: flex-end; padding-top: 12px; }
.message-empty, .inbox-empty { align-items: center; color: #64748b; display: flex; flex-direction: column; justify-content: center; min-height: 260px; padding: 24px; text-align: center; }
.message-empty h2, .inbox-empty strong { color: #334155; margin: 0 0 6px; }
.inline-form { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form input, .inline-form select { margin-top: 0; min-height: 40px; min-width: 140px; width: auto; }
.inline-form button, .inline-form .button { margin-top: 0; min-height: 40px; white-space: nowrap; }
.user-action-form { align-items: stretch; flex-wrap: wrap; }
.user-action-form input { flex: 1 1 180px; min-width: 0; }
.user-action-form button { flex: 0 0 auto; }
.account-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.account-profile { align-items: center; display: flex; gap: 14px; margin-bottom: 16px; }
.account-profile > div { min-width: 0; }
.account-profile img, .account-profile span { border-radius: 999px; flex: 0 0 72px; height: 72px; object-fit: cover; width: 72px; }
.account-profile span { align-items: center; background: #18181b; color: white; display: inline-flex; font-size: 28px; font-weight: 700; justify-content: center; }
.account-profile p { margin: 0 0 6px; overflow-wrap: anywhere; white-space: normal; }
.account-grid .account-profile p { white-space: nowrap; }
.account-log-table { table-layout: fixed; }
.account-log-table th, .account-log-table td { min-width: 0; overflow-wrap: anywhere; }
.pagination { align-items: center; display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.pagination button { margin-top: 0; min-width: 44px; }
.pagination span { color: #52525b; font-size: 14px; font-weight: 700; }
.calendar-toolbar { align-items: center; display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.calendar-toolbar h2 { font-size: 22px; margin: 0; text-align: center; }
.calendar-toolbar .button { margin-top: 0; }
.calendar-toolbar-actions { align-items: center; display: flex; gap: 8px; }
.calendar-month { display: grid; gap: 8px; grid-template-columns: repeat(7, minmax(120px, 1fr)); }
.calendar-heading { color: #71717a; font-size: 12px; font-weight: 700; padding: 0 8px; text-transform: uppercase; }
.calendar-day { background: white; border: 1px solid #e4e4e7; border-radius: 8px; min-height: 150px; padding: 10px; }
.calendar-day.is-muted { background: #fafafa; color: #a1a1aa; }
.calendar-day.is-today { border-color: #18181b; box-shadow: inset 0 0 0 1px #18181b; }
.calendar-day h3 { font-size: 15px; margin: 0 0 8px; }
.calendar-job { background: #f4f4f5; border: 1px solid #e4e4e7; border-radius: 6px; display: block; margin-bottom: 8px; padding: 9px; position: relative; text-decoration: none; }
.calendar-job.is-in-progress { background: #dbeafe; border-color: #93c5fd; }
.calendar-job.is-completed { background: #dcfce7; border-color: #86efac; }
.calendar-job em { color: #18181b; display: block; font-size: 12px; font-style: normal; font-weight: 700; margin-bottom: 3px; }
.calendar-job strong, .calendar-job span { display: block; font-size: 13px; line-height: 1.35; }
.calendar-job .pill { display: inline-block; }
.calendar-job span { color: #52525b; margin-top: 3px; }
.calendar-job-main { display: block; padding-right: 28px; text-decoration: none; }
.calendar-job-edit { align-items: center; background: rgba(255, 255, 255, .86); border: 1px solid #a1a1aa; border-radius: 999px; color: #3f3f46; display: inline-flex; height: 26px; justify-content: center; margin: 0; min-height: 26px; padding: 0; position: absolute; right: 6px; top: 6px; width: 26px; }
.calendar-job-edit svg { fill: none; height: 15px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 15px; }
.calendar-job-edit:hover { background: white; border-color: #18181b; color: #18181b; }
.alert-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.dashboard-alert { border: 1px solid #e4e4e7; border-radius: 8px; display: block; padding: 12px; text-decoration: none; }
.dashboard-alert strong, .dashboard-alert span { display: block; }
.dashboard-alert span { font-size: 13px; margin-top: 4px; }
.dashboard-alert-items { display: grid; gap: 5px; margin: 10px 0 0; padding-left: 18px; }
.dashboard-alert-items li { font-size: 13px; line-height: 1.35; }
.alert-green { background: #dcfce7; border-color: #86efac; color: #166534; }
.alert-amber { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.alert-orange { background: #ffedd5; border-color: #fdba74; color: #9a3412; }
.alert-red { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.search-results-grid { grid-template-columns: 1fr; }
.search-result-card { padding: 0; }
.search-result-card h2 { border-bottom: 1px solid var(--wa-line); margin: 0; padding: 16px 18px; }
.search-result-list { display: grid; }
.search-result-item { align-items: center; border-bottom: 1px solid var(--wa-line); display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) auto; padding: 14px 18px; }
.search-result-item:last-child { border-bottom: 0; }
.search-result-item strong, .search-result-item span { display: block; }
.search-result-item span { color: var(--wa-muted); font-size: 13px; margin-top: 4px; }
.search-result-item p { color: #475569; font-size: 13px; line-height: 1.4; margin: 6px 0 0; overflow-wrap: anywhere; }
.search-result-item .button { margin-top: 0; white-space: nowrap; }
.config-page { display: grid; gap: 22px; }
.config-section { display: grid; gap: 14px; min-width: 0; }
.config-section-head { align-items: end; border-bottom: 1px solid var(--wa-line); display: flex; gap: 14px; justify-content: space-between; padding-bottom: 10px; }
.config-section-head h2 { color: var(--wa-text); font-size: 20px; line-height: 1.2; margin: 0; }
.config-section-head p { color: var(--wa-muted); font-size: 13px; margin: 0; text-align: right; }
.admin-general-grid { align-items: start; grid-template-columns: 1fr; }
.config-card-grid, .config-card-grid-core, .config-card-grid-business { align-items: stretch; display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(260px, 1fr)); }
.config-card-grid > .card, .config-card-grid > form.card { display: flex; flex-direction: column; min-width: 0; }
.config-card-grid .card h2, .config-wide-card h2 { font-size: 17px; margin-bottom: 12px; }
.config-card-grid textarea { min-height: 88px; }
.config-card-grid .card > button, .config-card-grid .card > .actions { margin-top: auto; }
.config-form-actions, .config-card-grid > .actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; justify-content: flex-end; }
.config-form-actions button, .config-card-grid > .actions button { margin-top: 0; }
.maintenance-results { display: grid; gap: 5px; list-style: none; margin: 0 0 14px; padding: 0; }
.maintenance-results li { align-items: center; border-bottom: 1px solid var(--wa-line); display: flex; gap: 12px; justify-content: space-between; padding: 6px 0; }
.maintenance-results li:last-child { border-bottom: 0; }
.config-card-grid .card hr { border: 0; border-top: 1px solid var(--wa-line); margin: 18px 0; width: 100%; }
.config-wide-card { display: grid; gap: 0 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.config-wide-card > h2, .config-wide-card > p, .config-wide-card > .actions, .config-wide-card > .toggle-row { grid-column: 1 / -1; }
.service-history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.service-history-card { overflow-x: hidden; }
.service-history-table { table-layout: fixed; }
.service-history-table th, .service-history-table td { min-width: 0; overflow-wrap: anywhere; padding: 8px; }
.service-history-table .actions { align-items: stretch; flex-direction: column; }
.service-history-table .actions a, .service-history-table .actions button { margin: 0; min-width: 0; width: 100%; }
.service-history-card .pill { max-width: 100%; white-space: normal; }
.vehicle-history-log-card { display: flex; flex-direction: column; overflow: hidden; }
.vehicle-history-log-card .log-list { overflow: hidden; }
@media (max-width: 1180px) {
    .config-card-grid, .config-card-grid-core, .config-card-grid-business { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
    .config-wide-card { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    body { background: #f7f7f8; }
    .menu-toggle { align-items: center; background: #000; border-radius: 6px; display: inline-flex; flex-direction: column; gap: 4px; height: 44px; justify-content: center; left: 14px; margin: 0; padding: 0; position: fixed; top: 12px; width: 48px; z-index: 38; }
    .menu-toggle span { background: white; border-radius: 999px; display: block; height: 2px; width: 22px; }
    .menu-close { align-items: center; background: #18181b; border: 1px solid #3f3f46; border-radius: 6px; color: white; display: inline-flex; font-size: 24px; height: 42px; justify-content: center; margin: 0 0 12px auto; padding: 0; width: 42px; }
    .sidebar { bottom: 0; left: 0; min-height: 100vh; overflow-y: auto; padding: 14px; position: fixed; top: 0; transform: translateX(-105%); transition: transform .2s ease; width: min(82vw, 320px); z-index: 40; }
    body.menu-open .sidebar { transform: translateX(0); }
    .brand-logo { height: auto; margin-bottom: 12px; max-width: 260px; }
    .brand-text-logo { font-size: 23px; line-height: .95; }
    .sidebar nav { display: grid; gap: 8px; margin-bottom: 12px; overflow: visible; padding-bottom: 0; }
    .sidebar a { padding: 12px; white-space: normal; }
    .nav-heading { margin: 12px 4px 8px; }
    .ghost-button { min-height: 42px; width: auto; }
    .main { margin-left: 0; }
    .topbar { align-items: flex-start; gap: 10px; min-height: 68px; padding: 14px 16px 14px 76px; }
    .topbar > div:first-child { min-width: 0; }
    .topbar h1 { font-size: 20px; }
    .topbar span { font-size: 13px; text-align: right; }
    .topbar-user { justify-content: flex-end; margin-left: auto; min-width: 0; text-align: right; }
    .topbar-user span { max-width: 150px; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
    .content { padding: 14px; }
    .two, .stats, .account-grid, .inbox-layout { grid-template-columns: 1fr; }
    .grid { gap: 14px; }
    .card { border-radius: 8px; max-width: 100%; overflow-x: auto; padding: 14px; }
    .stat strong { font-size: 26px; }
    table { min-width: 720px; table-layout: auto; }
    th, td { padding: 9px; }
    input, select, textarea { font-size: 16px; min-height: 44px; }
    textarea { min-height: 110px; }
    button, .button, .actions a { min-height: 44px; padding: 11px 14px; }
    .actions { align-items: stretch; gap: 6px; }
    .actions a, .actions button { flex: 1 1 auto; }
    .page-actions { align-items: stretch; flex-direction: column; }
    .page-actions .button, .page-actions button { width: 100%; }
    .page-actions-right { align-items: stretch; flex-direction: column; width: 100%; }
    .dashboard-period-form { align-items: stretch; flex-direction: column; width: 100%; }
    .dashboard-period-form label { justify-content: space-between; width: 100%; }
    .dashboard-period-form select { min-width: 0; width: min(72%, 240px); }
    .inline-form { align-items: stretch; flex-direction: column; min-width: 180px; }
    .inline-form input, .inline-form select { min-width: 0; width: 100%; }
    .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .photo-grid img { height: 130px; }
    .photo-upload-form { align-items: stretch; flex-direction: column; margin-left: 0; width: 100%; }
    .photo-upload-form input { max-width: none; }
    .compact-form { grid-template-columns: 1fr; }
    .filter-form { grid-template-columns: 1fr; max-width: none; }
    .bulk-update-bar { align-items: stretch; flex-direction: column; }
    .bulk-update-bar button { width: 100%; }
    .calendar-toolbar { align-items: stretch; flex-direction: column; }
    .calendar-toolbar-actions { align-items: stretch; flex-direction: column; }
    .calendar-month { grid-template-columns: 1fr; }
    .calendar-heading { display: none; }
    .admin-general-grid, .config-card-grid, .config-card-grid-core, .config-card-grid-business, .config-wide-card, .health-report-layout { grid-template-columns: 1fr; }
    .config-section-head { align-items: start; flex-direction: column; gap: 4px; }
    .config-section-head p { text-align: left; }
    .config-form-actions { align-items: stretch; flex-direction: column; }
    .config-form-actions button { width: 100%; }
    .service-history-grid { grid-template-columns: 1fr; }
    .service-history-card { overflow-x: auto; }
    .service-history-table { min-width: 560px; }
    .health-row { grid-template-columns: 1fr; }
    .health-report-meta, .health-check-grid { grid-template-columns: 1fr; }
    .health-check-head { grid-template-columns: 1fr; }
    .health-status-toggle { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .health-action-bar { align-items: stretch; flex-direction: column; margin: 18px -14px -14px; padding: 12px 14px; }
    .health-action-bar button, .health-action-bar .button { width: 100%; }
    .search-result-item { align-items: stretch; grid-template-columns: 1fr; }
    .search-result-item .button { width: 100%; }
    .user-modal { padding: 12px; }
    .user-modal-box { max-height: 94vh; padding: 16px; }
    .two-even, .permission-grid { grid-template-columns: 1fr; }
    .modal-actions { align-items: stretch; flex-direction: column; }
    .modal-actions button { width: 100%; }
    .form-pair { grid-template-columns: 1fr; }
    .edit-lower-grid { grid-template-columns: 1fr; }
    .work-order-attachments-grid { grid-template-columns: 1fr; }
    .attachment-upload-form { align-items: stretch; grid-template-columns: 1fr; }
    .attachment-upload-form button { width: 100%; }
    .part-row { grid-template-columns: 1fr; }
    .part-row-internal { grid-template-columns: 1fr; }
    .parts-editor-footer { align-items: stretch; grid-template-columns: 1fr; }
    .parts-editor-footer .parts-discount-label { grid-template-columns: 1fr; justify-content: stretch; }
    .parts-editor-footer button { width: 100%; }
    .icon-delete { height: 44px; min-height: 44px; width: 44px; }
    .profit-grid { grid-template-columns: 1fr; }
    .login { padding: 14px; }
    .login-logo { max-width: 220px; }
    .modern-login { padding: 16px; }
    .login-card { max-width: 100% !important; }
    .login-brand-panel { padding: 22px 20px 18px; }
    .login-brand-panel .login-logo { max-width: 260px; }
    .login-heading { padding: 22px 20px 2px; }
    .login-card label, .login-card .notice { margin-left: 20px; margin-right: 20px; }
    .login-submit { margin-left: 20px; margin-right: 20px; width: calc(100% - 40px); }
    .login-footer { margin-left: 20px; margin-right: 20px; }
    .image-modal { padding: 14px; }
    .modal-close { right: 14px; top: 14px; }
}

@media (max-width: 700px) {
    .portal-page { padding: 12px; }
    .portal-page .card { margin-left: 0; margin-right: 0; overflow-x: visible; padding: 14px; }
    .portal-page .login-logo { max-width: 210px; }
    .portal-page h1 { font-size: 24px; }
    .portal-page h2 { font-size: 18px; margin-top: 0; }
    .portal-page table { min-width: 0; width: 100%; }
    .portal-page thead { display: none; }
    .portal-page tbody, .portal-page tr, .portal-page td { display: block; width: 100%; }
    .portal-page tr { background: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 12px; padding: 12px; }
    .portal-page td { align-items: center; border-bottom: 0; display: grid; gap: 12px; grid-template-columns: minmax(112px, 34%) minmax(0, 1fr); min-width: 0; padding: 8px 0; }
    .portal-page td::before { color: #71717a; content: attr(data-label); font-size: 12px; font-weight: 700; line-height: 1.3; text-transform: uppercase; }
    .portal-page td.actions { display: block; padding-top: 10px; }
    .portal-page td.actions::before { display: none; }
    .portal-page td.actions > a, .portal-page td.actions > button { width: 100%; }
    .portal-page td.actions .portal-quote-actions { display: grid; gap: 10px; min-width: 0; width: 100%; }
    .portal-page td.actions .portal-quote-actions > a { margin: 0; width: 100%; }
    .portal-page .portal-quote-form { display: grid; gap: 8px; width: 100%; }
    .portal-page .portal-quote-form button, .portal-page .portal-quote-form input { width: 100%; }
    .portal-page .portal-decline-form input { min-height: 48px; }
    .portal-page .pill { max-width: 100%; white-space: normal; }
    .health-report-table { min-width: 0; width: 100%; }
    .health-report-table thead { display: none; }
    .health-report-table tbody, .health-report-table tr, .health-report-table td { display: block; width: 100%; }
    .health-report-table tr { background: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 10px; padding: 10px; }
    .health-report-table td { align-items: center; border-bottom: 0; display: grid; gap: 10px; grid-template-columns: minmax(105px, 34%) minmax(0, 1fr); min-width: 0; padding: 7px 0; }
    .health-report-table td::before { color: #71717a; content: attr(data-label); font-size: 12px; font-weight: 700; text-transform: uppercase; }
    .health-report-table td.actions { display: grid; grid-template-columns: 1fr; }
    .health-report-table td.actions::before { display: none; }
    .health-report-table td.actions a, .health-report-table td.actions button { width: 100%; }
    .account-log-table { min-width: 0; width: 100%; }
    .account-log-table thead { display: none; }
    .account-log-table tbody, .account-log-table tr, .account-log-table td { display: block; width: 100%; }
    .account-log-table tr { background: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 10px; padding: 10px; }
    .account-log-table td { align-items: start; border-bottom: 0; display: grid; gap: 10px; grid-template-columns: minmax(105px, 34%) minmax(0, 1fr); min-width: 0; padding: 7px 0; }
    .account-log-table td::before { color: #71717a; content: attr(data-label); font-size: 12px; font-weight: 700; text-transform: uppercase; }
}

@media (max-width: 560px) {
    .topbar { align-items: flex-start; display: flex; }
    .topbar span { display: block; margin-top: 0; text-align: right; }
    .topbar-user { margin-left: auto; margin-top: 0; }
    .topbar-user .topbar-avatar { margin-top: 0; }
    .account-profile { align-items: flex-start; flex-direction: column; }
    .account-profile p { overflow-wrap: anywhere; white-space: normal; }
    .card { margin-left: -4px; margin-right: -4px; }
    table { min-width: 680px; }
    .stats .card { margin-left: 0; margin-right: 0; }
    .actions { flex-direction: column; }
    .actions a, .actions button { width: 100%; }
    .two-factor-setup { grid-template-columns: 1fr; }
    .two-factor-setup img { height: auto; max-width: 220px; width: 100%; }
    .recovery-code-grid { grid-template-columns: 1fr; }
    .photo-grid { grid-template-columns: 1fr; }
}

/* Workshop scheduler refinement */
:root {
    --wa-sidebar: #2f3d4a;
    --wa-sidebar-dark: #26323d;
    --wa-sidebar-line: rgba(255,255,255,.1);
    --wa-blue: #0ea5e9;
    --wa-blue-dark: #0374b4;
    --wa-page: #f4f7fa;
    --wa-card: #ffffff;
    --wa-line: #dfe7ef;
    --wa-text: #1d2733;
    --wa-muted: #6b7785;
}

body {
    background: var(--wa-page);
    color: var(--wa-text);
    font-family: "Segoe UI", Arial, sans-serif;
}

.sidebar {
    background: var(--wa-sidebar);
    border-right: 1px solid var(--wa-sidebar-line);
    box-shadow: 4px 0 18px rgba(22, 34, 47, .08);
    padding: 18px 14px;
    width: 260px;
}

.brand-logo {
    align-items: center;
    background: transparent;
    border-bottom: 1px solid var(--wa-sidebar-line);
    border-radius: 0;
    display: flex;
    height: auto;
    margin-bottom: 12px;
    overflow: visible;
    padding: 4px 2px 16px;
}

.brand-logo img {
    display: block;
    height: auto;
    max-height: 72px;
    object-fit: contain;
    object-position: left center;
    width: 100%;
}

.brand-text-logo {
    align-items: flex-start;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    font-family: "Arial Narrow", "Segoe UI", Arial, sans-serif;
    font-size: 24px;
    font-weight: 800;
    gap: 0;
    letter-spacing: .13em;
    line-height: .92;
    overflow: visible;
    text-decoration: none;
    text-transform: uppercase;
}

.brand-text-logo span {
    display: block;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .18);
    white-space: nowrap;
}

.sidebar-meta {
    border-bottom: 1px solid var(--wa-sidebar-line);
    color: #d6dee7;
    margin: 0 0 14px;
    padding: 0 4px 14px;
}

.sidebar-meta span {
    color: #9fb0c0;
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.sidebar-meta strong {
    display: block;
    font-size: 12px;
    line-height: 1.3;
}

.nav-heading {
    color: #9fb0c0;
    font-size: 10px;
    letter-spacing: .08em;
    margin: 18px 8px 7px;
}

.sidebar nav {
    gap: 3px;
    margin-bottom: 10px;
}

.sidebar a {
    align-items: center;
    border-radius: 5px;
    color: #d7e0e8;
    display: flex;
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
    min-height: 32px;
    padding: 8px 10px;
}

.sidebar nav a::before {
    background: rgba(255,255,255,.38);
    border-radius: 3px;
    content: "";
    flex: 0 0 7px;
    height: 7px;
    width: 7px;
}

.sidebar a:hover,
.sidebar a.is-active {
    background: var(--wa-sidebar-dark);
    color: white;
}

.sidebar a.is-active::before {
    background: var(--wa-blue);
}

.ghost-button {
    border-color: var(--wa-sidebar-line);
    color: #d7e0e8;
    min-height: 36px;
}

.main {
    margin-left: 260px;
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--wa-line);
    box-shadow: 0 1px 0 rgba(24, 39, 56, .02);
    min-height: 58px;
    padding: 10px 24px;
}

.topbar-title {
    min-width: 180px;
}

.topbar p {
    color: var(--wa-muted);
    font-size: 10px;
    letter-spacing: .08em;
}

.topbar h1 {
    color: var(--wa-text);
    font-size: 22px;
    line-height: 1.15;
}

.topbar-search {
    align-items: center;
    display: flex;
    flex: 1 1 380px;
    justify-content: center;
    margin: 0 18px;
    max-width: 520px;
}

.topbar-search input {
    background: #f8fafc;
    border: 1px solid var(--wa-line);
    border-radius: 999px 0 0 999px;
    height: 38px;
    margin: 0;
    min-height: 38px;
    padding: 0 16px;
}

.topbar-search button {
    background: var(--wa-blue);
    border-radius: 0 999px 999px 0;
    box-shadow: none;
    height: 38px;
    margin: 0;
    min-height: 38px;
    min-width: 86px;
    padding: 0 18px;
}

.topbar-search button:hover {
    background: var(--wa-blue-dark);
    box-shadow: none;
    transform: none;
}

.topbar-user {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.mail-link {
    border-color: var(--wa-line);
    color: #475569;
}

.mail-link:hover {
    background: #f1f5f9;
}

.mail-link.has-mail {
    background: var(--wa-blue);
    border-color: var(--wa-blue);
}

.content {
    padding: 22px 24px;
}

.card {
    border: 1px solid var(--wa-line);
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(24, 39, 56, .04);
    padding: 18px;
}

.card h2,
.card h3,
.page-actions h2 {
    color: var(--wa-text);
    margin-top: 0;
}

.stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat {
    border-top: 3px solid var(--wa-blue);
    min-height: 104px;
}

.stat span {
    color: var(--wa-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.stat strong {
    color: #0f172a;
    font-size: 28px;
}

label,
.readonly-field,
.field-title {
    color: #334155;
    font-size: 12px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

input,
select,
textarea {
    background: #ffffff;
    border-color: #cfd9e3;
    border-radius: 5px;
    color: var(--wa-text);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--wa-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .14);
    outline: none;
}

button,
.button,
.actions a {
    background: var(--wa-blue);
    border-radius: 5px;
    box-shadow: none;
    font-size: 13px;
    min-height: 36px;
    padding: 9px 14px;
}

button:hover,
.button:hover,
.actions a:hover {
    background: var(--wa-blue-dark);
    box-shadow: 0 5px 12px rgba(3, 116, 180, .18);
    transform: translateY(-1px);
}

.actions a,
.secondary,
.button.secondary {
    background: #64748b;
}

.actions a:hover,
.secondary:hover,
.button.secondary:hover {
    background: #475569;
}

.danger {
    background: #c81e1e;
}

.danger:hover {
    background: #a91515;
}

.table-card {
    padding: 0;
}

.table-card > form,
.table-card > h2,
.table-card > p {
    margin: 0;
    padding: 16px 18px 0;
}

.table-card table {
    margin-top: 10px;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background: #f8fafc;
    border-bottom: 1px solid var(--wa-line);
    color: #64748b;
    font-size: 11px;
    letter-spacing: .04em;
}

td,
th {
    padding: 11px 12px;
}

tbody tr:hover td {
    background: #f8fbfe;
}

.pill {
    border-radius: 999px;
    font-weight: 700;
    padding: 5px 10px;
}

.notice {
    border-radius: 5px;
}

.page-actions {
    background: transparent;
    margin-bottom: 14px;
}

.page-actions h2 {
    font-size: 22px;
    line-height: 1.2;
}

.page-actions h2 {
    display: none;
}

.page-actions > div p {
    margin: 0;
}

.calendar-toolbar {
    background: white;
    border: 1px solid var(--wa-line);
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(24, 39, 56, .04);
    padding: 12px;
}

.calendar-toolbar h2 {
    color: var(--wa-text);
    font-size: 20px;
}

.calendar-month {
    background: white;
    border: 1px solid var(--wa-line);
    border-radius: 5px;
    gap: 0;
    overflow: hidden;
}

.calendar-heading {
    background: #f8fafc;
    border-bottom: 1px solid var(--wa-line);
    border-right: 1px solid var(--wa-line);
    color: #64748b;
    padding: 10px;
    text-align: center;
}

.calendar-day {
    border: 0;
    border-radius: 0;
    border-right: 1px solid var(--wa-line);
    border-bottom: 1px solid var(--wa-line);
    min-height: 142px;
    padding: 9px;
}

.calendar-day h3 {
    color: #334155;
    font-size: 13px;
}

.calendar-day.is-muted {
    background: #f8fafc;
}

.calendar-day.is-today {
    box-shadow: inset 0 0 0 2px var(--wa-blue);
}

.calendar-job {
    background: #ffffff;
    border: 1px solid #94a3b8;
    border-left: 4px solid #64748b;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
    margin-bottom: 7px;
    padding: 7px;
}

.calendar-job.is-in-progress {
    background: #eff6ff;
    border-color: #60a5fa;
    border-left-color: #2563eb;
}

.calendar-job.is-completed {
    background: #ecfdf5;
    border-color: #86efac;
    border-left-color: #16a34a;
}

.calendar-job em {
    color: #475569;
    font-size: 11px;
}

.calendar-job strong,
.calendar-job span {
    font-size: 12px;
}

.calendar-job-edit {
    background: rgba(255,255,255,.92);
    height: 24px;
    min-height: 24px;
    width: 24px;
}

.user-modal-box,
.delete-confirm-box {
    border-radius: 5px;
}

.quote-edit-box {
    max-width: 1060px;
}

.quote-edit-summary {
    background: #f8fafc;
    border: 1px solid var(--wa-line);
    border-radius: 5px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
    padding: 12px;
}

.quote-edit-summary p {
    margin: 0;
    min-width: 0;
}

.quote-edit-summary strong,
.quote-edit-summary span {
    display: block;
}

.quote-edit-summary strong {
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
}

.quote-edit-summary span {
    font-weight: 700;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.quote-modal-section {
    border-top: 1px solid var(--wa-line);
    margin-top: 18px;
    padding-top: 16px;
}

.quote-modal-section h3 {
    margin: 0 0 12px;
}

.quote-item-form {
    grid-template-columns: 105px minmax(180px, 1fr) 110px 90px 110px 100px;
}

@media (max-width: 900px) {
    .quote-edit-summary {
        grid-template-columns: 1fr 1fr;
    }

    .quote-item-form {
        grid-template-columns: 1fr;
    }
}

.workshop-login {
    background:
        linear-gradient(90deg, rgba(4, 4, 6, .82) 0%, rgba(4, 4, 6, .42) 52%, rgba(4, 4, 6, .70) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, .20), rgba(0, 0, 0, .72)),
        url("workshop-hero.png") center center / cover no-repeat;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: clamp(18px, 5vw, 72px);
}

.workshop-login-card {
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    backdrop-filter: blur(18px) saturate(130%);
    background: rgba(8, 10, 14, .46);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .50);
    color: #f8fafc;
    max-width: 370px !important;
    padding: 22px;
    width: min(100%, 370px);
}

.workshop-login-card .login-logo {
    background: transparent;
    border: 0;
    border-radius: 0;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .46));
    margin-bottom: 18px;
    max-width: 275px;
    padding: 0;
}

.workshop-login-card h1 {
    color: #ffffff;
    font-size: 30px;
    margin: 0 0 22px;
}

.workshop-login-card label {
    color: #cbd5e1;
    letter-spacing: .06em;
    margin-top: 12px;
}

.workshop-login-card input {
    background: rgba(15, 23, 42, .76);
    border: 1px solid rgba(226, 232, 240, .22);
    color: #ffffff;
    min-height: 44px;
}

.workshop-login-card input:focus {
    border-color: rgba(239, 68, 68, .92);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .18);
}

.workshop-login-card button {
    background: #d31616;
    border: 1px solid rgba(255, 255, 255, .08);
    color: #ffffff;
    font-weight: 800;
    margin-top: 18px;
    min-height: 44px;
    width: 100%;
}

.workshop-login-card button:hover {
    background: #f12121;
    box-shadow: 0 12px 28px rgba(239, 68, 68, .24);
}

.workshop-login-card .notice.error {
    background: rgba(127, 29, 29, .72);
    border-color: rgba(248, 113, 113, .42);
    color: #fee2e2;
}

@media (max-width: 760px) {
    .workshop-login {
        align-items: center;
        background-position: 58% center;
        justify-content: center;
        padding: 18px;
    }

    .workshop-login-card {
        padding: 18px;
    }
}

@media (max-width: 900px) {
    .menu-toggle {
        background: var(--wa-sidebar);
        border-radius: 5px;
    }

    .sidebar {
        width: min(82vw, 320px);
    }

    .main {
        margin-left: 0;
    }

    .topbar {
        align-items: center;
        flex-wrap: wrap;
        padding: 12px 14px 12px 76px;
    }

    .topbar-title {
        flex: 1 1 calc(100% - 160px);
        min-width: 0;
    }

    .topbar-search {
        flex: 1 1 100%;
        margin: 10px 0 0;
        max-width: none;
        order: 3;
    }

    .topbar-user {
        margin-left: auto;
    }

    .content {
        padding: 14px;
    }

    .calendar-month {
        background: transparent;
        border: 0;
        display: grid;
        gap: 10px;
        overflow: visible;
    }

    .calendar-day {
        border: 1px solid var(--wa-line);
        border-radius: 5px;
    }
}

.actions .icon-delete,
.health-report-table td.actions .icon-delete {
    flex: 0 0 32px;
    height: 32px;
    min-height: 32px;
    min-width: 32px !important;
    padding: 0;
    width: 32px !important;
}

.photo-delete {
    flex: 0 0 22px;
    min-width: 22px !important;
    width: 22px !important;
}

.modal-close-inline {
    border-radius: 4px;
    flex: 0 0 32px;
    font-size: 20px;
    height: 32px;
    min-height: 32px;
    min-width: 32px !important;
    width: 32px !important;
}

@media (min-width: 701px) {
    .health-report-table th:last-child,
    .health-report-table td:last-child {
        min-width: 430px;
        width: 430px;
    }
}
