/* Cablingpro Reporting — Industrial field service UI */

:root {
    --fp-navy: #0f172a;
    --fp-navy-light: #1e293b;
    --fp-blue: #2563eb;
    --fp-blue-dark: #1d4ed8;
    --fp-gray-50: #f8fafc;
    --fp-gray-100: #f1f5f9;
    --fp-gray-200: #e2e8f0;
    --fp-gray-300: #cbd5e1;
    --fp-gray-500: #64748b;
    --fp-gray-700: #334155;
    --fp-gray-900: #0f172a;
    --fp-success: #22c55e;
    --fp-warning: #f59e0b;
    --fp-danger: #ef4444;
    --fp-critical: #7c3aed;
    --fp-sidebar-w: 240px;
    --fp-topbar-h: 64px;
    --fp-radius: 8px;
    --fp-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --fp-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.fp-app {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--fp-gray-700);
    background: var(--fp-gray-100);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    text-decoration: none;
}

/* Shell layout */
.fp-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.fp-sidebar {
    width: var(--fp-sidebar-w);
    background: var(--fp-navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.2s, margin 0.2s;
    z-index: 100;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
}

.fp-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fp-logo-icon {
    font-size: 28px;
    color: var(--fp-blue);
}

.fp-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.fp-logo-text strong {
    font-size: 15px;
    letter-spacing: 0.05em;
}

.fp-logo-text span {
    font-size: 10px;
    opacity: 0.7;
    letter-spacing: 0.1em;
}

.fp-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.fp-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    border-radius: var(--fp-radius);
    margin-bottom: 2px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.fp-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.fp-nav-item.fp-nav-active {
    background: rgba(37, 99, 235, 0.25);
    color: #fff;
}

.fp-nav-item .material-symbols-outlined {
    font-size: 22px;
    opacity: 0.9;
}

.fp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    margin-left: auto;
}

.fp-badge-blue {
    background: var(--fp-blue);
    color: #fff;
}

.fp-badge-urgent {
    background: var(--fp-danger);
    color: #fff;
}

.fp-badge-high {
    background: #fef2f2;
    color: var(--fp-danger);
    border: 1px solid #fecaca;
}

.fp-badge-pending {
    background: var(--fp-gray-100);
    color: var(--fp-gray-500);
}

.fp-badge-review {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fcd34d;
}

.fp-sidebar-status {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--fp-navy);
    font-size: 12px;
    flex-shrink: 0;
}

.fp-status-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.fp-status-row strong {
    display: block;
    font-size: 12px;
}

.fp-status-row span {
    opacity: 0.7;
    font-size: 11px;
}

.fp-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.fp-status-online {
    background: var(--fp-success);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.fp-storage-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    opacity: 0.8;
}

.fp-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.fp-progress-fill {
    height: 100%;
    background: var(--fp-blue);
    border-radius: 3px;
    transition: width 0.3s;
}

.fp-progress-green {
    background: var(--fp-success);
}

/* Main area */
.fp-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.fp-topbar {
    height: var(--fp-topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--fp-gray-200);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.fp-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    border-radius: var(--fp-radius);
    cursor: pointer;
    color: var(--fp-gray-700);
    position: relative;
}

.fp-btn-icon:hover {
    background: var(--fp-gray-100);
}

.fp-has-badge .fp-notif-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--fp-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-search {
    position: relative;
    flex: 1;
    max-width: 480px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--fp-gray-100);
    border-radius: var(--fp-radius);
    padding: 0 14px;
    height: 44px;
}

.fp-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    min-width: 0;
}

.fp-search>.material-symbols-outlined {
    color: var(--fp-gray-500);
    font-size: 20px;
    flex-shrink: 0;
}

.fp-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 100;
    max-height: min(70vh, 420px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--fp-gray-200);
    border-radius: var(--fp-radius);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    padding: 6px 0;
}

.fp-search-group-label {
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fp-gray-500);
}

.fp-search-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: var(--fp-gray-700);
    font: inherit;
}

.fp-search-option:hover,
.fp-search-option.is-active {
    background: var(--fp-gray-50);
}

.fp-search-option-icon {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--fp-gray-500);
}

.fp-search-option-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fp-search-option-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-search-option-sub {
    font-size: 12px;
    color: var(--fp-gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-search-type-badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--fp-gray-500);
    background: var(--fp-gray-100);
    border-radius: 999px;
    padding: 2px 8px;
}

.fp-search-empty {
    padding: 16px 14px;
    font-size: 14px;
    color: var(--fp-gray-500);
    text-align: center;
}

@media (max-width: 768px) {
    .fp-search {
        max-width: none;
    }

    .fp-search-results {
        left: -8px;
        right: -8px;
        max-height: min(60vh, 360px);
    }
}

.fp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.fp-offline-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--fp-gray-500);
    padding: 0 8px;
}

.fp-offline-pill small {
    opacity: 0.8;
}

.fp-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
    border-left: 1px solid var(--fp-gray-200);
}

.fp-user img {
    border-radius: 50%;
    object-fit: cover;
}

.fp-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--fp-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fp-gray-500);
    flex-shrink: 0;
}

.fp-logout-btn {
    padding: 6px 8px;
    min-width: 36px;
    min-height: 36px;
}

.fp-logout-btn .material-symbols-outlined {
    font-size: 20px;
}

.fp-user strong {
    display: block;
    font-size: 13px;
    color: var(--fp-gray-900);
}

.fp-user span {
    font-size: 11px;
    color: var(--fp-gray-500);
}

.fp-content-wrap {
    flex: 1;
    padding: 20px;
    padding-bottom: 88px;
    overflow-x: hidden;
}

/* Report layout */
.fp-report-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

.fp-report-main {
    min-width: 0;
}

.fp-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--fp-blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
}

.fp-back-link:hover {
    text-decoration: underline;
}

.fp-report-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.fp-wo-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.fp-wo-id {
    font-weight: 600;
    color: var(--fp-gray-900);
}

.fp-wo-location {
    color: var(--fp-gray-500);
    font-size: 13px;
}

.fp-wo-pps-sc {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--fp-danger);
    font-size: 13px;
    font-weight: 600;
}

.fp-job-title {
    font-weight: 700;
    color: var(--fp-gray-900);
    font-size: 15px;
    letter-spacing: 0.01em;
}

.fp-job-pps-sc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    color: var(--fp-danger);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.fp-report-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--fp-gray-900);
    line-height: 1.3;
}

.fp-report-status-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.fp-status-field label {
    display: block;
    font-size: 11px;
    color: var(--fp-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.fp-status-field span {
    font-size: 13px;
    font-weight: 500;
}

.fp-progress-ring {
    position: relative;
    width: 56px;
    height: 56px;
}

.fp-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.fp-ring-bg {
    fill: none;
    stroke: var(--fp-gray-200);
    stroke-width: 3;
}

.fp-ring-fill {
    fill: none;
    stroke: var(--fp-blue);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.3s;
}

.fp-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--fp-gray-900);
}

/* Cards */
.fp-card {
    background: #fff;
    border: 1px solid var(--fp-gray-200);
    border-radius: var(--fp-radius);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--fp-shadow);
}

.fp-card h3 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fp-gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.fp-card h3 .material-symbols-outlined {
    font-size: 20px;
    color: var(--fp-gray-500);
}

