/* ============================
   CMF Shared Styles
   Underline form style used across all forms:
   Container Movement, Repair Estimates, Repair Jobs, etc.
   ============================ */

/* ---- Form Layout ---- */
.cmf-form {
    padding: 4px 0;
}
.cmf-form > .row {
    align-items: end;
}
.cmf-form > .row.cmf-row-top {
    align-items: stretch;
}

/* ---- Labels ---- */
.cmf-label {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #8b7355;
    margin-bottom: 2px;
    letter-spacing: 0.2px;
}
.cmf-required::after {
    content: ' *';
    color: #d32f2f;
}

/* ---- Fields (underline-only bottom border) ---- */
.cmf-field {
    width: 100%;
    padding: 6px 2px;
    font-size: 13px;
    color: #323130;
    background: transparent;
    border: none;
    border-bottom: 1px solid #d5d0c8;
    border-radius: 0;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    height: 32px;
    box-sizing: border-box;
    text-transform: uppercase;
}

/* CFS / shared pages: d365 controls inside .cmf-form use the same underline baseline as .cmf-field */
.cmf-form .d365-form-label {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #8b7355;
    margin-bottom: 2px;
    letter-spacing: 0.2px;
}
.cmf-form input.d365-form-control:not(.autocomplete-input),
.cmf-form select.d365-form-control,
.cmf-form textarea.d365-form-control {
    width: 100%;
    padding: 6px 2px;
    font-size: 13px;
    color: #323130;
    background: transparent;
    border: none;
    border-bottom: 1px solid #d5d0c8;
    border-radius: 0;
    outline: none;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, border-bottom-width 0.2s ease, padding-bottom 0.2s ease;
    height: 32px;
    box-sizing: border-box;
    text-transform: uppercase;
}
.cmf-form textarea.d365-form-control {
    height: auto;
    min-height: 60px;
    text-transform: none;
}
.cmf-form input.d365-form-control:not(.autocomplete-input):hover:not(:disabled):not(:focus):not(:focus-visible),
.cmf-form select.d365-form-control:hover:not(:disabled):not(:focus):not(:focus-visible),
.cmf-form textarea.d365-form-control:hover:not(:disabled):not(:focus):not(:focus-visible) {
    border-bottom-color: #2266e3;
}
.cmf-form input.d365-form-control:not(.autocomplete-input):focus,
.cmf-form input.d365-form-control:not(.autocomplete-input):focus-visible,
.cmf-form select.d365-form-control:focus,
.cmf-form select.d365-form-control:focus-visible,
.cmf-form textarea.d365-form-control:focus,
.cmf-form textarea.d365-form-control:focus-visible {
    border: none;
    border-bottom: 2px solid #2266e3;
    padding-bottom: 5px;
    box-shadow: 0 3px 10px -8px rgba(34, 102, 227, 0.38);
}
.cmf-form input.d365-form-control:not(.autocomplete-input):disabled,
.cmf-form select.d365-form-control:disabled,
.cmf-form textarea.d365-form-control:disabled {
    background: transparent;
    color: #323130;
    cursor: default;
    border-bottom-color: #e8e4de;
}

.cmf-form .autosuggest-input .d365-form-control,
.cmf-form .autocomplete-input {
    text-transform: uppercase;
}
.cmf-form .cmf-field:hover:not(:disabled):not(.cmf-field-readonly):not(:focus):not(:focus-visible) {
    border-bottom-color: #2266e3;
}
.cmf-form .cmf-field:focus,
.cmf-form .cmf-field:focus-visible {
    border-bottom: 2px solid #2266e3;
    padding-bottom: 5px;
    box-shadow: 0 3px 10px -8px rgba(34, 102, 227, 0.38);
}
.cmf-field:disabled {
    background: transparent;
    color: #323130;
    cursor: default;
    border-bottom-color: #e8e4de;
}
.cmf-field::placeholder {
    color: #c4bfb6;
    font-style: italic;
}
.cmf-field:disabled::placeholder {
    color: #605e5c;
    font-style: normal;
    opacity: 1;
}
select.cmf-field {
    cursor: pointer;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: menulist;
}

/* ---- Field Variants ---- */
.cmf-field-id, .cmf-field-id:disabled {
    font-weight: bold;
    font-size: 1.1em;
    color: #1a1a2e;
    background-color: #fff8e6 !important;
    border-bottom: 1px solid #d5d0c8;
    padding: 4px 6px;
    border-radius: 3px;
    border-top: none;
    border-left: none;
    border-right: none;
}
.cmf-field-readonly {
    background: transparent !important;
    color: #605e5c;
    border-bottom-style: dashed;
}
.cmf-field-highlight {
    background-color: transparent !important;
}
.cmf-field-multiline {
    min-height: 60px;
    height: auto;
    white-space: normal;
    padding: 6px 2px;
}
.cmf-value-display {
    padding: 6px 2px;
    font-size: 13px;
    font-weight: 600;
    color: #323130;
    border-bottom: 1px solid #e8e4de;
    height: 32px;
    line-height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Section Divider ---- */
.cmf-section-divider {
    border-top: 1px dashed #e0dbd3;
    margin: 4px 0 8px 0;
}

/* ---- Fieldset Group Box ---- */
.cmf-fieldset {
    border: 1px solid #d5d0c8;
    border-radius: 6px;
    padding: 12px 16px 8px 16px;
    margin: 4px 0 8px 0;
    background: #fafaf8;
}
.cmf-fieldset-legend {
    font-size: 12px;
    font-weight: 600;
    color: #2266e3;
    padding: 0 6px;
    width: auto;
    float: none;
    margin-bottom: 4px;
}

/* ---- AutoCompleteSelect Override ---- */
.cmf-form .autocomplete-select .autocomplete-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #d5d0c8;
    border-radius: 0;
    padding: 6px 2px;
    box-shadow: none;
}
.cmf-form .autocomplete-select .autocomplete-input:hover:not(:disabled):not(:focus):not(:focus-visible) {
    border-bottom-color: #2266e3;
}
.cmf-form .autocomplete-select .autocomplete-input:focus,
.cmf-form .autocomplete-select .autocomplete-input:focus-visible {
    border-bottom: 2px solid #2266e3;
    box-shadow: 0 3px 10px -8px rgba(34, 102, 227, 0.38);
    padding-bottom: 5px;
}
.cmf-form .autocomplete-select .autocomplete-input:disabled {
    background: transparent;
    border-bottom-color: #e8e4de;
}
.cmf-form .autocomplete-select .autocomplete-input:disabled::placeholder {
    color: #605e5c;
    font-style: normal;
    opacity: 1;
}
.cmf-form .autocomplete-select .autocomplete-toggle {
    background: transparent;
    border: none;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}
.cmf-form .autocomplete-select .autocomplete-input-wrapper {
    position: relative;
}

/* ---- AutoSuggestInput Override ---- */
.cmf-form .autosuggest-input .d365-form-control {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid #d5d0c8 !important;
    border-radius: 0 !important;
    padding: 6px 2px !important;
    box-shadow: none !important;
    height: 32px;
}
.cmf-form .autosuggest-input .d365-form-control:hover:not(:disabled):not(:focus):not(:focus-visible) {
    border-bottom-color: #2266e3 !important;
}
.cmf-form .autosuggest-input .d365-form-control:focus,
.cmf-form .autosuggest-input .d365-form-control:focus-visible {
    border-bottom: 2px solid #2266e3 !important;
    box-shadow: 0 3px 10px -8px rgba(34, 102, 227, 0.38) !important;
}
.cmf-form .autosuggest-input .d365-form-control:disabled {
    background: transparent !important;
    border-bottom-color: #e8e4de !important;
    color: #323130;
}
.cmf-form .autosuggest-input .d365-form-control:disabled::placeholder {
    color: #605e5c !important;
    font-style: normal !important;
    opacity: 1 !important;
}
.cmf-form .autosuggest-input .d365-form-control.cmf-field-highlight {
    background-color: transparent !important;
}
.cmf-form .autosuggest-input .d365-form-control.cmf-field-readonly {
    background: transparent !important;
    border-bottom-style: dashed !important;
}

/* ---- Store Module Underline Style ---- */
.store-module-page .d365-card {
    background: #fff;
}

.store-module-page .d365-card-header {
    min-height: 48px;
    padding: 10px 16px;
}

