/* Professional Green, White & Gold Yellow GIS Stylesheet */

:root {
    --bg-main: #ecfdf5;
    --bg-card: #ffffff;
    --bg-sidebar: #022c22;
    --bg-topbar: #064e3b;
    --border-color: #cbd5e1;
    --border-accent: #6ee7b7;
    --primary: #059669;
    --primary-hover: #047857;
    --accent-yellow: #eab308;
    --accent-yellow-light: #fef08a;
    --accent-yellow-dark: #ca8a04;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --text-light: #f8fafc;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Map Point Tooltip Badge */
.map-pt-tooltip {
    background-color: #064e3b !important;
    color: #fef08a !important;
    border: 1px solid #eab308 !important;
    font-weight: 700 !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    font-size: 12px !important;
    padding: 3px 7px !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4) !important;
    pointer-events: none !important;
}

.map-segment-tooltip {
    background-color: rgba(2, 44, 34, 0.95) !important;
    color: #fef08a !important;
    border: 1px solid #eab308 !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35) !important;
}

/* Sidebar (Dark Forest Green with Gold Yellow & White accents) */
#sidebar {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid #065f46;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    min-height: 100vh;
    z-index: 1020;
    flex-shrink: 0;
}

#wrapper.sidebar-collapsed #sidebar,
#sidebar.collapsed {
    margin-left: -250px;
    opacity: 0;
    pointer-events: none;
}

/* Sidebar Toggle Button */
.btn-sidebar-toggle {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-sidebar-toggle:hover {
    background: var(--accent-yellow);
    color: var(--text-dark);
    border-color: var(--accent-yellow);
    transform: scale(1.05);
}

#sidebar .nav-link {
    color: #d1fae5;
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
    margin: 0.2rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    white-space: nowrap;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
    color: #ffffff;
    background-color: #047857;
    border-left: 4px solid var(--accent-yellow);
    font-weight: 600;
}

#sidebar .nav-link i {
    color: var(--accent-yellow);
}

/* Topbar Header (Forest Green) */
.navbar-top {
    background-color: var(--bg-topbar);
    border-bottom: 3px solid var(--accent-yellow);
    padding: 0.75rem 1.5rem;
}

/* Main Wrapper */
.main-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* GIS Workbench Grid Layout */
.workbench-grid {
    display: grid;
    grid-template-columns: 390px 1fr 340px;
    grid-template-rows: 1fr auto;
    height: calc(100vh - 65px);
    overflow: hidden;
}

@media (max-width: 1200px) {
    .workbench-grid {
        grid-template-columns: 1fr;
        height: auto;
        overflow: auto;
    }
}

.workbench-panel {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Canvas Viewport */
.canvas-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #064e3b 0%, #022c22 100%);
    overflow: hidden;
}

#plotterCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

/* Universal Compact Button Size */
.btn-xs {
    padding: 3px 8px !important;
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
}

/* Canvas Floating Toolbar - Compact & Sleek */
.canvas-controls-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    max-width: calc(100% - 20px);
    overflow-x: auto;
}

.canvas-controls-overlay .btn {
    padding: 3px 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 27px;
}

/* Map Container & Control Positioning */
.leaflet-top.leaflet-left .leaflet-control-zoom {
    margin-top: 48px !important;
    margin-left: 12px !important;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.leaflet-top.leaflet-right .leaflet-control-layers {
    margin-top: 10px !important;
    margin-right: 12px !important;
}

.canvas-container {
    perspective: 1400px;
    overflow: hidden;
}

#leafletMap {
    width: 100%;
    height: 100% !important;
    min-height: 100%;
    border-radius: 0;
    border: none;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Google Earth 3D Perspective Tilt Transform */
.canvas-container {
    perspective: 1400px;
    overflow: hidden;
}

#leafletMap {
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

#leafletMap.google-earth-3d-view {
    transform: rotateX(48deg) rotateZ(-10deg) scale(1.25);
    transform-origin: center 40%;
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.85);
    border-radius: 8px;
}

/* 3D Horizon Atmosphere Gradient Overlay */
.canvas-container.has-3d-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(to bottom, rgba(56, 189, 248, 0.5) 0%, rgba(14, 165, 233, 0.18) 60%, transparent 100%);
    pointer-events: none;
    z-index: 99;
}