.fp-card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.fp-card-header-row h3 {
    margin: 0;
}

/* Per-card edit mode */
.fp-editable-card .fp-card-edit-btn {
    flex-shrink: 0;
}

.fp-editable-card.fp-card-editing .fp-card-edit-btn {
    display: none;
}

.fp-editable-card.fp-card-editing .fp-card-view {
    display: none;
}

.fp-header-card .fp-card-header-row {
    align-items: flex-start;
}

.fp-header-card .fp-report-title-row {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    margin-bottom: 0;
}

.fp-report-title-row-full {
    flex: 1;
    min-width: 0;
}

.fp-card-edit .fp-label:first-child {
    margin-top: 0;
}

.fp-card-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--fp-gray-200, #e2e8f0);
}

.fp-direct-edit-card h3 {
    margin: 0 0 14px;
    font-size: 1rem;
}

.fp-direct-edit-card .fp-severity-group {
    margin-bottom: 12px;
}

.fp-direct-edit-card .fp-card-edit-actions {
    border-top: none;
    padding-top: 0;
    margin-top: 12px;
}

.fp-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.fp-info-card p {
    margin: 0 0 6px;
    font-size: 13px;
}

.fp-asset-row,
.fp-tech-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.fp-asset-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.fp-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

/* Form grid */
.fp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.fp-form-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.fp-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--fp-gray-700);
    margin-bottom: 6px;
}

.fp-input,
.fp-select,
.fp-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--fp-gray-200);
    border-radius: var(--fp-radius);
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
}

.fp-select-block {
    margin-bottom: 10px;
}

.fp-textarea {
    resize: vertical;
    min-height: 80px;
}

.fp-char-count {
    font-size: 11px;
    color: var(--fp-gray-500);
}

/* Checklist */
.fp-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fp-checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--fp-gray-100);
    font-size: 13px;
}

.fp-checklist-item.fp-done .fp-check-icon {
    color: var(--fp-success);
}

.fp-checklist-item.fp-pending .fp-check-icon {
    color: var(--fp-gray-300);
}

