.fi-header-heading {
    color: #006400 !important;
}

.dark .fi-header-heading {
    color: #86efac !important;
}

.fi-section-header .seafarer-move-to-sea-service-action {
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}

.fi-section-header .seafarer-move-to-sea-service-action:hover {
    text-decoration: underline;
}

.fi-section-header {
    background-color: rgba(0, 100, 0, 0.06) !important;
    border-bottom: 2px solid rgba(0, 100, 0, 0.15) !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.fi-section-header-heading {
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
}

.dark .fi-section-header {
    background-color: rgba(0, 100, 0, 0.12) !important;
    border-bottom: 2px solid rgba(0, 100, 0, 0.25) !important;
}

#floating-save-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50;
    display: none;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.5rem;
    color: #ffffff;
    background-color: #006400;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

#floating-save-btn .floating-save-icon,
#floating-save-btn .floating-save-spinner {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

#floating-save-btn .floating-save-spinner {
    display: none;
    animation: floating-spin 0.8s linear infinite;
}

#floating-save-btn:hover {
    background-color: #007800;
}

#floating-save-btn:active {
    background-color: #005000;
}

#floating-save-btn:focus-visible {
    outline: 2px solid #006400;
    outline-offset: 2px;
}

#floating-save-btn.saving {
    background-color: #339933;
    pointer-events: none;
}

#floating-save-btn.saving .floating-save-icon {
    display: none;
}

#floating-save-btn.saving .floating-save-spinner {
    display: block;
}

#floating-save-btn.saved {
    background-color: #15803d;
    box-shadow: 0 4px 16px rgba(21, 128, 61, 0.35);
}

/* Toast notifications: top center (keeps them away from the floating save button) */
.fi-no {
    top: 1rem !important;
    right: auto !important;
    bottom: auto !important;
    left: 50% !important;
    transform: translateX(-50%);
    width: min(24rem, calc(100vw - 2rem));
    margin: 0 !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
}

@keyframes floating-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fi-fo-file-upload:not(.fi-fo-file-upload-avatar):not(.seafarer-photo):not(.person-photo-upload) .filepond--root {
    min-height: 3rem !important;
    max-height: 4.5rem !important;
}

.fi-fo-file-upload:not(.fi-fo-file-upload-avatar):not(.seafarer-photo):not(.person-photo-upload) .filepond--root .filepond--drop-label {
    min-height: 2.5rem !important;
}

.fi-fo-file-upload:not(.fi-fo-file-upload-avatar):not(.seafarer-photo):not(.person-photo-upload) .filepond--root .filepond--drop-label label {
    font-size: 0.75rem !important;
}

[data-repeater-item] + [data-repeater-item] {
    border-top: 2px solid rgba(0, 100, 0, 0.15) !important;
    padding-top: 0.75rem !important;
    margin-top: 0.25rem !important;
}

.dark [data-repeater-item] + [data-repeater-item] {
    border-top: 2px solid rgba(0, 100, 0, 0.3) !important;
}

/* Sea Service table - horizontal scroll */
.fi-fo-repeater.sea-service-table > div {
    overflow-x: auto !important;
}

.fi-fo-repeater.sea-service-table table {
    min-width: 2160px !important;
}

.fi-fo-repeater.sea-service-table table th,
.fi-fo-repeater.sea-service-table table td {
    min-width: 0 !important;
    white-space: nowrap;
    padding: 0.15rem 0.3rem !important;
    vertical-align: middle !important;
    overflow: visible !important;
    text-overflow: unset !important;
}

.fi-fo-repeater.sea-service-table table th {
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
    color: rgba(0, 100, 0, 0.7) !important;
}

.dark .fi-fo-repeater.sea-service-table table th {
    color: rgba(134, 239, 172, 0.7) !important;
}

.fi-fo-repeater.sea-service-table .fi-fo-text-input input {
    font-size: 0.65rem !important;
    padding: 0.15rem 0.25rem !important;
    height: auto !important;
    min-height: 1.4rem !important;
    line-height: 1.2 !important;
    overflow: visible !important;
    text-overflow: unset !important;
}

.fi-fo-repeater.sea-service-table [data-field-wrapper] {
    gap: 0 !important;
}

.fi-fo-repeater.sea-service-table .fi-fo-field-wrp {
    gap: 0 !important;
}

/* Smaller action buttons in table */
.fi-fo-repeater.sea-service-table .fi-fo-repeater-item-actions button {
    padding: 0.2rem !important;
}

.fi-fo-repeater.sea-service-table .fi-fo-repeater-item-actions svg {
    width: 0.9rem !important;
    height: 0.9rem !important;
}

/* Sidebar animation and styling */
.fi-sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.fi-sidebar nav {
    transition: opacity 0.2s ease, transform 0.2s ease !important;
}

