:root {
    --primary: #0073ea;
    --dark: #2b3348;
    --light: #f5f6f8;
    --success: #28a745;
    --danger: #e24c4c;
    --sidebar-bg: #2b3348;
    --border: #ddd;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Figtree", "Segoe UI", sans-serif;
    background: var(--light);
    color: var(--dark);
    min-height: 100vh;
}

.banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    min-height: 60px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.banner-left,
.banner-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.brand-icon {
    display: block;
    width: 40px;
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}

.btn {
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.report-toolbar .btn,
.admin-form .report-actions .btn,
.banner-left .btn.btn-secondary {
    font-size: 1.05rem;
    padding: 0.6rem 1.15rem;
}

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

.btn-secondary {
    background: var(--dark);
    color: #fff;
}

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

.btn-danger:hover {
    filter: brightness(0.92);
}

.bulk-delete-list {
    display: grid;
    gap: 0.45rem;
    max-height: 360px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.bulk-delete-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 500;
}

.btn-reset {
    background: var(--success);
    color: #fff;
}

.btn:disabled,
.menu-btn:disabled,
.icon-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 0.95rem;
}

.icon-btn-prominent {
    color: var(--dark);
    font-weight: 600;
}

.icon-btn-prominent:hover:not(:disabled) {
    color: #1a2030;
}

.user-name {
    font-weight: 600;
}

.layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100vh - 60px);
}

.layout-no-sidebar {
    grid-template-columns: 1fr;
}

.left-pane {
    background: #fff;
    color: var(--dark);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    max-height: calc(100vh - 60px);
    overflow: hidden;
    padding: 0.65rem 0.6rem 0.75rem;
}

.menu-group {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.menu-heading {
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
    font-weight: 600;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    margin-bottom: 0.2rem;
    padding: 0.5rem 0.6rem;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--dark);
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.25;
}

.menu-btn-sub {
    padding-left: 1.75rem;
    font-size: 0.92rem;
}

.menu-icon {
    width: 1.05rem;
    flex-shrink: 0;
    text-align: center;
    font-size: 0.95rem;
    color: #444;
}

.menu-btn.active,
.menu-btn:hover:not(:disabled) {
    background: var(--light);
}

.left-footer {
    flex-shrink: 0;
    margin-top: 0.5rem;
    padding-top: 0.45rem;
    font-size: 0.78rem;
    color: #666;
    text-align: center;
    line-height: 1.25;
}

.right-pane {
    padding: 1.5rem;
    overflow: auto;
}

.right-pane:has(.welcome-page) {
    overflow: hidden;
}

.welcome-panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.welcome-page {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: calc(100vh - 60px - 3rem);
    min-height: 0;
}

.welcome-intro {
    flex: 0 0 auto;
}

.welcome-hero {
    padding: 1.5rem 1.5rem 1.25rem;
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    color: #fff;
}

.welcome-hero h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
}

.welcome-hero p {
    margin: 0;
}

.welcome-body {
    padding: 0.85rem 1.5rem;
}

.welcome-body p {
    margin: 0;
}

.welcome-visual {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 0.75rem;
}

.welcome-visual-frame {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
}

.welcome-visual-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.phase-list {
    margin: 1rem 0 0;
    padding-left: 1.25rem;
}

.phase-list {
    margin: 1rem 0 0;
    padding-left: 1.25rem;
}

.admin-panel {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-form label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.admin-form input,
.admin-form select {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0.5rem;
    text-align: left;
}

.form-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 1.5rem;
    width: min(100%, 420px);
    position: relative;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    margin: auto;
}

.modal-content-sm {
    width: min(100%, 360px);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #888;
    z-index: 2;
}