/* 3D Upright Location Pins & Building Marker */
.google-earth-3d-view .leaflet-location-pin-container,
.google-earth-3d-view .leaflet-house-pin-container,
.google-earth-3d-view .map-aligned-segment-label {
    transform: rotateX(-48deg) rotateZ(10deg) scale(1.15);
    transform-origin: bottom center;
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.7));
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Elevated Red Line Polyline 3D Shadow */
.google-earth-3d-view .leaflet-interactive {
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.65));
}



/* CAD Blueprint Black & White Mode - Pure White Paper (#ffffff) */
.canvas-container.cad-blueprint-mode,
#leafletMap.cad-blueprint-mode,
.cad-blueprint-mode.leaflet-container,
.cad-blueprint-mode .leaflet-container,
.cad-blueprint-mode .leaflet-map-pane,
.cad-blueprint-mode .leaflet-proxy,
.cad-blueprint-mode .leaflet-layer,
.cad-blueprint-mode .leaflet-pane,
.cad-blueprint-mode .leaflet-overlay-pane,
.cad-blueprint-mode .leaflet-marker-pane,
.cad-blueprint-mode .leaflet-tooltip-pane,
.cad-blueprint-mode .leaflet-popup-pane,
.cad-blueprint-mode .leaflet-objects-pane {
    background-color: #ffffff !important;
    background: #ffffff !important;
    filter: none !important;
}

.cad-blueprint-mode svg,
.cad-blueprint-mode path {
    background-color: transparent !important;
    background: transparent !important;
}

.cad-blueprint-mode .leaflet-tile-pane {
    display: none !important;
    /* HIDE MAP TILES COMPLETELY IN B&W MODE */
}

/* CAD Sheet Outer Frame - Removed / Hidden */
.cad-outer-frame {
    display: none !important;
}

/* GIS Interactive Map Compass Widget */
.gis-map-compass {
    position: absolute;
    top: 54px;
    right: 14px;
    z-index: 500;
    width: 76px;
    height: 76px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    user-select: none;
}

.gis-map-compass:hover {
    transform: scale(1.08);
    border-color: #f59e0b;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.6), 0 0 14px rgba(245, 158, 11, 0.5);
}

.gis-map-compass:active {
    transform: scale(0.95);
}

.compass-dial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.compass-svg {
    width: 68px;
    height: 68px;
    display: block;
}

.compass-outer-ring {
    fill: none !important;
    stroke: rgba(255, 255, 255, 0.45);
    stroke-width: 1.5;
}

.compass-inner-ring {
    fill: none !important;
    stroke: rgba(255, 255, 255, 0.25);
    stroke-dasharray: 2 2;
    stroke-width: 1;
}

.compass-ticks line {
    stroke: rgba(255, 255, 255, 0.8);
    stroke-width: 1.2;
}

.compass-guide-ring {
    fill: none !important;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 0.8;
}

.needle-north-red {
    fill: #ef4444;
}

.needle-north-dark {
    fill: #b91c1c;
}

.needle-south-light {
    fill: #e2e8f0;
}

.needle-south-dark {
    fill: #94a3b8;
}

.needle-side-light {
    fill: #cbd5e1;
}

.needle-side-dark {
    fill: #64748b;
}

.needle-ordinal-light {
    fill: #94a3b8;
}

.needle-ordinal-dark {
    fill: #475569;
}

.compass-center-pivot {
    fill: #1e293b;
    stroke: #fbbf24;
    stroke-width: 1.5;
}

.compass-center-dot {
    fill: #fbbf24;
}

.compass-text {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 900;
    fill: #f1f5f9;
    letter-spacing: 0.5px;
}

.compass-text-n {
    fill: #ef4444;
    font-size: 15px;
    font-weight: 900;
}

.compass-text-ordinal {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 7.5px;
    font-weight: 800;
    fill: #fbbf24;
    letter-spacing: 0.3px;
}