.fp-check-status {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.fp-checklist-item.fp-done .fp-check-status {
    color: var(--fp-success);
}

.fp-checklist-item.fp-pending .fp-check-status {
    color: var(--fp-gray-500);
}

.fp-checklist-progress {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.fp-checklist-progress .fp-progress-bar {
    flex: 1;
    background: var(--fp-gray-200);
}

.fp-checklist-progress span {
    font-size: 12px;
    color: var(--fp-gray-500);
    white-space: nowrap;
}

/* Severity */
.fp-severity-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.fp-severity-btn {
    padding: 14px 8px;
    border: 2px solid var(--fp-gray-200);
    border-radius: var(--fp-radius);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 48px;
}

.fp-sev-low {
    color: var(--fp-blue);
}

.fp-sev-medium {
    color: var(--fp-warning);
}

.fp-sev-high {
    color: var(--fp-danger);
}

.fp-sev-critical {
    color: var(--fp-critical);
}

.fp-severity-btn:hover {
    border-color: currentColor;
    opacity: 0.9;
}

.fp-severity-btn.fp-active.fp-sev-low {
    background: #eff6ff;
    border-color: var(--fp-blue);
}

.fp-severity-btn.fp-active.fp-sev-medium {
    background: #fffbeb;
    border-color: var(--fp-warning);
}

.fp-severity-btn.fp-active.fp-sev-high {
    background: #fef2f2;
    border-color: var(--fp-danger);
}

.fp-severity-btn.fp-active.fp-sev-critical {
    background: #f5f3ff;
    border-color: var(--fp-critical);
}

/* Photos */
.fp-photo-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.fp-photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fp-photo-thumb {
    position: relative;
    width: 100px;
    height: 75px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--fp-gray-200);
}

.fp-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fp-photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.fp-photo-remove .material-symbols-outlined {
    font-size: 16px;
}

.fp-photo-add {
    width: 100px;
    height: 75px;
    border: 2px dashed var(--fp-gray-300);
    border-radius: 6px;
    background: var(--fp-gray-50);
    color: var(--fp-gray-500);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.fp-photo-add:hover {
    border-color: var(--fp-blue);
    color: var(--fp-blue);
}

.fp-photo-dropzone {
    width: 160px;
    min-height: 96px;
    height: auto;
    padding: 10px 8px;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.fp-photo-dropzone .material-symbols-outlined {
    font-size: 28px;
    line-height: 1;
}

.fp-photo-dropzone-label {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

.fp-photo-dropzone-hint {
    font-size: 10px;
    line-height: 1.2;
    color: var(--fp-gray-500);
}

.fp-photo-dropzone.is-dragover {
    border-color: var(--fp-blue);
    background: rgba(37, 99, 235, 0.08);
    color: var(--fp-blue);
}

.fp-photo-grid.is-uploading .fp-photo-dropzone {
    opacity: 0.6;
    pointer-events: none;
}

/* Dense photo grid — charge cost section (drag-sort, mixed orientation) */
.fp-photo-grid-dense {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.fp-photo-grid-dense .fp-photo-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    cursor: grab;
    touch-action: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fp-photo-grid-dense .fp-photo-thumb:hover {
    border-color: var(--fp-blue);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.fp-photo-grid-dense .fp-photo-thumb.fp-photo-chosen,
.fp-photo-grid-dense .fp-photo-thumb:active {
    cursor: grabbing;
}

.fp-photo-grid-dense .fp-photo-thumb img {
    object-fit: contain;
    background: var(--fp-gray-100);
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.fp-photo-grid-dense .fp-photo-add {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    min-height: 80px;
    cursor: pointer;
}

.fp-photo-grid-dense .fp-photo-dropzone {
    min-height: 100px;
    aspect-ratio: 3 / 4;
}

.fp-photo-grid-dense .fp-photo-remove {
    z-index: 3;
    cursor: pointer;
}

.fp-photo-ghost {
    opacity: 0.45;
    outline: 2px dashed var(--fp-blue);
    outline-offset: -2px;
}

@media (max-width: 1024px) {
    .fp-photo-grid-dense {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 640px) {
    .fp-photo-grid-dense {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Table */
.fp-table-wrap {
    overflow-x: auto;
}

.fp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.fp-table th,
.fp-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--fp-gray-100);
}

.fp-table th {
    font-weight: 600;
    color: var(--fp-gray-500);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.fp-th-sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    margin: -10px -12px;
    padding: 10px 12px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 6px;
}

.fp-th-sort .material-symbols-outlined {
    font-size: 16px;
    color: var(--fp-gray-200);
    text-transform: none;
    letter-spacing: normal;
}

.fp-th-sort:hover,
.fp-th-sort:focus-visible {
    color: var(--fp-blue);
    background: var(--fp-gray-50);
}

.fp-th-sort:hover .material-symbols-outlined,
.fp-th-sort.is-active .material-symbols-outlined {
    color: var(--fp-blue);
}

.fp-th-sort.is-active {
    color: var(--fp-gray-700);
}

.fp-th-sort:focus-visible {
    outline: 2px solid var(--fp-blue);
    outline-offset: 2px;
}

.fp-table-jobs th {
    vertical-align: middle;
}

/* Voice note */
.fp-voice-note {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--fp-gray-50);
    border-radius: var(--fp-radius);
    border: 1px solid var(--fp-gray-200);
}

.fp-waveform {
    flex: 1;
    height: 32px;
    background: linear-gradient(90deg, var(--fp-gray-300) 0%, var(--fp-gray-300) 20%, transparent 20%, transparent 25%, var(--fp-gray-300) 25%, var(--fp-gray-300) 35%, transparent 35%, transparent 40%, var(--fp-gray-300) 40%, var(--fp-gray-300) 55%, transparent 55%, transparent 60%, var(--fp-gray-300) 60%, var(--fp-gray-300) 75%, transparent 75%, transparent 80%, var(--fp-gray-300) 80%, var(--fp-gray-300) 100%);
    background-size: 8px 100%;
    border-radius: 4px;
}

.fp-voice-actions {
    display: flex;
    gap: 4px;
}

/* Right sidebar */
.fp-report-sidebar {
    position: sticky;
    top: calc(var(--fp-topbar-h) + 20px);
}

.fp-preview-card .fp-btn-block {
    margin-top: 0;
}

.fp-report-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.fp-pdf-preview {
    background: var(--fp-gray-100);
    border: 1px solid var(--fp-gray-200);
    border-radius: var(--fp-radius);
    padding: 16px;
    margin-bottom: 12px;
    max-height: 280px;
    overflow-y: auto;
}

.fp-pdf-mock {
    background: #fff;
    padding: 16px;
    font-size: 11px;
    box-shadow: var(--fp-shadow);
}

.fp-pdf-header {
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 8px;
    color: var(--fp-gray-900);
}

.fp-pdf-small {
    font-size: 10px;
    color: var(--fp-gray-500);
    margin: 4px 0;
}

.fp-pdf-line {
    height: 1px;
    background: var(--fp-gray-200);
    margin: 12px 0;
}

.fp-link {
    color: var(--fp-blue);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.fp-link:hover {
    text-decoration: underline;
}

.fp-mt-sm {
    margin-top: 10px;
}

/* Buttons */
.fp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--fp-radius);
    cursor: pointer;
    border: none;
    min-height: 44px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.fp-btn:hover,
.fp-btn:focus,
.fp-btn:focus-visible {
    text-decoration: none;
}

.fp-btn .material-symbols-outlined {
    text-decoration: none;
}

.fp-btn-primary {
    background: var(--fp-blue);
    color: #fff;
}

.fp-btn-primary:hover {
    background: var(--fp-blue-dark);
}

.fp-btn-danger {
    background: var(--fp-danger);
    color: #fff;
    border: 1px solid var(--fp-danger);
}

.fp-btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.fp-btn-outline {
    background: #fff;
    border: 1px solid var(--fp-gray-200);
    color: var(--fp-gray-700);
}

.fp-btn-outline:hover {
    background: var(--fp-gray-50);
    border-color: var(--fp-gray-300);
}

.fp-btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
}

.fp-btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.fp-btn-block {
    width: 100%;
}

.fp-text-success {
    color: var(--fp-success);
}

.fp-text-danger {
    color: var(--fp-danger);
}

/* Action bar */
.fp-action-bar {
    position: fixed;
    bottom: 0;
    left: var(--fp-sidebar-w);
    right: 0;
    height: 72px;
    background: #fff;
    border-top: 1px solid var(--fp-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 40;
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.06);
}

.fp-draft-status {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--fp-gray-500);
    white-space: nowrap;
    pointer-events: none;
}

.fp-draft-status .material-symbols-outlined {
    font-size: 18px;
}

.fp-draft-status[hidden] {
    display: none !important;
}

.fp-draft-status.fp-draft-status-error {
    color: var(--fp-danger);
}

.fp-action-bar-end {
    justify-content: space-between;
    gap: 16px;
}

.fp-action-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fp-action-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Responsive */
@media (max-width: 1200px) {
    .fp-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fp-report-layout {
        grid-template-columns: 1fr;
    }

    .fp-report-sidebar {
        position: static;
    }
}

@media (max-width: 900px) {
    .fp-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

    .fp-sidebar.fp-sidebar-open {
        transform: translateX(0);
    }

    .fp-action-bar {
        left: 0;
    }

    .fp-form-grid,
    .fp-form-grid-2,
    .fp-photo-section {
        grid-template-columns: 1fr;
    }

    .fp-info-grid {
        grid-template-columns: 1fr;
    }

    .fp-severity-group {
        grid-template-columns: repeat(2, 1fr);
    }

    .fp-offline-pill {
        display: none;
    }

    .fp-user span {
        display: none;
    }
}

@media (max-width: 600px) {
    .fp-action-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 12px;
        gap: 10px;
    }

    .fp-draft-status {
        order: 3;
        width: 100%;
        justify-content: center;
        font-size: 12px;
    }
}

/* --------------------------------------------------------------------------
   Site Visit Report — Enterprise Solution input form
   -------------------------------------------------------------------------- */

.fp-sitevisit {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 96px;
}

.fp-sitevisit-header {
    margin-bottom: 20px;
}

.fp-sitevisit-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--fp-gray-500);
}

.fp-doc-page {
    background: #fff;
    border: 1px solid var(--fp-gray-200);
    border-radius: var(--fp-radius);
    box-shadow: var(--fp-shadow-md);
    margin-bottom: 24px;
    overflow: hidden;
}

.fp-doc-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: var(--fp-gray-50);
    border-bottom: 2px solid var(--fp-gray-200);
}

.fp-doc-brand {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    color: var(--fp-gray-900);
}

.fp-doc-version {
    font-size: 11px;
    color: var(--fp-gray-500);
    font-weight: 500;
}

.fp-doc-print-date {
    font-size: 11px;
    color: var(--fp-gray-500);
    white-space: nowrap;
}

.fp-doc-page>.fp-card,
.fp-doc-page>.fp-sitevisit-photo-layout,
.fp-doc-page>.fp-sitevisit-summary {
    margin: 16px;
    box-shadow: none;
}

.fp-sitevisit-info-grid {
    grid-template-columns: repeat(2, 1fr);
}

.fp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fp-field-span-2 {
    grid-column: span 2;
}

.fp-sitevisit-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    max-width: 360px;
}

.fp-sitevisit-search .fp-input {
    flex: 1;
    min-width: 0;
}

.fp-sitevisit-search .material-symbols-outlined {
    color: var(--fp-gray-500);
    font-size: 20px;
}

.fp-sitevisit-table-wrap {
    max-height: 520px;
    overflow: auto;
    position: relative;
    z-index: 1;
}

.fp-sitevisit-table .fp-col-num {
    text-align: right;
    white-space: nowrap;
}

.fp-sitevisit-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--fp-gray-50);
    box-shadow: 0 1px 0 var(--fp-gray-200);
}

.fp-sitevisit-table th,
.fp-sitevisit-table td {
    /* Keep all cells in a row the same height / top-aligned content */
    vertical-align: top;
}

.fp-sitevisit-table .fp-vo-desc {
    min-width: 220px;
    max-width: 420px;
    font-size: 13px;
    line-height: 1.4;
}

.fp-sitevisit-table .fp-vo-code {
    /* Do not set display:flex here — it breaks equal table-row cell height */
    font-weight: 600;
    white-space: nowrap;
}