.fi-sidebar-nav-collapse-btn {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.2s ease !important;
}

.fi-sidebar-nav-collapse-btn:hover {
    background-color: rgba(0, 100, 0, 0.08) !important;
    border-radius: 0.5rem !important;
}

.dark .fi-sidebar-nav-collapse-btn:hover {
    background-color: rgba(134, 239, 172, 0.1) !important;
}

.fi-main {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.fi-sidebar-item {
    transition: padding 0.2s ease, opacity 0.2s ease !important;
}

.fi-sidebar-item-label {
    transition: opacity 0.2s ease, transform 0.2s ease !important;
}

.fi-sidebar-item-icon {
    transition: margin 0.2s ease !important;
}

.fi-topbar {
    transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Person photo upload - 3:4 portrait card. Size only the FilePond root;
   do not force inner canvas/preview boxes or the image sits off-center. */
.person-photo-upload {
    width: 204px;
    max-width: 100%;
}

.person-photo-upload .fi-fo-file-upload {
    width: 204px;
    max-width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.person-photo-upload .filepond--root {
    width: 180px !important;
    height: 240px !important;
    min-height: 240px !important;
    max-height: 240px !important;
    max-width: 100%;
    margin: 0 auto !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    font-family: inherit;
}

.person-photo-upload .filepond--drop-label,
.person-photo-upload .filepond--list-scroller,
.person-photo-upload .filepond--list,
.person-photo-upload .filepond--item,
.person-photo-upload .filepond--file-wrapper,
.person-photo-upload .filepond--file,
.person-photo-upload .filepond--panel,
.person-photo-upload .filepond--panel-root {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    border-radius: 12px !important;
}

.person-photo-upload .filepond--panel-root {
    background-color: #f1f5f9 !important;
}

.person-photo-upload .filepond--image-preview-wrapper,
.person-photo-upload .filepond--image-preview {
    background: #f1f5f9 !important;
}

.person-photo-upload .filepond--image-preview-overlay {
    display: none !important;
}

.person-photo-upload .filepond--image-clip {
    inset: 0 !important;
}

.person-photo-upload .filepond--image-bitmap,
.person-photo-upload .filepond--image-preview canvas {
    object-fit: cover !important;
    object-position: center center !important;
}

.person-photo-upload .filepond--drop-label {
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.75rem;
}

.person-photo-upload .filepond--drop-label label {
    line-height: 1.35;
    padding: 0 8px;
}

.person-photo-table-thumb {
    width: 39px !important;
    height: 52px !important;
    max-width: 39px !important;
    max-height: 52px !important;
    min-width: 39px !important;
    min-height: 52px !important;
    border-radius: 8px !important;
    object-fit: cover !important;
    object-position: center top !important;
    display: block !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    background: #f1f5f9;
}

.fi-ta-image:has(img.person-photo-table-thumb) {
    width: 39px !important;
    max-width: 39px !important;
    flex: 0 0 39px !important;
}

/* Legacy class kept for older cached markup */
.seafarer-photo .filepond--image-preview-overlay {
    display: none !important;
}

.seafarer-photo .filepond--image-preview-wrapper,
.seafarer-photo .filepond--image-preview {
    background: transparent !important;
}

.seafarer-photo .filepond--panel-root {
    background-color: transparent !important;
}

.seafarer-photo .filepond--file {
    background: transparent !important;
}

.seafarer-photo .filepond--item-panel {
    background: transparent !important;
}

/* Match Seafarer photo style: do not "crop to fill", keep full image visible. */
.seafarer-photo .filepond--image-preview {
    background-size: contain !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

/* Working Clothes Form - Print Styles */
@media print {
    .fi-sidebar, .fi-topbar, .fi-header, .fi-tabs-nav, #floating-save-btn,
    .fi-sc-form > *:not(.working-clothes-document) { display: none !important; }
    .working-clothes-document { border: none !important; box-shadow: none !important; }
    body { background: white !important; }
}

/* Ensure Filament content can truly use full width */
.fi-main,
.fi-main-ctn,
.fi-page,
.fi-page-content,
.fi-page-body,
.fi-page-header {
    max-width: 100% !important;
}

/* Filament uses an inner container with max-width (e.g. max-w-7xl). Remove it. */
.fi-container {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.fi-main-ctn > .fi-container,
.fi-page > .fi-container,
.fi-page-content > .fi-container {
    max-width: 100% !important;
    width: 100% !important;
}

/* Filament pages often use Tailwind max-w-* utilities for the inner container. Override them in-panel. */
.fi-main .max-w-5xl,
.fi-main .max-w-6xl,
.fi-main .max-w-7xl,
.fi-main .max-w-screen-xl,
.fi-main .max-w-screen-2xl {
    max-width: 100% !important;
}

/* Also override smaller max-w-* that Filament uses on resource pages */
.fi-main .max-w-xs,
.fi-main .max-w-sm,
.fi-main .max-w-md,
.fi-main .max-w-lg,
.fi-main .max-w-xl,
.fi-main .max-w-2xl,
.fi-main .max-w-3xl,
.fi-main .max-w-4xl {
    max-width: 100% !important;
    width: 100% !important;
}

/* Absolute fallback: any Tailwind max-w-* inside page content */
.fi-main .fi-page [class*="max-w-"] {
    max-width: 100% !important;
}

/* If an inner wrapper is centered (mx-auto), it can still look "narrow".
   Only neutralize this inside Filament page content. */
.fi-main .fi-page .mx-auto,
.fi-main .fi-page-content .mx-auto,
.fi-main .fi-page-body .mx-auto {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Ensure max-w wrappers actually stretch. */
.fi-main .fi-page [class*="max-w-"],
.fi-main .fi-page-content [class*="max-w-"],
.fi-main .fi-page-body [class*="max-w-"] {
    width: 100% !important;
}

/* Last-resort: Filament sometimes constrains the form wrapper itself */
.fi-main .fi-sc-form,
.fi-main form.fi-sc-form,
.fi-main .fi-sc-form > div,
.fi-main .fi-sc-form .fi-sc,
.fi-main .fi-sc-form .fi-sc-component,
.fi-main .fi-page-content-ctn,
.fi-main .fi-page-content-ctn > div {
    max-width: none !important;
    width: 100% !important;
}

/* Filament "contained" layouts (tabs, widgets) can hard-cap width ~52rem. */
.fi-main .fi-contained,
.fi-main .fi-sc-tabs.fi-contained,
.fi-main .fi-tabs.fi-contained,
.fi-main .fi-section.fi-contained,
.fi-main .fi-wi.fi-contained {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    align-self: stretch !important;
}

/* Tabs containers can still be constrained even when not marked `fi-contained`. */
.fi-main .fi-sc-tabs,
.fi-main .fi-tabs,
.fi-main .fi-sc-tabs-tab,
.fi-main .fi-sc-tabs-tab > div {
    max-width: 100% !important;
    width: 100% !important;
}

/* Extra hardening for Applicant/Seafarer-like forms with Tabs:
   Filament may apply centering/gaps on the schema container, even after removing max-width. */
.fi-main .fi-sc-tabs.fi-contained,
.fi-main nav.fi-tabs.fi-contained {
    justify-content: flex-start !important;
}

.fi-main .fi-sc-tabs.fi-contained > *:not(nav.fi-tabs) {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

/* Tab bar: keep natural pill width; scroll instead of squashing labels */
.fi-main nav.fi-tabs,
.fi-main nav.fi-tabs.fi-contained {
    overflow-x: auto !important;
    overflow-y: hidden;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.fi-main nav.fi-tabs .fi-tabs-item {
    flex: 0 0 auto !important;
    min-width: max-content !important;
}

/* Some pages center the content via flex/grid on the page content container. Force stretch. */
.fi-main .fi-page-content-ctn,
.fi-main .fi-page-content,
.fi-main .fi-page-body {
    justify-content: stretch !important;
    align-items: stretch !important;
}

.fi-main .fi-page-content-ctn > *,
.fi-main .fi-page-content > *,
.fi-main .fi-page-body > * {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

/* Seafarer profile: expiring document dates in table repeaters */
.fi-fo-table-repeater .document-expiry-field--soon .fi-input,
.fi-fo-table-repeater input.document-expiry-soon {
    color: #c2410c !important;
    font-weight: 600 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    --tw-ring-color: transparent !important;
}

.fi-fo-table-repeater .document-expiry-field--past .fi-input,
.fi-fo-table-repeater input.document-expiry-past {
    color: #dc2626 !important;
    font-weight: 600 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    --tw-ring-color: transparent !important;
}

.fi-fo-table-repeater .document-expiry-field .fi-input-wrp {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    --tw-ring-shadow: 0 0 #0000 !important;
}

/* Edit slide-overs */
.fi-modal .document-expiry-field--soon .fi-input,
.fi-modal input.document-expiry-soon {
    color: #c2410c !important;
    font-weight: 600 !important;
    border-left: 3px solid #f59e0b !important;
    padding-left: 0.5rem !important;
}

.fi-modal .document-expiry-field--past .fi-input,
.fi-modal input.document-expiry-past {
    color: #dc2626 !important;
    font-weight: 600 !important;
    border-left: 3px solid #ef4444 !important;
    padding-left: 0.5rem !important;
}

/* Crew Expenses Record — include / not include indicator */
.evidence-inclusion-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
}

.evidence-inclusion-dot--include {
    background-color: #16a34a;
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.25);
}

.evidence-inclusion-dot--not-include {
    background-color: #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.25);
}
