:root {
    --spacing: 0.2rem;
    --ca-font-size-step: 1px;
    --ca-compact-line-height: 1.22;
    --ca-compact-line-height-tight: 1.15;
}

body {
    font-size: calc(1rem + var(--ca-font-size-step));
}

.text-xs {
    font-size: calc(0.75rem + var(--ca-font-size-step)) !important;
}

.text-sm {
    font-size: calc(0.875rem + var(--ca-font-size-step)) !important;
}

.text-base {
    font-size: calc(1rem + var(--ca-font-size-step)) !important;
}

.text-lg {
    font-size: calc(1.125rem + var(--ca-font-size-step)) !important;
}

.text-xl {
    font-size: calc(1.25rem + var(--ca-font-size-step)) !important;
}

.text-2xl {
    font-size: calc(1.5rem + var(--ca-font-size-step)) !important;
}

body,
.fi-body,
.fi-main,
.fi-page,
.fi-modal-window,
.fi-section,
.fi-ta,
.fi-fo,
.fi-dropdown-panel {
    line-height: var(--ca-compact-line-height);
}

.fi-modal-content,
.fi-section-content,
.fi-ta-content,
.fi-fo-field-wrp,
.fi-fo-field-wrp-label,
.fi-input-wrp,
.fi-in,
.fi-select-input,
.fi-ta-text,
.fi-label,
.fi-btn-label,
.fi-dropdown-list-item-label,
.fi-tabs-item-label {
    line-height: var(--ca-compact-line-height-tight);
}

.fi-modal-content :where(p, li, dd),
.fi-section-content :where(p, li, dd),
.fi-ta-content :where(p, li, dd) {
    line-height: var(--ca-compact-line-height);
}

.fi-modal-content :where(.fi-fo-field-wrp-helper-text, .fi-fo-field-wrp-error-message),
.fi-section-content :where(.fi-fo-field-wrp-helper-text, .fi-fo-field-wrp-error-message) {
    line-height: 1.18;
}

.fi-one-time-code-input-ctn {
    --ca-otp-digit-size: 2.15rem;
    --ca-otp-digit-gap: 0.35rem;
    --ca-otp-caret-buffer: calc(var(--ca-otp-digit-size) + var(--ca-otp-digit-gap));
    display: inline-flex;
    gap: var(--ca-otp-digit-gap);
    width: max-content;
    max-width: 100%;
}

.fi-one-time-code-input-ctn > .fi-one-time-code-input-digit-field {
    display: block;
    flex: 0 0 var(--ca-otp-digit-size);
    width: var(--ca-otp-digit-size);
}

input[type='text'].fi-one-time-code-input {
    inset-inline: 0 !important;
    width: calc((var(--ca-otp-digit-size) * 6) + (var(--ca-otp-digit-gap) * 5) + var(--ca-otp-caret-buffer)) !important;
    max-width: none;
    padding-inline: calc((var(--ca-otp-digit-size) - 1ch) / 2) 0 !important;
    font-family: var(--font-mono) !important;
    font-size: 1rem !important;
    font-variant-numeric: tabular-nums;
    line-height: 1 !important;
    letter-spacing: calc(var(--ca-otp-digit-size) + var(--ca-otp-digit-gap) - 1ch) !important;
}

.ca-email-template-section {
    border-left: 4px solid #dc2626 !important;
}

.ca-email-template-section .fi-section-header-heading {
    color: #b91c1c !important;
    font-weight: 900 !important;
}

.ca-email-template-section .fi-section-header {
    background: #fef2f2 !important;
}

.ca-email-rich-editor.fi-fo-rich-editor {
    overflow: hidden;
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.ca-email-rich-editor .fi-fo-rich-editor-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid #dbe3ee;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 8px;
}

.ca-email-rich-editor .fi-fo-rich-editor-toolbar-group {
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.ca-email-rich-editor .fi-fo-rich-editor-main {
    min-height: var(--ca-email-editor-min-height, 320px);
    background: #ffffff;
}

.ca-email-rich-editor .fi-fo-rich-editor-content {
    min-height: var(--ca-email-editor-min-height, 320px);
    max-height: min(72vh, 760px);
    overflow: auto;
    padding: 18px 20px;
    background:
        linear-gradient(90deg, rgba(203, 213, 225, 0.16) 1px, transparent 1px),
        linear-gradient(180deg, rgba(203, 213, 225, 0.16) 1px, transparent 1px),
        #ffffff;
    background-size: 24px 24px;
    font-size: 15px;
    line-height: 1.6;
}

.ca-email-rich-editor .fi-fo-rich-editor-content .ProseMirror {
    min-height: calc(var(--ca-email-editor-min-height, 320px) - 36px);
    outline: none;
}

.ca-email-rich-editor .fi-fo-rich-editor-content :where(h1, h2, h3) {
    letter-spacing: 0;
}

.ca-email-rich-editor .fi-fo-rich-editor-content img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    border-radius: 6px;
}

.ca-email-rich-editor .fi-fo-rich-editor-content blockquote[type="cite"] img,
.ca-email-rich-editor .fi-fo-rich-editor-content blockquote[data-ca-mail-reply-quote] img,
.ca-email-rich-editor .fi-fo-rich-editor-content blockquote img,
.ca-email-rich-editor .fi-fo-rich-editor-content img[data-ca-mail-quote-image] {
    max-width: min(280px, 100%) !important;
    width: auto !important;
    height: auto !important;
    max-height: 180px !important;
    object-fit: contain;
}

.ca-email-rich-editor .fi-fo-rich-editor-content blockquote[type="cite"] [data-resize-wrapper],
.ca-email-rich-editor .fi-fo-rich-editor-content blockquote[data-ca-mail-reply-quote] [data-resize-wrapper],
.ca-email-rich-editor .fi-fo-rich-editor-content blockquote [data-resize-wrapper] {
    max-width: min(280px, 100%) !important;
    width: auto !important;
}

.ca-email-rich-editor .fi-fo-rich-editor-content blockquote[type="cite"] [data-resize-handle],
.ca-email-rich-editor .fi-fo-rich-editor-content blockquote[data-ca-mail-reply-quote] [data-resize-handle],
.ca-email-rich-editor .fi-fo-rich-editor-content blockquote [data-resize-handle] {
    display: none !important;
}

.ca-email-rich-editor .fi-fo-rich-editor-content table {
    background: rgba(255, 255, 255, 0.82);
}

.ca-supplier-brand-report {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    color: #111827;
}

.ca-supplier-brand-report__summary,
.ca-supplier-brand-report__empty {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f8fafc;
    color: #374151;
    font-size: 0.94rem;
    line-height: 1.45;
    padding: 0.75rem 0.9rem;
}