.fp-qty-stepper {
    display: inline-flex;
    align-items: stretch;
    margin: 0;
    border: 1px solid var(--fp-gray-300);
    border-radius: var(--fp-radius);
    overflow: hidden;
    background: #fff;
    vertical-align: middle;
    position: relative;
    z-index: 0;
}

.fp-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-height: 36px;
    border: none;
    background: var(--fp-gray-100);
    color: var(--fp-gray-700);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.fp-qty-btn:hover {
    background: var(--fp-gray-200);
}

.fp-qty-btn:active {
    background: var(--fp-gray-300);
}

.fp-qty-btn .material-symbols-outlined {
    font-size: 18px;
}

.fp-qty-stepper .fp-vo-qty {
    width: 52px;
    min-height: 36px;
    padding: 6px 4px;
    margin: 0;
    text-align: center;
    border: none;
    border-left: 1px solid var(--fp-gray-200);
    border-right: 1px solid var(--fp-gray-200);
    border-radius: 0;
    -moz-appearance: textfield;
}

.fp-qty-stepper .fp-vo-qty:focus {
    outline: 2px solid var(--fp-blue);
    outline-offset: -2px;
}

.fp-vo-qty::-webkit-outer-spin-button,
.fp-vo-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fp-vo-price {
    color: var(--fp-gray-500);
    font-variant-numeric: tabular-nums;
}

.fp-vo-subtotal {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.fp-vo-row.fp-vo-row-hidden {
    display: none;
}

.fp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.fp-sitevisit-header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.fp-vo-fav-toggle {
    flex-shrink: 0;
    gap: 6px;
    white-space: nowrap;
}

.fp-vo-fav-toggle .material-symbols-outlined {
    font-size: 18px;
}

.fp-vo-fav-toggle.is-active {
    border-color: var(--fp-warning);
    color: var(--fp-warning);
}

.fp-vo-fav-toggle.is-active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    color: var(--fp-warning);
}

.fp-vo-fav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0 4px 0 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--fp-gray-500);
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    vertical-align: middle;
}

.fp-vo-fav-btn .material-symbols-outlined {
    font-size: 16px;
    line-height: 1;
    display: block;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.fp-vo-fav-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--fp-danger);
}

.fp-vo-fav-btn.is-on {
    color: var(--fp-danger);
}

.fp-vo-fav-btn.is-on .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
    color: var(--fp-danger);
}

.fp-vo-fav-btn:disabled {
    cursor: default;
    opacity: 1;
}

.fp-vo-fav-btn:disabled:hover {
    background: transparent;
}

.fp-vo-version-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.fp-vo-code-text {
    min-width: 0;
    line-height: 22px;
    vertical-align: middle;
}

.fp-vo-row-multiplier {
    background: rgba(245, 158, 11, 0.06);
}

.fp-vo-multiplier-note {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--fp-warning);
    font-weight: 500;
}

.fp-badge-capex {
    background: rgba(37, 99, 235, 0.1);
    color: var(--fp-blue);
    font-size: 10px;
    padding: 3px 8px;
}

.fp-badge-opex {
    background: rgba(100, 116, 139, 0.12);
    color: var(--fp-gray-700);
    font-size: 10px;
    padding: 3px 8px;
}

.fp-sitevisit-total-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    margin: 12px 0 20px;
    background: var(--fp-navy);
    color: #fff;
    border-radius: var(--fp-radius);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.fp-sitevisit-vo-card .fp-sitevisit-total-bar {
    position: sticky;
    bottom: 0;
}

.fp-sitevisit-total-label {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.fp-sitevisit-total-value {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.fp-sitevisit-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.fp-vo-detail-field .fp-vo-detail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-bottom: 6px;
}

.fp-vo-detail-field .fp-vo-detail-head .fp-label {
    margin: 0;
}

.fp-vo-detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.fp-vo-detail-overridden-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.35);
    font-size: 12px;
    min-height: 28px;
    padding: 4px 10px;
}

/* .fp-badge/.fp-btn set display and override the HTML hidden attribute */
.fp-vo-detail-overridden-badge[hidden],
.fp-vo-detail-regen[hidden],
.fp-vo-default-badge[hidden],
.fp-vo-set-default-btn[hidden] {
    display: none !important;
}

.fp-vo-detail,
.fp-vo-detail-readonly {
    background: var(--fp-gray-50);
    color: var(--fp-gray-700);
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 13px;
}

.fp-vo-detail.is-overridden {
    background: #fffbeb;
    border-color: rgba(245, 158, 11, 0.45);
}

.fp-vo-detail-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--fp-gray-500);
}

.fp-vo-detail-regen {
    min-height: 36px;
}

.fp-vo-detail-regen .material-symbols-outlined {
    font-size: 18px;
}

@media (max-width: 640px) {
    .fp-vo-detail-field .fp-vo-detail-head {
        align-items: flex-start;
    }

    .fp-vo-detail-actions {
        width: 100%;
    }

    .fp-vo-detail-regen {
        flex: 1 1 auto;
        min-height: 44px;
    }
}

.fp-vo-version-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 0 0 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--fp-gray-200);
}

.fp-vo-version-bar .fp-label {
    margin: 0;
    white-space: nowrap;
}

.fp-vo-version-select {
    min-width: 260px;
    max-width: 100%;
    min-height: 44px;
    flex: 1 1 240px;
}

.fp-vo-set-default-btn {
    flex: 0 0 auto;
    min-height: 44px;
    white-space: nowrap;
}

.fp-vo-set-default-btn .material-symbols-outlined {
    font-size: 18px;
}

.fp-vo-default-badge {
    flex: 0 0 auto;
}

.fp-vo-version-hint {
    flex: 1 1 100%;
    font-size: 13px;
    line-height: 1.4;
}

.fp-badge-success {
    background: #dcfce7;
    color: #166534;
}

.fp-gray-card {
    background: var(--fp-gray-50);
    border: 1px solid var(--fp-gray-200);
    box-shadow: none;
}

.fp-mb-md {
    margin-bottom: 16px;
}

.fp-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.fp-checkbox-label input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .fp-vo-version-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .fp-vo-version-select {
        min-width: 0;
        width: 100%;
    }

    .fp-vo-set-default-btn {
        width: 100%;
        justify-content: center;
    }
}

.fp-sitevisit-photo-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
}

.fp-sitevisit-photo-block h3 {
    margin-bottom: 4px;
}

.fp-photo-evidence-card .fp-sitevisit-photo-block h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fp-gray-900);
}

.fp-photo-evidence-card>.fp-sitevisit-photo-layout {
    padding: 0;
    margin-bottom: 0;
}

.fp-photo-evidence-card .fp-sitevisit-photo-block {
    margin-bottom: 0;
}

.fp-sitevisit-photo-hint {
    margin: 0 0 12px;
    font-size: 12px;
    color: var(--fp-gray-500);
}

.fp-photo-grid-single {
    max-width: 320px;
}

.fp-photo-grid-single .fp-photo-thumb,
.fp-photo-grid-single .fp-photo-add {
    aspect-ratio: 4 / 3;
}

.fp-photo-grid-single .fp-photo-dropzone {
    width: 100%;
    max-width: 280px;
    min-height: 120px;
}

.fp-photo-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.fp-photo-thumb {
    cursor: zoom-in;
}

.fp-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.fp-photo-lightbox[hidden] {
    display: none !important;
}