/* CAD Blueprint Mode Adaptation for Compass */
.cad-blueprint-mode .gis-map-compass {
    top: 30px;
    right: 35px;
    width: 80px;
    height: 80px;
    background: #ffffff;
    border: 2px solid #000000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 950;
}

.cad-blueprint-mode .compass-svg {
    width: 72px;
    height: 72px;
}

.cad-blueprint-mode .compass-outer-ring {
    fill: none !important;
    stroke: #000000;
    stroke-width: 2;
}

.cad-blueprint-mode .compass-inner-ring {
    fill: none !important;
    stroke: #000000;
}

.cad-blueprint-mode .compass-ticks line {
    stroke: #000000;
}

.cad-blueprint-mode .needle-north-red {
    fill: #000000;
}

.cad-blueprint-mode .needle-north-dark {
    fill: #444444;
}

.cad-blueprint-mode .needle-south-light {
    fill: #ffffff;
    stroke: #000000;
    stroke-width: 0.8;
}

.cad-blueprint-mode .needle-south-dark {
    fill: #cccccc;
    stroke: #000000;
    stroke-width: 0.8;
}

.cad-blueprint-mode .needle-side-light {
    fill: #ffffff;
    stroke: #000000;
    stroke-width: 0.8;
}

.cad-blueprint-mode .needle-side-dark {
    fill: #888888;
}

.cad-blueprint-mode .needle-ordinal-light {
    fill: #ffffff;
    stroke: #000000;
    stroke-width: 0.6;
}

.cad-blueprint-mode .needle-ordinal-dark {
    fill: #bbbbbb;
    stroke: #000000;
    stroke-width: 0.6;
}

.cad-blueprint-mode .compass-guide-ring {
    fill: none !important;
    stroke: #dddddd;
    stroke-width: 0.8;
}

.cad-blueprint-mode .compass-center-pivot {
    fill: #000000;
    stroke: #ffffff;
}

.cad-blueprint-mode .compass-center-dot {
    fill: #ffffff;
}

.cad-blueprint-mode .compass-text {
    fill: #000000;
    font-size: 13px;
    font-weight: 900;
}

.cad-blueprint-mode .compass-text-n {
    fill: #000000;
    font-size: 15px;
    font-weight: 900;
}

.cad-blueprint-mode .compass-text-ordinal {
    fill: #333333;
    font-size: 7.5px;
    font-weight: 800;
}

/* Legacy fallback */
.cad-north-arrow {
    display: none !important;
}

/* Adjusted Survey Data Title Block Box (Bottom Right) */
.cad-title-block-box {
    position: absolute;
    bottom: 30px;
    right: 35px;
    width: 290px;
    border: 2px solid #000000;
    background: #ffffff;
    font-family: Arial, sans-serif;
    padding: 8px 12px;
    color: #000000;
    z-index: 950;
    text-align: center;
}

