.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
.fixed { position: fixed; }
.absolute { position: absolute; }
.inset-0 { inset: 0px; }
.inset-x-0 { left: 0px; right: 0px; }
.inset-y-0 { top: 0px; bottom: 0px; }
.bottom-0 { bottom: 0px; }
.left-0 { left: 0px; }
.right-0 { right: 0px; }
.right-4 { right: 1rem; }
.top-0 { top: 0px; }
.top-4 { top: 1rem; }
.z-50 { z-index: 50; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.h-10 { height: 2.5rem; }
.h-4 { height: 1rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-\[1px\] { height: 1px; }
.h-full { height: 100%; }
.w-3\/4 { width: 75%; }
.w-4 { width: 1rem; }
.w-9 { width: 2.25rem; }
.w-\[1px\] { width: 1px; }
.w-full { width: 100%; }
.shrink-0 { flex-shrink: 0; }
.flex-col { flex-direction: column; }
.flex-col-reverse { flex-direction: column-reverse; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { --tw-space-y-reverse: 0; margin-top: calc(0.375rem * calc(1 - var(--tw-space-y-reverse))); margin-bottom: calc(0.375rem * var(--tw-space-y-reverse)); }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { --tw-space-y-reverse: 0; margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse))); margin-bottom: calc(0.5rem * var(--tw-space-y-reverse)); }
.whitespace-nowrap { white-space: nowrap; }
.rounded-md { border-radius: calc(var(--radius) - 2px); }
.rounded-sm { border-radius: calc(var(--radius) - 4px); }
.rounded-xl { border-radius: 0.75rem; }
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-l { border-left-width: 1px; }
.border-r { border-right-width: 1px; }
.border-t { border-top-width: 1px; }
.border-input { border-color: hsl(var(--ui-input)); }
.border-transparent { border-color: transparent; }
.bg-background { background-color: hsl(var(--ui-background)); }
.bg-black\/80 { background-color: rgb(0 0 0 / 0.8); }
.bg-border { background-color: hsl(var(--ui-border)); }
.bg-card { background-color: hsl(var(--ui-card)); }
.bg-destructive { background-color: hsl(var(--ui-destructive)); }
.bg-primary { background-color: hsl(var(--ui-primary)); }
.bg-secondary { background-color: hsl(var(--ui-secondary)); }
.bg-transparent { background-color: transparent; }
.p-6 { padding: 1.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.pt-0 { padding-top: 0px; }
.text-center { text-align: center; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.leading-none { line-height: 1; }
.tracking-tight { letter-spacing: -0.025em; }
.text-card-foreground { color: hsl(var(--ui-card-foreground)); }
.text-destructive-foreground { color: hsl(var(--ui-destructive-foreground)); }
.text-foreground { color: hsl(var(--ui-foreground)); }
.text-muted-foreground { color: hsl(var(--ui-muted-foreground)); }
.text-primary { color: hsl(var(--ui-primary)); }
.text-primary-foreground { color: hsl(var(--ui-primary-foreground)); }
.text-secondary-foreground { color: hsl(var(--ui-secondary-foreground)); }
.underline-offset-4 { text-underline-offset: 4px; }
.opacity-70 { opacity: 0.7; }
.shadow { --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); }
.shadow-lg { --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); }
.shadow-sm { --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); }
.outline { outline-style: solid; }
.ring-offset-background { --tw-ring-offset-color: hsl(var(--ui-background)); }
.filter { filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); }
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.ease-in-out { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes enter {
 from { opacity: var(--tw-enter-opacity, 1); transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0)); } }
@keyframes exit {
 to { opacity: var(--tw-exit-opacity, 1); transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0)); } }