.fp-photo-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
}

.fp-photo-lightbox-panel {
    position: relative;
    z-index: 1;
    max-width: min(960px, 100%);
    max-height: min(90vh, 100%);
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.fp-photo-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.fp-photo-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.92);
}

body.fp-lightbox-open {
    overflow: hidden;
}

@media (max-width: 900px) {

    .fp-sitevisit-info-grid,
    .fp-sitevisit-summary-grid {
        grid-template-columns: 1fr;
    }

    .fp-field-span-2 {
        grid-column: span 1;
    }

    .fp-sitevisit-search {
        max-width: none;
        width: 100%;
    }

    .fp-sitevisit-header-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .fp-vo-fav-toggle {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .fp-card-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .fp-sitevisit-table-wrap {
        max-height: none;
    }
}

/* Mobile-only card layout for the variation order table */
@media (max-width: 700px) {
    .fp-sitevisit-table-wrap {
        overflow: visible;
    }

    .fp-sitevisit-table thead {
        display: none;
    }

    .fp-sitevisit-table,
    .fp-sitevisit-table tbody,
    .fp-sitevisit-table tr,
    .fp-sitevisit-table td {
        display: block;
        width: 100%;
    }

    .fp-sitevisit-table tr.fp-vo-row {
        border: 1px solid var(--fp-gray-200);
        border-radius: var(--fp-radius);
        background: #fff;
        padding: 12px 14px;
        margin-bottom: 14px;
        box-shadow: var(--fp-shadow);
        position: relative;
        z-index: 0;
    }

    .fp-sitevisit-table tr.fp-vo-row.fp-vo-row-hidden {
        display: none;
    }

    .fp-vo-user-fav .fp-sitevisit-table td.fp-vo-code {
        justify-content: flex-start;
        align-items: center;
        gap: 6px;
    }

    /* Keep 44px touch target; icon stays visually small and centered */
    .fp-vo-user-fav .fp-vo-fav-btn {
        width: 44px;
        height: 44px;
        margin: -11px 0 -11px -8px;
    }

    .fp-vo-user-fav .fp-vo-fav-btn .material-symbols-outlined {
        font-size: 18px;
        font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
    }

    .fp-vo-user-fav .fp-vo-fav-btn.is-on .material-symbols-outlined {
        font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
    }

    .fp-sitevisit-table tr.fp-vo-row-multiplier {
        border-color: var(--fp-warning);
    }

    .fp-sitevisit-table td {
        border: none;
        padding: 8px 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        text-align: right;
    }

    .fp-sitevisit-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--fp-gray-500);
        text-align: left;
        flex-shrink: 0;
    }

    /* Item code becomes the card title */
    .fp-sitevisit-table td.fp-vo-code {
        justify-content: flex-start;
        font-size: 16px;
        font-weight: 700;
        color: var(--fp-gray-900);
        padding: 0 0 8px;
        margin-bottom: 4px;
        border-bottom: 1px solid var(--fp-gray-100);
    }

    .fp-sitevisit-table td.fp-vo-code::before {
        content: none;
    }

    /* Description stacks label above full-width text */
    .fp-sitevisit-table td.fp-vo-desc {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        max-width: none;
    }

    .fp-sitevisit-table td.fp-vo-desc::before {
        margin-bottom: 4px;
    }

    /* Bigger touch targets for editing (44px per PRD) */
    .fp-sitevisit-table .fp-qty-stepper {
        margin: 0;
    }

    .fp-sitevisit-table .fp-qty-btn {
        width: 48px;
        min-height: 44px;
    }

    .fp-sitevisit-table .fp-qty-stepper .fp-vo-qty {
        width: 64px;
        min-height: 44px;
        font-size: 16px;
    }

    .fp-sitevisit-table td.fp-vo-subtotal {
        font-size: 16px;
        color: var(--fp-blue);
        border-top: 1px solid var(--fp-gray-100);
        margin-top: 4px;
        padding-top: 10px;
    }
}

/* Job edit — editable fields, map modal, multi-tech, list rows */
.fp-field-editable .fp-label {
    margin-top: 0.5rem;
}

.fp-field-editable .fp-label:first-child {
    margin-top: 0;
}

.fp-field-editable-grow {
    flex: 1;
    min-width: 0;
}

.fp-report-title-input {
    font-size: 1.35rem;
    font-weight: 700;
    border: none;
    background: transparent;
    padding-left: 0;
    padding-right: 0;
}

.fp-report-title-input:focus {
    outline: 2px solid var(--fp-blue, #2563eb);
    border-radius: 4px;
    background: #fff;
    padding-left: 0.5rem;
}

.fp-inline-check {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    margin-left: 0.5rem;
    cursor: pointer;
}

.fp-text-muted {
    color: var(--fp-gray-500, #64748b);
    font-size: 0.875rem;
}

.fp-tech-multi {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
}

.fp-tech-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--fp-gray-200, #e2e8f0);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.fp-tech-check:hover {
    background: var(--fp-gray-50, #f8fafc);
}

.fp-tech-check input {
    flex-shrink: 0;
}

.fp-tech-check strong {
    display: block;
    font-size: 0.9rem;
}

.fp-tech-check small {
    color: var(--fp-gray-500, #64748b);
    font-size: 0.75rem;
}

.fp-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.fp-table-row-clickable {
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.fp-table-row-clickable td {
    transition: background-color 0.15s ease, color 0.15s ease;
}

.fp-table-row-clickable:hover td,
.fp-table-row-clickable:focus td,
.fp-table-row-clickable:focus-visible td {
    background: #eff6ff;
}

.fp-table-row-clickable:hover td:first-child,
.fp-table-row-clickable:focus td:first-child,
.fp-table-row-clickable:focus-visible td:first-child {
    box-shadow: inset 3px 0 0 var(--fp-blue);
}

.fp-table-row-clickable:hover td strong,
.fp-table-row-clickable:focus td strong,
.fp-table-row-clickable:focus-visible td strong {
    color: var(--fp-blue-dark);
}

.fp-table-row-clickable:focus {
    outline: none;
}

.fp-table-row-clickable:focus-visible {
    outline: 2px solid var(--fp-blue);
    outline-offset: -2px;
}

.fp-table-jobs {
    font-size: 13px;
}

.fp-table-jobs .fp-job-vo-price-col,
.fp-table-jobs .fp-job-vo-price {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.fp-table-jobs .fp-job-vo-price {
    font-weight: 600;
    color: var(--fp-gray-700);
}

.fp-table-jobs .fp-job-vo-price-col .fp-th-sort {
    justify-content: flex-end;
}

.fp-table-jobs .fp-job-title {
    font-size: 13px;
    letter-spacing: normal;
}

.fp-table-jobs .fp-table-row-clickable:hover td:first-child,
.fp-table-jobs .fp-table-row-clickable:focus td:first-child,
.fp-table-jobs .fp-table-row-clickable:focus-visible td:first-child {
    box-shadow: none;
}

.fp-table-jobs .fp-table-row-clickable:hover td:nth-child(2),
.fp-table-jobs .fp-table-row-clickable:focus td:nth-child(2),
.fp-table-jobs .fp-table-row-clickable:focus-visible td:nth-child(2) {
    box-shadow: inset 3px 0 0 var(--fp-blue);
}

.fp-table-jobs .fp-table-row-clickable.is-selected td {
    background: #eff6ff;
}

.fp-table-jobs .fp-table-row-clickable td:last-child {
    position: relative;
    padding-right: 2rem;
}

.fp-table-jobs .fp-table-row-clickable td:last-child::after {
    content: 'chevron_right';
    font-family: 'Material Symbols Outlined';
    font-size: 18px;
    color: var(--fp-blue);
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.fp-table-jobs .fp-table-row-clickable:hover td:last-child::after,
.fp-table-jobs .fp-table-row-clickable:focus td:last-child::after,
.fp-table-jobs .fp-table-row-clickable:focus-visible td:last-child::after {
    opacity: 0.85;
}

.fp-map-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.fp-map-modal[hidden] {
    display: none !important;
}

body.fp-map-open {
    overflow: hidden;
}

.fp-map-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    cursor: pointer;
}

.fp-map-modal-panel {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: min(720px, 96vw);
    max-height: 92vh;
    overflow: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.fp-map-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--fp-gray-200, #e2e8f0);
}

.fp-map-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.fp-map-modal-body {
    padding: 1rem 1.25rem;
}

.fp-map-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--fp-gray-200, #e2e8f0);
}

.fp-job-map-wrap {
    position: relative;
    height: 360px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--fp-gray-200, #e2e8f0);
    background: var(--fp-gray-100, #f1f5f9);
    overflow: hidden;
}

.fp-job-map {
    display: block;
    height: 100%;
    width: 100%;
    border: 0;
}

.fp-job-map[hidden] {
    display: none;
}

.fp-map-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 1rem;
    text-align: center;
}

.fp-map-empty[hidden] {
    display: none !important;
}

.fp-map-fields input[readonly] {
    background: var(--fp-gray-50, #f8fafc);
    cursor: default;
}

.fp-save-toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #fff;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 1100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fp-save-toast[hidden] {
    display: none !important;
}

.fp-save-toast-error {
    background: #dc2626;
}

/* Team modal */
.fp-team-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.fp-team-modal[hidden] {
    display: none !important;
}

body.fp-team-open {
    overflow: hidden;
}

.fp-team-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    cursor: pointer;
}

.fp-team-modal-panel {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: min(640px, 96vw);
    max-height: 92vh;
    overflow: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.fp-team-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--fp-gray-200, #e2e8f0);
}

.fp-team-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.fp-team-modal-body {
    padding: 1rem 1.25rem;
}

.fp-team-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--fp-gray-200, #e2e8f0);
}

.fp-team-section {
    margin-bottom: 1.25rem;
}

.fp-team-section:last-child {
    margin-bottom: 0;
}

.fp-team-section h4 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
}

.fp-team-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.fp-team-section-hint {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
}

.fp-team-contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fp-team-contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.fp-team-role-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--fp-gray-500, #64748b);
    margin: 0 0 0.35rem;
}