.cad-title-block-box h6 {
    font-weight: bold;
    margin: 0 0 2px 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cad-title-block-box p {
    margin: 0;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.cad-title-block-box .cad-scale-text {
    font-size: 0.72rem;
    margin-top: 4px;
    color: #000000;
}

/* Rotated & Line-Aligned Segment Bearing & Distance Labels */
.cad-aligned-segment-label {
    position: absolute;
    white-space: nowrap;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: #000000;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    text-align: center;
    line-height: 1.15;
    pointer-events: none;
    transform-origin: center center;
    box-shadow: none !important;
}

.cad-aligned-segment-label .cad-bearing-line {
    color: #000000;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.2px;
    margin-bottom: 2px;
    /* Sitting directly above boundary line */
}

.cad-aligned-segment-label .cad-distance-line {
    color: #000000;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.2px;
    margin-top: 2px;
    /* Sitting directly below boundary line */
}

.leaflet-aligned-label-wrapper {
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

.map-aligned-segment-label {
    position: absolute;
    top: 0;
    left: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.94) !important;
    backdrop-filter: blur(4px);
    border: 1.5px solid #eab308 !important;
    border-radius: 4px;
    padding: 1px 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    font-family: 'Consolas', 'Courier New', 'Inter', monospace;
    font-size: 9.5px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    white-space: nowrap;
    user-select: none;
    pointer-events: none !important;
    cursor: default;
    transform-origin: center center;
    letter-spacing: 0.2px;
}

.map-aligned-segment-label .dist-pill {
    background: #eab308;
    color: #0f172a;
    font-weight: 800;
    padding: 0px 4px;
    border-radius: 3px;
    font-size: 9px;
}

.cad-aligned-segment-label {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: center center;
    white-space: nowrap;
    pointer-events: none;
    text-align: center;
}

/* Parcel Centroid Text Label (Lot ID & Area) */
.cad-centroid-label {
    background: transparent !important;
    border: none !important;
    color: #000000 !important;
    font-family: Arial, sans-serif !important;
    font-weight: bold !important;
    font-size: 13px !important;
    text-align: center !important;
    box-shadow: none !important;
    white-space: nowrap !important;
}

/* Card Styling with High-Contrast Typography */
.card-gis {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    color: var(--text-dark);
}

/* High-contrast typography for cards and main page viewports */
.card-gis h1.text-white,
.card-gis h2.text-white,
.card-gis h3.text-white,
.card-gis h4.text-white,
.card-gis h5.text-white,
.card-gis h6.text-white,
.card-gis .fw-bold.text-white,
.card-gis .text-white:not(.badge):not(.btn) {
    color: #0f172a !important;
    /* High contrast dark navy/slate */
}

/* Page headings outside cards on light background */
.main-wrapper h5.text-white:not(.modal *):not(.modal-dialog *),
.main-wrapper h6.text-white:not(.badge):not(.btn):not(.modal *):not(.modal-dialog *) {
    color: #064e3b !important;
    /* Forest green */
}

/* Subheadings and small text */
.card-gis .text-white-50,
.main-wrapper .text-white-50:not(#sidebar *):not(.navbar-top *):not(.modal *):not(.modal-dialog *) {
    color: #475569 !important;
    /* Clear slate gray */
    font-weight: 500;
}

/* ==========================================================================
   MODAL DIALOG STYLES (Ultra High Readability & Contrast)
   ========================================================================== */
.modal-content.bg-dark,
.modal-content {
    background-color: #1e293b !important;
    /* Clean deep slate */
    border: 1px solid #475569 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75) !important;
    color: #f8fafc !important;
}

.modal-content .modal-header,
.modal-content.bg-dark .modal-header {
    background-color: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
}

.modal-content .modal-footer,
.modal-content.bg-dark .modal-footer {
    background-color: #0f172a !important;
    border-top: 1px solid #334155 !important;
}

.modal-content h1,
.modal-content h2,
.modal-content h3,
.modal-content h4,
.modal-content h5,
.modal-content h6,
.modal-content .modal-title,
.modal-content.bg-dark .modal-title,
.main-wrapper .modal-content h5,
.main-wrapper .modal-content h5.text-white,
.main-wrapper .modal h5,
.main-wrapper .modal h5.text-white {
    color: #ffffff !important;
    /* Brilliant pure white */
    font-weight: 700 !important;
}

.modal-content label,
.modal-content .form-label,
.modal-content.bg-dark label,
.modal-content.bg-dark .form-label,
.modal-content.bg-dark .text-white-50,
.modal-content .text-white-50,
.main-wrapper .modal-content .text-white-50,
.main-wrapper .modal-content label {
    color: #f1f5f9 !important;
    /* Crisp high-contrast bright text */
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.015em;
}

.modal-content .form-control,
.modal-content .form-select,
.modal-content.bg-dark .form-control,
.modal-content.bg-dark .form-select {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid #475569 !important;
    font-size: 0.9rem !important;
    padding: 0.5rem 0.75rem !important;
}

.modal-content .form-control:focus,
.modal-content .form-select:focus,
.modal-content.bg-dark .form-control:focus,
.modal-content.bg-dark .form-select:focus {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.25) !important;
}

.modal-content .form-control::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

/* Prevent browser autofill from rendering white background with dark text */
.modal-content input:-webkit-autofill,
.modal-content input:-webkit-autofill:hover,
.modal-content input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0px 1000px #0f172a inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Form labels inside card-gis */
.card-gis label.text-muted,
.card-gis .form-label.text-muted {
    color: #1e293b !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
}

.card-gis .text-muted {
    color: #475569 !important;
}

/* Dark tables readable text contrast */
.table-dark .text-muted {
    color: #cbd5e1 !important;
    /* Light silver/gray */
}

.table-dark .text-white-50 {
    color: #f1f5f9 !important;
    /* Crisp readable light text */
}

/* Stat card metric subtitle in branches & dashboard */
.card-gis .text-uppercase.fw-semibold,
.card-gis .text-uppercase.fw-bold {
    color: #334155 !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.5px;
}

/* Custom Green, White & Yellow Badges */
.badge-pass {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
    font-weight: 700;
}

.badge-warning {
    background-color: #fef08a;
    color: #854d0e;
    border: 1px solid #eab308;
    font-weight: 700;
}

.badge-fail {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
    font-weight: 700;
}

/* Green & Yellow Button Utilities */
.btn-emerald {
    background-color: #059669;
    color: #ffffff;
    font-weight: 600;
    border: none;
}

.btn-emerald:hover {
    background-color: #047857;
    color: #ffffff;
}

.btn-yellow {
    background-color: #eab308;
    color: #0f172a;
    font-weight: 700;
    border: none;
}

.btn-yellow:hover {
    background-color: #ca8a04;
    color: #ffffff;
}

/* Table survey styling */
.table-survey {
    background-color: #ffffff;
    color: #0f172a;
}

.table-survey th {
    background-color: #064e3b !important;
    color: #ffffff !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    padding: 6px 4px !important;
}

.table-survey td {
    font-size: 13px !important;
    font-weight: 600 !important;
}

.table-survey input,
.table-survey select {
    font-size: 13px !important;
    font-weight: 600 !important;
}

/* Printable Report Styles */
@media print {

    #sidebar,
    .navbar-top,
    .no-print {
        display: none !important;
    }

    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }

    .printable-report {
        padding: 20px;
    }
}