.ca-supplier-brand-report__empty {
    background: #ffffff;
    color: #6b7280;
    padding-block: 1.5rem;
    text-align: center;
}

.ca-supplier-brand-report__table-wrap {
    max-height: min(64vh, 720px);
    overflow: auto;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
}

.ca-supplier-brand-report__table {
    width: 100%;
    min-width: 1560px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    line-height: 1.35;
    table-layout: fixed;
}

.ca-supplier-brand-report__table th,
.ca-supplier-brand-report__table td {
    padding: 0.62rem 0.85rem;
    white-space: nowrap;
    vertical-align: middle;
}

.ca-supplier-brand-report__table th {
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid #cbd5e1;
    background: #f3f4f6;
    color: #374151;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-align: left;
}

.ca-supplier-brand-report__table td {
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.ca-supplier-brand-report__table :is(th, td) + :is(th, td) {
    border-left: 1px solid #eef2f7;
}

.ca-supplier-brand-report__table tbody tr:nth-child(even) td {
    background: #f9fafb;
}

.ca-supplier-brand-report__table tbody tr:hover td {
    background: #eef6ff;
}

.ca-supplier-brand-report__table tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 1;
    border-top: 1px solid #cbd5e1;
    border-bottom: 0;
    background: #eef2ff;
    color: #111827;
    font-weight: 800;
}

.ca-supplier-brand-report__table :is(th, td):nth-child(1) {
    width: 235px;
}

.ca-supplier-brand-report__table :is(th, td):nth-child(2) {
    width: 130px;
}

.ca-supplier-brand-report__table :is(th, td):nth-child(3) {
    width: 115px;
}

.ca-supplier-brand-report__table :is(th, td):nth-child(4) {
    width: 125px;
}

.ca-supplier-brand-report__table :is(th, td):nth-child(5) {
    width: 140px;
}

.ca-supplier-brand-report__table :is(th, td):nth-child(6) {
    width: 150px;
}

.ca-supplier-brand-report__table :is(th, td):nth-child(7) {
    width: 125px;
}

.ca-supplier-brand-report__table :is(th, td):nth-child(8) {
    width: 125px;
}

.ca-supplier-brand-report__table :is(th, td):nth-child(9) {
    width: 180px;
}

.ca-supplier-brand-report__table :is(th, td):nth-child(10) {
    width: 125px;
}

.ca-supplier-brand-report__table :is(th, td):nth-child(11) {
    width: 110px;
}

.ca-supplier-brand-report__supplier {
    color: #111827 !important;
    font-weight: 800;
}

.ca-supplier-brand-report__supplier,
.ca-supplier-brand-report__brand {
    overflow: hidden;
    text-overflow: ellipsis;
}

.ca-supplier-brand-report__number {
    font-variant-numeric: tabular-nums;
    text-align: right !important;
}

.ca-supplier-brand-report__margin {
    font-weight: 800;
}

.ca-supplier-brand-report__margin.is-positive {
    color: #15803d;
}

.ca-supplier-brand-report__margin.is-negative {
    color: #dc2626;
}

html.dark .ca-supplier-brand-report {
    color: #f9fafb;
}

html.dark .ca-supplier-brand-report__summary,
html.dark .ca-supplier-brand-report__empty {
    border-color: #374151;
    background: #111827;
    color: #d1d5db;
}

html.dark .ca-supplier-brand-report__table-wrap {
    border-color: #374151;
    background: #020617;
}

html.dark .ca-supplier-brand-report__table th {
    border-bottom-color: #475569;
    background: #111827;
    color: #e5e7eb;
}

html.dark .ca-supplier-brand-report__table td {
    border-bottom-color: #1f2937;
    color: #d1d5db;
}

html.dark .ca-supplier-brand-report__table :is(th, td) + :is(th, td) {
    border-left-color: #1f2937;
}

html.dark .ca-supplier-brand-report__table tbody tr:nth-child(even) td {
    background: #0f172a;
}

html.dark .ca-supplier-brand-report__table tbody tr:hover td {
    background: #1e293b;
}

html.dark .ca-supplier-brand-report__table tfoot td {
    border-top-color: #475569;
    background: #172554;
    color: #f9fafb;
}

html.dark .ca-supplier-brand-report__supplier {
    color: #f9fafb !important;
}

html.dark .ca-supplier-brand-report__margin.is-positive {
    color: #86efac;
}

html.dark .ca-supplier-brand-report__margin.is-negative {
    color: #fca5a5;
}

.fi-topbar-nav-groups {
    column-gap: calc(var(--spacing) * 1) !important;
    margin-inline: 0 !important;
}

.fi-topbar-nav-groups .fi-topbar-item-btn {
    column-gap: calc(var(--spacing) * 1.5);
    padding-inline: calc(var(--spacing) * 2);
}

.ca-topbar-actions,
.fi-topbar .fi-topbar-database-notifications-btn {
    --ca-topbar-badge-ring: #ffffff;
}

.ca-topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ca-topbar-icon-link,
.fi-topbar .ca-topbar-icon-button.fi-icon-btn,
.fi-topbar .fi-topbar-database-notifications-btn.fi-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
}

.ca-topbar-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    text-decoration: none;
}

.ca-topbar-icon,
.fi-topbar .ca-topbar-icon-button.fi-icon-btn > .fi-icon:not(.fi-loading-indicator),
.fi-topbar .fi-topbar-database-notifications-btn.fi-icon-btn > .fi-icon:not(.fi-loading-indicator) {
    display: block;
    width: 24px;
    height: 24px;
}

.ca-topbar-icon-link:hover,
.fi-topbar .ca-topbar-icon-button.fi-icon-btn:hover,
.fi-topbar .fi-topbar-database-notifications-btn.fi-icon-btn:hover {
    background: #f3f4f6;
}

.ca-topbar-count-badge,
.fi-topbar .fi-topbar-database-notifications-btn .fi-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--ca-topbar-badge-ring), 0 0 0 3px rgba(239, 68, 68, 0.22), 0 0 8px rgba(239, 68, 68, 0.5);
    transform-origin: center;
    animation: ca-topbar-count-pulse 0.95s ease-in-out infinite;
    will-change: transform, box-shadow, background-color;
}

.ca-topbar-mail-button:has(.ca-topbar-count-badge) .ca-topbar-icon,
.fi-topbar .fi-topbar-database-notifications-btn:has(.fi-icon-btn-badge-ctn) > .fi-icon:not(.fi-loading-indicator) {
    color: #dc2626;
    stroke: #dc2626;
}