.fp-team-contact-view p {
    margin: 0;
    font-size: 13px;
}

@media (max-width: 560px) {
    .fp-team-contact-row {
        grid-template-columns: 1fr;
    }
}

/* Supervisor name picker */
.fp-input-block,
.fp-select-block {
    width: 100%;
}

.fp-supervisor-custom {
    margin-top: 0.5rem;
}

.fp-supervisor-manage {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--fp-gray-200, #e2e8f0);
}

.fp-supervisor-manage-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.fp-label-inline {
    margin-bottom: 0;
}

.fp-supervisor-manage .fp-hint {
    font-size: 12px;
    color: var(--fp-gray-500, #64748b);
}

.fp-hint {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--fp-gray-500, #64748b);
}

.fp-hint code,
.fp-form-rules-list code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--fp-gray-100, #f1f5f9);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--fp-gray-700, #334155);
}

.fp-form-rules {
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid var(--fp-gray-200, #e2e8f0);
    border-radius: var(--fp-radius, 8px);
    background: var(--fp-gray-50, #f8fafc);
}

.fp-form-rules-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fp-gray-700, #334155);
}

.fp-form-rules-title .material-symbols-outlined {
    font-size: 20px;
    color: var(--fp-blue, #2563eb);
}

.fp-form-rules-list {
    margin: 0;
    padding-left: 1.2em;
    font-size: 13px;
    line-height: 1.55;
    color: var(--fp-gray-700, #334155);
}

.fp-form-rules-list li + li {
    margin-top: 4px;
}

.fp-suggested-code-row {
    margin: 10px 0 0;
}

.fp-flash .fp-suggested-code-row .fp-btn {
    margin-top: 4px;
}

.fp-supervisor-name-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 160px;
    overflow-y: auto;
}

.fp-supervisor-name-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.35rem 0.5rem 0.35rem 0.75rem;
    background: var(--fp-gray-50, #f8fafc);
    border: 1px solid var(--fp-gray-200, #e2e8f0);
    border-radius: 8px;
}

.fp-supervisor-name-label {
    font-size: 14px;
    color: var(--fp-gray-700, #334155);
    word-break: break-word;
}

.fp-supervisor-name-empty {
    font-size: 13px;
    color: var(--fp-gray-500, #64748b);
    padding: 0.5rem 0;
}

.fp-supervisor-name-remove {
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    color: var(--fp-gray-500, #64748b);
}

.fp-supervisor-name-remove:hover {
    color: var(--fp-danger, #ef4444);
}

.fp-supervisor-add-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 560px) {
    .fp-supervisor-add-row {
        grid-template-columns: 1fr;
    }

    .fp-supervisor-add-row .fp-btn {
        width: 100%;
        min-height: 44px;
    }
}

.fp-danger-zone {
    margin-top: 16px;
    border-color: #fecaca;
    background: #fffbfb;
}

.fp-danger-zone-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.fp-danger-zone-head .material-symbols-outlined {
    color: var(--fp-danger);
    font-size: 28px;
    flex-shrink: 0;
}

.fp-danger-zone h3 {
    margin: 0 0 4px;
    color: var(--fp-danger);
}

.fp-danger-zone-desc {
    margin: 0;
    font-size: 13px;
    color: var(--fp-gray-500);
    line-height: 1.5;
}

#jobDeactivateBtn {
    min-height: 44px;
}

/* Delete job confirm modal (GitHub-style retype title) */
.fp-delete-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.fp-delete-modal[hidden] {
    display: none !important;
}

body.fp-delete-open {
    overflow: hidden;
}

.fp-delete-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    cursor: pointer;
}

.fp-delete-modal-panel {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: min(480px, 96vw);
    max-height: 92vh;
    overflow: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    z-index: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #fecaca;
}

.fp-delete-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--fp-gray-200, #e2e8f0);
}

.fp-delete-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--fp-danger);
}

.fp-delete-modal-body {
    padding: 1rem 1.25rem;
}

.fp-delete-modal-warn {
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 14px;
    line-height: 1.45;
}

.fp-delete-modal-hint {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--fp-gray-700);
}

.fp-delete-confirm-name {
    margin-bottom: 14px;
}