/* Custom Location Pin Markers (Compact & Proportional) */
.custom-gis-pin-marker {
    background: transparent !important;
    border: none !important;
}

.leaflet-location-pin-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
}

.leaflet-location-pin-container:active {
    cursor: grabbing;
}

.leaflet-location-pin-container .pin-icon-body {
    font-size: 24px;
    color: #ffffff;
    line-height: 1;
    filter: drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.75));
    transition: transform 0.15s ease;
}

.leaflet-location-pin-container:hover .pin-icon-body {
    transform: scale(1.2);
    color: #fef08a;
}

.leaflet-location-pin-container .pin-badge-text {
    position: absolute;
    top: 3px;
    font-size: 8px;
    font-weight: 800;
    font-family: 'Inter', monospace;
    color: #064e3b;
    background: #ffffff;
    padding: 0px 3.5px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.custom-gis-circle-marker-container {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', monospace;
    font-weight: 800;
    font-size: 8px;
    color: #ffffff;
    cursor: grab;
    transition: transform 0.15s ease;
}

.custom-gis-circle-marker-container:hover {
    transform: scale(1.3);
}

/* Center House Pin Icon (Whole Lot Move Handle) */
.custom-gis-house-marker {
    background: transparent !important;
    border: none !important;
}

/* Parcel Polygon & Boundary Dragging Cursor */
.parcel-interactive-shape,
.leaflet-interactive.parcel-interactive-shape,
path.parcel-interactive-shape,
.parcel-interactive-drag-hitzone,
.leaflet-interactive.parcel-interactive-drag-hitzone,
path.parcel-interactive-drag-hitzone {
    cursor: grab !important;
}

.parcel-interactive-shape:active,
.leaflet-interactive.parcel-interactive-shape:active,
path.parcel-interactive-shape:active,
.parcel-interactive-drag-hitzone:active,
.leaflet-interactive.parcel-interactive-drag-hitzone:active,
path.parcel-interactive-drag-hitzone:active {
    cursor: grabbing !important;
}

/* Locked Parcel State - Disables Drag Cursor & Locks Center Pin */
.parcel-is-locked .parcel-interactive-shape,
.parcel-is-locked .parcel-interactive-drag-hitzone,
.parcel-is-locked .leaflet-interactive.parcel-interactive-shape,
.parcel-is-locked .leaflet-interactive.parcel-interactive-drag-hitzone,
.parcel-is-locked .parcel-interactive-shape:active,
.parcel-is-locked .parcel-interactive-drag-hitzone:active {
    cursor: default !important;
}

.leaflet-house-pin-container {
    background: rgba(255, 255, 255, 0.98);
    border: 3px solid #ef4444;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    color: #ef4444;
    backdrop-filter: blur(4px);
    cursor: grab;
    position: relative;
    user-select: none;
    transition: transform 0.15s ease;
}

.leaflet-house-pin-container.is-locked {
    border: 3px solid #dc2626 !important;
    color: #dc2626 !important;
    cursor: default !important;
    background: rgba(254, 242, 242, 0.98) !important;
}

.leaflet-house-pin-container.is-locked:hover {
    transform: none !important;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4) !important;
}