.fi-topbar .fi-topbar-database-notifications-btn .fi-icon-btn-badge-ctn {
    position: absolute !important;
    top: -2px !important;
    right: -2px !important;
    bottom: auto !important;
    left: auto !important;
    inset: auto -2px auto auto !important;
    inset-inline-start: auto !important;
    inset-inline-end: -2px !important;
    z-index: 1 !important;
    display: flex !important;
    width: auto !important;
    max-width: 24px !important;
    background: transparent !important;
    pointer-events: none;
    transform: none !important;
    translate: none !important;
    --tw-translate-x: 0 !important;
    --tw-translate-y: 0 !important;
}

.fi-topbar .fi-topbar-database-notifications-btn .fi-icon-btn-badge-ctn .fi-badge {
    position: static !important;
    transform: none !important;
    translate: none !important;
    --tw-translate-x: 0 !important;
    --tw-translate-y: 0 !important;
}

html.dark .ca-topbar-icon-link:hover,
html.dark .fi-topbar .ca-topbar-icon-button.fi-icon-btn:hover,
html.dark .fi-topbar .fi-topbar-database-notifications-btn.fi-icon-btn:hover {
    background: #1f2937;
}

html.dark .ca-topbar-actions,
html.dark .fi-topbar .fi-topbar-database-notifications-btn {
    --ca-topbar-badge-ring: #111827;
}

html.dark .ca-topbar-count-badge,
html.dark .fi-topbar .fi-topbar-database-notifications-btn .fi-badge {
    box-shadow: 0 0 0 2px #111827, 0 0 0 3px rgba(248, 113, 113, 0.26), 0 0 10px rgba(248, 113, 113, 0.55);
}

@keyframes ca-topbar-count-pulse {
    0%,
    100% {
        transform: scale(1);
        background: #ef4444;
        box-shadow: 0 0 0 2px var(--ca-topbar-badge-ring), 0 0 0 3px rgba(239, 68, 68, 0.2), 0 0 7px rgba(239, 68, 68, 0.45);
    }

    50% {
        transform: scale(1.2);
        background: #dc2626;
        box-shadow: 0 0 0 2px var(--ca-topbar-badge-ring), 0 0 0 7px rgba(239, 68, 68, 0), 0 0 14px rgba(220, 38, 38, 0.8);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ca-topbar-count-badge,
    .fi-topbar .fi-topbar-database-notifications-btn .fi-badge {
        animation: none;
    }
}

@media (max-width: 640px) {
    .ca-topbar-actions {
        gap: 0;
    }

    .ca-topbar-icon-link,
    .fi-topbar .ca-topbar-icon-button.fi-icon-btn,
    .fi-topbar .fi-topbar-database-notifications-btn.fi-icon-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
        border-radius: 8px;
    }

    .ca-topbar-icon,
    .fi-topbar .ca-topbar-icon-button.fi-icon-btn > .fi-icon:not(.fi-loading-indicator),
    .fi-topbar .fi-topbar-database-notifications-btn.fi-icon-btn > .fi-icon:not(.fi-loading-indicator) {
        width: 22px;
        height: 22px;
    }

    .ca-topbar-count-badge,
    .fi-topbar .fi-topbar-database-notifications-btn .fi-badge {
        top: 0 !important;
        right: 0 !important;
        min-width: 14px;
        height: 14px;
        padding: 0 3px;
        font-size: 9px;
        line-height: 14px;
        box-shadow: 0 0 0 2px var(--ca-topbar-badge-ring), 0 0 7px rgba(239, 68, 68, 0.5);
        animation: ca-topbar-count-mobile-pulse 1s ease-in-out infinite;
    }

    .fi-topbar .fi-topbar-database-notifications-btn .fi-icon-btn-badge-ctn {
        top: 0 !important;
        right: 0 !important;
        inset: auto 0 auto auto !important;
        inset-inline-end: 0 !important;
        max-width: 22px !important;
    }
}

@keyframes ca-topbar-count-mobile-pulse {
    0%,
    100% {
        transform: scale(1);
        background: #ef4444;
        box-shadow: 0 0 0 2px var(--ca-topbar-badge-ring), 0 0 6px rgba(239, 68, 68, 0.45);
    }

    50% {
        transform: scale(1.14);
        background: #dc2626;
        box-shadow: 0 0 0 2px var(--ca-topbar-badge-ring), 0 0 10px rgba(220, 38, 38, 0.75);
    }
}

.wo-modal-form,
.wo-card,
.wo-owner-suggestions,
.fc-wo-hover {
    line-height: 1.18;
}

.wo-card {
    padding: 0.65rem 0.65rem 0.6rem;
}

.wo-label {
    margin-bottom: 0.15rem;
    line-height: 1.1;
}

.wo-input,
.wo-textarea {
    line-height: 1.1rem;
}

.wo-tax-lookup-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 0.35rem;
    align-items: center;
}

.wo-tax-refresh-button {
    width: 34px;
    height: 32px;
    border: 1px solid #2563eb;
    border-radius: 0.45rem;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.wo-tax-refresh-button:hover:not(:disabled),
.wo-tax-refresh-button:focus-visible:not(:disabled) {
    background: #dbeafe;
    border-color: #1d4ed8;
}

.wo-tax-refresh-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wo-tax-lookup-status {
    min-height: 1rem;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
}

.wo-tax-lookup-success {
    color: #15803d;
}

.wo-tax-lookup-error {
    color: #b91c1c;
}

.wo-card-header {
    margin-bottom: 0.45rem;
}

.wo-card-body > .wo-field-group + .wo-field-group {
    margin-top: 0.42rem;
}

.wo-row-info-trigger {
    position: relative;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    cursor: help;
}

.wo-row-info-trigger[hidden] {
    display: none !important;
}

.wo-row-info-trigger:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.wo-row-info-tooltip {
    position: absolute;
    left: 0;
    top: 24px;
    z-index: 1000;
    display: none;
    width: max-content;
    max-width: 280px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #111827;
    color: #f9fafb;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    pointer-events: none;
    white-space: nowrap;
}

.wo-row-info-trigger:hover .wo-row-info-tooltip,
.wo-row-info-trigger:focus .wo-row-info-tooltip,
.wo-row-info-trigger:focus-within .wo-row-info-tooltip {
    display: block;
}

.wo-field-group-inline {
    margin-top: 4px;
}

.wo-address-row {
    display: grid;
    gap: 0.5rem;
    margin-top: 4px;
}

.wo-address-row-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wo-address-row-3 {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
}

.wo-address-row-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 540px) {
    .wo-address-row {
        grid-template-columns: 1fr;
    }
}

.fi-modal-tab {
    line-height: 1.1;
}

.fc-wo-card,
.fc-wo-meta,
.fc-resource-header {
    line-height: 1.15;
}

.fi-header {
    min-width: 0;
}

