/* Structural styles for custom pages; all colors come from tenant branding. */
.erp-import { display: grid; gap: 1.25rem; min-width: 0; overflow-wrap: anywhere; }
.erp-import form { display: grid; gap: 1rem; min-width: 0; }
.erp-import table { border-collapse: collapse; }
.erp-import th, .erp-import td { padding: .5rem; border: 1px solid var(--gray-400); text-align: left; }
.erp-import section[data-testid="import-row"] { border: 1px solid var(--gray-400); border-radius: .5rem; padding: 1rem; display: grid; gap: .5rem; }
.erp-import h2, .erp-import h3 { font-weight: 600; }
.erp-import summary { cursor: pointer; min-height: 44px; padding-block: .5rem; }
.erp-import nav { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.erp-import-field { border: 1px solid var(--gray-400); border-radius: .5rem; padding: 1rem; margin-block: .75rem; }
.erp-import-field dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: .75rem; }
.erp-import-field dt { font-weight: 600; }
.erp-import-field dd { white-space: pre-wrap; }
.erp-import-comparison .fi-btn, .erp-import-comparison select, .erp-import-comparison .erp-check { min-height: 44px; }
.erp-import-comparison .erp-check { display: flex; gap: .75rem; align-items: start; padding-block: .5rem; }
.erp-import-comparison .erp-check input { margin-top: .25rem; flex-shrink: 0; }
@media (max-width: 640px) { .erp-import-field dl { grid-template-columns: minmax(0, 1fr); } }
.erp-day-form {
    display: grid;
    gap: 1.5rem;
}

.erp-day-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 1rem;
}

.erp-day .fi-input,
.erp-day .fi-select-input,
.erp-day [role='combobox'],
.erp-day .fi-btn,
.erp-day .fi-icon-btn,
.erp-day .fi-link {
    min-height: 44px;
}

.erp-planning, .erp-my-planning { display: grid; gap: 1rem; min-width: 0; }
.erp-planning-help { font-size: .875rem; }
.erp-planning-feedback { padding: 1rem; border: 2px solid var(--danger-600); border-radius: .5rem; }
.erp-planning-feedback.is-warning { border-color: var(--warning-600); }
.erp-planning-row.has-absence { min-height: 126px; }
.erp-absence-details { font-size: .75rem; margin-top: .5rem; }
.erp-absence-details summary { cursor: pointer; padding: .4rem 0; }
.erp-absence-details li { margin-top: .5rem; }
.erp-planning-absence { position: absolute; top: 88px; height: 28px; border: 2px solid var(--warning-600); border-radius: .25rem; padding: 0 .35rem; overflow: hidden; white-space: nowrap; font-size: .75rem; }
.erp-planning-event.during-absence { border: 2px solid var(--warning-600); }
.erp-own-absence { border: 1px solid var(--gray-400); border-radius: .5rem; padding: 1rem; overflow-wrap: anywhere; }
.erp-own-absence.has-absence { border: 2px solid var(--warning-600); }
.erp-own-absence h2 { font-weight: 600; }
.erp-own-absence p + p { margin-top: .5rem; }
.erp-during-absence { border-left: 3px solid var(--warning-600); padding-left: .5rem; }
.erp-saved-route { display: grid; gap: 1rem; overflow-wrap: anywhere; }
.erp-saved-route li { border-bottom: 1px solid var(--gray-400); padding: .5rem 0; }
.erp-saved-route small { display: block; }
.erp-mileage-history-version { border-top: 1px solid var(--gray-400); padding-top: 1rem; overflow-wrap: anywhere; }
.erp-planning-scroll { max-width: 100%; overflow: auto; border: 1px solid var(--gray-300); border-radius: .5rem; }
.erp-planning-grid { width: calc(180px + var(--timeline-width)); }
.erp-planning-row { display: flex; min-height: 88px; border-bottom: 1px solid var(--gray-200); }
.erp-planning-name { position: sticky; left: 0; width: 180px; flex-shrink: 0; z-index: 2; padding: 1rem; background: var(--gray-50); border-right: 1px solid var(--gray-300); overflow-wrap: anywhere; }
.erp-planning-name small { display: block; }
.erp-planning-track { width: var(--timeline-width); position: relative; flex-shrink: 0; }
.erp-planning-axis { min-height: 52px; }
.erp-planning-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--gray-300); padding: .7rem .25rem; font-size: .75rem; white-space: nowrap; }
.erp-planning-event { position: absolute; top: 6px; height: 74px; display: flex; min-width: 12px; border-radius: .5rem; background: var(--primary-100); color: var(--primary-950); border: 1px solid var(--primary-500); overflow: hidden; }
.erp-planning-event-main { min-width: 0; flex: 1; text-align: left; padding: .25rem .5rem; cursor: grab; }
.erp-planning-event-main > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; }
.erp-planning-resize { flex-shrink: 0; width: 24px; cursor: ew-resize; border-left: 1px solid var(--primary-500); }
.erp-planning-event :focus-visible { outline: 3px solid var(--primary-700); outline-offset: -3px; }
.erp-planning-event.is-dragging { opacity: .55; outline: 2px dashed var(--primary-600); }
.dark .erp-planning-name { background: var(--gray-900); }
.dark .erp-planning-event { background: var(--primary-900); color: var(--primary-50); }
.dark .erp-planning-row, .dark .erp-planning-scroll { border-color: var(--gray-700); }