.fp-delete-confirm-name code {
    display: block;
    user-select: text;
    -webkit-user-select: text;
    min-height: 44px;
    padding: 12px;
    background: var(--fp-gray-100, #f1f5f9);
    border: 1px solid var(--fp-gray-200, #e2e8f0);
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-all;
    color: var(--fp-navy, #0f172a);
    cursor: text;
}

.fp-delete-match-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--fp-danger);
}

.fp-delete-modal-footer {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--fp-gray-200, #e2e8f0);
}

.fp-delete-modal-footer .fp-btn {
    min-height: 44px;
}

.fp-delete-modal-footer .fp-btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .fp-delete-modal-footer {
        flex-direction: column-reverse;
    }

    .fp-delete-modal-footer .fp-btn {
        width: 100%;
    }
}

@media print {

    .fp-sidebar,
    .fp-topbar,
    .fp-action-bar,
    .fp-back-link,
    .fp-sitevisit-header .fp-report-title {
        display: none !important;
    }

    .fp-main,
    .fp-content-wrap,
    .fp-sitevisit {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none;
    }

    .fp-doc-page {
        box-shadow: none;
        border: none;
        page-break-after: always;
        margin-bottom: 0;
    }

    .fp-doc-page:last-child {
        page-break-after: auto;
    }

    .fp-vo-qty {
        border: none;
        background: transparent;
        padding: 0;
    }

    .fp-photo-add,
    .fp-photo-remove,
    .fp-photo-lightbox,
    #svItemSearch {
        display: none !important;
    }
}

/* Auth login page */
body.fp-auth-body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--fp-gray-700);
    background: var(--fp-gray-50);
    min-height: 100vh;
}

.fp-auth-layout {
    display: flex;
    min-height: 100vh;
}

.fp-auth-brand-panel {
    width: 42%;
    max-width: 480px;
    min-width: 280px;
    background: var(--fp-navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 32px;
    flex-shrink: 0;
}

.fp-auth-brand-inner {
    flex: 1;
}

.fp-auth-sidebar-brand {
    padding: 0;
    border-bottom: none;
    margin-bottom: 32px;
}

.fp-auth-sidebar-brand .fp-logo-text strong {
    font-size: 18px;
    letter-spacing: 0.06em;
}

.fp-auth-sidebar-brand .fp-logo-text span {
    font-size: 11px;
    opacity: 0.75;
    letter-spacing: 0.12em;
}

.fp-auth-tagline {
    margin: 0 0 28px;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    max-width: 320px;
}

.fp-auth-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fp-auth-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.fp-auth-feature .material-symbols-outlined {
    font-size: 22px;
    color: var(--fp-blue);
    flex-shrink: 0;
}

.fp-auth-brand-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.fp-auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: var(--fp-gray-50);
}

.fp-auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--fp-gray-200);
    border-radius: var(--fp-radius);
    box-shadow: var(--fp-shadow-md);
    padding: 36px 32px;
}

.fp-auth-card-header {
    margin-bottom: 28px;
}

.fp-auth-title {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--fp-navy);
}

.fp-auth-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--fp-gray-500);
}

.fp-auth-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--fp-radius);
    padding: 12px 14px;
    margin-bottom: 20px;
    color: var(--fp-danger);
    font-size: 13px;
}

.fp-auth-alert p {
    margin: 0;
}

.fp-auth-alert p+p {
    margin-top: 6px;
}

.fp-auth-field {
    margin-bottom: 20px;
}

.fp-auth-field .fp-label {
    font-size: 13px;
    margin-bottom: 8px;
}

.fp-auth-input {
    min-height: 44px;
    margin-bottom: 0;
    font-size: 15px;
}

.fp-auth-input:focus {
    outline: none;
    border-color: var(--fp-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.fp-auth-submit {
    margin-top: 8px;
    min-height: 48px;
    font-size: 15px;
}

.fp-auth-footer-note {
    margin: 24px 0 0;
    font-size: 12px;
    color: var(--fp-gray-500);
    text-align: center;
}

@media (max-width: 768px) {
    .fp-auth-layout {
        flex-direction: column;
    }

    .fp-auth-brand-panel {
        width: 100%;
        max-width: none;
        min-width: 0;
        padding: 28px 20px;
    }

    .fp-auth-tagline {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .fp-auth-features {
        display: none;
    }

    .fp-auth-brand-footer {
        padding-top: 16px;
        margin-top: 8px;
    }

    .fp-auth-main {
        padding: 24px 16px 32px;
        justify-content: flex-start;
    }

    .fp-auth-card {
        padding: 28px 20px;
        box-shadow: var(--fp-shadow);
    }

    .fp-auth-title {
        font-size: 22px;
    }
}

/* Flash messages */
.fp-flash {
    padding: 12px 16px;
    border-radius: var(--fp-radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.fp-flash p {
    margin: 0;
}

.fp-flash p+p {
    margin-top: 4px;
}

.fp-flash-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.fp-flash-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--fp-danger);
}

/* Personnel / user header */
.fp-report-header .fp-card-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.fp-badge-active {
    background: #dcfce7;
    color: #15803d;
}

.fp-user-cell {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.fp-user-cell .fp-badge,
.fp-wo-meta .fp-badge {
    margin-left: 0;
}

.fp-row-current td:first-child {
    box-shadow: inset 3px 0 0 var(--fp-blue);
}

.fp-row-current {
    background: #eff6ff;
}

.fp-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.fp-row-actions .fp-btn .material-symbols-outlined {
    font-size: 16px;
}

.fp-inline-form {
    display: inline;
    margin: 0;
}

.fp-btn-warning-text {
    color: var(--fp-warning);
    border-color: var(--fp-warning);
}

.fp-btn-success-text {
    color: var(--fp-success);
    border-color: var(--fp-success);
}

.fp-btn-danger-text {
    color: var(--fp-danger);
    border-color: #fecaca;
}

.fp-btn-danger-text:hover {
    background: #fef2f2;
    border-color: var(--fp-danger);
}

.fp-required {
    color: var(--fp-danger);
}

@media (max-width: 768px) {
    .fp-user>div:nth-child(2) {
        display: none;
    }

    .fp-row-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .fp-row-actions .fp-btn,
    .fp-row-actions .fp-inline-form .fp-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .fp-report-header .fp-card-header-row .fp-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .fp-wo-pps-sc {
        width: 100%;
    }

    .fp-danger-zone .fp-btn-block {
        min-height: 44px;
    }
}

/* Dashboard */
.fp-dashboard-kpi {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.fp-dashboard-stat {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--fp-gray-200);
    border-radius: var(--fp-radius);
    padding: 16px;
    box-shadow: var(--fp-shadow);
    min-height: 88px;
}

.fp-dashboard-stat-icon {
    font-size: 28px;
    color: var(--fp-blue);
    flex-shrink: 0;
}

.fp-dashboard-stat-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.fp-dashboard-stat-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--fp-gray-900);
}

.fp-dashboard-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--fp-gray-500);
}

.fp-dashboard-stat-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    min-height: 32px;
    padding: 4px 10px;
    margin-top: 2px;
    border: 1px solid var(--fp-gray-200);
    border-radius: 999px;
    background: var(--fp-gray-50);
    font-size: 12px;
    font-weight: 600;
    color: var(--fp-blue);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.fp-dashboard-stat-link:hover {
    background: #fff;
    border-color: var(--fp-blue);
    color: var(--fp-blue-dark);
}

.fp-dashboard-stat-link:focus-visible {
    outline: 2px solid var(--fp-blue);
    outline-offset: 2px;
}