.fi-header-actions-ctn {
    flex-shrink: 1 !important;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100%;
    min-width: 0;
}

.fi-header-actions-ctn > .fi-ac:not(.fi-width-full) {
    flex-wrap: wrap;
    max-width: 100%;
    min-width: 0;
}

.ca-finance-invoice-table .fi-ta-row:nth-child(even) > .fi-ta-cell {
    background: #f8fafc !important;
}

.ca-finance-invoice-table .fi-ta-row:nth-child(even):hover > .fi-ta-cell {
    background: #eef6ff !important;
}

html.dark .ca-finance-invoice-table .fi-ta-row:nth-child(even) > .fi-ta-cell {
    background: #0f172a !important;
}

html.dark .ca-finance-invoice-table .fi-ta-row:nth-child(even):hover > .fi-ta-cell {
    background: #1e293b !important;
}

.ca-work-order-offers-table .fi-ta-row > .fi-ta-cell:has(> .fi-ta-actions) {
    min-width: 22rem;
    white-space: normal;
}

.ca-work-order-offers-table .fi-ta-row > .fi-ta-cell > .fi-ta-actions.fi-wrapped {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    align-items: stretch;
    justify-items: stretch;
}

.ca-work-order-offers-table .fi-ta-row > .fi-ta-cell > .fi-ta-actions.fi-wrapped > *,
.ca-work-order-offers-table .fi-ta-row > .fi-ta-cell > .fi-ta-actions.fi-wrapped .fi-btn {
    width: 100%;
    min-width: 0;
}

.ca-work-order-offers-table .fi-ta-row > .fi-ta-cell > .fi-ta-actions.fi-wrapped .fi-btn {
    justify-content: flex-start;
}

.ca-work-order-offers-table .fi-ta-row > .fi-ta-cell > .fi-ta-actions.fi-wrapped .fi-btn-label {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
}

.ca-crm-submission-details,
.ca-crm-submission-summary,
.ca-crm-file-preview,
.ca-crm-file-list-item {
    max-width: 100%;
    min-width: 0;
}

.ca-crm-submission-table {
    max-width: 100%;
    table-layout: fixed;
}

.ca-crm-submission-table td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ca-crm-file-preview-frame {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overscroll-behavior: contain;
}

@media (max-width: 640px) {
    .ca-crm-submission-table,
    .ca-crm-submission-table tbody,
    .ca-crm-submission-table tr,
    .ca-crm-submission-table td {
        display: block;
        width: 100% !important;
    }

    .ca-crm-submission-table tr {
        border-bottom: 1px solid #e5e7eb;
    }

    .ca-crm-submission-table tr:last-child {
        border-bottom: 0;
    }

    .ca-crm-submission-table td {
        border-bottom: 0 !important;
        padding: 7px 9px !important;
    }

    .ca-crm-submission-table td + td {
        padding-top: 0 !important;
    }

    .ca-crm-file-preview-toolbar {
        align-items: flex-start !important;
    }

    .ca-crm-file-preview-toolbar > * {
        max-width: 100%;
    }

    .ca-crm-file-preview-frame {
        max-height: 65vh !important;
    }
}

@media (min-width: 1024px) and (hover: hover) {
    .fi-ta-table .fi-ta-actions-header-cell,
    .fi-ta-table .fi-ta-row > .fi-ta-cell:has(> .fi-ta-actions) {
        position: sticky;
        inset-inline-end: 0;
        z-index: 12;
        background: #ffffff;
        box-shadow: -10px 0 14px -14px rgba(15, 23, 42, 0.45);
    }

    .fi-ta-table thead .fi-ta-actions-header-cell {
        z-index: 13;
    }

    .fi-ta-table .fi-ta-row > .fi-ta-cell:has(> .fi-ta-actions .fi-dropdown-panel[style*="display: block"]) {
        z-index: 30;
    }

    .fi-ta-table .fi-ta-actions-header-cell:first-child,
    .fi-ta-table .fi-ta-row > .fi-ta-cell:first-child:has(> .fi-ta-actions) {
        inset-inline-start: 0;
        inset-inline-end: auto;
        box-shadow: 10px 0 14px -14px rgba(15, 23, 42, 0.45);
    }

    html.dark .fi-ta-table .fi-ta-actions-header-cell,
    html.dark .fi-ta-table .fi-ta-row > .fi-ta-cell:has(> .fi-ta-actions) {
        background: var(--ca-dark-panel, #111827);
        box-shadow: -10px 0 14px -14px rgba(0, 0, 0, 0.75);
    }

    html.dark .fi-ta-table .fi-ta-actions-header-cell:first-child,
    html.dark .fi-ta-table .fi-ta-row > .fi-ta-cell:first-child:has(> .fi-ta-actions) {
        box-shadow: 10px 0 14px -14px rgba(0, 0, 0, 0.75);
    }
}

.fc .fc-col-header-cell-cushion {
    display: block;
    box-sizing: border-box;
    height: 78px;
    min-height: 78px;
    max-height: 78px;
    padding: 4px 6px !important;
    width: 100% !important;
    overflow: hidden;
}

.fc .fc-col-header-cell {
    min-width: 205px;
    vertical-align: top;
}

.fc .fc-timegrid-col {
    min-width: 205px;
}

.fc .fc-scrollgrid-section-header > th {
    background: #ffffff !important;
    z-index: 6 !important;
}

.fc-resource-header {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    height: 34px;
    min-height: 34px;
    max-height: 34px;
    min-width: 0;
    overflow: hidden;
}

.fc-resource-name {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px;
    min-width: 0;
    width: 100%;
    height: 16px;
    min-height: 16px;
    max-height: 16px;
    text-align: center;
    overflow: hidden;
}

.fc-resource-title {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-resource-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.fc-resource-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 5px;
    width: 100%;
    height: 16px;
    min-height: 16px;
    max-height: 16px;
    white-space: nowrap;
    overflow: hidden;
}

.fc-resource-comment {
    height: 32px;
    min-height: 32px !important;
    max-height: 32px;
    resize: none !important;
    overflow: hidden;
}

.fc-resource-header-absence {
    align-items: stretch;
}

.fc-resource-absence-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    width: 100%;
    height: 16px;
    overflow: hidden;
}

.fc-resource-absence-top {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex-wrap: nowrap;
    height: 16px;
    overflow: hidden;
}

.fc-resource-name-absence {
    width: 100%;
    display: block;
}

.fc .fc-resource-absence.fc-resource-disabled,
.fc .fc-resource-absence .fc-resource-name,
.fc .fc-resource-absence .fc-datagrid-cell-main {
    opacity: 1;
}