.ease-in-out { animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* shadcn Zinc tokens, with aliases for the existing business forms. */
:where(#crm-shell-root, #crm-login-root, .crm-component) * { border: 0 solid var(--border); }
:root {
  --ui-background: 0 0% 100%; --ui-foreground: 240 10% 3.9%;
  --ui-card: 0 0% 100%; --ui-card-foreground: 240 10% 3.9%;
  --ui-popover: 0 0% 100%; --ui-popover-foreground: 240 10% 3.9%;
  --ui-primary: 240 5.9% 10%; --ui-primary-foreground: 0 0% 98%;
  --ui-secondary: 240 4.8% 95.9%; --ui-secondary-foreground: 240 5.9% 10%;
  --ui-muted: 240 4.8% 95.9%; --ui-muted-foreground: 240 3.8% 46.1%;
  --ui-accent: 240 4.8% 95.9%; --ui-accent-foreground: 240 5.9% 10%;
  --ui-destructive: 0 72% 45%; --ui-destructive-foreground: 0 0% 98%;
  --ui-border: 240 5.9% 90%; --ui-input: 240 5.9% 90%; --ui-ring: 240 5.9% 10%;
  --bg: #fafafa; --surface: hsl(var(--ui-card)); --surface2: hsl(var(--ui-muted));
  --border: hsl(var(--ui-border)); --text: hsl(var(--ui-foreground)); --text-muted: #71717a;
  --accent: #18181b; --accent-hover: #3f3f46; --green: #15803d; --yellow: #a16207; --red: #b91c1c; --danger: #b91c1c;
  --success-bg: #f0fdf4; --success-border: #bbf7d0; --info: #1d4ed8; --info-bg: #eff6ff; --info-border: #bfdbfe;
  --warn-bg: #fffbeb; --warn-border: #fde68a; --danger-bg: #fef2f2; --danger-border: #fecaca;
  --radius: .625rem; --shadow: 0 1px 3px rgb(0 0 0 / .06); --sidebar-width: 240px;
  --scrollbar-thumb: #d4d4d8; --scrollbar-thumb-hover: #a1a1aa;
  color-scheme: light;
}
.dark {
  --ui-background: 240 10% 3.9%; --ui-foreground: 0 0% 98%;
  --ui-card: 240 6% 8%; --ui-card-foreground: 0 0% 98%;
  --ui-popover: 240 6% 8%; --ui-popover-foreground: 0 0% 98%;
  --ui-primary: 0 0% 98%; --ui-primary-foreground: 240 5.9% 10%;
  --ui-secondary: 240 3.7% 15.9%; --ui-secondary-foreground: 0 0% 98%;
  --ui-muted: 240 3.7% 15.9%; --ui-muted-foreground: 240 5% 64.9%;
  --ui-accent: 240 3.7% 15.9%; --ui-accent-foreground: 0 0% 98%;
  --ui-destructive: 0 62% 45%; --ui-destructive-foreground: 0 0% 98%;
  --ui-border: 240 3.7% 19%; --ui-input: 240 3.7% 23%; --ui-ring: 240 4.9% 83.9%;
  --bg: #09090b; --text-muted: #a1a1aa; --accent: #fafafa; --accent-hover: #d4d4d8;
  --green: #86efac; --yellow: #fcd34d; --red: #fca5a5; --danger: #fca5a5;
  --success-bg: #10251a; --success-border: #225437; --info: #93c5fd; --info-bg: #122139; --info-border: #28466d;
  --warn-bg: #292211; --warn-border: #65501e; --danger-bg: #2e171a; --danger-border: #663036;
  --scrollbar-thumb: #3f3f46; --scrollbar-thumb-hover: #71717a; color-scheme: dark;
}
body.crm-workspace, body.crm-login { font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; letter-spacing: -.012em; background: var(--bg); color: var(--text); line-height: 1.5; margin: 0; }
.crm-workspace *, .crm-login *, .crm-component * { box-sizing: border-box; }
.crm-workspace [hidden], .crm-login [hidden] { display: none !important; }
.crm-workspace :focus-visible, .crm-login :focus-visible, .crm-component :focus-visible { outline: 2px solid hsl(var(--ui-ring)); outline-offset: 3px; }
.crm-workspace a, .crm-login a { color: inherit; }
.crm-workspace button, .crm-login button, .crm-component button { font-family: inherit; cursor: pointer; }
.crm-workspace button:disabled, .crm-login button:disabled { cursor: not-allowed; opacity: .5; }
.crm-workspace svg, .crm-login svg { flex-shrink: 0; vertical-align: middle; }
.crm-brand { display: flex; align-items: center; gap: 11px; }
.crm-brand-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: hsl(var(--ui-primary)); color: hsl(var(--ui-primary-foreground)); }
.crm-brand > div { display: flex; flex-direction: column; }
.crm-brand strong { font-size: 15px; letter-spacing: -.03em; font-weight: 650; }
.crm-brand span:not(.crm-brand-icon) { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.crm-brand-link { display: block; padding: 26px 20px; text-decoration: none; }
.crm-sidebar { width: var(--sidebar-width); position: fixed; inset: 0 auto 0 0; z-index: 35; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.crm-navigation { display: block; overflow-y: auto; margin: 0; padding: 8px 12px 20px; flex: 1; }
.crm-nav-group { margin: 0 0 22px; }
.crm-nav-label { margin: 0 10px 8px; color: var(--text-muted); font-size: 11px; font-weight: 500; letter-spacing: .025em; }
.crm-nav-link { display: flex; gap: 10px; align-items: center; text-decoration: none; padding: 9px 10px; min-height: 39px; border-radius: 6px; margin: 3px 0; color: var(--text-muted) !important; font-size: 13px; font-weight: 450; }
.crm-nav-link:hover { background: var(--surface2); color: var(--text) !important; }
.crm-nav-link[aria-current=page] { background: var(--surface2); color: var(--text) !important; font-weight: 600; }
.crm-nav-arrow { margin-left: auto; }
.crm-sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.crm-preview-label { display: flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 11px; padding: 2px 9px 12px; margin: 0; }
.crm-preview-label > span { width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
.crm-profile { display: flex; align-items: center; gap: 9px; padding: 5px 3px; }
.crm-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--border); display: grid; place-items: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.crm-profile > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.crm-profile strong { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crm-profile span:not(.crm-avatar) { font-size: 11px; color: var(--text-muted); }
#crm-shell-root button, .crm-component button, #crm-login-root button { min-height: 36px; border-style: solid; line-height: 1.4; }
#crm-shell-root button.h-9, .crm-component button.h-9 { padding: 8px; }
#crm-shell-root button.border, .crm-component button.border { border-width: 1px; }
#crm-shell-root button:not(.border), .crm-component button:not(.border), #crm-login-root button:not(.border) { border-width: 0; }
#crm-shell-root button svg, .crm-component button svg, #crm-login-root button svg { width: 17px; height: 17px; }
.crm-topbar { height: 64px; position: fixed; inset: 0 0 auto var(--sidebar-width); z-index: 30; border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 30px; }
.crm-topbar-start, .crm-topbar-actions { display: flex; align-items: center; gap: 14px; min-width: 0; }
.crm-topbar-start strong { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-breadcrumb, .crm-breadcrumb-chevron { color: var(--text-muted); font-size: 12px; }
.crm-topbar .crm-search-trigger { width: 212px; justify-content: flex-start; gap: 8px; color: var(--text-muted); background: var(--bg); font-size: 12px; font-weight: 400; }
.crm-search-trigger kbd { font: inherit; font-size: 10px; border: 1px solid var(--border); border-radius: 4px; padding: 1px 4px; margin-left: auto; }
.crm-topbar .crm-menu-button { display: none; }
.crm-component { color: var(--text); font-family: inherit; font-size: 14px; border-color: var(--border); }
.crm-mobile-menu { width: min(320px, 90vw); padding: 24px 12px 16px; display: flex; flex-direction: column; }
.crm-mobile-menu > div:first-of-type { padding: 2px 10px 16px; text-align: left; }
.crm-mobile-menu .crm-navigation { padding-top: 12px; }
.crm-mobile-menu .crm-profile { border-top: 1px solid var(--border); padding-top: 14px; }
.crm-search-sheet { top: 12vh; left: 50%; right: auto; width: min(560px, calc(100vw - 32px)); max-height: 76dvh; transform: translateX(-50%); border: 1px solid var(--border); border-radius: 14px; padding: 24px; overflow-y: auto; }
.crm-search-sheet h2 { font-size: 18px; margin: 0; }
.crm-search-sheet p { margin: 6px 0; }
.crm-search-field { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; margin: 20px 0 10px; }
.crm-search-field input { border: 0; background: transparent; padding-left: 0; box-shadow: none; width: 100%; min-width: 0; height: 44px; color: var(--text); }
.crm-search-results a { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-radius: 7px; text-decoration: none; color: var(--text); }
.crm-search-results a:hover, .crm-search-results a:focus-visible { background: var(--surface2); }
.crm-search-results a > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.crm-search-results strong { font-size: 13px; font-weight: 600; }
.crm-search-results span, .crm-no-results { color: var(--text-muted); font-size: 12px; }
.crm-session-error { position: fixed; top: 70px; right: 20px; z-index: 60; max-width: calc(100vw - 40px); padding: 12px 16px; border: 1px solid var(--danger-border); border-radius: 8px; background: var(--danger-bg); color: var(--danger); }
.crm-skip { position: fixed; top: -100px; left: 12px; z-index: 100; background: var(--surface); padding: 12px 20px; border-radius: 6px; }
.crm-skip:focus { top: 12px; }

/* Business controllers own this DOM; React owns only the separate shell and metrics. */
.crm-legacy { margin-left: var(--sidebar-width); padding-top: 64px; min-width: 0; }
.crm-legacy > .workspace-header, .crm-legacy > .wh-header { position: static; display: flex; align-items: center; gap: 20px; max-width: 1500px; margin: 0 auto; padding: 30px 32px 12px; border: 0; background: transparent; box-shadow: none; }
.crm-legacy > main { width: 100%; max-width: 1500px; margin: 0 auto; padding: 0 32px 40px; }
.crm-legacy h1, .crm-legacy .wh-title { font-size: 28px; line-height: 1.25; font-weight: 650; letter-spacing: -.04em; margin: 0; }
.crm-legacy h2 { font-size: 16px; line-height: 1.4; font-weight: 600; letter-spacing: -.02em; margin: 0 0 16px; }
.crm-legacy h3 { font-size: 14px; font-weight: 600; margin: 20px 0 12px; }
.crm-legacy h4 { font-size: 13px; font-weight: 600; margin: 12px 0 8px; }
.crm-legacy .crm-page-description { color: var(--text-muted); font-size: 13px; margin: 8px 0 0; }
.crm-legacy .workspace-header .eyebrow { display: none; }
.crm-legacy .workspace-header .hint { margin-top: 6px; font-size: 11px; }
.crm-ready .crm-global-link, .crm-ready .workspace-header #logout, .crm-ready #whBackBtn { display: none !important; }
.crm-legacy > main > #status { font-size: 11px; color: var(--text-muted); margin: 2px 0 16px; }
.crm-legacy .panel, .crm-legacy .wh-panel { padding: 24px; margin: 0 0 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .025); min-width: 0; }
.crm-legacy .panel > .toolbar:first-child { margin-bottom: 12px; justify-content: flex-start; }
.crm-legacy .panel > .toolbar:first-child h2 { margin: 0 auto 0 0; }
.crm-legacy .panel > .toolbar:first-child > div:first-child { margin-right: auto; }
.crm-legacy .toolbar, .crm-legacy .actions { gap: 8px; }
.crm-legacy .toolbar input { width: auto; flex: 1; }
.crm-legacy button, .crm-legacy .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 8px 13px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 500; line-height: 1.45; box-shadow: 0 1px 2px rgb(0 0 0 / .03); white-space: normal; text-align: center; text-decoration: none; transition: background-color .15s, border-color .15s; max-width: 100%; }
.crm-legacy button:hover:not(:disabled), .crm-legacy .btn:hover { background: var(--surface2); border-color: hsl(var(--ui-input)); }
.crm-legacy button.primary, .crm-legacy .btn-primary, .crm-legacy button[type=submit] { background: hsl(var(--ui-primary)); color: hsl(var(--ui-primary-foreground)); border-color: hsl(var(--ui-primary)); }
.crm-legacy button.primary:hover:not(:disabled), .crm-legacy button[type=submit]:hover:not(:disabled) { opacity: .9; }
.crm-legacy input, .crm-legacy select, .crm-legacy textarea { font: inherit; font-size: 13px; min-height: 38px; padding: 8px 11px; border: 1px solid hsl(var(--ui-input)); border-radius: 6px; background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .02); min-width: 0; }
.crm-legacy input::-moz-placeholder, .crm-legacy textarea::-moz-placeholder { color: var(--text-muted); }
.crm-legacy input::placeholder, .crm-legacy textarea::placeholder { color: var(--text-muted); }
.crm-legacy input[type=checkbox], .crm-legacy input[type=radio] { width: 18px; height: 18px; min-height: 18px; padding: 0; flex-shrink: 0; accent-color: hsl(var(--ui-primary)); }
.crm-legacy input[type=file] { max-width: 100%; }
.crm-legacy textarea { min-height: 92px; }
.crm-legacy .field { margin: 12px 0; gap: 7px; }
.crm-legacy .field > span, .crm-legacy label { font-size: 12px; font-weight: 500; color: var(--text); }
.crm-legacy .hint, .crm-legacy .meta-line, .crm-legacy .payroll-meta, .crm-legacy .details-meta { font-size: 12px; color: var(--text-muted); line-height: 1.65; }
.crm-legacy .panel > .hint { max-width: 85ch; margin-bottom: 12px; }
.crm-legacy .item, .crm-legacy .details-item, .crm-legacy .payroll-worker-row, .crm-legacy .payroll-line { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.crm-legacy .item p { margin: 5px 0; }
.crm-legacy .item strong { font-weight: 600; }
.crm-legacy .list { gap: 12px; margin: 12px 0; }
.crm-legacy .actions { padding-top: 4px; }
.crm-legacy .empty { padding: 32px 16px; text-align: center; border: 1px dashed var(--border); border-radius: 8px; font-size: 13px; }
.crm-legacy .amount { font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.crm-legacy .badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 500; padding: 3px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface2); color: var(--text-muted); }
.crm-legacy .badge.confirmed, .crm-legacy .badge.in_service, .crm-legacy .badge.proposed, .crm-legacy .state-in_progress { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.crm-legacy .badge.arrived, .crm-legacy .badge.ready, .crm-legacy .badge.agreed, .crm-legacy .state-done { background: var(--success-bg); color: var(--green); border-color: var(--success-border); }
.crm-legacy .badge.no_show, .crm-legacy .badge.waiting, .crm-legacy .state-paused { background: var(--warn-bg); color: var(--yellow); border-color: var(--warn-border); }
.crm-legacy .badge.final { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.crm-legacy .danger, .crm-legacy .payroll-negative { color: var(--danger); }
.crm-legacy .warn-box, .crm-legacy #error, .crm-legacy .wh-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); border-radius: 8px; padding: 14px; margin: 12px 0; }
.crm-legacy .pending, .crm-legacy .pending-banner { border-color: var(--warn-border); background: var(--warn-bg); }
.crm-legacy .quality-warn, .crm-legacy .result-incomplete, .crm-legacy .period-blockers { color: var(--yellow); }
.crm-legacy .finance-note, .crm-legacy .payroll-note, .crm-legacy .report-disclaimer { border-left-color: var(--info); background: var(--info-bg); color: var(--text); font-size: 12px; line-height: 1.6; border-radius: 4px; }
.crm-legacy #editor, .crm-legacy #history, .crm-legacy #visit-panel, .crm-legacy #order-panel, .crm-legacy #detail-panel { scroll-margin-top: 84px; }
.crm-legacy #editor { border-color: hsl(var(--ui-ring) / .4); box-shadow: 0 3px 12px rgb(0 0 0 / .04); }
.crm-legacy table { width: 100%; border-collapse: collapse; font-size: 12px; }
.crm-legacy th { color: var(--text-muted); text-align: left; background: var(--bg); font-weight: 500; }
.crm-legacy th, .crm-legacy td { padding: 12px; border-bottom: 1px solid var(--border); }
.crm-legacy tr:last-child td { border-bottom: 0; }
.crm-legacy summary { cursor: pointer; padding: 8px 0; }
.crm-legacy #workspace > nav { display: flex; align-items: center; gap: 4px; padding: 4px; margin: 0 0 20px; width: -moz-fit-content; width: fit-content; max-width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; }
.crm-legacy #workspace > nav button { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-muted); }
.crm-legacy #workspace > nav button[aria-current=page] { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
.crm-legacy .bay-grid { gap: 14px; }
.crm-legacy .bay-card { padding: 18px; border-radius: 8px; background: var(--surface); border-color: var(--border); }
.crm-legacy .bay-card.free { border-left: 3px solid var(--green); }
.crm-legacy .bay-card.occupied, .crm-legacy .bay-occupied { border-left: 3px solid var(--info); }
.crm-legacy .bay-card h3 { margin: 0 0 12px; }
.crm-legacy .bay-column { background: var(--bg); border-color: var(--border); padding: 14px; }
.crm-legacy .booking-chip { display: block; text-align: left; background: var(--surface); border-left: 3px solid var(--info-border); padding: 12px; }
.crm-legacy #operations-overview { background: transparent; border: 0; box-shadow: none; padding: 0; }
.crm-legacy #operations-overview > h2 { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.crm-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.crm-metric { border: 1px solid var(--border); box-shadow: 0 1px 2px rgb(0 0 0 / .025); border-radius: 9px; }
.crm-metric > div { padding: 20px; }
.crm-metric > div > div { display: flex; justify-content: space-between; gap: 14px; color: var(--text-muted); font-size: 12px; }
.crm-metric strong { display: block; margin-top: 12px; font-size: 30px; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.crm-legacy .crm-contacts { padding: 18px 22px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); margin-top: 20px; }
.crm-legacy .crm-contacts summary { font-size: 14px; font-weight: 600; padding: 0; }
.crm-legacy .crm-contacts[open] summary { margin-bottom: 18px; }
.crm-legacy .report-card, .crm-legacy .summary-card, .crm-legacy .wh-kpi { background: var(--surface); padding: 20px; border: 1px solid var(--border); border-radius: 9px; box-shadow: none; }
.crm-legacy .report-card h3 { font-size: 12px; color: var(--text-muted); }
.crm-legacy .report-card .amount, .crm-legacy .finance-grid .amount { font-size: 27px; }
.crm-legacy .order-card.selected { border-color: var(--info); background: var(--info-bg); }
.crm-legacy .workshop-layout > .panel { margin-top: 0; }
.crm-workspace .crm-page-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.crm-page-shortcuts a { text-decoration: none; color: var(--text-muted); border-bottom: 1px solid var(--border); padding: 7px 10px; font-size: 12px; }
.crm-page-shortcuts a:hover { color: var(--text); border-color: var(--text); }

.crm-login-layout { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.crm-login-story { background: var(--surface2); padding: 42px; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.crm-login-story-body { margin: auto; max-width: 440px; padding: 70px 0; }
.crm-login-story-body h1 { font-size: clamp(36px,4vw,60px); line-height: 1.13; font-weight: 600; letter-spacing: -.06em; margin: 30px 0 22px; }
.crm-login-story-body h1 span { color: var(--text-muted); }
.crm-login-story-body p { font-size: 15px; line-height: 1.8; max-width: 370px; color: var(--text-muted); }
.crm-login-features { display: flex; flex-direction: column; gap: 18px; margin-top: 38px; }
.crm-login-features span { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.crm-login-features svg { width: 17px; color: var(--text-muted); }
.crm-login-footer { font-size: 11px; color: var(--text-muted); }
.crm-login-main { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 70px 32px; max-width: none; margin: 0; background: var(--surface); }
.crm-login-card { width: 100%; max-width: 352px; }
.crm-login-emblem { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 24px; }
.crm-login-card h2 { font-size: 26px; font-weight: 600; letter-spacing: -.04em; margin: 0; }
.crm-login-subtitle { font-size: 13px; color: var(--text-muted); margin: 8px 0 30px; }
.crm-login-card label { display: block; margin: 20px 0 8px; font-size: 12px; font-weight: 500; }
.crm-login-card input { width: 100%; height: 42px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 14px; }
.crm-password { position: relative; }
.crm-password input { padding-right: 46px; }
.crm-password button { position: absolute; top: 3px; right: 3px; padding: 8px; background: transparent; color: var(--text-muted); }
#crm-login-root .crm-login-submit { display: flex; justify-content: space-between; width: 100%; margin: 24px 0; height: 42px; padding: 10px 14px; font-size: 13px; }
.crm-login-help { display: flex; align-items: flex-start; gap: 7px; color: var(--text-muted); font-size: 11px; margin-top: 20px; }
.crm-login-bottom { position: absolute; bottom: 24px; font-size: 11px; color: var(--text-muted); }
.crm-login-theme { position: absolute; top: 24px; right: 24px; padding: 9px; }
.crm-login-mobile-brand { display: none; }
.crm-login-error { margin-top: 14px; padding: 12px; background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); border-radius: 7px; font-size: 12px; }

@media(min-width:1600px) { .crm-metrics { grid-template-columns: repeat(6,minmax(0,1fr)); } }
@media(max-width:1150px) { :root { --sidebar-width: 214px; } .crm-brand-link { padding-left: 16px; } .crm-breadcrumb, .crm-breadcrumb-chevron { display: none; } .crm-legacy > .workspace-header,.crm-legacy > .wh-header { padding: 24px 22px 12px; } .crm-legacy > main { padding: 0 22px 32px; } }
@media(max-width:900px) {
  .crm-sidebar { display: none; } .crm-topbar { left: 0; height: 60px; padding: 0 16px; } .crm-topbar .crm-menu-button { display: inline-flex; }
  .crm-legacy { margin-left: 0; padding-top: 60px; } .crm-topbar-start { gap: 8px; } .crm-topbar-actions { gap: 4px; }
  .crm-legacy > .workspace-header,.crm-legacy > .wh-header { padding: 24px 20px 12px; } .crm-legacy > main { padding: 0 20px 32px; }
  .crm-nav-link { min-height: 44px; } #crm-shell-root button, .crm-component button { min-height: 44px; min-width: 44px; }
}
@media(max-width:600px) {
  .crm-topbar { padding: 0 10px; } .crm-topbar .crm-search-trigger { width: 40px; min-width: 40px; border: 0; padding: 8px; background: transparent; justify-content: center; } .crm-search-trigger span,.crm-search-trigger kbd { display: none; }
  .crm-legacy > .workspace-header,.crm-legacy > .wh-header { padding: 24px 16px 14px; align-items: flex-start; flex-direction: column; gap: 14px; }
  .crm-legacy > main { padding: 0 16px 28px; } .crm-legacy h1,.crm-legacy .wh-title { font-size: 26px; }
  .crm-legacy .panel,.crm-legacy .wh-panel { padding: 18px 16px; margin-bottom: 16px; }
  .crm-legacy .panel > .toolbar:first-child { align-items: flex-start; gap: 12px; }
  .crm-legacy input,.crm-legacy select,.crm-legacy textarea { font-size: 16px; min-height: 44px; }
  .crm-legacy button,.crm-legacy .btn { min-height: 44px; font-size: 12px; padding: 10px 12px; }
  .crm-legacy .toolbar { flex-wrap: wrap; } .crm-legacy .toolbar input { flex-basis: 100%; width: 100%; }
  .crm-legacy .grid,.crm-legacy .bay-grid,.crm-legacy .finance-grid,.crm-legacy .report-grid,.crm-legacy .period-control-form { grid-template-columns: 1fr; }
  .crm-legacy #workspace > nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
  .crm-legacy #workspace > nav button { flex-shrink: 0; white-space: nowrap; }
  .crm-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; } .crm-metric > div { padding: 14px; }
  .crm-metric strong { font-size: 27px; } .crm-metric > div > div { gap: 6px; font-size: 11px; align-items: flex-start; min-height: 34px; }
  .crm-metric svg { width: 15px; height: 15px; }
  .crm-legacy .crm-contacts { padding: 16px; } .crm-legacy .item { padding: 14px; }
  .crm-legacy .workshop-layout { grid-template-columns: minmax(0,1fr); }
  .crm-search-sheet { padding: 22px 16px; top: 6vh; max-height: 86dvh; } .crm-search-field input { font-size: 16px; }
  .crm-login-layout { display: block; } .crm-login-story { display: none; }
  .crm-login-main { min-height: 100dvh; padding: 96px 26px 70px; justify-content: center; }
  .crm-login-mobile-brand { display: block; margin-bottom: 42px; } .crm-login-emblem { display: none; }
  .crm-login-card input { height: 46px; font-size: 16px; } #crm-login-root .crm-login-submit { height: 46px; }
  .crm-password button { top: 5px; } .crm-login-theme { top: 20px; right: 18px; }
}
@media(prefers-reduced-motion:reduce) { .crm-workspace *, .crm-login *, .crm-component { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
@media print { #crm-shell-root,.crm-page-shortcuts { display: none !important; } .crm-legacy { margin: 0; padding: 0; } .crm-legacy > main { max-width: none; padding: 0; } }
.file\:border-0::file-selector-button { border-width: 0px; }
.file\:bg-transparent::file-selector-button { background-color: transparent; }
.file\:text-sm::file-selector-button { font-size: 0.875rem; line-height: 1.25rem; }
.file\:font-medium::file-selector-button { font-weight: 500; }
.file\:text-foreground::file-selector-button { color: hsl(var(--ui-foreground)); }
.placeholder\:text-muted-foreground::-moz-placeholder { color: hsl(var(--ui-muted-foreground)); }
.placeholder\:text-muted-foreground::placeholder { color: hsl(var(--ui-muted-foreground)); }
.hover\:bg-accent:hover { background-color: hsl(var(--ui-accent)); }
.hover\:bg-destructive\/80:hover { background-color: hsl(var(--ui-destructive) / 0.8); }
.hover\:bg-destructive\/90:hover { background-color: hsl(var(--ui-destructive) / 0.9); }
.hover\:bg-primary\/80:hover { background-color: hsl(var(--ui-primary) / 0.8); }
.hover\:bg-primary\/90:hover { background-color: hsl(var(--ui-primary) / 0.9); }
.hover\:bg-secondary\/80:hover { background-color: hsl(var(--ui-secondary) / 0.8); }
.hover\:text-accent-foreground:hover { color: hsl(var(--ui-accent-foreground)); }
.hover\:underline:hover { text-decoration-line: underline; }
.hover\:opacity-100:hover { opacity: 1; }
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); }
.focus\:ring-ring:focus { --tw-ring-color: hsl(var(--ui-ring)); }
.focus\:ring-offset-2:focus { --tw-ring-offset-width: 2px; }
.focus-visible\:outline-none:focus-visible { outline: 2px solid transparent; outline-offset: 2px; }
.focus-visible\:ring-1:focus-visible { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); }
.focus-visible\:ring-ring:focus-visible { --tw-ring-color: hsl(var(--ui-ring)); }
.disabled\:pointer-events-none:disabled { pointer-events: none; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }
.disabled\:opacity-50:disabled { opacity: 0.5; }
.data-\[state\=open\]\:bg-secondary[data-state="open"] { background-color: hsl(var(--ui-secondary)); }
.data-\[state\=closed\]\:duration-300[data-state="closed"] { transition-duration: 300ms; }
.data-\[state\=open\]\:duration-500[data-state="open"] { transition-duration: 500ms; }
.data-\[state\=open\]\:animate-in[data-state="open"] { animation-name: enter; animation-duration: 150ms; --tw-enter-opacity: initial; --tw-enter-scale: initial; --tw-enter-rotate: initial; --tw-enter-translate-x: initial; --tw-enter-translate-y: initial; }
.data-\[state\=closed\]\:animate-out[data-state="closed"] { animation-name: exit; animation-duration: 150ms; --tw-exit-opacity: initial; --tw-exit-scale: initial; --tw-exit-rotate: initial; --tw-exit-translate-x: initial; --tw-exit-translate-y: initial; }
.data-\[state\=closed\]\:fade-out-0[data-state="closed"] { --tw-exit-opacity: 0; }
.data-\[state\=open\]\:fade-in-0[data-state="open"] { --tw-enter-opacity: 0; }
.data-\[state\=closed\]\:slide-out-to-bottom[data-state="closed"] { --tw-exit-translate-y: 100%; }
.data-\[state\=closed\]\:slide-out-to-left[data-state="closed"] { --tw-exit-translate-x: -100%; }
.data-\[state\=closed\]\:slide-out-to-right[data-state="closed"] { --tw-exit-translate-x: 100%; }
.data-\[state\=closed\]\:slide-out-to-top[data-state="closed"] { --tw-exit-translate-y: -100%; }
.data-\[state\=open\]\:slide-in-from-bottom[data-state="open"] { --tw-enter-translate-y: 100%; }
.data-\[state\=open\]\:slide-in-from-left[data-state="open"] { --tw-enter-translate-x: -100%; }
.data-\[state\=open\]\:slide-in-from-right[data-state="open"] { --tw-enter-translate-x: 100%; }
.data-\[state\=open\]\:slide-in-from-top[data-state="open"] { --tw-enter-translate-y: -100%; }
.data-\[state\=closed\]\:duration-300[data-state="closed"] { animation-duration: 300ms; }
.data-\[state\=open\]\:duration-500[data-state="open"] { animation-duration: 500ms; }
@media (min-width: 640px) {
 .sm\:max-w-sm { max-width: 24rem; }
 .sm\:flex-row { flex-direction: row; }
 .sm\:justify-end { justify-content: flex-end; }
 .sm\:space-x-2 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(0.5rem * var(--tw-space-x-reverse)); margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse))); }
 .sm\:text-left { text-align: left; } }
@media (min-width: 768px) {
 .md\:text-sm { font-size: 0.875rem; line-height: 1.25rem; } }
.\[\&_svg\]\:pointer-events-none svg { pointer-events: none; }
.\[\&_svg\]\:size-4 svg { width: 1rem; height: 1rem; }
.\[\&_svg\]\:shrink-0 svg { flex-shrink: 0; }