.erp-planning-toolbar { gap: .5rem; padding: .75rem; border: 1px solid var(--gray-300); border-radius: .5rem; background: var(--gray-50); }
.erp-planning-toolbar > div { flex: 1 1 145px; max-width: 210px; min-width: 0; }
.erp-planning-toolbar input, .erp-planning-toolbar select { min-width: 0; width: 100%; }
.erp-planning > .erp-day-toolbar > span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.erp-planning > *, .erp-planning .fi-section { min-width: 0; }
.erp-planning-toolbar label { display: block; font-size: .75rem; font-weight: 600; margin-bottom: .25rem; }
.erp-planning-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .5rem .75rem; background: var(--primary-700); color: var(--primary-50); border-radius: .35rem; }
.erp-planning-caption span { font-size: .75rem; overflow-wrap: anywhere; }
.erp-planning-dates { min-height: 42px; background: var(--gray-100); }
.erp-planning-dates .erp-planning-name { padding-block: .65rem; }
.erp-planning-date { position: absolute; top: 0; bottom: 0; padding: .65rem .5rem; border-left: 2px solid var(--gray-400); font-size: .8rem; font-weight: 700; white-space: nowrap; overflow: hidden; }
.erp-planning-axis { background: var(--gray-50); min-height: 36px; }
.erp-planning-axis .erp-planning-name { padding-block: .4rem; font-size: .75rem; }
.erp-planning-tick { padding-block: .4rem; }
.erp-planning-day-band { position: absolute; inset-block: 0; border-left: 2px solid var(--gray-400); pointer-events: none; background: var(--gray-50); }
.erp-planning-day-band:nth-child(even) { background: var(--gray-100); }
.erp-planning-person { display: flex; align-items: center; gap: .5rem; font-size: .8rem; }
.erp-planning-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: var(--primary-100); color: var(--primary-950); font-weight: 700; }
.erp-planning-event { border-width: 2px; border-radius: .35rem; box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.erp-planning-event-main > span { font-weight: 600; }
.erp-planning-event-main { padding-inline: .25rem; }
.erp-planning-resize { position: absolute; inset-block: 0; right: 0; width: 12px; opacity: 0; background: var(--primary-100); }
.erp-planning-event:hover .erp-planning-resize, .erp-planning-event:focus-within .erp-planning-resize { opacity: 1; }
.dark .erp-planning-resize { background: var(--primary-900); }
.erp-planning-workorders { overflow-x: auto; }
.erp-planning-workorders table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.erp-planning-workorders th, .erp-planning-workorders td { padding: .5rem .75rem; text-align: left; border: 1px solid var(--gray-300); }
.erp-planning-workorders th { background: var(--gray-100); font-weight: 600; }
.erp-planning-workorders tbody tr:nth-child(even) { background: var(--gray-50); }
.erp-planning-notes { font-size: .8rem; }
.erp-planning-notes summary { cursor: pointer; min-height: 44px; padding-block: .65rem; font-weight: 600; }
.erp-planning-notes p { margin-bottom: .5rem; }

/* Equal local-day columns: the entire week fits the available panel width. */
.erp-workspace { width: 100%; min-width: 0; }
.erp-workspace .erp-planning-scroll { overflow-x: hidden; }
.erp-workspace-grid { width: 100%; --name-width: 180px; }
.erp-workspace-row { display: grid; grid-template-columns: var(--name-width) repeat(var(--days), minmax(0, 1fr)); min-height: 124px; border-bottom: 1px solid var(--gray-300); }
.erp-workspace-row > * { min-width: 0; }
.erp-workspace .erp-planning-name { width: auto; padding: .65rem; font-size: .8rem; }
.erp-workspace .erp-planning-name small { font-size: .7rem; }
.erp-workspace-head { min-height: 58px; }
.erp-workspace .erp-planning-date { position: static; padding: .5rem; white-space: normal; line-height: 1.2; background: var(--gray-100); border-left: 1px solid var(--gray-300); font-size: .75rem; overflow-wrap: anywhere; }
.erp-workspace .erp-planning-date small { display: block; font-size: .65rem; margin-top: .25rem; }
.erp-date-short { display: none; }
.erp-workspace-cell { width: auto; border-left: 1px solid var(--gray-300); background: var(--gray-50); }
.erp-workspace-cell:nth-child(odd) { background: var(--gray-100); }
.erp-workspace .erp-planning-event { top: 19px; height: 96px; min-width: 0; border-color: rgb(17 24 39 / .3); }
.erp-workspace .erp-planning-event:hover, .erp-workspace .erp-planning-event:focus-within { overflow: visible; z-index: 5; }
.erp-workspace .erp-planning-event:hover .erp-workspace-confirm, .erp-workspace .erp-planning-event:focus-within .erp-workspace-confirm { min-width: 60px; left: auto; }
.erp-workspace .erp-planning-event-main { padding: .2rem .45rem; touch-action: pan-y; overflow: hidden; }
.erp-workspace .erp-planning-event-main > * { font-size: .7rem; }
.erp-workspace .erp-planning-resize { width: min(8px, 20%); right: 0; opacity: .35; background: rgb(0 0 0 / .15); z-index: 3; border: none; touch-action: none; }
.erp-workspace .erp-resize-start { left: 0; right: auto; }
.erp-workspace .erp-planning-event:hover .erp-planning-resize { opacity: 1; }
.erp-workspace-menu-button { position: absolute; right: 8px; top: 0; z-index: 4; background: #fff; color: #111827; width: 28px; height: 30px; font-weight: 700; border: 1px solid #6b7280; border-radius: .25rem; }
.erp-workspace-confirm { position: absolute; right: 8px; left: 8px; bottom: 0; z-index: 4; height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #fff; color: #111827; font-size: .65rem; border: 1px solid #6b7280; border-radius: .25rem; }
.erp-cell-menu { position: absolute; right: 2px; bottom: 0; width: 26px; height: 26px; color: var(--primary-700); z-index: 4; }
.erp-workspace-tick { position: absolute; top: 0; height: 100%; border-left: 1px solid rgb(0 0 0 / .12); pointer-events: none; font-size: .65rem; padding-left: .15rem; }
.erp-workspace-absence { position: absolute; top: 0; bottom: 0; padding: .2rem; font-size: .7rem; border: 1px solid #64748b; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.erp-workspace-absence button { position: relative; z-index: 4; font-weight: 600; text-align: left; max-width: 100%; min-height: 24px; pointer-events: auto; }
.erp-workspace-absence button:focus-visible { outline: 2px solid #111827; }
.erp-drag-preview { position: fixed; z-index: 80; width: 280px; padding: .75rem; pointer-events: none; background: var(--gray-950); color: var(--gray-50); border: 2px solid var(--gray-400); border-radius: .4rem; font-size: .875rem; line-height: 1.5; }
.erp-workspace-toolbar { gap: .5rem; padding: .5rem; background: var(--gray-50); border: 1px solid var(--gray-300); border-radius: .5rem; }
.erp-workspace-toolbar label { display: block; font-size: .75rem; }
.erp-workspace-toolbar > div { min-width: 100px; }
.erp-workspace-legend { display: flex; flex-wrap: wrap; gap: .4rem; padding-block: .5rem; font-size: .75rem; }
.erp-workspace-legend > span { border-radius: .3rem; padding: .3rem .5rem; border: 1px solid rgb(17 24 39 / .3); }
.erp-workspace-help { font-size: .75rem; margin-bottom: .5rem; }
.erp-workspace-context { position: fixed; z-index: 60; background: var(--gray-50); color: var(--gray-950); box-shadow: 0 4px 18px rgb(0 0 0 / .3); border: 1px solid var(--gray-400); border-radius: .4rem; width: 210px; padding: .25rem; }
.erp-workspace-context button { display: block; width: 100%; min-height: 40px; text-align: left; padding: .4rem; font-size: .8rem; }
.erp-workspace-context button:hover, .erp-workspace-context button:focus-visible { background: var(--primary-100); color: var(--primary-950); }
.erp-workspace-context button:disabled { opacity: .4; }
.erp-skill-match .erp-planning-name { background: #bbf7d0; color: #14532d; outline: 2px solid #16a34a; outline-offset: -2px; }
.erp-unplanned-drag { cursor: grab; min-height: 44px; text-align: left; touch-action: pan-y; }
.erp-workspace-selection { padding: 1rem; border: 1px solid var(--gray-400); border-radius: .4rem; }
.erp-status-tentative { background: #fde68a !important; color: #422006 !important; }
.erp-status-confirmed { background: #34d399 !important; color: #052e16 !important; }
.erp-status-completed { background: #7dd3fc !important; color: #082f49 !important; }
.erp-status-incomplete { background: #fdba74 !important; color: #431407 !important; }
.erp-status-general { background: #c4b5fd !important; color: #2e1065 !important; }
.erp-status-leave { background: #bae6fd !important; color: #082f49 !important; }
.erp-status-absent { background: #f9a8d4 !important; color: #500724 !important; }
.dark .erp-workspace-cell, .dark .erp-workspace-toolbar, .dark .erp-workspace-context { background: var(--gray-900); color: var(--gray-50); }
.dark .erp-workspace-cell:nth-child(odd), .dark .erp-workspace .erp-planning-date { background: var(--gray-800); }
@media (max-width: 900px) { .erp-workspace-grid { --name-width: 125px; } .erp-workspace .erp-planning-date { font-size: .65rem; padding: .3rem; } }
@media (max-width: 640px) { .erp-workspace-grid { --name-width: 86px; } .erp-workspace .erp-planning-name { padding: .35rem; font-size: .6rem; } .erp-workspace .erp-planning-name small { font-size: .6rem; } .erp-workspace .erp-planning-date { font-size: .55rem; padding: .1rem; } .erp-workspace .erp-planning-date small, .erp-date-long { display: none; } .erp-date-short { display: block; } }
.dark .erp-planning-toolbar, .dark .erp-planning-axis, .dark .erp-planning-day-band, .dark .erp-planning-workorders tbody tr:nth-child(even) { background: var(--gray-900); }
.dark .erp-planning-dates, .dark .erp-planning-day-band:nth-child(even), .dark .erp-planning-workorders th { background: var(--gray-800); }
@media (max-width: 640px) { .erp-planning-toolbar > div { max-width: none; } }

.erp-day .fi-fo-field-label-ctn {
    flex-wrap: wrap;
}

.erp-day .fi-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

/* Visible boundaries in both themes, retaining the company primary palette. */
.fi-section, .fi-modal-window { border: 1px solid var(--gray-400); }
.fi-input-wrp { outline: 1px solid var(--gray-400); outline-offset: -1px; }
.fi-btn.fi-color-gray { outline: 1px solid var(--gray-400); outline-offset: -1px; }
.dark .fi-section, .dark .fi-modal-window { border-color: var(--gray-500); }
.dark .fi-input-wrp, .dark .fi-btn.fi-color-gray { outline-color: var(--gray-500); }
.fi-fo-field-wrp-helper-text, .erp-workspace-help, .erp-planning-help { line-height: 1.6; }
.erp-customer-form { display: grid; gap: 1.25rem; line-height: 1.6; }
.erp-customer-form .fi-section-content { display: grid; gap: 1.25rem; }
.erp-customer-form form { display: grid; gap: 1.25rem; }
.erp-customer-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1.5rem; }
.erp-customer-fields label, .erp-customer-form form > label { display: grid; gap: .5rem; min-width: 0; font-weight: 500; }
.erp-customer-fields p { grid-column: 1 / -1; }
.erp-customer-form input, .erp-customer-form select { min-height: 44px; }
.erp-customer-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
@media (max-width: 640px) { .erp-customer-fields { grid-template-columns: minmax(0, 1fr); } }
.erp-required-password-form {
    display: grid;
    gap: 1.5rem;
}

.erp-required-password-form > .fi-btn {
    min-height: 44px;
    width: 100%;
}

.erp-employee-permissions label { min-height: 44px; align-items: center; }

.erp-import-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; }
.erp-import-toolbar label { display: grid; gap: .25rem; }
.erp-import-toolbar select { min-height: 44px; border: 1px solid var(--gray-400); border-radius: .375rem; padding: .4rem .75rem; background: transparent; color: inherit; }
.erp-import-table-region { max-width: 100%; overflow-x: auto; }
.erp-import .erp-import-table { font-size: .875rem; width: 100%; }
.erp-import .erp-import-table th, .erp-import .erp-import-table td { padding: .35rem .5rem; vertical-align: top; min-width: 7rem; max-width: 22rem; }
.erp-import .erp-import-table th:first-child { min-width: 3rem; }
.erp-import .erp-import-cell-error { border-inline-start: 3px solid var(--danger-600); }
.erp-import-cell-error p { font-size: .75rem; font-weight: 600; }
.erp-import .erp-import-table td.erp-import-status { min-width: 12rem; font-size: .75rem; }
.erp-import-table details { min-width: 5rem; }
.erp-import .erp-import-table td[data-field="email"] { min-width: 14rem; }
.erp-import .erp-import-table td[data-field="display_name"] { min-width: 12rem; }

/* Keep column headings readable when a complete export has many fields. */
.erp-import .erp-import-table thead th { white-space: nowrap; overflow-wrap: normal; }
.erp-import .erp-import-table tbody th { white-space: nowrap; }

.erp-import label.erp-check { display: flex; align-items: center; gap: .75rem; min-height: 44px; }
.erp-import label.erp-check input { flex-shrink: 0; }

/* Office roster: fixed names and readable days on a continuous, bounded timeline. */
.erp-office-timeline { gap: .65rem; }
.erp-office-timeline .erp-planning-scroll { overflow: auto; max-height: 65vh; border-radius: .2rem; overscroll-behavior-x: contain; scrollbar-gutter: stable; }
.erp-office-timeline .erp-workspace-grid { --name-width: 190px; --day-width: max(270px, calc((100vw - 550px) / 5)); }
.erp-office-timeline .erp-workspace-grid[data-view="week"] { width: calc(var(--name-width) + var(--days) * var(--day-width)); }
.erp-office-timeline .erp-workspace-grid[data-view="week"] .erp-workspace-row { grid-template-columns: var(--name-width) repeat(var(--days), var(--day-width)); }
.erp-office-timeline .erp-workspace-row { min-height: 88px; }
.erp-office-timeline .erp-workspace-head { position: sticky; top: 0; z-index: 15; min-height: 66px; }
.erp-office-timeline .erp-planning-name { position: sticky; left: 0; z-index: 10; background: var(--gray-50); border-right: 2px solid var(--gray-400); padding: .35rem .5rem; }
.erp-office-timeline .erp-workspace-head .erp-planning-name { z-index: 16; }
.erp-office-timeline .erp-planning-person { font-size: .75rem; }
.erp-office-timeline .erp-planning-avatar { flex: 0 0 28px; width: 28px; height: 28px; background: var(--primary-100); color: var(--primary-900); }
.erp-office-timeline .erp-planning-name small { display: block; font-size: .65rem; line-height: 1.3; }
.erp-office-timeline .erp-planning-name details { font-size: .65rem; }
.erp-office-timeline .erp-planning-date { padding: .35rem .5rem 0; white-space: nowrap; overflow-wrap: normal; background: var(--gray-100); }
.erp-office-timeline .erp-date-long { display: inline; }
.erp-office-timeline .erp-date-short { display: none; }
.erp-office-timeline .erp-office-hour-axis { position: relative; height: 24px; margin-top: .4rem; font-size: .6rem; font-weight: 400; }
.erp-office-hour-axis span { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--gray-400); padding-left: .15rem; }
.erp-office-timeline .erp-workspace-cell { background: var(--gray-50); background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / var(--hours) - 1px), rgb(0 0 0 / .08) calc(100% / var(--hours) - 1px), rgb(0 0 0 / .08) calc(100% / var(--hours))); }
.erp-office-timeline .erp-weekend { background-color: var(--gray-200); }
.erp-office-timeline .erp-week-start { border-left: 3px solid var(--gray-500); }
.erp-office-timeline .erp-planning-event { top: 5px; height: 76px; border-width: 2px; border-radius: .3rem; box-shadow: 0 1px 1px rgb(0 0 0 / .15); }
.erp-office-timeline .erp-planning-event-main > * { font-size: .75rem; line-height: 1.35; }
.erp-office-timeline .erp-planning-event-main strong { font-weight: 700; }
.erp-office-timeline .erp-planning-event-main .erp-office-card-extra { display: none; }
.erp-office-timeline .erp-workspace-tick { display: none; }
.erp-office-timeline .erp-workspace-absence { top: 5px; bottom: 6px; border-radius: .3rem; border-width: 2px; padding: .4rem; font-size: .8rem; }
.erp-office-timeline .erp-workspace-absence button { min-height: 44px; }
.erp-office-timeline .erp-office-workorders { border: 1px solid var(--gray-300); border-radius: .2rem; overflow: hidden; }
.erp-office-workorders-body { padding: .5rem; display: grid; gap: .4rem; }
.erp-office-timeline .erp-planning-workorders th, .erp-office-timeline .erp-planning-workorders td { padding: .25rem .5rem; font-size: .75rem; }
.erp-office-timeline .erp-planning-workorders .fi-btn { min-height: 44px; }
.erp-timeline-navigation { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.erp-timeline-navigation span { font-size: .75rem; }
.dark .erp-office-timeline .erp-planning-name { background: var(--gray-900); }
.dark .erp-office-timeline .erp-weekend { background-color: var(--gray-800); }
@media (max-width: 640px) { .erp-office-timeline .erp-workspace-grid { --name-width: 130px; --day-width: 280px; } .erp-office-timeline .erp-planning-name { font-size: .7rem; } .erp-office-timeline .erp-planning-date { font-size: .75rem; padding: .35rem; } }

.erp-timeline-navigation .fi-btn { min-height: 44px; }

.erp-office-timeline .erp-planning-event-main { touch-action: pan-x pan-y; }
.erp-office-timeline .erp-workspace-cell:hover, .erp-office-timeline .erp-workspace-cell:focus-within { z-index: 6; }
.erp-office-timeline .erp-workspace-menu-button { left: max(8px, calc(100% - 52px)); right: auto; width: 44px; height: 44px; }

.erp-office-timeline .erp-workspace-legend { padding-block: 0; gap: .3rem; }
.erp-office-timeline .erp-workspace-legend > span { padding: .15rem .4rem; }
.erp-office-timeline .erp-workspace-help { margin-bottom: 0; }
.erp-office-timeline .erp-workspace-menu-button { opacity: 0; }
.erp-office-timeline .erp-planning-event:hover .erp-workspace-menu-button, .erp-office-timeline .erp-planning-event:focus-within .erp-workspace-menu-button { opacity: 1; }
@media (hover: none) { .erp-office-timeline .erp-workspace-menu-button { opacity: 1; } }

/* Shared progress feedback uses the current tenant palette. */
.erp-task-progress { padding: .75rem; border: 1px solid var(--gray-300); border-inline-start: 4px solid var(--primary-600); border-radius: .35rem; display: grid; gap: .35rem; min-width: 0; overflow-wrap: anywhere; }
.erp-task-progress progress, .erp-request-progress progress { width: 100%; height: .7rem; accent-color: var(--primary-600); }
.erp-task-progress p, .erp-task-progress span { font-size: .8rem; }
.erp-request-progress { pointer-events: none; position: fixed; z-index: 60; bottom: 1rem; right: 1rem; width: min(360px, calc(100vw - 2rem)); padding: .75rem 2rem .75rem .75rem; background: var(--gray-50); color: var(--gray-950); border: 1px solid var(--primary-500); border-radius: .4rem; box-shadow: 0 3px 12px rgb(0 0 0 / .15); font-size: .8rem; }
.erp-request-progress button { pointer-events: auto; position: absolute; right: 0; top: 0; width: 44px; height: 44px; font-size: 1.25rem; }
.dark .erp-request-progress { background: var(--gray-900); color: var(--gray-50); }
.erp-import-status-list { display: grid; gap: .75rem; margin-block: .75rem 1rem; }

/* Month calendar: employee colors derive from tenant and shared theme tokens. */
.erp-month {
    --month-person-0: color-mix(in oklab, var(--primary-400) 35%, var(--warning-300));
    --month-person-1: color-mix(in oklab, var(--primary-300) 45%, var(--info-300));
    --month-person-2: color-mix(in oklab, var(--primary-300) 35%, var(--success-300));
    --month-person-3: color-mix(in oklab, var(--primary-300) 25%, var(--danger-300));
    --month-person-4: color-mix(in oklab, var(--primary-300) 65%, var(--gray-300));
    --month-person-5: color-mix(in oklab, var(--warning-300) 50%, var(--danger-300));
    display: grid; grid-template-columns: 220px minmax(0, 1fr); min-width: 0;
    border: 1px solid var(--gray-300); border-radius: .5rem; overflow: hidden; background: white;
}
.erp-month-sidebar { padding: .6rem; background: var(--gray-50); border-right: 1px solid var(--gray-300); min-width: 0; }
.erp-month-mini-title { display: flex; align-items: center; justify-content: space-between; font-size: .85rem; text-transform: capitalize; }
.erp-month-mini-title button { min-width: 36px; min-height: 44px; font-size: 1.5rem; }
.erp-month-mini { display: grid; grid-template-columns: 22px repeat(7, minmax(0, 1fr)); align-items: center; text-align: center; font-size: .7rem; margin-bottom: 1rem; }
.erp-month-mini > span { padding-block: .35rem; }
.erp-month-mini button { min-height: 30px; border-radius: .2rem; }
.erp-month-mini-week { color: var(--primary-600); }
.erp-month-mini .erp-month-focus { background: var(--primary-600); color: white; font-weight: 700; }
.erp-month-search { display: grid; gap: .4rem; font-size: .8rem; }
.erp-month-search input { min-height: 44px; }
.erp-month-all { font-size: .75rem; text-decoration: underline; min-height: 44px; }
.erp-month-people { display: grid; }
.erp-month-people label { display: flex; align-items: center; gap: .65rem; min-height: 44px; font-size: .85rem; cursor: pointer; }
.erp-month-people input { accent-color: var(--person-color); width: 20px; height: 20px; box-shadow: 0 0 0 2px var(--person-color); }
.erp-month-help { font-size: .75rem; color: var(--gray-600); margin-top: 1rem; }
.erp-month-main { min-width: 0; }
.erp-month-heading { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: .65rem 1rem; border-bottom: 1px solid var(--gray-300); }
.erp-month-heading h2 { font-size: 1.15rem; font-weight: 600; text-transform: capitalize; }
.erp-month-heading span { font-size: .75rem; color: var(--gray-500); }
.erp-month-scroll { overflow-x: auto; min-width: 0; }
.erp-month-grid { min-width: 700px; }
.erp-month-weekdays { display: grid; grid-template-columns: 30px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--gray-300); text-align: center; font-size: .8rem; }
.erp-month-weekdays strong { padding: .5rem; font-weight: 400; }
.erp-month-week { display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: 28px minmax(78px, auto) auto; position: relative; border-bottom: 1px solid var(--gray-300); }
.erp-month-week:last-child { border-bottom: 0; }
.erp-month-week-number { grid-row: 1 / -1; grid-column: 1; color: var(--gray-500); text-align: center; padding-top: .3rem; font-size: .75rem; border-right: 1px solid var(--gray-300); }
.erp-month-days { grid-column: 2; grid-row: 1 / -1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.erp-month-day { border-right: 1px solid var(--gray-300); min-width: 0; text-align: right; }
.erp-month-day:last-child { border-right: 0; }
.erp-month-day > button { position: relative; z-index: 1; min-width: 32px; min-height: 28px; padding-inline: .4rem; font-size: .75rem; }
.erp-month-weekend { background: var(--gray-50); }
.erp-month-outside { color: var(--gray-400); }
.erp-month-day.erp-month-today > button { border-radius: .25rem; background: var(--primary-600); color: white; font-weight: 700; }
.erp-month-events { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: 24px; align-content: start; gap: 2px 3px; margin: 1px 3px 3px; pointer-events: none; z-index: 2; }
.erp-month-event { pointer-events: auto; min-width: 0; padding: 2px 5px; border-radius: 4px; font-size: .75rem; line-height: 20px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--gray-950); }
.erp-month-event:hover { filter: brightness(.95); box-shadow: inset 0 0 0 1px var(--primary-600); }
.erp-month-event:focus-visible, .erp-month button:focus-visible { outline: 2px solid var(--primary-600); outline-offset: 1px; z-index: 3; }
.erp-month-tentative { border: 1px dashed var(--gray-700); padding-block: 1px; }
.erp-month-absence { font-style: italic; }
.erp-month-continued-before { border-left: 4px solid var(--primary-600); }
.erp-month-continued-after { border-right: 4px solid var(--primary-600); }
.erp-month-more { grid-column: 2; grid-row: 3; justify-self: start; z-index: 3; padding: .25rem .5rem; font-size: .75rem; color: var(--primary-700); min-height: 30px; }
.erp-month-view { gap: .65rem; }
.dark .erp-month { background: var(--gray-900); border-color: var(--gray-700); }
.dark .erp-month-sidebar, .dark .erp-month-weekend { background: var(--gray-950); }
.dark .erp-month-heading, .dark .erp-month-weekdays, .dark .erp-month-week, .dark .erp-month-day, .dark .erp-month-sidebar, .dark .erp-month-week-number { border-color: var(--gray-700); }
.dark .erp-month-help { color: var(--gray-400); }
@media (max-width: 1024px) { .erp-month { grid-template-columns: 185px minmax(0, 1fr); } }
@media (max-width: 640px) {
    .erp-month { grid-template-columns: minmax(0, 1fr); }
    .erp-month-sidebar { border-right: 0; border-bottom: 1px solid var(--gray-300); }
    .erp-month-mini { max-width: 320px; margin-inline: auto; }
    .erp-month-mini button { min-height: 44px; }
    .erp-month-people { max-height: 180px; overflow-y: auto; }
    .erp-month-heading { flex-wrap: wrap; gap: .25rem; }
    .erp-month-events { grid-auto-rows: 44px; }
    .erp-month-week { grid-template-rows: 44px minmax(138px, auto) auto; }
    .erp-month-day > button, .erp-month-more { min-height: 44px; }
}

.erp-home { display:grid; gap:1.25rem; }
.erp-home-intro p, .erp-home-muted { color:var(--gray-500); font-size:.875rem; }
.erp-home-intro h2 { font-size:1.35rem; font-weight:650; margin-top:.3rem; }
.erp-home-actions { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:.75rem; }
.erp-home-actions > a { display:flex; flex-direction:column; justify-content:center; gap:.35rem; min-height:100px; padding:1.1rem; border:1px solid var(--gray-300); border-radius:.8rem; background:var(--gray-50); }
.erp-home-actions > a span { font-size:.85rem; }
.erp-home-actions > a.erp-home-primary { background:var(--primary-50); border-color:var(--primary-400); color:var(--primary-950); }
.erp-home-actions > a:focus-visible, .erp-home-task:focus-visible, .erp-home-link:focus-visible { outline:3px solid var(--primary-500); outline-offset:3px; }
.erp-home-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1.25rem; align-items:start; }
.erp-home-panel { min-width:0; padding:1.1rem; border:1px solid var(--gray-300); border-radius:.8rem; background:white; }
.erp-home-panel > h2 { font-size:1.05rem; font-weight:650; margin-bottom:.8rem; }
.erp-home-task { display:grid; gap:.25rem; padding:.9rem 0; border-bottom:1px solid var(--gray-200); min-height:44px; overflow-wrap:anywhere; }
.erp-home-task strong { font-weight:600; }
.erp-home-task small, .erp-home-time { font-size:.85rem; color:var(--gray-600); }
.erp-home-link { display:inline-flex; align-items:center; min-height:44px; margin-top:.5rem; text-decoration:underline; }
.erp-home-notice { padding:.8rem; margin-block:.75rem; background:var(--gray-100); border-radius:.5rem; overflow-wrap:anywhere; }
.erp-home-stats { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; margin-bottom:.6rem; }
.erp-home-stats > div { display:grid; gap:.3rem; }
.erp-home-stats strong { font-size:1.5rem; font-weight:650; }
.erp-home-stats span { font-size:.8rem; color:var(--gray-600); }
.dark .erp-home-panel, .dark .erp-home-actions > a { background:var(--gray-900); border-color:var(--gray-700); }
.dark .erp-home-actions > a.erp-home-primary { background:var(--primary-950); color:var(--primary-100); border-color:var(--primary-700); }
.dark .erp-home-notice { background:var(--gray-800); }
.dark .erp-home-task { border-color:var(--gray-700); }
.dark .erp-home-task small, .dark .erp-home-time, .dark .erp-home-stats span { color:var(--gray-400); }
@media(max-width:767px) { .erp-home-columns { grid-template-columns:minmax(0,1fr); } .erp-home-actions { grid-template-columns:minmax(0,1fr); } .erp-home-actions > a { min-height:84px; } }

.erp-agenda { min-width:0; }
.erp-agenda-toolbar, .erp-agenda-actions { display:flex; align-items:end; flex-wrap:wrap; gap:.6rem; margin-bottom:1rem; }
.erp-agenda-toolbar label { display:grid; gap:.3rem; min-width:0; }
.erp-agenda .fi-btn, .erp-agenda input, .erp-agenda select { min-height:44px; }
.erp-agenda-days { display:grid; grid-template-columns:repeat(7,minmax(44px,1fr)); gap:4px; max-width:100%; overflow-x:auto; padding:3px; margin-bottom:1rem; }
.erp-agenda-days button { display:grid; justify-items:center; gap:.2rem; min-height:76px; padding:.5rem .2rem; border:1px solid var(--gray-300); border-radius:.6rem; font-size:.8rem; }
.erp-agenda-days button strong { font-size:1.1rem; }
.erp-agenda-days button.is-selected { background:var(--primary-50); border-color:var(--primary-600); color:var(--primary-900); }
.erp-agenda-days button:focus-visible { outline:3px solid var(--primary-500); outline-offset:1px; }
.erp-agenda-day { display:grid; gap:.75rem; margin-block:1rem; }
.erp-agenda-day > h2 { font-size:1.05rem; font-weight:650; }
.erp-agenda-card { border:1px solid var(--gray-300); border-left:4px solid var(--primary-500); border-radius:.7rem; padding:1rem; background:white; min-width:0; overflow-wrap:anywhere; display:grid; gap:.5rem; }
.erp-agenda-card > header { display:flex; justify-content:space-between; flex-wrap:wrap; gap:.5rem; font-size:.85rem; }
.erp-agenda-card h3 { font-size:1.05rem; font-weight:650; }
.erp-agenda-time { font-weight:650; }
.erp-agenda-details summary, .erp-planning-filters summary { display:flex; align-items:center; cursor:pointer; min-height:44px; font-weight:600; text-decoration:underline; text-underline-offset:3px; }
.erp-agenda-details[open] > :not(summary) { margin-top:.75rem; }
.erp-planning-filters { margin-block:.6rem; }
.erp-office-agenda { display:none; }
[data-layout="agenda"] .erp-office-agenda { display:block; }
[data-layout="agenda"] .erp-planning-scroll, [data-layout="agenda"] .erp-timeline-navigation { display:none; }
.dark .erp-agenda-card, .dark .erp-agenda-days button { background:var(--gray-900); border-color:var(--gray-700); }
.dark .erp-agenda-card { border-left-color:var(--primary-500); }
.dark .erp-agenda-days button.is-selected { background:var(--primary-950); border-color:var(--primary-500); color:var(--primary-100); }
@media(max-width:767px) {
    [data-layout="auto"] .erp-office-agenda { display:block; }
    [data-layout="auto"] .erp-planning-scroll, [data-layout="auto"] .erp-timeline-navigation { display:none; }
    .erp-workspace-toolbar > .fi-btn, .erp-workspace-toolbar input, .erp-workspace-toolbar select { min-height:44px; }
    .erp-agenda-toolbar label { flex:1 1 100%; }
    .erp-agenda-toolbar .fi-input-wrp, .erp-agenda-toolbar input { min-width:0; width:100%; }
    .erp-agenda-card { padding:.8rem; }
}

.erp-material-form { display:grid; gap:1rem; min-width:0; }
.erp-material-form label { display:grid; gap:.35rem; min-width:0; }
.erp-materials input, .erp-materials select, .erp-materials .fi-btn, .erp-materials summary { min-height:44px; }
.erp-material-form textarea { border:1px solid var(--gray-400); border-radius:.5rem; padding:.65rem; width:100%; background:transparent; color:inherit; }
.erp-material-check { display:flex !important; align-items:center; gap:.7rem !important; min-height:44px; }
.erp-material-check input { width:1.25rem; min-height:1.25rem; height:1.25rem; flex:none; }
.erp-material-line { border:1px solid var(--gray-300); border-radius:.6rem; padding:.8rem; min-width:0; }
.erp-material-line legend { font-weight:600; padding-inline:.3rem; max-width:100%; overflow-wrap:anywhere; }
.erp-material-quantity { display:flex; flex-wrap:wrap; align-items:end; gap:.6rem; margin-top:.6rem; }
.erp-material-quantity label { flex:1 1 100px; }
.erp-material-quantity > strong { min-height:44px; display:flex; align-items:center; }
.erp-material-result { margin-block:.6rem; border:1px solid var(--gray-300); border-radius:.5rem; padding:.6rem; }
.erp-material-result summary { cursor:pointer; display:flex; align-items:center; overflow-wrap:anywhere; }
.erp-material-result li { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.6rem; padding-block:.6rem; border-top:1px solid var(--gray-200); }
.erp-material-lines, .erp-material-history { display:grid; gap:.75rem; margin-block:.75rem; }
.erp-material-lines li, .erp-material-history li { display:grid; gap:.3rem; border-left:3px solid var(--primary-400); padding-left:.75rem; overflow-wrap:anywhere; }
.erp-material-history time, .erp-material-lines small { font-size:.8rem; color:var(--gray-500); }
.erp-material-detail { display:grid; gap:.7rem; }
.erp-material-detail header h2 { font-weight:650; font-size:1.1rem; }
.erp-material-state { display:inline-block; padding:.3rem .6rem; border-radius:.4rem; background:var(--primary-50); color:var(--primary-900); margin-block:.5rem; }
.dark .erp-material-line, .dark .erp-material-result { border-color:var(--gray-700); }
.dark .erp-material-state { background:var(--primary-950); color:var(--primary-100); }
[data-layout="agenda"] .erp-month { display:none; }
@media(max-width:767px) { [data-layout="auto"] .erp-month { display:none; } }
@media(max-width:767px) {
    .fi-page:has(.erp-material-detail) .fi-btn { min-height:44px; max-width:100%; white-space:normal; }
    .fi-page:has(.erp-material-detail) .fi-btn > span { white-space:normal; }
}