.fc .fc-resource-absence-vacation.fc-datagrid-cell,
.fc .fc-resource-absence-vacation .fc-datagrid-cell-main {
    background: #f3f4f6;
}

.fc .fc-resource-absence-sick.fc-datagrid-cell,
.fc .fc-resource-absence-sick .fc-datagrid-cell-main {
    background: #fff1f2;
}

.fc .fc-resource-absence-holiday.fc-datagrid-cell,
.fc .fc-resource-absence-holiday .fc-datagrid-cell-main {
    background: #fffbeb;
}

.fc .fc-timegrid-col.fc-resource-absence-vacation,
.fc [data-resource-id].fc-resource-absence-vacation,
.fc [data-resource-id].fc-resource-absence-vacation .fc-timegrid-col-frame,
.fc [data-resource-id].fc-resource-absence-vacation .fc-timegrid-col-bg,
.fc [data-resource-id].fc-resource-absence-vacation .fc-timegrid-bg-harness {
    background-color: #eef0f3 !important;
}

.fc .fc-timegrid-col.fc-resource-absence-sick,
.fc [data-resource-id].fc-resource-absence-sick,
.fc [data-resource-id].fc-resource-absence-sick .fc-timegrid-col-frame,
.fc [data-resource-id].fc-resource-absence-sick .fc-timegrid-col-bg,
.fc [data-resource-id].fc-resource-absence-sick .fc-timegrid-bg-harness {
    background-color: #fff1f2 !important;
}

.fc .fc-timegrid-col.fc-resource-absence-holiday,
.fc [data-resource-id].fc-resource-absence-holiday,
.fc [data-resource-id].fc-resource-absence-holiday .fc-timegrid-col-frame,
.fc [data-resource-id].fc-resource-absence-holiday .fc-timegrid-col-bg,
.fc [data-resource-id].fc-resource-absence-holiday .fc-timegrid-bg-harness {
    background-color: #fffbeb !important;
}

.fc .fc-timegrid-col.fc-resource-absence-vacation::after {
    background: rgba(107, 114, 128, 0.16) !important;
    box-shadow: inset 0 0 0 1px rgba(107, 114, 128, 0.24);
}

.fc .fc-timegrid-col.fc-resource-absence-sick::after {
    background: rgba(254, 205, 211, 0.38);
}

.fc .fc-timegrid-col.fc-resource-absence-holiday::after {
    background: rgba(253, 230, 138, 0.36);
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.18);
}

.fc-resource-absence-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

.fc-resource-absence-badge-vacation {
    background: #dcfce7;
    color: #166534;
}

.fc-resource-absence-badge-sick {
    background: #fee2e2;
    color: #991b1b;
}

.fc-resource-absence-badge-holiday {
    background: #fef3c7;
    color: #92400e;
}

.ca-team-attendance {
    margin-top: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    padding: 10px;
}

.ca-team-attendance-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.ca-team-attendance-title {
    font-size: 15px;
    font-weight: 800;
    color: #111827;
}

.ca-team-attendance-meta {
    margin-top: 2px;
    font-size: 13px;
    color: #6b7280;
}

.ca-team-attendance-toggle {
    flex: 0 0 auto;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #ffffff;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    padding: 7px 9px;
}

.ca-team-attendance-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
}

.ca-team-attendance-group {
    min-width: 0;
}

.ca-team-attendance-group-title {
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 800;
    color: #4b5563;
    text-transform: uppercase;
}