.fp-filter-clear-btn {
    margin-left: 8px;
    margin-top: 8px;
}

/* Job list — filter panel */
.fp-jobs-filter-card {
    margin-bottom: 16px;
}

.fp-jobs-filter-form .fp-input,
.fp-jobs-filter-form .fp-select {
    margin-bottom: 0;
}

.fp-jobs-filter-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.fp-jobs-filter-search .fp-input {
    flex: 1;
    min-width: 0;
}

.fp-jobs-filter-search .material-symbols-outlined {
    color: var(--fp-gray-500);
    font-size: 20px;
    flex-shrink: 0;
}

.fp-jobs-filter-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
}

.fp-jobs-filter-field {
    flex: 1 1 160px;
    min-width: 0;
}

.fp-jobs-filter-field .fp-label {
    margin-bottom: 6px;
}

.fp-jobs-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 200px;
}

.fp-jobs-filter-actions .fp-btn {
    min-height: 44px;
}

.fp-jobs-filter-count {
    margin: 12px 0 0;
    font-size: 13px;
}

@media (max-width: 600px) {
    .fp-jobs-filter-actions {
        width: 100%;
    }

    .fp-jobs-filter-actions .fp-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (min-width: 601px) {
    .fp-filter-clear-btn {
        margin-top: 0;
    }
}

.fp-dashboard-stat-danger .fp-dashboard-stat-icon,
.fp-dashboard-stat-danger .fp-dashboard-stat-value {
    color: var(--fp-danger);
}

.fp-dashboard-stat-warning .fp-dashboard-stat-icon {
    color: var(--fp-warning);
}

.fp-dashboard-stat-success .fp-dashboard-stat-icon {
    color: var(--fp-success);
}

.fp-dashboard-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.fp-dashboard-chart-card {
    margin-bottom: 0;
}

.fp-dashboard-chart-card h3 {
    margin-bottom: 8px;
}

.fp-dashboard-chart-wrap {
    position: relative;
    min-height: 260px;
    height: 260px;
}

.fp-dashboard-tables {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.fp-dashboard-tables .fp-card {
    margin-bottom: 0;
}

@media (max-width: 1200px) {
    .fp-dashboard-kpi {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {

    .fp-dashboard-charts,
    .fp-dashboard-tables {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .fp-dashboard-kpi {
        grid-template-columns: repeat(2, 1fr);
    }

    .fp-dashboard-stat {
        padding: 12px;
        min-height: 76px;
    }

    .fp-dashboard-stat-value {
        font-size: 20px;
    }

    .fp-dashboard-stat-link {
        min-height: 44px;
        padding: 8px 12px;
    }

    .fp-dashboard-chart-wrap {
        min-height: 220px;
        height: 220px;
    }
}

/* VO Summary import / export on jobs list */
.fp-jobs-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.fp-jobs-header-actions .fp-btn {
    min-height: 44px;
}

.fp-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.fp-summary-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.fp-summary-modal[hidden] {
    display: none !important;
}

body.fp-summary-modal-open {
    overflow: hidden;
}

.fp-summary-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    cursor: pointer;
}

.fp-summary-modal-panel {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: min(640px, 96vw);
    max-height: 92vh;
    overflow: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.fp-summary-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--fp-gray-200, #e2e8f0);
}

.fp-summary-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.fp-summary-modal-body {
    padding: 1rem 1.25rem;
}

.fp-summary-modal-hint {
    margin: 0 0 12px;
    font-size: 13px;
}

.fp-summary-import-option {
    min-height: 44px;
    margin-top: 16px;
    align-items: flex-start;
}

.fp-summary-import-option .fp-hint {
    display: block;
    margin-top: 4px;
    font-weight: 400;
    color: var(--fp-gray-500, #64748b);
    font-size: 13px;
}

.fp-summary-modal-body .fp-input[type="file"] {
    min-height: 44px;
    width: 100%;
    padding: 8px;
}

.fp-summary-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--fp-gray-200, #e2e8f0);
}

.fp-summary-export-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.fp-summary-export-dates .fp-input {
    min-height: 44px;
    width: 100%;
}

.fp-jobs-bulk-bar {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--fp-gray-200, #e2e8f0);
    background: var(--fp-gray-50, #f8fafc);
}

#fpJobsListCard.is-delete-mode .fp-jobs-bulk-bar {
    display: flex;
}

.fp-jobs-bulk-count {
    margin: 0;
    font-size: 14px;
}

.fp-jobs-bulk-bar .fp-btn {
    min-height: 44px;
}

.fp-jobs-check-col,
.fp-jobs-check-cell {
    display: none;
    width: 48px;
    min-width: 48px;
    text-align: center;
    vertical-align: middle;
}

#fpJobsListCard.is-delete-mode .fp-jobs-check-col,
#fpJobsListCard.is-delete-mode .fp-jobs-check-cell {
    display: table-cell;
}

.fp-jobs-check-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    cursor: pointer;
}

.fp-jobs-check-label input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--fp-blue, #2563eb);
    cursor: pointer;
}

#fpJobsBulkDeleteNames {
    white-space: pre-wrap;
    max-height: 160px;
    overflow: auto;
}

.fp-jobs-bulk-delete-list {
    margin-bottom: 16px;
}

.fp-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--fp-gray-200, #e2e8f0);
}

.fp-pagination--top {
    border-top: none;
    border-bottom: 1px solid var(--fp-gray-200, #e2e8f0);
}

.fp-pagination .fp-btn[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}

.fp-pagination-pages {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.fp-pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid var(--fp-gray-200, #e2e8f0);
    border-radius: 8px;
    color: var(--fp-gray-700, #334155);
    text-decoration: none;
    font-size: 14px;
    background: #fff;
}

.fp-pagination-page.is-current {
    background: var(--fp-blue, #2563eb);
    border-color: var(--fp-blue, #2563eb);
    color: #fff;
    font-weight: 600;
}

.fp-pagination-ellipsis {
    padding: 0 4px;
    color: var(--fp-gray-500, #64748b);
}

.fp-summary-version-ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fp-summary-version-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--fp-gray-200, #e2e8f0);
    border-radius: 8px;
    background: var(--fp-gray-50, #f8fafc);
}

.fp-summary-version-meta {
    min-width: 0;
    flex: 1;
}

.fp-summary-version-title {
    font-weight: 600;
    color: var(--fp-gray-700, #334155);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    word-break: break-word;
}

.fp-summary-version-sub {
    margin-top: 4px;
    font-size: 12px;
}

.fp-summary-latest-badge {
    flex-shrink: 0;
}

.fp-summary-version-item .fp-btn {
    min-height: 44px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .fp-jobs-header-actions {
        width: 100%;
    }

    .fp-jobs-header-actions .fp-btn {
        width: 100%;
        justify-content: center;
    }

    .fp-jobs-bulk-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .fp-jobs-bulk-bar .fp-btn {
        width: 100%;
        justify-content: center;
    }

    .fp-summary-export-dates {
        grid-template-columns: 1fr;
    }

    .fp-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .fp-pagination .fp-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .fp-pagination-pages {
        justify-content: center;
        width: 100%;
    }

    .fp-summary-version-item {
        flex-direction: column;
        align-items: stretch;
    }

    .fp-summary-version-item .fp-btn {
        width: 100%;
        justify-content: center;
    }
}