.store-module-page .d365-card-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 4px;
}

.store-module-page .d365-card-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: #2266e3;
    border-radius: 999px;
}

.store-module-page .d365-form-label {
    font-size: 12px;
    font-weight: 400;
    color: #8b7355;
    margin-bottom: 2px;
    letter-spacing: 0.2px;
}

.store-module-page .d365-form-control,
.store-module-page .d365-search-input,
.store-module-page textarea.d365-form-control,
.store-module-page select.d365-form-control {
    background: transparent;
    border: none;
    border-bottom: 1px solid #d5d0c8;
    border-radius: 0;
    box-shadow: none;
    padding: 6px 2px;
}

.store-module-page .d365-form-control {
    color: #323130;
    text-transform: uppercase;
}

.store-module-page textarea.d365-form-control {
    min-height: 60px;
}

/* Detail Item Description - styled box override */
.store-module-page .detail-item-field-name {
    width: 28rem;
    min-width: 28rem;
    max-width: 28rem;
}

.store-module-page .detail-item-field-id {
    width: 5rem;
    max-width: 5rem;
    margin-right: 0.75rem;
}

.store-module-page .detail-item-field-parent {
    width: 24rem;
    max-width: 24rem;
}

.store-module-page .detail-item-field-description {
    width: calc(28rem + 0.5rem + 8.5rem);
    max-width: calc(28rem + 0.5rem + 8.5rem);
    flex: 0 0 auto;
}

.store-module-page .detail-item-attr-unit-wrap {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.store-module-page .detail-item-unit-strip {
    border-left: 3px solid #d46b08 !important;
    background: linear-gradient(135deg, #fffef5 0%, #fff4d6 100%) !important;
    background-color: #fffef5 !important;
    border-radius: 0 4px 4px 0 !important;
    padding: 8px 12px !important;
    box-sizing: border-box !important;
    display: inline-block !important;
    white-space: nowrap !important;
    min-height: 32px !important;
}

.store-module-page .detail-item-unit-strip-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.5rem 1.25rem !important;
    white-space: nowrap !important;
}

.store-module-page .detail-item-unit-chip {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 0.35rem !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
}

.store-module-page .detail-item-unit-chip-label {
    color: #8a6116 !important;
    font-weight: 600 !important;
}

.store-module-page .detail-item-unit-chip-value {
    color: #1a1a2e !important;
    font-weight: 700 !important;
}

.store-module-page .detail-item-attributes-col {
    width: 8.5rem;
    min-width: 8.5rem;
}

.store-module-page .detail-item-field-unit {
    width: 8rem;
    min-width: 8rem;
}

.store-module-page .detail-item-field-unit .d365-form-control {
    width: 100%;
}

.store-module-page .detail-item-field-factor-unit {
    width: 9rem;
    min-width: 9rem;
}

.store-module-page .detail-item-field-factor-unit .d365-form-control {
    width: 100%;
}

.store-module-page .detail-item-field-factor-qty {
    width: 8rem;
    min-width: 8rem;
}

.store-module-page .detail-item-field-factor-qty .d365-form-control {
    width: 100%;
}

.store-module-page .detail-item-description-box {
    border-left: 3px solid #107c10;
    background: linear-gradient(135deg, rgba(248, 249, 251, 0.55) 0%, rgba(243, 242, 241, 0.4) 100%);
    border-radius: 0 4px 4px 0;
    padding: 7px 12px;
    box-sizing: border-box;
    min-height: 0;
}

.store-module-page .detail-item-description-box textarea.d365-form-control {
    background: transparent !important;
    border: none !important;
    border-bottom: none !important;
    border-radius: 0;
    padding: 0 !important;
    color: #323130;
    font-size: 13px;
    line-height: 1.35;
    text-transform: none !important;
    box-shadow: none !important;
    height: calc(1.35em * 5) !important;
    min-height: calc(1.35em * 5) !important;
    max-height: calc(1.35em * 5) !important;
    overflow-y: auto;
    resize: none;
}

.store-module-page .detail-item-description-box textarea.d365-form-control:focus {
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
    outline: none;
}

.store-module-page .detail-item-description-box textarea.d365-form-control:disabled {
    opacity: 1;
    color: #605e5c;
    background: transparent !important;
}

.store-module-page .detail-item-auto-column {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.detail-item-auto-strip.container-info-strip {
    position: relative;
}

.detail-item-auto-qr-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 2;
    width: 42px;
    height: 42px;
    padding: 1px;
    margin: 0;
    border: 1px solid #b8b4ac;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    line-height: 0;
    box-sizing: border-box;
}

.detail-item-auto-qr-btn:hover {
    border-color: #2266e3;
}

.detail-item-auto-qr-img {
    display: block;
    width: 38px !important;
    height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    margin: 0 !important;
    object-fit: contain;
}

.detail-item-auto-has-qr .detail-item-main-code-header {
    padding-right: 46px;
}

.store-module-page .detail-item-picture-box {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.store-module-page .detail-item-picture-frame {
    width: 100% !important;
    max-width: 100% !important;
    height: 10rem !important;
    max-height: 10rem !important;
    border: 1px solid #d8d4cd !important;
    border-radius: 0.35rem !important;
    background: #f3f7fc !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65) !important;
    overflow: hidden !important;
    position: relative !important;
}

.store-module-page .detail-item-picture-frame img:not(.detail-item-gallery-slide),
.store-module-page .detail-item-picture-img {
    display: block !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    max-height: 10rem !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

.store-module-page .detail-item-gallery-slide {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    margin: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

.store-module-page .detail-item-gallery-upload-btn {
    position: absolute !important;
    right: 8px !important;
    bottom: 8px !important;
    z-index: 5 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.store-module-page .detail-item-gallery-upload-btn:hover,
.store-module-page .detail-item-gallery-upload-btn:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.store-module-page .detail-item-gallery-lock {
    position: absolute !important;
    right: 8px !important;
    bottom: 8px !important;
    z-index: 5 !important;
    border: none !important;
}

.store-module-page .d365-form-control:focus,
.store-module-page .d365-search-input:focus {
    outline: none;
    border-bottom: 2px solid #2266e3;
    box-shadow: 0 3px 10px -8px rgba(34, 102, 227, 0.38);
    padding-bottom: 5px;
}

.store-module-page .d365-form-control:disabled {
    background: transparent;
    color: #323130;
    border-bottom-color: #e8e4de;
    cursor: default;
}

.store-module-page .d365-form-control::placeholder,
.store-module-page .d365-search-input::placeholder {
    color: #c4bfb6;
    font-style: italic;
}

.store-module-page .d365-form-control:disabled::placeholder {
    color: #605e5c;
    font-style: normal;
    opacity: 1;
}

.store-module-page .d365-card-body .border.rounded,
.store-module-page .d365-card-body .border.rounded.p-3 {
    border-color: #d5d0c8 !important;
    border-radius: 6px !important;
    background: #fafaf8 !important;
}

/* ---- Input Grid (data-entry tables) ---- */
.d365-input-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.d365-input-grid th {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 6px;
    text-align: left;
    font-weight: 600;
    color: #605e5c;
    position: sticky;
    top: 0;
    z-index: 10;
}
.d365-input-grid td {
    border: 1px solid #dee2e6;
    padding: 0;
    height: 20px;
}
.d365-grid-cell {
    padding: 1px 6px;
    height: 100%;
    display: flex;
    align-items: center;
}
.d365-grid-cell input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 12px;
    padding: 0;
}
.d365-grid-cell input:focus {
    background-color: #e8f0fe;
}
.d365-grid-cell select {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 12px;
}
.d365-grid-cell-checkbox {
    justify-content: center;
}
.d365-grid-cell-numeric input {
    text-align: right;
}

/* Grid Footer Total */
.grid-footer-total {
    text-align: right;
    padding: 8px 16px;
    background-color: #f3f2f1;
    border-top: 1px solid #e1dfdd;
    font-weight: bold;
    font-size: 14px;
}

/* ---- Pill Toggle (e.g., Food/NonFood, InProcess/Completed, Active/Inactive) ---- */
.pill-toggle {
    display: inline-flex;
    border: 2px solid #2266e3;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
}
.pill-toggle-btn {
    border: none;
    background: transparent;
    padding: 2px 12px;
    font-size: 11px;
    font-weight: 500;
    color: #2266e3;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    outline: none;
}
.pill-toggle-btn:hover:not(:disabled) {
    background: #e8f0fe;
}
.pill-toggle-btn.pill-toggle-active {
    background: #2266e3;
    color: #fff;
    border-radius: 18px;
}
.pill-toggle-disabled {
    opacity: 0.6;
    pointer-events: none;
}
.pill-toggle-disabled .pill-toggle-btn {
    cursor: default;
}
.pill-toggle-sm {
    border-width: 1.5px;
    border-radius: 16px;
}
.pill-toggle-sm .pill-toggle-btn {
    padding: 1px 8px;
    font-size: 10px;
}
.pill-toggle-sm .pill-toggle-btn.pill-toggle-active {
    border-radius: 14px;
}

/* ---- CMF-style toggle pill (Shift, Food Grade, etc.) ---- */
.cmf-toggle-pill {
    display: flex;
    gap: 4px;
    align-items: center;
    background: #e8f4fc;
    padding: 3px;
    border-radius: 16px;
}
.cmf-toggle-pill-btn {
    border: none;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #90caf9;
    padding: 4px 10px;
    white-space: nowrap;
    line-height: 1.2;
}
.cmf-toggle-pill-btn:hover:not(:disabled):not(.active) {
    background: rgba(33, 150, 243, 0.1);
    color: #2196f3;
}
.cmf-toggle-pill-btn.active.food {
    background: #2196f3;
    color: #fff;
    box-shadow: 0 1px 4px rgba(33, 150, 243, 0.4);
}
.cmf-toggle-pill-btn.active.non-food {
    background: #1565c0;
    color: #fff;
    box-shadow: 0 1px 4px rgba(21, 101, 192, 0.4);
}
.cmf-toggle-pill-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Food Grade Icon Toggle (CMF-style) ---- */
.food-grade-toggle-pill {
    display: flex;
    gap: 4px;
    align-items: center;
    background: #e8f4fc;
    padding: 3px;
    border-radius: 16px;
}
.food-grade-pill {
    width: 24px;
    height: 24px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2196f3;
    padding: 0;
}
.food-grade-pill:focus {
    outline: none;
    border-color: #2266e3;
    box-shadow: 0 0 6px rgba(34, 102, 227, 0.6);
}
.food-grade-pill:hover:not(:disabled):not(.active) {
    background: rgba(33, 150, 243, 0.1);
    color: #1976d2;
}
.food-grade-pill.active.food {
    background: #2196f3;
    color: #fff;
    box-shadow: 0 1px 4px rgba(33, 150, 243, 0.4);
}
.food-grade-pill.active.non-food {
    background: #1565c0;
    color: #fff;
    box-shadow: 0 1px 4px rgba(21, 101, 192, 0.4);
}
.food-grade-pill:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.food-grade-icon {
    width: 14px;
    height: 14px;
    display: block;
    flex-shrink: 0;
}
.food-grade-pill:not(.active) .food-grade-icon {
    opacity: 0.75;
}
.food-grade-pill.active .food-grade-icon {
    opacity: 1;
}
.food-grade-pill.non-food::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transform: translate(-50%, -50%) rotate(-35deg);
}

.repair-estimate-trans-no {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    text-align: center;
}
.repair-estimate-revision-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 148px;
}
.repair-estimate-revision-actions .btn {
    width: 100%;
    justify-content: flex-start;
    padding: 2px 10px;
    font-size: 11px;
    line-height: 1.3;
    white-space: nowrap;
}
.repair-estimate-detail-split {
    align-items: stretch;
}
.repair-estimate-detail-split > [class*="col-"] {
    display: flex;
    flex-direction: column;
}
.repair-estimate-detail-split .container-info-strip,
.repair-estimate-detail-split .container-info-empty,
.repair-estimate-approval-panel {
    flex: 1 1 auto;
    width: 100%;
    min-height: 100%;
}
.repair-estimate-approval-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid #d5d0c8;
    border-radius: 4px;
    background: #faf9f8;
    padding: 7px 12px 9px;
    min-height: 102px;
    box-sizing: border-box;
}
.repair-estimate-approval-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px;
    padding-right: 84px;
    min-width: 0;
}
.repair-estimate-approval-field {
    flex: 0 0 auto;
    min-width: 0;
}
.repair-estimate-approval-type-picker {
    width: 148px;
}
.repair-estimate-approval-status-picker {
    width: 132px;
}