.ca-team-attendance-users {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ca-team-attendance-user {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    max-width: 100%;
    min-width: 190px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    padding: 7px 8px;
}

.ca-team-attendance-user--vacation {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.ca-team-attendance-user--sick {
    border-color: #fecdd3;
    background: #fff1f2;
}

.ca-team-attendance-user--holiday {
    border-color: #fde68a;
    background: #fffbeb;
}

.ca-team-attendance-user-name,
.ca-team-attendance-status {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ca-team-attendance-user-name {
    font-size: 13px;
    font-weight: 800;
    color: #111827;
}

.ca-team-attendance-status {
    margin-top: 2px;
    font-size: 12px;
    color: #6b7280;
}

.ca-attendance-action {
    width: 24px;
    height: 24px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #ffffff;
    color: #374151;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.ca-attendance-dialog {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ca-attendance-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
}

.ca-attendance-dialog-card {
    position: relative;
    width: min(360px, 100%);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.24);
    padding: 14px;
}

.ca-attendance-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.ca-attendance-dialog-title {
    color: #111827;
    font-size: 16px;
    font-weight: 900;
}

.ca-attendance-dialog-subtitle {
    margin-top: 2px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.ca-attendance-dialog-close {
    width: 28px;
    height: 28px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #ffffff;
    color: #374151;
    font-size: 19px;
    font-weight: 900;
    line-height: 1;
}

.ca-attendance-dialog-field {
    display: grid;
    gap: 5px;
    color: #374151;
    font-size: 13px;
    font-weight: 800;
}

.ca-attendance-dialog-field input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #ffffff;
    color: #111827;
    padding: 8px 9px;
    font-size: 15px;
    font-weight: 700;
}

.ca-attendance-dialog-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.ca-attendance-dialog-actions--restore {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.ca-attendance-dialog-actions--choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ca-attendance-dialog-submit {
    min-height: 42px;
    border-radius: 7px;
    border: 1px solid #d1d5db;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.12;
    padding: 5px 7px;
}

.ca-attendance-dialog-submit--vacation,
.ca-attendance-dialog-submit--workday {
    border-color: #86efac;
    background: #dcfce7;
    color: #166534;
}

.ca-attendance-dialog-submit--sick {
    border-color: #fecdd3;
    background: #fee2e2;
    color: #991b1b;
}

.ca-attendance-dialog-submit--holiday {
    border-color: #fde68a;
    background: #fef3c7;
    color: #92400e;
}

.ca-team-attendance-empty,
.ca-team-attendance-loading {
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    font-size: 13px;
    padding: 10px;
}

html.dark .fc .fc-timegrid-col.fc-resource-absence-vacation::after {
    background: rgba(148, 163, 184, 0.22) !important;
}

html.dark .fc .fc-timegrid-col.fc-resource-absence-sick::after {
    background: rgba(127, 29, 29, 0.46) !important;
}

html.dark .fc .fc-timegrid-col.fc-resource-absence-holiday::after {
    background: rgba(146, 64, 14, 0.38) !important;
}

html.dark .fc .fc-resource-absence.fc-resource-disabled,
html.dark .fc .fc-resource-absence .fc-resource-name,
html.dark .fc .fc-resource-absence .fc-datagrid-cell-main {
    opacity: 1;
}

html.dark .ca-team-attendance {
    border-color: #334155;
    background: #111827;
}

html.dark .ca-team-attendance-title,
html.dark .ca-team-attendance-user-name {
    color: #f8fafc;
}

html.dark .ca-team-attendance-meta,
html.dark .ca-team-attendance-status,
html.dark .ca-team-attendance-group-title,
html.dark .ca-team-attendance-empty,
html.dark .ca-team-attendance-loading {
    color: #9ca3af;
}

html.dark .ca-team-attendance-toggle,
html.dark .ca-attendance-action,
html.dark .ca-team-attendance-user {
    border-color: #334155;
    background: #1f2937;
    color: #e5e7eb;
}

html.dark .ca-team-attendance-user--vacation {
    border-color: #166534;
    background: rgba(20, 83, 45, 0.34);
}

html.dark .ca-team-attendance-user--sick {
    border-color: #991b1b;
    background: rgba(127, 29, 29, 0.34);
}

html.dark .ca-team-attendance-user--holiday {
    border-color: #92400e;
    background: rgba(120, 53, 15, 0.32);
}

html.dark .ca-attendance-dialog-card,
html.dark .ca-attendance-dialog-close,
html.dark .ca-attendance-dialog-field input {
    border-color: #334155;
    background: #111827;
    color: #e5e7eb;
}

html.dark .ca-attendance-dialog-title {
    color: #f8fafc;
}

html.dark .ca-attendance-dialog-subtitle,
html.dark .ca-attendance-dialog-field {
    color: #9ca3af;
}

.fi-modal>.fi-modal-window-ctn>.fi-modal-window .fi-modal-header {
    padding-top: 12px !important;
}
.text-danger {
    color: red;
}

html.dark {
    --ca-dark-bg: #090d13;
    --ca-dark-panel: #111827;
    --ca-dark-panel-soft: #182231;
    --ca-dark-border: #2b3647;
    --ca-dark-border-strong: #3b4657;
    --ca-dark-text: #e5e7eb;
    --ca-dark-text-strong: #f8fafc;
    --ca-dark-muted: #9ca3af;
    --ca-dark-focus: #fb7185;
    color-scheme: dark;
}

html.dark body,
html.dark .fi-body,
html.dark .fi-main {
    background: var(--ca-dark-bg) !important;
    color: var(--ca-dark-text);
}

html.dark .fi-topbar,
html.dark .fi-sidebar,
html.dark .fi-modal-window,
html.dark .fi-modal-header,
html.dark .fi-modal-footer {
    background: var(--ca-dark-panel) !important;
    border-color: var(--ca-dark-border) !important;
    color: var(--ca-dark-text) !important;
}

html.dark .fi-modal-heading,
html.dark .fi-section-header-heading,
html.dark .fi-ta-header-heading {
    color: var(--ca-dark-text-strong) !important;
}

html.dark .ca-email-template-section {
    border-left-color: #fb7185 !important;
}

html.dark .ca-email-template-section .fi-section-header {
    background: rgba(127, 29, 29, 0.28) !important;
}

html.dark .ca-email-template-section .fi-section-header-heading {
    color: #fecdd3 !important;
}

html.dark .ca-email-rich-editor.fi-fo-rich-editor {
    border-color: var(--ca-dark-border-strong) !important;
    background: #111827 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html.dark .ca-email-rich-editor .fi-fo-rich-editor-toolbar {
    border-bottom-color: var(--ca-dark-border);
    background: linear-gradient(180deg, #182231 0%, #111827 100%);
}

html.dark .ca-email-rich-editor .fi-fo-rich-editor-toolbar-group {
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.18);
}

html.dark .ca-email-rich-editor .fi-fo-rich-editor-main,
html.dark .ca-email-rich-editor .fi-fo-rich-editor-content {
    background-color: #0b1220;
}

html.dark .ca-email-rich-editor .fi-fo-rich-editor-content {
    background:
        linear-gradient(90deg, rgba(75, 85, 99, 0.18) 1px, transparent 1px),
        linear-gradient(180deg, rgba(75, 85, 99, 0.18) 1px, transparent 1px),
        #0b1220;
}

html.dark .ca-email-rich-editor .fi-fo-rich-editor-content table {
    background: rgba(15, 23, 42, 0.78);
}

html.dark .fi-modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html.dark .fi-modal select,
html.dark .fi-modal textarea {
    background-color: #0b1220 !important;
    border-color: var(--ca-dark-border-strong) !important;
    color: var(--ca-dark-text) !important;
}

html.dark .fi-modal input:not([type="checkbox"]):not([type="radio"]):focus,
html.dark .fi-modal select:focus,
html.dark .fi-modal textarea:focus {
    border-color: var(--ca-dark-focus) !important;
    box-shadow: 0 0 0 1px var(--ca-dark-focus), 0 0 0 4px rgba(244, 63, 94, 0.15) !important;
}

.ca-task-status-marker {
    display: none !important;
}

.fi-no-notification-date .ca-task-status-inline {
    color: #374151;
    font-weight: 600;
}

html.dark .fi-no-notification-date .ca-task-status-inline {
    color: #d1d5db;
}

.fi-modal:has(.ca-workorder-modal-shell) {
    z-index: 9999 !important;
}

#calendar-email-modal,
#calendar-arrival-modal,
#calendar-handover-modal,
#calendar-offer-email-modal,
#calendar-offer-audit-modal,
#calendar-missing-car-data-email-modal,
#calendar-outgoing-email-viewer-modal,
#calendar-attachment-email-modal,
#calendar-open-workorder-choice-modal {
    z-index: 10020 !important;
}

#calendar-email-modal .fi-modal-close-overlay,
#calendar-email-modal .fi-modal-window-ctn,
#calendar-arrival-modal .fi-modal-close-overlay,
#calendar-arrival-modal .fi-modal-window-ctn,
#calendar-handover-modal .fi-modal-close-overlay,
#calendar-handover-modal .fi-modal-window-ctn,
#calendar-offer-email-modal .fi-modal-close-overlay,
#calendar-offer-email-modal .fi-modal-window-ctn,
#calendar-offer-audit-modal .fi-modal-close-overlay,
#calendar-offer-audit-modal .fi-modal-window-ctn,
#calendar-missing-car-data-email-modal .fi-modal-close-overlay,
#calendar-missing-car-data-email-modal .fi-modal-window-ctn,
#calendar-outgoing-email-viewer-modal .fi-modal-close-overlay,
#calendar-outgoing-email-viewer-modal .fi-modal-window-ctn,
#calendar-attachment-email-modal .fi-modal-close-overlay,
#calendar-attachment-email-modal .fi-modal-window-ctn,
#calendar-open-workorder-choice-modal .fi-modal-close-overlay,
#calendar-open-workorder-choice-modal .fi-modal-window-ctn {
    z-index: 10021 !important;
}

#calendar-attachment-email-modal .ca-attachment-email-modal-body {
    min-height: 0;
    overscroll-behavior: contain;
}