.leaflet-house-pin-container:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.6);
}

.leaflet-house-pin-container:active {
    cursor: grabbing;
}

.leaflet-house-pin-container.is-locked:active {
    cursor: default !important;
}

.leaflet-house-pin-container .house-move-tag {
    position: absolute;
    bottom: -16px;
    white-space: nowrap;
    font-size: 8px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    background: #ef4444;
    padding: 1px 5px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.3px;
    pointer-events: none;
}

/* Parcel Rotation Handle Gizmo */
.custom-gis-rotate-marker {
    background: transparent !important;
    border: none !important;
}

.leaflet-parcel-rotate-handle {
    background: rgba(15, 23, 42, 0.96);
    border: 2.5px solid #3b82f6;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
    color: #60a5fa;
    cursor: grab;
    position: relative;
    user-select: none;
    transition: transform 0.15s ease, background 0.15s ease;
    backdrop-filter: blur(4px);
}

.leaflet-parcel-rotate-handle:hover {
    transform: scale(1.18);
    background: #1e3a8a;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.7);
}

.leaflet-parcel-rotate-handle:active {
    cursor: grabbing;
}

.leaflet-parcel-rotate-handle .rotate-handle-tag {
    position: absolute;
    top: -16px;
    white-space: nowrap;
    font-size: 8px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    background: #3b82f6;
    padding: 1px 5px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.3px;
    pointer-events: none;
}

/* Floating Lot Rotation Control Panel */
.lot-rotation-panel {
    position: absolute;
    top: 55px;
    left: 15px;
    z-index: 1010;
    width: 260px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1.5px solid #3b82f6;
    border-radius: 10px;
    padding: 10px 12px;
    color: #f8fafc;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    user-select: none;
    transition: all 0.3s ease;
}

.lot-rotation-panel input[type=range] {
    accent-color: #3b82f6;
    height: 4px;
}

/* Compact Segment Bearing Tooltips */
.map-segment-tooltip {
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid #eab308 !important;
    color: #fef08a !important;
    font-family: 'Consolas', 'Courier New', 'Inter', monospace !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5) !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    line-height: 1.35 !important;
}

.map-segment-tooltip::before {
    display: none !important;
}

/* CAD & Blueprint Aligned Segment Labels (Clean CAD Drafting Typography with White Halo) */
.custom-gis-aligned-label {
    background: transparent !important;
    border: none !important;
}

.cad-aligned-segment-label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    font-family: 'Consolas', 'Courier New', 'Inter', monospace;
    line-height: 1.05;
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    text-align: center;
}

.cad-aligned-segment-label.cad-compact {
    flex-direction: row;
    gap: 3px;
}

.cad-aligned-segment-label .cad-bearing-line {
    font-size: 8.5px;
    font-weight: 800;
    color: #000000;
    letter-spacing: 0.1px;
    text-shadow: 0 0 2px #ffffff, 0 0 4px #ffffff, 1px 1px 0 #ffffff, -1px -1px 0 #ffffff, 1px -1px 0 #ffffff, -1px 1px 0 #ffffff;
}