/* Native select with capsule pill overlay (keyboard type-ahead + visual display) */
.approval-select-capsule {
    position: relative;
    display: inline-block;
    vertical-align: bottom;
}
.approval-select-capsule select.cmf-field {
    width: 100%;
    position: relative;
    z-index: 2;
    color: transparent;
    background: transparent;
    text-transform: none;
}
.approval-select-capsule select.cmf-field option {
    color: #323130;
}
.approval-select-capsule select.cmf-field:disabled {
    color: transparent;
}
.approval-select-capsule-display {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 6px 22px 6px 2px;
    pointer-events: none;
    z-index: 1;
}
.approval-select-capsule-display .approval-pill-infield {
    font-size: 11px;
    padding: 3px 9px;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.repair-estimate-approved-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 11px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    border-radius: 12px;
    --bs-btn-padding-y: 3px;
    --bs-btn-padding-x: 11px;
}
.repair-estimate-approved-btn .bi {
    font-size: 11px;
    line-height: 1;
}
/* Expanded sidebar: icon-only Approved action so it does not overlap Approval Status */
.d365-sidebar:not(.collapsed) ~ .d365-main-content .repair-estimate-approved-btn {
    top: 7px;
    right: 6px;
    width: 26px;
    height: 26px;
    min-width: 26px;
    padding: 0;
    gap: 0;
    border-radius: 50%;
    justify-content: center;
    --bs-btn-padding-y: 0;
    --bs-btn-padding-x: 0;
}
.d365-sidebar:not(.collapsed) ~ .d365-main-content .repair-estimate-approved-btn-label {
    display: none;
}
.d365-sidebar:not(.collapsed) ~ .d365-main-content .repair-estimate-approved-btn .bi {
    font-size: 13px;
    margin: 0;
}
.d365-sidebar:not(.collapsed) ~ .d365-main-content .repair-estimate-approval-row {
    padding-right: 34px;
}
.repair-estimate-additional-remarks {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
}
.repair-estimate-additional-remarks-label {
    font-size: 12px;
    color: #8b7355;
    white-space: nowrap;
    flex-shrink: 0;
}
.repair-estimate-additional-remarks-field {
    flex: 1;
    min-width: 0;
    height: auto;
    padding: 2px 2px;
}

/* ---- EIR Server-Side Search Dropdown ---- */
.eir-search-wrapper {
    position: relative;
    display: inline-block;
}
.eir-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    width: 380px;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d5d0c8;
    border-top: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 0 0 4px 4px;
}
.eir-dropdown-item {
    padding: 6px 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0ede8;
}
.eir-dropdown-item:hover {
    background: #e8f0fe;
}
.eir-dropdown-item.highlighted {
    background: #e8f0fe;
}
.eir-item-primary {
    font-size: 13px;
    font-weight: 500;
    color: #323130;
}
.eir-item-secondary {
    font-size: 11px;
    color: #8b7355;
}
.eir-dropdown-hint {
    padding: 6px 10px;
    font-size: 11px;
    color: #8b7355;
    text-align: center;
    font-style: italic;
}

/* ---- Tab Overrides ---- */
.nav-tabs .nav-link {
    font-size: 12px;
    padding: 6px 14px;
    color: #605e5c;
}
.nav-tabs .nav-link.active {
    font-weight: 600;
    color: #2266e3;
}