#calendar-attachment-email-modal .ca-attachment-email-message-field {
    min-height: 0;
}

#calendar-attachment-email-modal .ca-attachment-email-editor-wrap {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

#calendar-attachment-email-modal .ca-attachment-email-editor-wrap :where(.ql-toolbar, .ql-container) {
    max-width: 100%;
    box-sizing: border-box;
}

#calendar-attachment-email-modal .ca-attachment-email-editor-wrap .ql-toolbar {
    flex: 0 0 auto;
    white-space: normal;
}

#calendar-attachment-email-modal .ca-attachment-email-editor-wrap .ql-container {
    flex: 1 1 auto;
    min-height: 0;
}

#calendar-attachment-email-modal .ca-attachment-email-editor {
    max-width: 100%;
    box-sizing: border-box;
}

#calendar-attachment-email-modal .ca-attachment-email-editor .ql-editor {
    box-sizing: border-box;
    height: 100% !important;
    max-height: none !important;
    overflow-x: hidden;
    overflow-y: auto;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#calendar-attachment-email-modal .ca-attachment-email-editor .ql-editor :where(p, li) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ca-workorder-modal-footer {
    min-width: 0;
}

.ca-workorder-modal-footer :where(button, a, .fi-btn) {
    min-height: 28px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    border-radius: 7px !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
}

.ca-workorder-modal-footer select {
    min-height: 28px !important;
    padding-left: 7px !important;
    padding-right: 7px !important;
    border-radius: 7px !important;
    font-size: 11px !important;
}

.ca-workorder-footer-actions {
    min-width: 0;
}

.ca-workorder-footer-actions > span {
    gap: 4px !important;
}

.ca-workorder-footer-summary {
    min-width: 0;
}

.ca-workorder-footer-summary > div {
    min-width: 0;
}

.ca-workorder-footer-summary [style*="font-size:13px"] {
    font-size: 12px !important;
}

.ca-parts-table thead th {
    text-align: center !important;
}

.ca-parts-table thead th.ca-col-product {
    text-align: left !important;
}

@media (max-width: 1180px) {
    .fi-modal-window:has(.ca-workorder-modal-shell) {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
    }
}