.cad-aligned-segment-label .cad-distance-line {
    font-size: 8px;
    font-weight: 800;
    color: #047857;
    /* Crisp Emerald Green for distance distinction */
    letter-spacing: 0.1px;
    text-shadow: 0 0 2px #ffffff, 0 0 4px #ffffff, 1px 1px 0 #ffffff, -1px -1px 0 #ffffff, 1px -1px 0 #ffffff, -1px 1px 0 #ffffff;
}

.map-aligned-segment-label:hover {
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.8), 0 4px 12px rgba(0, 0, 0, 0.7) !important;
    border-color: #facc15 !important;
    z-index: 1000 !important;
}

/* Hide number input spinners for clean table numbers */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

input[type=number] {
    -moz-appearance: textfield !important;
}

/* Floating Drone Shot Overlay Control Panel */
.drone-controls-panel {
    position: absolute;
    top: 60px;
    right: 15px;
    z-index: 1010;
    width: 220px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1.5px solid #eab308;
    border-radius: 10px;
    padding: 10px 12px;
    color: #f8fafc;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    user-select: none;
    transition: all 0.3s ease;
}

.drone-controls-panel input[type=range] {
    accent-color: #eab308;
    height: 4px;
}

.drone-overlay-layer {
    filter: contrast(1.08) brightness(1.03);
    transition: opacity 0.2s ease;
}

/* Tie Point & Monument GIS Marker Styles */
.leaflet-tiepoint-icon {
    background: transparent !important;
    border: none !important;
}

.custom-gis-tiepoint-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    cursor: grab;
    user-select: none;
    transition: transform 0.15s ease;
}

.custom-gis-tiepoint-marker:hover {
    transform: scale(1.1);
    z-index: 1050 !important;
}

.tp-beacon-badge {
    background: #064e3b;
    color: #fef08a;
    border: 2px solid #eab308;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 800;
    font-family: 'Inter', system-ui, sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.tp-beacon-badge i {
    color: #eab308;
    font-size: 13px;
}

.tp-pin-dot {
    width: 10px;
    height: 10px;
    background: #eab308;
    border: 2px solid #ffffff;
    border-radius: 50%;
    margin-top: -2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* CAD Blueprint Mode Tie Point Marker */
.cad-blueprint-mode .tp-beacon-badge {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

.cad-blueprint-mode .tp-beacon-badge i {
    color: #000000 !important;
}

.cad-blueprint-mode .tp-pin-dot {
    background: #000000 !important;
    border-color: #ffffff !important;
}

/* Tie Line Midpoint Label */
.cad-tie-line-label {
    background: #fef3c7;
    color: #92400e;
    border: 1.5px solid #d97706;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.cad-blueprint-mode .cad-tie-line-label {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1.5px solid #000000 !important;
}

/* Map Pick Mode Interactive Banner */
.map-pick-mode-banner {
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1020;
    background: rgba(6, 78, 59, 0.95);
    color: #fef08a;
    border: 2px solid #eab308;
    border-radius: 30px;
    padding: 6px 18px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: bounceBanner 1s infinite alternate ease-in-out;
}

@keyframes bounceBanner {
    from {
        transform: translateX(-50%) translateY(0px);
    }

    to {
        transform: translateX(-50%) translateY(-4px);
    }
}

/* Tie Point 3-Tier Selector Component (Province -> Municipality -> Name) */
.tie-point-fieldset {
    background-color: #022c22;
    border: 1px solid #065f46;
    border-radius: 6px;
    padding: 7px 10px 9px 10px;
    margin-bottom: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: block;
}

.tie-point-legend {
    float: none;
    width: auto;
    font-size: 13.5px;
    font-weight: 700;
    color: #fef08a;
    /* Gold yellow on dark green */
    padding: 0 6px;
    margin-bottom: 3px;
    line-height: 1;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tie-point-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    align-items: start;
}

.tie-point-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tie-point-select {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 12.5px;
    font-weight: 600;
    width: 100%;
    height: 32px;
    line-height: 1.2;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tie-point-select:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4) !important;
    outline: none;
}

.tie-point-label {
    font-size: 12px;
    font-weight: 600;
    color: #d1fae5;
    /* Crisp readable light mint on forest green */
    margin-top: 4px;
    line-height: 1.2;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    user-select: none;
}