/* ---- Approval Status Badge ---- */
.approval-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    min-width: 120px;
    margin-left: 12px;
}
.approval-status-badge.repair-estimate-status {
    margin-left: 0;
    white-space: nowrap;
}
.repair-estimate-form {
    padding-top: 2px;
}
.repair-estimate-header-rows {
    margin-bottom: 1rem;
}
.repair-estimate-header-rows > .row {
    margin-bottom: 0 !important;
}
.repair-estimate-header-rows > .row.repair-estimate-first-row {
    margin-bottom: 1rem !important;
}
.repair-estimate-header-rows > .repair-estimate-second-row {
    margin-top: -6px;
}
.repair-estimate-header-actions {
    position: relative;
    min-width: 120px;
    height: 0;
    align-self: flex-start;
    overflow: visible;
}
.repair-estimate-status-top {
    position: absolute;
    top: -12px;
    right: 0;
    padding: 3px 12px;
    margin: 0;
    white-space: nowrap;
}
.repair-estimate-food-grade {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 4px;
}
.repair-estimate-food-grade .cmf-label {
    margin-bottom: 1px;
}
.repair-estimate-first-row,
.repair-estimate-second-row {
    flex-wrap: nowrap;
}
.repair-estimate-revision-col {
    align-self: flex-end;
}
.repair-estimate-form .cmf-section-divider {
    margin: 4px 0 8px;
}

/* RE → RJ workflow tracker (matches Release Order header tracker) */
.re-header-actions-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.re-header-tracker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.re-header-tracker .tracker-step {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    gap: 2px;
}

.re-header-tracker .tracker-step-clickable {
    cursor: pointer;
}

.re-header-tracker .tracker-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #64748b;
    background: #fff;
}

.re-header-tracker .tracker-label {
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    color: #64748b;
}

.re-header-tracker .tracker-line {
    width: 36px;
    height: 2px;
    background: #cbd5e1;
    margin-top: -10px;
}