@media (max-width: 1024px) {
    .fi-modal-window:has(.ca-workorder-modal-shell) {
        max-height: calc(100dvh - 16px);
        margin: 8px;
        border-radius: 14px;
    }

    .fi-modal-window:has(.ca-workorder-modal-shell) .fi-modal-header {
        position: sticky;
        top: 0;
        z-index: 20;
    }

    .fi-modal-window:has(.ca-workorder-modal-shell) .fi-modal-content {
        max-height: calc(100dvh - 104px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ca-workorder-modal-shell {
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .ca-workorder-modal-shell :where(form, section, div) {
        min-width: 0;
    }

    .ca-workorder-modal-shell .fi-modal-tabs {
        gap: 6px;
        margin-bottom: 10px;
        padding-bottom: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .ca-workorder-modal-shell .fi-modal-tab {
        flex: 0 0 auto;
        scroll-snap-align: start;
        min-height: 38px;
        padding: 8px 10px;
        font-size: 13px;
        white-space: nowrap;
    }

    .ca-workorder-modal-shell .wo-top-row {
        gap: 8px;
        padding: 8px;
    }

    .ca-workorder-modal-shell .wo-top-row .wo-field {
        flex: 1 1 190px;
        min-width: min(190px, 100%);
    }

    .ca-workorder-modal-shell .wo-field-group-inline {
        flex-wrap: wrap;
    }

    .ca-workorder-modal-shell .wo-field-group-inline .wo-field {
        flex: 1 1 180px;
    }

    .ca-workorder-modal-shell .wo-card {
        height: auto;
    }

    .ca-workorder-task-form {
        grid-template-columns: minmax(0, 1fr) minmax(170px, .75fr) minmax(120px, .55fr) auto !important;
    }
}

@media (max-width: 760px) {
    .fi-modal:has(.ca-workorder-modal-shell) {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
    }

    .fi-modal-window-ctn:has(.ca-workorder-modal-shell) {
        width: 100vw !important;
        height: 100dvh !important;
        padding: 4px !important;
    }

    .fi-modal-window:has(.ca-workorder-modal-shell) {
        width: calc(100vw - 8px) !important;
        min-width: 0 !important;
        max-width: calc(100vw - 8px) !important;
        height: calc(100dvh - 8px);
        max-height: calc(100dvh - 8px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        margin: 0 !important;
        border-radius: 12px;
    }

    .fi-modal-window:has(.ca-workorder-modal-shell) .fi-modal-header {
        flex: 0 0 auto;
        position: relative;
        z-index: 40;
        padding: 10px 12px !important;
    }

    .fi-modal-window:has(.ca-workorder-modal-shell) .fi-modal-content {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        position: relative;
        z-index: 10;
        padding: 8px !important;
    }

    .fi-modal-window:has(.ca-workorder-modal-shell) .fi-modal-footer {
        flex: 0 0 auto;
        position: relative;
        z-index: 50;
        max-height: min(240px, 34dvh);
        overflow-x: hidden;
        overflow-y: auto;
        padding: 8px !important;
        background: var(--fi-modal-footer-bg, #fff);
        pointer-events: auto;
        -webkit-overflow-scrolling: touch;
    }

    #calendar-attachment-email-modal .fi-modal-window {
        display: flex;
        flex-direction: column;
        height: calc(100dvh - 16px);
        max-height: calc(100dvh - 16px) !important;
        overflow: hidden;
    }

    #calendar-attachment-email-modal .fi-modal-content {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow: hidden;
    }

    #calendar-attachment-email-modal .fi-modal-footer {
        flex: 0 0 auto;
        background: var(--fi-modal-footer-bg, #fff);
    }

    #calendar-attachment-email-modal .ca-attachment-email-modal-body {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
        max-height: none !important;
        overflow: hidden !important;
        padding-bottom: 0 !important;
    }

    #calendar-attachment-email-modal .ca-attachment-email-message-field {
        flex: 1 1 auto;
    }

    #calendar-attachment-email-modal .ca-attachment-email-editor-wrap {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
    }

    #calendar-attachment-email-modal .ca-attachment-email-editor {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        height: 100% !important;
    }

    #calendar-update-modal .ca-workorder-modal-footer {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        align-items: stretch !important;
    }

    #calendar-update-modal .ca-workorder-footer-actions {
        display: grid !important;
        flex: 0 0 auto !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: stretch !important;
        gap: 6px !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: visible !important;
        padding-bottom: 0;
    }

    #calendar-update-modal .ca-workorder-footer-actions > * {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    #calendar-update-modal .ca-workorder-footer-actions :where(button, a, .fi-btn) {
        justify-content: center !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: 30px !important;
        white-space: nowrap !important;
        text-align: center;
    }

    #calendar-update-modal .ca-workorder-footer-summary {
        flex: 0 0 auto !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 5px 8px !important;
        overflow: visible !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
        align-items: start !important;
    }

    #calendar-update-modal .ca-workorder-footer-summary:not([style*="display: none"]) {
        display: grid !important;
    }

    #calendar-update-modal .ca-workorder-footer-summary[style*="display: none"] {
        display: none !important;
    }

    #calendar-update-modal .ca-workorder-footer-summary > div {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .ca-workorder-modal-heading {
        width: 100%;
    }

    .ca-workorder-modal-heading-title {
        font-size: 17px;
        line-height: 1.15;
    }

    .ca-workorder-modal-refresh-button {
        min-height: 32px;
        padding: 6px 10px;
        font-size: 13px;
    }

    .ca-workorder-modal-shell {
        gap: 10px;
    }

    .ca-workorder-modal-shell .fi-modal-tabs {
        margin-inline: -2px;
    }

    .ca-workorder-modal-shell .fi-modal-tab {
        min-height: 36px;
        padding: 7px 9px;
        border-radius: 8px;
        font-size: 12px;
    }

    .ca-workorder-modal-shell .wo-modal-form {
        gap: 10px;
    }

    .ca-workorder-modal-shell .wo-top-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ca-workorder-modal-shell .wo-address-row,
    .ca-workorder-modal-shell .wo-address-row-2,
    .ca-workorder-modal-shell .wo-address-row-3,
    .ca-workorder-modal-shell .wo-address-row-4 {
        grid-template-columns: 1fr !important;
    }

    .ca-workorder-modal-shell .wo-field-group-inline,
    .ca-workorder-modal-shell .wo-work-day-time-row,
    .ca-workorder-modal-shell .wo-work-group-insert-row {
        flex-direction: column;
        align-items: stretch !important;
    }

    .ca-workorder-modal-shell .wo-field-group-inline .wo-field {
        flex: 0 1 auto !important;
        width: 100%;
    }

    .ca-workorder-modal-shell .wo-work-days-toolbar {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 12px;
    }

    .ca-workorder-modal-shell .wo-work-day-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .ca-workorder-modal-shell .wo-add-work-day-button {
        width: 100%;
    }

    .ca-workorder-modal-shell .wo-work-header {
        display: none !important;
    }

    .ca-workorder-modal-shell .wo-work-body {
        gap: 10px !important;
    }

    .ca-workorder-modal-shell .wo-work-row {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 10px;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        background: #ffffff;
    }

    .ca-workorder-modal-shell .wo-work-cell {
        display: block !important;
    }

    .ca-workorder-modal-shell .wo-work-cell::before {
        display: block;
        margin-bottom: 4px;
        color: #4b5563;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.04em;
        line-height: 1.1;
        text-transform: uppercase;
    }

    .ca-workorder-modal-shell .wo-work-cell:nth-child(1)::before {
        content: "Megnevezés";
    }

    .ca-workorder-modal-shell .wo-work-cell:nth-child(2)::before {
        content: "Cikkszám";
    }

    .ca-workorder-modal-shell .wo-work-cell:nth-child(3)::before {
        content: "Idő (óra)";
    }

    .ca-workorder-modal-shell .wo-work-cell:nth-child(4) {
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    .ca-workorder-modal-shell .wo-work-cell:nth-child(4) button {
        width: 100%;
        min-height: 34px;
        border: 1px solid #e5e7eb !important;
        border-radius: 8px !important;
        background: #f9fafb !important;
    }

    .ca-workorder-modal-shell .wo-gross-panel-grid,
    .ca-workorder-modal-shell .wo-gross-summary-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .ca-workorder-modal-shell .wo-gross-table-card,
    .ca-workorder-modal-shell .wo-gross-table-card-wide {
        grid-column: 1 / -1 !important;
    }

    .ca-workorder-task-form {
        grid-template-columns: 1fr !important;
    }

    .ca-workorder-task-form > div,
    .ca-workorder-task-form > button {
        grid-column: auto !important;
        width: 100%;
    }

    .ca-workorder-table-wrap {
        max-width: 100%;
    }

    .ca-workorder-task-table {
        min-width: 680px;
    }

    .ca-workorder-invoices-header,
    .ca-workorder-invoices-header > div:first-child,
    .ca-workorder-invoices-header > div:last-child {
        align-items: flex-start !important;
        width: 100%;
    }

    .ca-workorder-invoices-header {
        flex-direction: column;
    }

    .ca-workorder-invoice-totals {
        grid-template-columns: 1fr !important;
    }

    .ca-repairs-table-wrap,
    .ca-parts-table-wrap {
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .ca-repairs-table {
        min-width: 1360px;
    }

    .ca-parts-table {
        min-width: 980px;
    }
}

@media (max-width: 480px) {
    .ca-workorder-modal-shell .wo-card {
        padding: 10px;
        border-radius: 10px;
    }

    .ca-workorder-modal-shell .wo-card-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .ca-workorder-modal-shell .wo-input,
    .ca-workorder-modal-shell .wo-textarea {
        min-height: 36px;
        font-size: 14px;
    }

    .ca-workorder-modal-shell .ca-parts-table,
    .ca-workorder-modal-shell .ca-repairs-table {
        font-size: 13px !important;
    }
}

html.dark .ca-workorder-modal-shell .wo-work-row {
    background: var(--ca-dark-panel) !important;
    border-color: var(--ca-dark-border) !important;
}

html.dark .ca-workorder-modal-shell .wo-work-cell::before {
    color: var(--ca-dark-muted) !important;
}

.fi-no {
    top: 16px !important;
    right: auto !important;
    bottom: auto !important;
    left: 50% !important;
    align-items: stretch !important;
    width: min(calc(100vw - 32px), 384px) !important;
    margin-inline: 0 !important;
    transform: translateX(-50%) !important;
}

.fi-no .fi-no-notification:not(.fi-inline) {
    max-width: none !important;
}

@media (max-width: 640px) {
    .fi-no {
        top: auto !important;
        right: 16px !important;
        bottom: 16px !important;
        left: auto !important;
        flex-direction: column !important;
        justify-content: flex-end !important;
        width: min(calc(100vw - 32px), 384px) !important;
        transform: none !important;
    }
}