.login-form label {
    display: block;
    margin-top: 0.75rem;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.login-form input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.form-error {
    background: #fdecec;
    color: var(--danger);
    border: 1px solid #f5c2c2;
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.modal-form-error {
    background: #fdecec;
    color: var(--danger);
    border: 1px solid #f5c2c2;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.modal-form-error-message {
    margin: 0 0 0.85rem;
    line-height: 1.45;
}

.modal-form-error .btn {
    min-width: 5rem;
}

.form-note {
    color: var(--danger);
    font-weight: 600;
}

.data-tab-warning {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--danger);
    text-align: left;
}

.form-help {
    color: var(--muted, #555);
    margin: 0.75rem 0 1rem;
}

.form-links,
.sso-actions {
    margin-top: 1rem;
}

.link-btn,
a.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

a.link-btn:hover {
    color: var(--dark);
}

.link-btn:disabled {
    color: var(--muted, #888);
    cursor: not-allowed;
    text-decoration: none;
}

.table-thumb {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
}

.table-thumb-pdf,
.media-pdf-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted, #666);
}

.pic-field-group {
    margin: 0.75rem 0;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.access-panel {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
}

.access-panel h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.ticket-submission-review {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
}

.ticket-submission-review .modal-section-heading {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.signature-approve-panel {
    max-width: 520px;
    margin: 2rem auto;
    padding: 1.5rem;
}

.signature-approve-form label {
    display: block;
    margin-top: 1rem;
}

.pic-url-field {
    font-size: 0.85rem;
    color: #666;
}

.thumbnail-picker .field-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.thumb-upload-hitbox {
    position: relative;
    display: inline-block;
    width: 96px;
    height: 96px;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 1px dashed var(--border);
    background: var(--light);
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.file-drop-active,
.thumb-upload-hitbox.file-drop-active,
.upload-thumb-block.file-drop-active,
.upload-doc-receipt-upload.file-drop-active,
.upload-doc-document-row.file-drop-active,
.pic-field-group.file-drop-active {
    border-color: var(--primary, #0073ea);
    background: rgba(0, 115, 234, 0.08);
    box-shadow: 0 0 0 2px rgba(0, 115, 234, 0.15);
}

.thumb-upload-hitbox .pic-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.user-pic-thumb {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: cover;
}

.user-pic-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    padding: 0.35rem;
}

.field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: #666;
}

.hidden {
    display: none !important;
}

.sso-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.human-challenge {
    margin-top: 0.75rem;
}

[x-cloak] {
    display: none !important;
}

.report-panel {
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.report-header,
.report-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
    padding: 1rem 1rem 0.5rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.report-toolbar + .report-filters,
.report-header + .report-filters {
    margin-top: 0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding-top: 0.5rem;
}

.report-toolbar:empty,
.report-header:empty {
    display: none;
}

.report-notice {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.report-filters {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.report-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.report-filter-grid label,
.data-form-grid label,
.modal-content label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.report-filter-grid label.filter-combobox {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-content label.filter-combobox,
.modal-content label.field-combobox {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.report-filter-grid .combobox-text,
.report-filter-grid input,
.report-filter-grid select,
.data-form-grid input,
.modal-content input,
.modal-content select,
.modal-content textarea {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.report-actions,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0;
}

.report-filters .report-actions {
    margin-top: 0.25rem;
}

.table-actions {
    margin-bottom: 1rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 6.25rem;
    padding: 0.85rem 0.75rem;
    text-align: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.kpi-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
}

.kpi-value {
    margin: 0.4rem 0 0;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-chevron-panel {
    margin-bottom: 1.25rem;
    padding: 0.85rem 0.95rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.kpi-chevron-title {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #555;
}

.chevron-bar {
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.chevron-stage {
    position: relative;
    flex: 1;
    min-width: 100px;
    padding: 14px 18px 14px 30px;
    text-align: center;
    background: #e9ecef;
    color: #555;
    font-weight: 600;
    font-size: 0.82em;
    clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%, 15px 50%);
}

.chevron-stage:first-child {
    clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%);
    padding-left: 18px;
}

.chevron-stage .chev-count {
    display: block;
    margin-top: 2px;
    font-size: 1.6em;
    font-weight: 800;
}

.chevron-stage.has-items {
    background: #cce5ff;
    color: #004085;
}

.text-primary {
    color: #0073ea;
}

.text-success {
    color: #28a745;
}

.text-danger {
    color: #dc3545;
}

.text-warning {
    color: #d39e00;
}

.text-info {
    color: #17a2b8;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.chart-grid-thirds {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chart-slot {
    padding: 0.85rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chart-heading {
    display: block;
    margin: 0 0 0.5rem;
    padding: 0;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
}

.chart-card {
    height: 15.95rem;
    max-height: 15.95rem;
}

.chart-canvas-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-card canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.map-panel,
.report-section-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.property-map-panel {
    display: block;
    justify-content: initial;
    margin-top: 0;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.property-map-title {
    margin: 0 0 0.75rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
}

.property-map-panel .property-map {
    border: 1px solid var(--border);
}

.property-map-empty {
    margin: 0;
    text-align: center;
}

.report-inline-error {
    margin: 0 0 0.75rem;
}

.report-table-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.property-map {
    width: 100%;
    height: 24rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--light);
    position: relative;
    z-index: 0;
}

.property-map.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted, #5a6478);
    font-weight: 600;
}

.property-map .leaflet-container {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    z-index: 1;
}

.property-map .leaflet-control-attribution {
    font-size: 0.7rem;
}

.table-wrap {
    max-height: 24rem;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.table-wrap .data-table {
    margin: 0;
}

.table-wrap .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    box-shadow: 0 1px 0 var(--border);
}

.sortable-th-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.sortable-th-btn:hover,
.sortable-th-btn:focus-visible {
    color: var(--primary);
}

.sortable-th-static .sortable-th-btn {
    display: none;
}

.sort-indicator::before {
    content: "↕";
    opacity: 0.35;
    font-size: 0.75rem;
}

.sortable-th[aria-sort="ascending"] .sort-indicator::before {
    content: "↑";
    opacity: 1;
    color: var(--primary);
}

.sortable-th[aria-sort="descending"] .sort-indicator::before {
    content: "↓";
    opacity: 1;
    color: var(--primary);
}

.report-table-section h3,
.property-map-title,
.chart-slot .chart-heading {
    margin-top: 0;
}

.table-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.75rem 0 1.25rem;
}

.table-pagination-summary {
    margin: 0;
    color: var(--muted, #666);
    font-size: 0.9rem;
}

.table-pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-pagination-page {
    font-size: 0.9rem;
    padding: 0 0.25rem;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}

.chart-grid-empty {
    min-height: 15.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.row-filter-active {
    background: rgba(0, 115, 234, 0.08);
}

.row-filter-btn-active {
    color: var(--primary);
}

.modal-content-wide {
    width: min(100%, 720px);
}

.modal-content .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: #fff;
    padding-top: 0.75rem;
    padding-bottom: 0.25rem;
    margin-top: 1rem;
    border-top: 1px solid #e8eaf0;
}

.modal-region-name {
    margin: 0 0 1rem;
    text-align: center;
}

.modal-image {
    display: block;
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 0.5rem;
    background: var(--light);
}

.modal-doc-frame {
    display: block;
    width: 100%;
    min-height: 60vh;
    border: 1px solid #e8eaf0;
    border-radius: 0.5rem;
    background: var(--light);
}

.po-doc-preview {
    margin-bottom: 0.5rem;
}

.upload-document-content h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.upload-doc-section-rule {
    border: 0;
    border-top: 2px solid var(--primary);
    margin: 1.25rem 0;
    opacity: 0.85;
}

.upload-doc-before-after {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0;
}

.upload-doc-image-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.upload-doc-row-heading {
    margin: 0;
}

.upload-doc-column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.upload-doc-image-group {
    border: 1px solid #c5d5e8;
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #fafcff;
}

.upload-doc-image-group-row {
    flex-direction: row;
    flex-wrap: wrap;
}

.upload-doc-image-row .upload-doc-image-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.upload-thumb-block,
.upload-doc-receipt-upload,
.upload-doc-document-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.upload-thumb-label {
    cursor: pointer;
}

.upload-thumb-title {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.upload-thumb-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border: 2px dashed var(--border);
    border-radius: 0.5rem;
    background: #fafbfc;
    overflow: hidden;
}

.upload-thumb-frame.has-image {
    border-style: solid;
}

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

.upload-thumb-placeholder {
    font-size: 2rem;
    color: #9aa3b2;
}

.upload-thumb-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.upload-doc-receipt-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 0;
}

.upload-doc-po-picker {
    min-width: 240px;
}

.upload-doc-receipt-hint {
    display: block;
    font-size: 0.85rem;
    color: #666;
}

.upload-doc-receipt-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.upload-doc-receipt-preview-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    max-width: 120px;
}

.upload-doc-receipt-preview-name {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    word-break: break-word;
}

.upload-doc-labor-log {
    margin-top: 1rem;
}

.upload-doc-receipt-history {
    margin-top: 1rem;
}

.upload-doc-receipt-history h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.upload-doc-receipt-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.upload-doc-receipt-history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fafbfc;
}

.upload-doc-receipt-history-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.upload-doc-receipt-history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--text-muted, #555);
}

.asset-financial-section {
    margin: 1rem 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.asset-financial-section h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.asset-financial-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: end;
    margin-bottom: 0.75rem;
}

.asset-financial-section > label {
    display: block;
}

.asset-financial-row .field-readonly input[readonly] {
    background: #f5f5f5;
    cursor: default;
}

@media (max-width: 640px) {
    .asset-financial-row {
        grid-template-columns: 1fr;
    }
}

.upload-doc-document-row {
    margin-bottom: 1rem;
}

.modal-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.modal-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-title-row h2 {
    margin: 0;
}

.modal-title-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wo-asset-field {
    display: block;
    margin-bottom: 0;
}

.wo-asset-panel {
    width: 100%;
    margin-bottom: 0.85rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.wo-asset-panel .wo-asset-field {
    margin-bottom: 0.45rem;
}

.wo-asset-label {
    display: block;
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
}

.wo-asset-select,
.wo-asset-readonly {
    width: 100%;
    max-width: 100%;
    font-size: 0.82rem;
    padding: 0.3rem 0.45rem;
}

.wo-asset-panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
}

.btn-compact {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    white-space: nowrap;
}

.wo-assigned-users {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.35rem;
}

.wo-assigned-users .field-label {
    margin-bottom: 0.1rem;
}

.wo-assigned-users > .btn-compact {
    align-self: flex-start;
}

.assignment-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem;
}

.assignment-row label {
    flex: 1 1 8rem;
    min-width: 8rem;
}

.wo-assignment-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.85rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--light);
}

.wo-assignment-option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    cursor: pointer;
}

.wo-labor-history {
    margin-top: 1.25rem;
}

.wo-labor-log {
    margin-bottom: 0.75rem;
}

.wo-labor-log .field-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.wo-labor-log-body {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-muted, #f7f7f7);
    color: var(--text-muted, #555);
    font-size: 0.92rem;
    white-space: pre-wrap;
}

.wo-labor-history h3 {
    margin: 0 0 0.65rem;
    font-size: 1rem;
}

.wo-labor-history-table-wrap {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.table-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tab-pill {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: var(--light);
    color: var(--dark);
    text-decoration: none;
    border: 1px solid var(--border);
}

.tab-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.data-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.data-form {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#data-table-wrap .table-wrap {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.map-pin-list {
    margin: 0;
    padding-left: 1.2rem;
}

.row-filter-btn {
    padding: 0;
}

.qr-code-field {
    grid-column: 1 / -1;
}

.qr-code-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.qr-code-input-row input[type="text"] {
    flex: 1 1 16rem;
    min-width: 12rem;
}

.qr-scanner-panel {
    margin: 0.75rem 0 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fafbfd;
}

.qr-reader {
    width: min(100%, 420px);
    min-height: 280px;
}

.qr-scanner-status {
    margin: 0.75rem 0;
    color: var(--muted, #5a6478);
}

.asset-qr-group {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.asset-qr-group > label {
    flex: 1 1 16rem;
    margin-bottom: 0;
}

.asset-qr-thumb {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.asset-thumb-btn {
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.asset-thumb-btn .table-thumb {
    display: block;
}

.asset-qr-thumb-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border: 1px dashed var(--border);
    border-radius: 6px;
    color: var(--muted, #5a6478);
    font-size: 0.85rem;
    text-align: center;
    padding: 0.35rem;
}

@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .left-pane {
        min-height: auto;
    }

    .banner {
        padding: 0.75rem 1rem;
    }

    .chart-grid,
    .chart-grid-thirds {
        grid-template-columns: 1fr;
    }
}