.re-header-tracker .tracker-line.line-pending { background: #f97316; }
.re-header-tracker .tracker-line.line-approved { background: #7c3aed; }
.re-header-tracker .tracker-line.line-rj { background: #16a34a; }

.re-header-tracker .step-re-pending .tracker-icon {
    border-color: #f97316;
    color: #f97316;
}

.re-header-tracker .step-re-pending .tracker-label {
    color: #f97316;
}

.re-header-tracker .step-re-approved .tracker-icon,
.re-header-tracker .step-re-approved .tracker-label {
    color: #7c3aed;
}

.re-header-tracker .step-re-approved .tracker-icon {
    border-color: #7c3aed;
    color: #7c3aed;
}

.re-header-tracker .step-re-voided .tracker-icon,
.re-header-tracker .step-re-voided .tracker-label {
    color: #dc2626;
}

.re-header-tracker .step-re-voided .tracker-icon {
    border-color: #dc2626;
    color: #dc2626;
}

.re-header-tracker .step-rj-active .tracker-icon,
.re-header-tracker .step-rj-active .tracker-label {
    color: #16a34a;
}

.re-header-tracker .step-rj-active .tracker-icon {
    border-color: #16a34a;
    color: #16a34a;
}

.re-header-tracker .step-rj-inactive .tracker-icon,
.re-header-tracker .step-rj-inactive .tracker-label {
    color: #94a3b8;
}

.re-header-tracker .step-rj-inactive .tracker-icon {
    border-color: #cbd5e1;
    color: #94a3b8;
}

.re-header-tracker .step-rj-voided .tracker-icon,
.re-header-tracker .step-rj-voided .tracker-label {
    color: #dc2626;
}

.re-header-tracker .step-rj-voided .tracker-icon {
    border-color: #dc2626;
    color: #dc2626;
}

@media (max-width: 1200px) {
    .repair-estimate-first-row {
        flex-wrap: wrap;
    }
}
.approval-status-badge i {
    font-size: 18px;
}
.approval-status-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    gap: 2px;
}
.approval-status-label {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
}
.approval-status-date {
    font-size: 10px;
    opacity: 0.8;
}
.approval-status-approved {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}
.approval-status-approved i {
    color: #2e7d32;

}

/* ---- CMF Global Wrapper (for migrated setup pages) ---- */
.cmf-global {
    background: #f6f8fb;
    border: 1px solid #d9e2ef;
    border-radius: 6px;
    padding: 0.75rem;
}

.cmf-global .d365-header {
    background: linear-gradient(90deg, #1b2240 0%, #2d315c 100%);
    border-radius: 4px 4px 0 0;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.cmf-global .d365-header h2,
.cmf-global .d365-header .text-muted {
    color: #fff !important;
}

.cmf-global .d365-card {
    border: 1px solid #d6dde8;
    border-radius: 6px;
}

.cmf-global .d365-card-header {
    background: #f2f5fa;
}

.cmf-global .voucher-setup-master .cmf-field,
.cmf-global .voucher-setup-master .cmf-form .autosuggest-input .d365-form-control,
.cmf-global .voucher-setup-master .cmf-form .autocomplete-input {
    text-transform: none;
}

.cmf-global .voucher-setup-master .cmf-fieldset {
    background: #ffffff;
}

.approval-status-pending {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #e65100;
    border: 1px solid #ffcc80;
}
.approval-status-pending i {
    color: #e65100;
}

/* ---- Container Info Strip (used in Estimates) ---- */
.container-info-strip {
    border-left: 3px solid #2266e3;
    background: linear-gradient(135deg, #f8f9fb 0%, #f3f2f1 100%);
    border-radius: 0 4px 4px 0;
    padding: 7px 12px;
    min-height: 96px;
    box-sizing: border-box;
}
.container-info-grid {
    display: grid;
    grid-template-columns: auto 1px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 12px;
    row-gap: 6px;
    align-items: start;
}
.container-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-column: 1;
    grid-row: 1;
}
.container-info-divider-vertical {
    grid-column: 2;
    grid-row: 1 / 4;
    width: 1px;
    background-color: #e0dbd3;
    align-self: stretch;
    margin-bottom: -3px;
}
.container-info-remarks-inline {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    grid-column: 3;
    grid-row: 1 / 4;
}
.container-info-remarks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}
.container-info-remarks-label {
    font-size: 9px;
    text-transform: uppercase;
    color: #8b7355;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.container-info-remarks-value {
    font-size: 11px;
    color: #323130;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
    max-height: calc(1.4em * 3);
    overflow-y: auto;
}
.container-info-no {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    letter-spacing: 0.5px;
}
.container-info-badge {
    display: inline-block;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 500;
    background: #e8f0fe;
    color: #2266e3;
    border-radius: 10px;
}
.container-info-badge-condition {
    background: #fff3e0;
    color: #e65100;
}
.container-info-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    grid-column: 1;
    grid-row: 2;
}
.container-info-row-meta {
    grid-row: 3;
    width: 100%;
    gap: 0;
}
.container-info-row-meta .container-info-item-half {
    flex: 0 0 50%;
    max-width: 50%;
    min-width: 0;
    padding-right: 8px;
}
.container-info-row-meta .container-info-item-half + .container-info-item-half {
    padding-right: 0;
    padding-left: 8px;
}
.container-info-item {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.container-info-label {
    font-size: 9px;
    text-transform: uppercase;
    color: #8b7355;
    letter-spacing: 0.5px;
}
.container-info-value {
    font-size: 11px;
    color: #323130;
}
.container-info-empty {
    padding: 14px 12px;
    color: #a09888;
    font-size: 11px;
    border: 1px dashed #d5d0c8;
    border-radius: 4px;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Container + EIR Split Layout ---- */
.container-eir-layout {
    display: flex;
    gap: 0;
    align-items: stretch;
}
.container-eir-left {
    flex: 1;
    min-width: 0;
}
.container-eir-divider {
    width: 1px;
    background-color: #d5d0c8;
    margin: 0 16px;
    flex-shrink: 0;
}
.container-eir-right {
    width: 240px;
    flex-shrink: 0;
}

/* ---- Approval Pill Selectors ---- */
.approval-pill-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.approval-pill-group-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
.approval-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #d5d0c8;
    background: transparent;
    color: #605e5c;
    outline: none;
    white-space: nowrap;
}
.approval-pill:hover:not(:disabled) {
    border-color: #8b7355;
    color: #323130;
}
.approval-pill:disabled {
    opacity: 0.55;
    cursor: default;
}
.approval-pill i { font-size: 13px; }
.approval-pill-display {
    cursor: default;
    pointer-events: none;
}
.approval-pill-infield {
    pointer-events: none;
    margin: 0;
    max-width: calc(100% - 18px);
    overflow: hidden;
    text-overflow: ellipsis;
}
.approval-picker {
    position: relative;
}
.approval-picker-trigger {
    width: 100%;
    min-height: 32px;
    border: none;
    border-bottom: 1px solid #d5d0c8;
    background: transparent;
    padding: 4px 0 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
    text-align: left;
}
.approval-picker-trigger:focus {
    outline: none;
    border-bottom: 2px solid #2266e3;
    padding-bottom: 1px;
}
.approval-picker-trigger:disabled {
    cursor: default;
    opacity: 0.85;
}
.approval-picker-placeholder {
    font-size: 12px;
    color: #c4bfb6;
    font-style: italic;
    text-transform: none;
}
.approval-picker-chevron {
    font-size: 11px;
    color: #8a8278;
    flex-shrink: 0;
}
.approval-picker-menu {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    z-index: 120;
    background: #fff;
    border: 1px solid #d5d0c8;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    min-width: 100%;
    max-height: 200px;
    overflow-y: auto;
}
.approval-picker-option {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 6px 10px;
    font-size: 12px;
    color: #323130;
    text-transform: none;
    cursor: pointer;
}
.approval-picker-option:hover {
    background: #f3f2f1;
}

/* Approval Status: Approved */
.approval-pill-outline-approved { border-color: #4caf50; color: #4caf50; }
.approval-pill-outline-approved:hover:not(:disabled) { background: #e8f5e9; border-color: #388e3c; color: #388e3c; }
.approval-pill-approved { background: #4caf50; border-color: #4caf50; color: #fff; }
.approval-pill-approved:hover:not(:disabled) { background: #388e3c; border-color: #388e3c; color: #fff; }

/* Approval Status: Rejected */
.approval-pill-outline-rejected { border-color: #f44336; color: #f44336; }
.approval-pill-outline-rejected:hover:not(:disabled) { background: #ffebee; border-color: #d32f2f; color: #d32f2f; }
.approval-pill-rejected { background: #f44336; border-color: #f44336; color: #fff; }
.approval-pill-rejected:hover:not(:disabled) { background: #d32f2f; border-color: #d32f2f; color: #fff; }

/* Approval Status: Recommended */
.approval-pill-outline-recommended { border-color: #2266e3; color: #2266e3; }
.approval-pill-outline-recommended:hover:not(:disabled) { background: #e8f0fe; border-color: #1a53c0; color: #1a53c0; }
.approval-pill-recommended { background: #2266e3; border-color: #2266e3; color: #fff; }
.approval-pill-recommended:hover:not(:disabled) { background: #1a53c0; border-color: #1a53c0; color: #fff; }

/* Approval Status: Pending */
.approval-pill-outline-pending { border-color: #ffcc80; color: #e65100; background: #fffaf3; }
.approval-pill-pending {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-color: #ffcc80;
    color: #e65100;
}
.approval-pill-pending i { color: #e65100; }

/* Approval Type: Generic active */
.approval-pill-active { background: #2266e3; border-color: #2266e3; color: #fff; }
.approval-pill-active:hover:not(:disabled) { background: #1a53c0; border-color: #1a53c0; color: #fff; }

/* Approval Status Badge: Rejected */
.approval-status-rejected {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    border: 1px solid #ef9a9a;
}
.approval-status-rejected i { color: #c62828; }

/* Approval Status Badge: Recommended */
.approval-status-recommended {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border: 1px solid #90caf9;
}
.approval-status-recommended i { color: #1565c0; }

/* ---- Dashboard (HRM-style) ---- */
.tms-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f5f6fb;
    border-radius: 18px;
}

.tms-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e6e8ef;
    box-shadow: 0 10px 24px rgba(31, 41, 55, 0.08);
}

.tms-dashboard-title h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.tms-dashboard-title p {
    margin: 0.35rem 0 0;
    color: #6b7280;
    font-size: 0.95rem;
}

.tms-dashboard-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tms-dashboard-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tms-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    background: #1f6feb;
    color: #ffffff;
}

.tms-btn-outline {
    background: #ffffff;
    border: 1px solid #d5d9e2;
    color: #1f2937;
}

.tms-link {
    background: none;
    border: none;
    color: #1f6feb;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.tms-badge {
    background: #ef4444;
    color: #ffffff;
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 0.1rem 0.45rem;
    font-weight: 700;
}

.tms-badge-muted {
    background: #6366f1;
}

.tms-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.tms-kpi-card {
    background: #ffffff;
    border: 1px solid #e6e8ef;
    border-radius: 16px;
    padding: 1rem 1.2rem;
    box-shadow: 0 8px 18px rgba(31, 41, 55, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tms-kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    font-weight: 700;
}

.tms-kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111827;
}

.tms-kpi-subtext {
    font-size: 0.85rem;
    color: #6b7280;
}

.tms-kpi-success {
    border-left: 4px solid #22c55e;
}

.tms-kpi-warning {
    border-left: 4px solid #f59e0b;
}

.tms-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tms-section-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.tms-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.tms-tile {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.2rem;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e6e8ef;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 18px rgba(31, 41, 55, 0.05);
}

.tms-tile-title {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.2rem;
}

.tms-tile-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
}

.tms-tile-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
}

.tms-blue { background: #2563eb; }
.tms-green { background: #16a34a; }
.tms-orange { background: #f97316; }
.tms-purple { background: #8b5cf6; }
.tms-teal { background: #0d9488; }
.tms-red { background: #ef4444; }

.tms-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.5rem;
}

.tms-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e6e8ef;
    box-shadow: 0 12px 26px rgba(31, 41, 55, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tms-card-large {
    min-height: 360px;
}

.tms-card-stack {
    gap: 1rem;
    padding-bottom: 1rem;
}

.tms-card-header {
    padding: 1.2rem 1.4rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.tms-card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.tms-card-header p {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: #6b7280;
}

.tms-card-body {
    padding: 0 1.4rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tms-card-actions {
    padding-top: 0;
}

.tms-card-divider {
    height: 1px;
    margin: 0 1.4rem;
    background: #e6e8ef;
}

.tms-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #d7dbe5;
    text-decoration: none;
    color: #1f2937;
    font-weight: 600;
    background: #ffffff;
}

.tms-action-primary {
    background: #2563eb;
    color: #ffffff;
    border-color: transparent;
}

.tms-table-wrapper {
    overflow-x: auto;
}

.tms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tms-table th,
.tms-table td {
    padding: 0.75rem 0.6rem;
    border-bottom: 1px solid #e6e8ef;
    text-align: left;
    color: #374151;
}

.tms-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.tms-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.tms-status-success {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.tms-status-info {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}

.tms-status-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #b45309;
}

.tms-status-list {
    gap: 0.85rem;
}

.tms-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #374151;
}

.tms-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.tms-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid rgba(37, 99, 235, 0.2);
    border-top-color: #2563eb;
    animation: tms-spin 1s linear infinite;
}

@keyframes tms-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 992px) {
    .tms-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tms-dashboard-actions {
        width: 100%;
        justify-content: space-between;
    }

    .tms-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tms-dashboard {
        padding: 1rem;
    }

    .tms-dashboard-header {
        padding: 1rem;
    }

    .tms-kpi-grid,
    .tms-quick-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================
   Context Menu Styles
   ============================ */
.context-menu {
    position: fixed;
    z-index: 10000;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 160px;
    padding: 4px 0;
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.15s;
}

.context-menu-item:hover {
    background-color: #f5f5f5;
}

.context-menu-item i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.context-menu-item.text-danger {
    color: #d32f2f;
}

.context-menu-item.text-danger:hover {
    background-color: #ffebee;
}

.context-menu-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 4px 0;
}

.repair-estimate-detail-count,
.cmf-container-detail-count {
    font-size: 12px;
    color: #605e5c;
    margin-left: auto;
}
.repair-estimate-detail-grid .d365-editable-grid-toolbar button,
.cmf-container-detail-grid .d365-editable-grid-toolbar button {
    height: 20px !important;
}
.repair-estimate-detail-grid .d365-editable-grid-toolbar button.grid-nav-mode-active,
.cmf-container-detail-grid .d365-editable-grid-toolbar button.grid-nav-mode-active {
    color: #ff8c00;
}

.repair-estimate-detail-grid .d365-editable-grid-toolbar .separator,
.cmf-container-detail-grid .d365-editable-grid-toolbar .separator {
    height: 14px !important;
    align-self: center;
}
.repair-estimate-detail-grid,
.cmf-container-detail-grid {
    border-color: #edebe9;
}
.repair-estimate-detail-grid-scroll,
.cmf-container-detail-grid-scroll {
    max-height: 300px;
    overflow: auto;
    border-top: 1px solid #edebe9;
}
.repair-estimate-detail-grid .d365-grid-fo-editable,
.cmf-container-detail-grid .d365-grid-fo-editable {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
}
.repair-estimate-detail-grid .d365-grid-fo-editable thead th {
    background: #fff;
    border: none;
    border-bottom: 1px solid #d2d0ce;
    font-weight: 400;
    font-size: 12px;
    color: #605e5c;
    padding: 8px 10px;
    height: auto;
    text-align: left;
}
.cmf-container-detail-grid .d365-grid-fo-editable thead th {
    position: relative;
    background: #fff;
    border: none;
    border-bottom: 1px solid #d2d0ce;
    font-weight: 400;
    font-size: 12px;
    color: #605e5c;
    padding: 4px 8px;
    height: 28px;
    line-height: 1.2;
    text-align: center;
    vertical-align: middle;
}
.cmf-container-detail-grid .d365-grid-fo-editable thead th + th::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background: #d0d0d0;
}
.repair-estimate-detail-grid .d365-grid-fo-editable td,
.cmf-container-detail-grid .d365-grid-fo-editable td {
    border: none;
    border-bottom: 1px solid #edebe9;
    height: 28px;
    padding: 0;
}
.repair-estimate-detail-grid .d365-grid-fo-editable tbody tr:hover,
.cmf-container-detail-grid .d365-grid-fo-editable tbody tr:hover {
    background: #f3f2f1;
}
.repair-estimate-detail-grid .d365-grid-fo-editable tbody tr.selected,
.cmf-container-detail-grid .d365-grid-fo-editable tbody tr.selected {
    background: #deecf9 !important;
}
.repair-estimate-detail-grid .d365-grid-fo-editable tbody tr.selected td:first-child,
.cmf-container-detail-grid .d365-grid-fo-editable tbody tr.selected td:first-child {
    box-shadow: inset 3px 0 0 #0078d4;
}
.repair-estimate-detail-grid .d365-fo-checkbox-col,
.cmf-container-detail-grid .d365-fo-checkbox-col {
    width: 32px;
    min-width: 32px;
}
.repair-estimate-detail-grid .repair-estimate-detail-actions-col {
    width: 32px;
    min-width: 32px;
}
.repair-estimate-detail-grid .d365-grid-cell-action {
    justify-content: center;
    padding: 0 4px;
}
.repair-estimate-detail-delete-btn {
    border: 1px solid transparent;
    background: transparent;
    color: #d13438;
    padding: 2px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.repair-estimate-detail-delete-btn:focus {
    outline: none;
    border-color: #a4262c;
    background-color: #fde7e9;
}
.repair-estimate-detail-delete-btn:hover:not(:disabled) {
    color: #a4262c;
}
.repair-estimate-detail-delete-btn:disabled {
    color: #c8c6c4;
    cursor: not-allowed;
}
.repair-estimate-detail-delete-btn .bi {
    font-size: 14px;
}
.repair-estimate-detail-footer,
.cmf-container-detail-footer {
    display: flex;
    justify-content: flex-end;
    padding: 8px 12px;
    border-top: 1px solid #edebe9;
    background: #faf9f8;
}
.repair-estimate-detail-total,
.cmf-container-detail-total {
    font-size: 13px;
    font-weight: 600;
    color: #323130;
}

/* Repair code in-cell lookup (D365 style) */
.repair-estimate-detail-grid .repair-code-lookup-cell .repair-code-lookup-btn {
    opacity: 0;
    transition: opacity 0.15s ease;
}
.repair-estimate-detail-grid .repair-code-lookup-cell:hover .repair-code-lookup-btn,
.repair-estimate-detail-grid .repair-code-lookup-cell:focus-within .repair-code-lookup-btn,
.repair-estimate-detail-grid .repair-code-lookup-cell.repair-code-lookup-active .repair-code-lookup-btn {
    opacity: 1;
}
.repair-estimate-detail-grid .repair-code-lookup-cell .d365-grid-lookup-input input {
    min-width: 0;
}
.repair-estimate-detail-grid .repair-code-lookup-cell.repair-code-lookup-active {
    background: #f3f9fd;
}
.repair-code-header-hint {
    font-size: 11px;
    color: #8a8886;
    margin-left: 4px;
    cursor: help;
    vertical-align: middle;
}
.mnr-job-picker-grid {
    max-height: 420px;
    overflow-y: auto;
}
.mnr-job-picker-modal .selected-row {
    background-color: #deecf9 !important;
}
.mnr-job-picker-modal .ro-grid-table thead th {
    font-size: 12px;
    font-weight: 600;
    color: #605e5c;
    background: #f8f9fa;
}

/* ---- Repair Estimate List Accordion ---- */
.repair-estimate-list-panel {
    background: transparent;
}
.repair-estimate-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #dee2e6;
    background: transparent;
    color: #212529;
}
.repair-estimate-list-header.expanded {
    color: #0d6efd;
    border-bottom-color: #dee2e6;
}
.repair-estimate-list-header-main {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    background: transparent;
    padding: 2px 6px;
    margin: -2px -6px;
    cursor: pointer;
    text-align: left;
    color: inherit;
    transition: color 0.15s ease;
}

.repair-estimate-list-header-main:focus {
    outline: none;
    border-color: #0078d4;
    border-radius: 4px;
    background: #e8f4fd;
}

.repair-estimate-list-header-main:hover {
    color: #0d6efd;
}
.repair-estimate-list-header-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}
.repair-estimate-list-range {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
}
.repair-estimate-list-header.expanded .repair-estimate-list-range {
    color: #5c8fd6;
}
.repair-estimate-list-pager {
    flex-shrink: 0;
}

/* ---- Compact Pagination (CMF list style) ---- */
.cmf-compact-pager {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 2px 4px;
    border: 1px solid #d5d5d5;
    border-radius: 4px;
    background: #fff;
}
.cmf-compact-pager-btn {
    border: none;
    background: transparent;
    padding: 4px 7px;
    line-height: 1;
    color: #5f6368;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}
.cmf-compact-pager-btn:hover:not(:disabled) {
    color: #212529;
}
.cmf-compact-pager-btn:disabled {
    color: #d0d0d0;
    cursor: default;
}
.cmf-compact-pager-btn .bi {
    font-size: 14px;
}
.cmf-compact-pager-label {
    padding: 0 10px;
    font-size: 13px;
    font-weight: 400;
    color: #3c4043;
    white-space: nowrap;
    user-select: none;
    line-height: 1.2;
}
.repair-estimate-list-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: transparent;
    padding: 2px 6px;
    margin: -2px -6px;
    cursor: pointer;
    color: inherit;
    flex-shrink: 0;
}

.repair-estimate-list-expand:focus {
    outline: none;
    border-color: #0078d4;
    border-radius: 4px;
    background: #e8f4fd;
}
.repair-estimate-list-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.repair-estimate-list-title > .bi {
    color: inherit;
    font-size: 16px;
    flex-shrink: 0;
}
.repair-estimate-list-count {
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
}
.repair-estimate-list-header.expanded .repair-estimate-list-count {
    color: #5c8fd6;
}
.repair-estimate-list-loading {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
}
.repair-estimate-list-loading .d365-spinner {
    width: 14px;
    height: 14px;
    border-width: 2px;
}
.repair-estimate-list-chevron {
    color: #6c757d;
    font-size: 14px;
    flex-shrink: 0;
}
.repair-estimate-list-header.expanded .repair-estimate-list-chevron {
    color: #0d6efd;
}
.repair-estimate-list-body {
    padding: 12px 0 0;
}
.repair-estimate-list-grid {
    max-height: 320px;
    overflow: auto;
    border: none;
    border-top: 1px solid #edebe9;
    background: #fff;
}
.repair-estimate-list-grid .d365-grid-fo {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}
.repair-estimate-list-grid .d365-grid-fo thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
}
.repair-estimate-list-grid .d365-grid-fo thead th {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: #605e5c;
    background: #fff;
    border-bottom: 1px solid #d2d0ce;
    border-top: none;
    white-space: nowrap;
}
.repair-estimate-list-grid .d365-grid-fo tbody td {
    padding: 9px 12px;
    color: #323130;
    border-bottom: 1px solid #edebe9;
    vertical-align: middle;
}
.repair-estimate-list-grid .d365-grid-fo tbody tr {
    cursor: pointer;
    transition: background-color 0.12s ease;
}
.repair-estimate-list-grid .d365-grid-fo tbody tr:hover {
    background: #f3f2f1;
}
.repair-estimate-list-grid .d365-grid-fo tbody tr.selected {
    background: #deecf9;
}
.repair-estimate-list-grid .d365-grid-fo tbody tr.selected td:first-child {
    box-shadow: inset 3px 0 0 #0078d4;
}
.repair-estimate-list-grid .d365-grid-fo tbody tr.is-void td {
    color: #a19f9d;
    text-decoration: line-through;
}
.repair-estimate-list-grid .d365-grid-fo tbody tr.is-void .d365-fo-link {
    color: #a19f9d;
}
.repair-estimate-list-grid .d365-fo-marker-col {
    width: 28px;
    min-width: 28px;
    padding-left: 8px !important;
    padding-right: 4px !important;
}
.repair-estimate-list-grid .d365-fo-row-checkbox {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: #0078d4;
}
.repair-estimate-list-grid .d365-fo-link {
    color: #0078d4;
    font-weight: 400;
}
.repair-estimate-list-grid .d365-fo-link:hover {
    text-decoration: underline;
}

/* Lay-off list — ground status pills in container grid */
.layoff-ground-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    white-space: nowrap;
}
.layoff-ground-status--selected {
    background: #605e5c;
    color: #fff;
}
.layoff-ground-status--grounded {
    background: #107c10;
    color: #fff;
}
.layoff-ground-status--not-grounded {
    background: #d83b01;
    color: #fff;
}
.layoff-not-grounded-btn {
    border: 1px solid #8a8886;
    background: #fff;
    color: #323130;
    font-size: 11px;
    padding: 2px 8px;
    line-height: 1.4;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}
.layoff-not-grounded-btn:hover {
    background: #f3f2f1;
    border-color: #605e5c;
}
.repair-estimate-list-grid .repair-estimate-detail-actions-col {
    width: 72px;
    min-width: 72px;
    padding-left: 4px !important;
    padding-right: 4px !important;
}
.repair-estimate-list-grid .d365-grid-cell-action {
    justify-content: center;
    padding: 0 4px;
}

.layoff-list-form .layoff-list-remarks-row {
    margin-top: 0.25rem;
}

.repair-estimate-list-footer {
    padding: 8px 0;
    border-top: 1px solid #e9ecef;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* Excel-style grid column headers (sort + value filter) */
.excel-grid-th {
    position: relative;
    padding: 0 !important;
    vertical-align: middle;
}
.excel-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    padding: 8px 6px;
    min-height: 36px;
}
.excel-grid-title {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    color: #605e5c;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    text-align: left;
}
.excel-grid-title.sorted {
    color: #0078d4;
    font-weight: 600;
}
.excel-grid-filter-btn {
    border: none;
    background: transparent;
    padding: 2px 4px;
    color: #8a8886;
    cursor: pointer;
    line-height: 1;
    border-radius: 3px;
}
.excel-grid-filter-btn:hover,
.excel-grid-filter-btn.active {
    color: #0078d4;
    background: #f3f2f1;
}
.excel-grid-filter-panel {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    min-width: 220px;
    max-width: 280px;
    background: #fff;
    border: 1px solid #d2d0ce;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    border-radius: 4px;
    padding: 6px 0;
}
.excel-grid-filter-action {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: none;
    background: transparent;
    padding: 7px 12px;
    font-size: 12px;
    color: #323130;
    text-align: left;
    cursor: pointer;
}
.excel-grid-filter-action:hover {
    background: #f3f2f1;
}
.excel-grid-filter-divider {
    height: 1px;
    background: #edebe9;
    margin: 4px 0;
}
.excel-grid-filter-search {
    width: calc(100% - 16px);
    margin: 4px 8px 6px;
    font-size: 12px;
    height: 28px;
}
.excel-grid-filter-values {
    max-height: 200px;
    overflow-y: auto;
    padding: 0 8px;
}
.excel-grid-filter-value {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px;
    font-size: 12px;
    color: #323130;
    cursor: pointer;
    margin: 0;
}
.excel-grid-filter-value.select-all {
    font-weight: 600;
    border-bottom: 1px solid #edebe9;
    margin-bottom: 4px;
    padding-bottom: 6px;
}
.excel-grid-filter-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 8px 2px;
    border-top: 1px solid #edebe9;
    margin-top: 6px;
}
.layoff-pool-container-search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid #edebe9;
    background: #faf9f8;
}
.layoff-pool-container-search .cmf-field {
    width: 220px;
    height: 30px;
}

/* MNR Operations Dashboard */
.ops-kpi-card {
    text-align: left;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.ops-kpi-card:hover {
    box-shadow: 0 10px 22px rgba(31, 41, 55, 0.1);
}
.ops-kpi-card.ops-kpi-active {
    border-color: #0078d4;
    box-shadow: 0 0 0 1px #0078d4;
}
.ops-work-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    white-space: nowrap;
}
.ops-work-status--queued {
    background: #edebe9;
    color: #323130;
}
.ops-work-status--grounded {
    background: #0078d4;
    color: #fff;
}
.ops-work-status--in-progress {
    background: #107c10;
    color: #fff;
}
.ops-work-status--on-hold {
    background: #d83b01;
    color: #fff;
}
.ops-work-status--completed {
    background: #498205;
    color: #fff;
}
.ops-progress-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 90px;
}
.ops-progress-bar {
    flex: 1;
    max-width: 72px;
    height: 6px;
    background: #edebe9;
    border-radius: 999px;
    overflow: hidden;
}
.ops-progress-fill {
    height: 100%;
    background: #0078d4;
    border-radius: 999px;
}

/* Foreman lay-off grounding (tablet / mobile web) */
.layoff-grounding-mobile {
    max-width: 520px;
    margin: 0 auto;
    min-height: calc(100vh - 48px);
    background: #f5f7fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding-bottom: 24px;
}
.layoff-grounding-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #0078d4;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
}
.layoff-grounding-topbar-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 17px;
    line-height: 1.2;
}
.layoff-grounding-topbar-title small {
    font-weight: 400;
    font-size: 12px;
    opacity: 0.9;
}
.layoff-grounding-icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.layoff-grounding-body {
    padding: 16px;
}
.layoff-grounding-hint {
    font-size: 14px;
    color: #605e5c;
    margin: 0 16px 12px;
    line-height: 1.45;
}
.layoff-grounding-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px 16px;
}
.layoff-grounding-stats > div {
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.layoff-grounding-stats .stat-num {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #323130;
}
.layoff-grounding-stats .stat-lbl {
    font-size: 10px;
    text-transform: uppercase;
    color: #888;
}
.layoff-grounding-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
}
.layoff-grounding-tab {
    flex: 1;
    border: none;
    background: #fff;
    color: #605e5c;
    padding: 12px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.layoff-grounding-tab.active {
    background: #0078d4;
    color: #fff;
}
.layoff-grounding-panel {
    padding: 0 16px 16px;
}
.layoff-grounding-primary-btn,
.layoff-grounding-secondary-btn,
.layoff-grounding-file-btn {
    display: block;
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    margin-bottom: 10px;
}
.layoff-grounding-primary-btn {
    background: #0078d4;
    color: #fff;
}
.layoff-grounding-secondary-btn {
    background: #fff;
    color: #605e5c;
    border: 1px solid #edebe9;
}
.layoff-grounding-file-btn {
    background: #fff;
    color: #0078d4;
    border: 2px dashed #0078d4;
}
.layoff-grounding-camera-wrap {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}
.layoff-grounding-video {
    width: 100%;
    display: block;
    max-height: 360px;
    object-fit: cover;
}
.layoff-grounding-ocr-box {
    margin-top: 12px;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.layoff-grounding-ocr-box pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    margin: 0;
    color: #323130;
}
.layoff-grounding-list-card,
.layoff-grounding-container-card {
    width: 100%;
    text-align: left;
    background: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}
.layoff-grounding-list-card:hover,
.layoff-grounding-container-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.layoff-grounding-list-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.layoff-grounding-list-no {
    font-weight: 700;
    font-size: 16px;
    color: #323130;
}
.layoff-grounding-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #deecf9;
    color: #0078d4;
    font-weight: 600;
}
.layoff-grounding-list-card-meta,
.layoff-grounding-list-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #605e5c;
}
.layoff-grounding-list-card-stats {
    margin-top: 8px;
}
.layoff-grounding-container-no {
    font-size: 18px;
    font-weight: 700;
    color: #0078d4;
    letter-spacing: 0.5px;
}
.layoff-grounding-container-meta {
    font-size: 13px;
    color: #605e5c;
    margin-top: 4px;
}
.layoff-grounding-container-action {
    font-size: 12px;
    color: #0078d4;
    margin-top: 8px;
    font-weight: 600;
}
.layoff-grounding-loading,
.layoff-grounding-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 16px;
    color: #888;
    text-align: center;
}
.layoff-grounding-empty i {
    font-size: 40px;
    color: #0078d4;
}
.layoff-grounding-confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
}
.layoff-grounding-confirm-card {
    background: #fff;
    border-radius: 16px 16px 12px 12px;
    padding: 20px;
    width: 100%;
    max-width: 480px;
}
.layoff-grounding-confirm-no {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #0078d4;
    margin-bottom: 12px;
}
.layoff-grounding-toast {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 488px;
    margin: 0 auto;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 600;
    z-index: 1100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.layoff-grounding-toast.success {
    background: #dff6dd;
    color: #107c10;
}
.layoff-grounding-toast.error {
    background: #fde7e9;
    color: #a80000;
}

/* Full-width mobile chrome for field/tablet pages */
.mobile-field-chrome .d365-header,
.mobile-field-chrome .d365-sidebar {
    display: none;
}
.mobile-field-chrome .d365-app-container {
    min-height: 100vh;
}
.mobile-field-chrome .d365-main-content {
    padding: 0;
    min-height: 100vh;
}
.layoff-grounding-mobile.field-route .layoff-grounding-topbar {
    background: #059669;
}
.layoff-grounding-mobile.field-route .layoff-grounding-primary-btn,
.layoff-grounding-mobile.field-route .layoff-grounding-tab.active {
    background: #059669;
}
.layoff-grounding-mobile.field-route .layoff-grounding-file-btn {
    color: #059669;
    border-color: #059669;
}
.layoff-grounding-mobile.field-route .layoff-grounding-container-no,
.layoff-grounding-mobile.field-route .layoff-grounding-container-action,
.layoff-grounding-mobile.field-route .layoff-grounding-confirm-no {
    color: #059669;
}

.layoff-grounding-suggest-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: #ecfdf5;
    border: 2px solid #059669;
    color: #065f46;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
    cursor: pointer;
}

/* Continue Mode toggle (command bar) - shared with CMF / RO */
.cmf-command-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-width: 92px;
}

.cmf-command-toggle-label {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: #4b5563;
    cursor: pointer;
}

.cmf-switch {
    position: relative;
    display: inline-flex;
    width: 30px;
    height: 16px;
    cursor: pointer;
}

.cmf-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cmf-switch-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 999px;
    transition: all 0.15s ease;
}

.cmf-switch-slider::before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    left: 2px;
    top: 2px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: all 0.15s ease;
}

.cmf-switch input:checked + .cmf-switch-slider {
    background: var(--d365-primary);
}

.cmf-switch input:checked + .cmf-switch-slider::before {
    transform: translateX(14px);
}

.cmf-switch input:disabled + .cmf-switch-slider {
    opacity: 0.55;
    cursor: not-allowed;
}

.cmf-switch input:focus-visible + .cmf-switch-slider {
    outline: 2px solid rgba(34, 102, 227, 0.25);
    outline-offset: 2px;
}

/* ============================
   Common Coding — Entity Toolbar (global, not scoped)
   Moved here so layout survives Blazor scoped CSS re-bundling.
   ============================ */

.common-coding-form > .row > .common-coding-entity-toolbar-col {
    align-self: start !important;
}

.common-coding-entity-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: 36px !important;
    align-items: center !important;
    column-gap: 12px !important;
    width: 100% !important;
    min-height: 36px !important;
    max-height: 36px !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 0 4px !important;
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
}

.common-coding-entity-toolbar-types {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    height: 36px !important;
    overflow: hidden !important;
}

.common-coding-entity-toolbar-label {
    flex: 0 0 auto !important;
    display: inline-block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #333 !important;
    white-space: nowrap !important;
    line-height: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 4px 0 0 !important;
    text-transform: none !important;
}

.common-coding-entity-toolbar-chips {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    height: 36px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin !important;
}

/* Chip — override Bootstrap label{display:inline-block} permanently */
label.common-coding-party-type-chip {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0 10px !important;
    margin: 0 !important;
    border: 1px solid #bfc5cb !important;
    border-radius: 2px !important;
    background: #fff !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    color: #212529 !important;
    cursor: pointer !important;
    user-select: none !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    text-transform: none !important;
    float: none !important;
    vertical-align: middle !important;
}

label.common-coding-party-type-chip.is-checked {
    border-color: #0d6efd !important;
    background: #eef5ff !important;
}

label.common-coding-party-type-chip input[type="checkbox"] {
    width: 13px !important;
    height: 13px !important;
    min-width: 13px !important;
    min-height: 13px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 auto !important;
    cursor: pointer !important;
    accent-color: #0d6efd !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    float: none !important;
    display: inline-block !important;
    opacity: 1 !important;
    vertical-align: middle !important;
}

.common-coding-party-type-chip-text {
    display: inline-block !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-transform: none !important;
    vertical-align: middle !important;
}

label.common-coding-party-type-chip:has(input:disabled) {
    opacity: 0.7 !important;
    cursor: default !important;
}

/* Status toggle — pinned right column, no capsule border/bg */
.common-coding-entity-toolbar-status {
    grid-column: 2 !important;
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    white-space: nowrap !important;
}

.common-coding-entity-toolbar-status.is-active {
    border: none !important;
    background: transparent !important;
}

.common-coding-entity-toolbar-status.is-inactive {
    border: none !important;
    background: transparent !important;
}

.common-coding-entity-toolbar-status-text {
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    min-width: 3.25rem !important;
    text-align: right !important;
    text-transform: none !important;
}

.common-coding-entity-toolbar-status.is-active .common-coding-entity-toolbar-status-text {
    color: #198754 !important;
}

.common-coding-entity-toolbar-status.is-inactive .common-coding-entity-toolbar-status-text {
    color: #6c757d !important;
}

/* Custom switch */
.common-coding-entity-toolbar-switch {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    width: 36px !important;
    height: 20px !important;
    margin: 0 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

.common-coding-entity-toolbar-switch input {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
}

.common-coding-entity-toolbar-switch-track {
    display: block !important;
    width: 36px !important;
    height: 20px !important;
    border-radius: 10px !important;
    background: #adb5bd !important;
    transition: background 0.15s ease !important;
    position: relative !important;
}

.common-coding-entity-toolbar-switch-track::after {
    content: "" !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: #fff !important;
    transition: transform 0.15s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.common-coding-entity-toolbar-switch input:checked + .common-coding-entity-toolbar-switch-track {
    background: #198754 !important;
}

.common-coding-entity-toolbar-switch input:checked + .common-coding-entity-toolbar-switch-track::after {
    transform: translateX(16px) !important;
}

.common-coding-entity-toolbar-switch input:disabled + .common-coding-entity-toolbar-switch-track {
    opacity: 0.55 !important;
    cursor: default !important;
}

.common-coding-manual-code-check {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #495057 !important;
    margin: 0 0 2px !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    line-height: 1 !important;
    text-transform: none !important;
}

.common-coding-manual-code-check input {
    width: 13px !important;
    height: 13px !important;
    margin: 0 !important;
}

.common-coding-code-block {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    max-width: 5.5rem !important;
}

.common-coding-code-block .cmf-label {
    margin-bottom: 0.25rem !important;
}

.common-coding-code-block .cmf-field-id {
    max-width: 5rem !important;
    width: 5rem !important;
    text-align: center !important;
}

/* Name: DB max is 50 chars; field width = longest + small buffer */
.common-coding-name-block {
    max-width: 52ch !important;
    width: 52ch !important;
}

.common-coding-name-block .cmf-field {
    width: 100% !important;
    max-width: 52ch !important;
}

.common-coding-zone-block .cmf-field {
    max-width: 14rem !important;
    width: 100% !important;
}

