/* ==========================================================================
   GIS AVIALESOOKHRANA — 1C THEMED STYLESHEET
   ========================================================================== */

:root {
    --color-1c-yellow: #f5c400;
    --color-1c-yellow-hover: #facc15;
    --color-1c-yellow-dark: #d97706;
    --color-1c-border: #cbd5e1;
    --color-1c-bg: #f1f5f9;
    --color-1c-header: #ffffff;
    --color-text-main: #0f172a;
    --color-text-muted: #475569;
    --color-red: #ef4444;
    --color-red-hover: #dc2626;
    --color-green: #16a34a;
    --color-blue: #2563eb;
    --color-blue-hover: #1d4ed8;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-main);
    color: var(--color-text-main);
    background-color: #ffffff;
}

#app {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ==========================================================================
   TOP 1C CONTROL / FILTER TOOLBAR (44px HEIGHT)
   ========================================================================== */
.top-control-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 12px;
    background-color: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
    z-index: 1000;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    user-select: none;
    transition: margin-top 0.25s ease;
}

.top-control-panel.hidden {
    margin-top: -44px;
}

.top-control-panel label {
    font-weight: 700;
    color: var(--color-text-muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.top-control-panel select,
.top-control-panel input[type="date"],
.top-control-panel input[type="text"] {
    background-color: #ffffff;
    color: var(--color-text-main);
    border: 1px solid var(--color-1c-border);
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 600;
    outline: none;
    height: 26px;
    font-family: var(--font-main);
}

.top-control-panel select:hover,
.top-control-panel input[type="date"]:hover {
    border-color: #94a3b8;
}

.top-control-panel input[type="checkbox"] {
    accent-color: var(--color-1c-yellow-dark);
    cursor: pointer;
}

/* Base button styles */
.btn-1c {
    background-color: #ffffff;
    color: #1e293b;
    border: 1px solid var(--color-1c-border);
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 26px;
    transition: background-color 0.15s, border-color 0.15s;
    font-family: var(--font-main);
    white-space: nowrap;
}

.btn-1c:hover {
    background-color: #e2e8f0;
}

.btn-1c-yellow {
    background-color: var(--color-1c-yellow) !important;
    color: #111827 !important;
    border-color: var(--color-1c-yellow-dark) !important;
    font-weight: 800 !important;
}

.btn-1c-yellow:hover {
    background-color: var(--color-1c-yellow-hover) !important;
}

.btn-1c-red {
    background-color: var(--color-red) !important;
    color: #ffffff !important;
    border-color: #b91c1c !important;
    font-weight: 800 !important;
}

.btn-1c-red:hover {
    background-color: var(--color-red-hover) !important;
}

.btn-1c-blue {
    background-color: var(--color-blue) !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    font-weight: 800 !important;
}

.btn-1c-blue:hover {
    background-color: var(--color-blue-hover) !important;
}

.toolbar-spacer {
    flex: 1;
}

/* ==========================================================================
   MAP CONTAINER
   ========================================================================== */
.map-container-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    background: #f1f5f9;
}

#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: #f1f5f9;
}

/* Floating toggles */
.floating-panel-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 500;
    background: #ffffff;
    border: 1px solid var(--color-1c-border);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.floating-panel-toggle:hover {
    background: #f8fafc;
}

.floating-route-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 500;
    background: #ffffff;
    border: 1px solid var(--color-1c-border);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.floating-route-btn:hover {
    background: #f8fafc;
}

/* Coordinates box at bottom */
.coords-box {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border: 1px solid var(--color-1c-border);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 10.5px;
    font-weight: 700;
    color: #334155;
    z-index: 500;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    pointer-events: none;
    user-select: none;
}

/* ==========================================================================
   ROUTE PLANNING SIDEBAR PANEL
   ========================================================================== */
.route-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 380px;
    height: 100%;
    background: #ffffff;
    border-left: 1px solid var(--color-1c-border);
    box-shadow: -4px 0 20px rgba(0,0,0,0.12);
    z-index: 900;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.route-panel.active {
    transform: translateX(0);
}

.route-panel-header {
    height: 44px;
    background: #f8fafc;
    border-bottom: 1px solid var(--color-1c-border);
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    font-size: 13px;
}

.route-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.route-header-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
}

.route-header-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.route-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Route Action Buttons */
.route-actions-box {
    background: #f8fafc;
    border: 1px solid var(--color-1c-border);
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.route-actions-row-1 {
    display: flex;
    gap: 6px;
}

.route-actions-row-1 button {
    flex: 1;
    height: 32px;
}

.route-actions-row-2, .route-actions-row-3 {
    display: flex;
    gap: 6px;
}

.route-actions-row-2 button, .route-actions-row-3 button {
    flex: 1;
}

/* Stats Card */
.route-card-box {
    background: #ffffff;
    border: 1px solid var(--color-1c-border);
    border-radius: 6px;
    padding: 10px;
}

.route-stats-flex {
    display: flex;
    gap: 8px;
}

.route-stat-box {
    flex: 1;
    background: #f8fafc;
    border: 1px solid var(--color-1c-border);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

.route-stat-val {
    font-size: 15px;
    font-weight: 900;
    color: #0f172a;
}

.route-stat-lbl {
    font-size: 9.5px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.route-waypoints-scroll {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 2px;
}

.waypoint-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--color-1c-border);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 11.5px;
    transition: background-color 0.15s, border-color 0.15s;
    user-select: none;
}

.waypoint-item:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.waypoint-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #e2e8f0;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    color: #334155;
    flex-shrink: 0;
}

.waypoint-name {
    flex: 1;
    font-weight: 700;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.waypoint-dwell {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    color: #64748b;
    font-weight: 600;
}

.waypoint-dwell input {
    width: 38px;
    padding: 2px 4px;
    border: 1px solid var(--color-1c-border);
    border-radius: 4px;
    font-size: 11px;
    text-align: center;
    font-weight: 700;
}

.waypoint-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   MODAL OVERLAYS & DIALOGS
   ========================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-dialog {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    border: 1px solid var(--color-1c-border);
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--color-1c-border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    font-size: 14px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Tables in modals */
.matrix-table, .legs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    text-align: center;
}

.matrix-table th, .matrix-table td,
.legs-table th, .legs-table td {
    border: 1px solid #cbd5e1;
    padding: 6px 8px;
}

.matrix-table th, .legs-table th {
    background: #f1f5f9;
    font-weight: 800;
    color: #1e293b;
}

.matrix-table td.locked-edge {
    background: #fef08a !important;
    font-weight: 800;
}

/* ==========================================================================
   PRINT / FLIGHT ASSIGNMENT SHEET (SPLIT VIEW)
   ========================================================================== */
#routePrintPanel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    height: 100vh;
    background: #ffffff;
    border-left: 2px solid #000000;
    box-shadow: -6px 0 25px rgba(0,0,0,0.25);
    z-index: 99999;
    flex-direction: column;
    font-family: var(--font-main);
}

body.print-mode-active #routePrintPanel {
    display: flex !important;
}

/* Legacy print rules removed in favor of A4 layout */

.print-panel-header {
    background: #0f172a;
    color: #ffffff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.print-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.print-doc-header {
    text-align: center;
    border-bottom: 2px solid #000000;
    padding-bottom: 8px;
}

.print-doc-title {
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.print-doc-sub {
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    margin-top: 4px;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5px;
    text-align: center;
}

.print-table th, .print-table td {
    border: 1px solid #000000;
    padding: 4px;
}

.print-table th {
    background: #e2e8f0;
    font-weight: 800;
}

.print-table tr.total-row {
    background: #fef08a;
    font-weight: 900;
}

.print-signatures {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 11px;
    font-weight: 700;
}

/* Custom SVG Markers */
.custom-maplibre-marker {
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.15s ease;
}

.custom-maplibre-marker:hover {
    transform: scale(1.15);
}


/* ==========================================================================
   AUTHENTIC 1C MAP CONTROLS & WIDGETS (PORTED FROM ШаблоКартыHTML.html)
   ========================================================================== */

/* Top-Left Controls Container */
.map-top-left-controls {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

/* Home & Info Buttons */
.map-home-btn, .map-search-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    background: linear-gradient(135deg, #f5c400, #ffd836);
    border: 1px solid rgba(0, 0, 0, 0.22);
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.18s ease;
    box-sizing: border-box;
    padding: 0;
}

.map-home-btn:hover, .map-search-btn:hover {
    background: linear-gradient(135deg, #facc15, #fef08a);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.28);
}

.map-home-btn:active, .map-search-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Search Container & Dropdown */
.map-search-container {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 105;
}

.map-search-wrapper {
    display: none;
    align-items: center;
    position: relative;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.22);
    border-radius: 6px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.25);
    height: 36px;
    width: 260px;
    padding: 0 6px 0 10px;
}

.map-search-container.active .map-search-btn {
    display: none;
}

.map-search-container.active .map-search-wrapper {
    display: flex;
}

.map-search-input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 13px;
    font-family: inherit;
    color: #1e293b;
    font-weight: 600;
}

.map-search-input::placeholder {
    color: #94a3b8;
    font-weight: normal;
}

.map-search-clear-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    padding: 0 4px;
    display: none;
    align-items: center;
    justify-content: center;
}

.map-search-dropdown {
    position: absolute;
    top: 42px;
    left: 0;
    width: 290px;
    max-height: 360px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.18);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
    overflow-y: auto;
    display: none;
    z-index: 200;
}

.map-search-item {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s ease;
}

.map-search-item:last-child {
    border-bottom: none;
}

.map-search-item:hover, .map-search-item.selected {
    background: #fef9c3;
}

.map-search-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.map-search-item-badge {
    background: #f5c400;
    color: #0f172a;
    font-weight: 800;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.map-search-item-les {
    font-weight: 700;
    font-size: 13px;
    color: #0f172a;
}

.map-search-item-sub {
    font-size: 11px;
    color: #64748b;
    padding-left: 2px;
}

.map-search-no-results {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    color: #64748b;
}

/* Top-Right Layer Control Button & Panel */
.map-layer-control-container {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 100;
}

.map-layer-toggle-btn {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #f5c400, #ffd836);
    border: 1px solid rgba(0, 0, 0, 0.22);
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.18s ease;
}

.map-layer-panel {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    width: 250px;
    max-height: 480px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    border: 1px solid rgba(0,0,0,0.15);
    overflow-y: auto;
    z-index: 110;
    font-family: inherit;
}

.map-layer-panel.active {
    display: block;
}

.map-layer-panel-header {
    background: #ffd836;
    padding: 8px 12px;
    font-weight: 800;
    font-size: 13px;
    color: #1e293b;
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.map-layer-section {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.map-layer-section:last-child {
    border-bottom: none;
}

.map-layer-section-title {
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-layer-section-title.maps { color: #854d0e; }
.map-layer-section-title.zones { color: #991b1b; }
.map-layer-section-title.grids { color: #166534; }

.map-layer-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    user-select: none;
}

.map-layer-option input[type="radio"],
.map-layer-option input[type="checkbox"] {
    accent-color: #f5c400;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Bottom Coordinates & Zoom Badges */
.map-coords-box {
    position: absolute;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.map-coords-bottom-left {
    bottom: 12px;
    left: 12px;
}

.map-coords-bottom-right {
    bottom: 12px;
    right: 12px;
}

.coord-badge {
    background: #fef08a;
    color: #854d0e;
    border: 1px solid #fde047;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    font-weight: 700;
}

/* Hint Modal Card & Layout */
.hint-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.hint-modal-overlay.active {
    display: flex;
}

.hint-modal-card {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid rgba(0,0,0,0.15);
    padding: 22px 24px;
    box-sizing: border-box;
    font-family: var(--font-main);
    color: #222222;
    animation: modalFadeIn 0.2s ease-out;
}

.hint-modal-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    background: linear-gradient(135deg, #eac91e, #f9e66b);
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hint-zoom-badge {
    display: inline-block;
    padding: 3px 8px;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    font-weight: 700;
    border-radius: 5px;
    background: #fef08a;
    color: #854d0e;
    border: 1px solid #fde047;
}

.hint-modal-btn {
    background: linear-gradient(135deg, #eac91e, #f9e66b);
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 6px;
    padding: 8px 22px;
    font-size: 13px;
    font-weight: 700;
    color: #222222;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.15s ease;
}

.hint-modal-btn:hover {
    background: linear-gradient(135deg, #facc15, #fef08a);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}


/* ==========================================================================
   AUTHENTIC 1C ROUTE PLANNER & COORDINATES STYLING (MATCHING SCREENSHOTS 1 & 2)
   ========================================================================== */

/* Fullscreen Map Wrapper */
.map-container-wrapper.full-screen {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Blue Plane Toggle Button */
.map-plane-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    background: #2563eb;
    border: 1px solid rgba(0, 0, 0, 0.22);
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.18s ease;
    padding: 0;
}

.map-plane-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.28);
}

.map-plane-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 1C Bottom Badges (Screenshot 1) */
.map-1c-badge {
    position: absolute;
    bottom: 14px;
    background: #ffd836;
    border: 1px solid #d97706;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    user-select: none;
    font-size: 13px;
    font-weight: 800;
    color: #1e293b;
}

.map-coords-bottom-left {
    left: 14px;
}

.map-coords-bottom-right {
    right: 14px;
}

.map-1c-badge .badge-label {
    font-weight: 800;
    color: #1e293b;
    font-size: 13px;
    letter-spacing: 0.2px;
}

.map-1c-badge .coord-pill {
    background: #e2e8f0;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    padding: 2px 10px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.map-1c-badge .coord-pill:hover {
    background: #cbd5e1;
    border-color: #94a3b8;
}

/* Route Control Panel Sidebar (Screenshot 2) */
.route-control-panel {
    position: absolute;
    top: 10px;
    bottom: 54px;
    left: 54px;
    width: 500px;
    min-width: 500px;
    max-width: 500px;
    height: auto;
    max-height: calc(100% - 64px);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    animation: modalFadeIn 0.2s ease-out;
}

.route-control-panel.active {
    display: flex;
}

.route-panel-header {
    background: #ffd836;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.route-header-title {
    font-weight: 800;
    font-size: 14px;
    color: #1e293b;
}

.route-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.route-header-btn {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    color: #1e293b;
    transition: background 0.15s ease;
}

.route-header-btn:hover {
    background: rgba(0,0,0,0.08);
}

.route-panel-body {
    padding: 10px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Row 1 Buttons */
.route-btn-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.route-btn-add {
    background: #f5c400;
    border: 1px solid #d97706;
    border-radius: 5px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 12px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex: 1;
    justify-content: center;
    transition: background 0.15s ease;
}

.route-btn-add:hover {
    background: #fbbf24;
}

.route-btn-add.active {
    background: #16a34a;
    color: #ffffff;
    border-color: #15803d;
}

.route-btn-build {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 12px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    flex: 1.3;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.15s ease;
}

.route-btn-build:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* Row 2 Buttons Grid */
.route-actions-grid-2 {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr 0.9fr 0.7fr 32px;
    gap: 5px;
    align-items: center;
}

.btn-1c-tab {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 5px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-1c-tab:hover {
    background: #e2e8f0;
}

.btn-1c-red-action {
    background: #ef4444;
    border: 1px solid #dc2626;
    border-radius: 4px;
    padding: 5px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s ease;
}

.btn-1c-red-action:hover {
    background: #dc2626;
}

.btn-1c-yellow-action {
    background: #ffd836;
    border: 1px solid #d97706;
    border-radius: 4px;
    padding: 5px 6px;
    font-size: 11px;
    font-weight: 800;
    color: #1e293b;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s ease;
}

.btn-1c-yellow-action:hover {
    background: #facc15;
}

/* Stats Summary Box */
.route-stat-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 14px;
    text-align: center;
}

.route-stat-value {
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
}

.route-stat-sub {
    font-size: 9px;
    font-weight: 800;
    color: #64748b;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

/* Settings Card */
.route-settings-card {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
}

.route-setting-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #334155;
}

.input-1c-field {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 600;
    outline: none;
    color: #0f172a;
}

.input-1c-field:focus {
    border-color: #f5c400;
}

/* Point Cards List */
.route-points-list {
    flex: 1;
    min-height: 0;
    max-height: none !important;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
    padding-right: 3px;
}

.route-points-empty {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px dashed #cbd5e1;
}

.route-point-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.15s ease;
}

.route-point-card:hover {
    border-color: #94a3b8;
}

.route-point-card.is-locked {
    border: 1.5px solid #f59e0b;
    background: #fffdf5;
}

.point-card-row-1 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.point-num-badge {
    background: #2563eb;
    color: #ffffff;
    font-weight: 800;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    user-select: none;
}

.point-title-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    outline: none;
}

.point-actions-btns {
    display: flex;
    align-items: center;
    gap: 3px;
}

.point-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #64748b;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.15s ease;
}

.point-action-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.point-action-btn.btn-delete:hover {
    background: #fee2e2;
    color: #ef4444;
}

.point-card-row-2 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
}

.point-card-row-3 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #475569;
}

/* Flight Leg Labels on Map (Screenshot 2) */
.route-leg-label-box {
    background: #ffffff;
    border: 1.5px solid #000000;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
    color: #000000;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: auto;
    font-family: var(--font-main);
}

.route-leg-label-box .ipu-val {
    color: #000000;
    font-weight: 900;
}

.custom-point-name-tag {
    background: #ffffff;
    border: 1.5px solid #000000;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 800;
    color: #000000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    white-space: nowrap;
    font-family: var(--font-main);
}

.route-locked-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 800;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 4px;
    padding: 3px 6px;
    margin: 4px 0;
    cursor: pointer;
    user-select: none;
}

/* Canvas Overlay for Quarter Numbers (100% Offline 144 FPS) */
.kvartal-canvas-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

/* Screen reader and accessibility utility */
.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;
}

/* ==========================================================================
   AUTHENTIC 1C CONTEXT MENU, MATRIX MODAL, LEGS MODAL & EXACT PRINT MODE (SCREENSHOT 3)
   ========================================================================== */

/* 1. Point Selection Styles (ЛКМ) */
.route-point-card.is-selected {
    border: 2px solid #2563eb !important;
    background: #eff6ff !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2) !important;
}

.custom-route-icon.is-selected {
    filter: drop-shadow(0 0 6px #2563eb) !important;
    z-index: 1000 !important;
}

/* 2. Route Marker Context Menu (ТОЛЬКО ПКМ) */
.route-context-menu {
    display: none;
    position: fixed;
    z-index: 999999;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    min-width: 270px;
    user-select: none;
    visibility: visible;
    opacity: 1;
}

.route-context-header {
    font-size: 11px;
    font-weight: 800;
    color: #475569;
    padding: 4px 10px 6px 10px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.route-context-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.route-context-item:hover {
    background: #f1f5f9;
}

.route-context-item-danger {
    color: #ef4444;
}

.route-context-item-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* 3. Matrix & Legs Modal Overlays */
.matrix-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.2s ease-out;
}

.matrix-modal-overlay.active {
    display: flex;
}

.matrix-modal-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 680px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cbd5e1;
}

.matrix-modal-header {
    background: #ffd836;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #d97706;
}

.matrix-modal-title {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
}

.matrix-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    padding: 2px 6px;
    border-radius: 4px;
}

.matrix-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.matrix-modal-body {
    padding: 16px;
    overflow: auto;
    max-height: calc(85vh - 50px);
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    text-align: center;
}

.matrix-table th, .matrix-table td {
    border: 1px solid #cbd5e1;
    padding: 6px 8px;
    vertical-align: middle;
}

.matrix-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #334155;
}

.matrix-table td b {
    font-size: 12px;
    color: #0f172a;
}

.route-legs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.route-legs-table th, .route-legs-table td {
    border: 1px solid #cbd5e1;
    padding: 8px 10px;
}

.route-legs-table th {
    background: #f1f5f9;
    font-weight: 700;
    color: #334155;
}

.route-legs-table tr.bg-alt {
    background: #f8fafc;
}

.route-legs-table tr.bg-white {
    background: #ffffff;
}

.route-legs-table td.leg-name {
    font-weight: 700;
    color: #2563eb;
}

.route-legs-table td.leg-course {
    font-weight: 800;
    text-align: right;
}

.route-legs-table td.leg-dist {
    text-align: right;
    font-weight: 700;
}

.route-legs-table td.leg-time {
    text-align: right;
}

/* 4. Exact 1C Print Mode Layout (A4 Landscape Frame & Ultra-Crisp Proportions) */
body.print-mode-active {
    background: #1e293b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Exact A4 Landscape Container (297 / 210 = 1.4142) */
body.print-mode-active #app {
    display: flex !important;
    flex-direction: row !important;
    height: 100vh !important;
    width: calc(100vh * 1.4142) !important;
    max-width: 100vw !important;
    background: #ffffff !important;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.7) !important;
    border: 3px solid #000000 !important;
    box-sizing: border-box !important;
    position: relative !important;
}

body.print-mode-active .map-container-wrapper {
    flex: 1 !important;
    height: 100% !important;
    position: relative !important;
    border-right: 3px solid #000000 !important;
    box-sizing: border-box !important;
}

body.print-mode-active #map {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

body.print-mode-active #routePrintPanel {
    display: flex !important;
    position: static !important;
    width: 480px !important;
    min-width: 480px !important;
    max-width: 480px !important;
    height: 100% !important;
    background: #ffffff !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    z-index: 100 !important;
}

/* Hide all extraneous UI controls and fire markers in print mode */
body.print-mode-active .top-1c-filter-bar,
body.print-mode-active #top1CFilterBar,
body.print-mode-active .route-control-panel,
body.print-mode-active #routeControlPanel,
body.print-mode-active .route-panel,
body.print-mode-active .route-points-linked-container,
body.print-mode-active #routePointsLinkedContainer,
body.print-mode-active .section-point-inspector,
body.print-mode-active #sectionPointInspector,
body.print-mode-active .section-points-main,
body.print-mode-active .route-table-wrapper,
body.print-mode-active .map-top-left-controls,
body.print-mode-active .map-layer-control-container,
body.print-mode-active .map-1c-badge,
body.print-mode-active #hintModalOverlay,
body.print-mode-active #pointEditModal,
body.print-mode-active #routeHelpModal,
body.print-mode-active .route-leg-label-box {
    display: none !important;
}

.print-panel-header {
    padding: 10px 14px;
    background: #ffffff;
    border-bottom: 2px solid #000000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.print-btn {
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.print-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.print-btn-blue {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
}

.print-btn-blue:hover {
    background: #1d4ed8;
}

/* Centered vertical flow for print cards */
.print-panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px 16px;
    box-sizing: border-box;
    overflow-y: auto;
    width: 100%;
}

.print-cards-wrapper {
    width: 100%;
    max-width: 100%;
    margin: auto 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.print-doc-header {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #000000;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.print-header-row {
    font-size: 13px;
    line-height: 1.35;
    color: #000000;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}

.print-header-lbl {
    font-weight: 800 !important;
    color: #000000 !important;
    white-space: nowrap !important;
}

.print-header-val {
    font-weight: 500 !important;
    color: #000000 !important;
    white-space: nowrap !important;
}

.print-doc-footer-meta {
    font-size: 9.5px !important;
    font-weight: 700 !important;
    color: #000000 !important;
    text-align: center !important;
    margin-top: 6px !important;
    padding-top: 3px !important;
    border-top: 1px dashed #000000 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    letter-spacing: 0.1px !important;
}

.print-cards-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 6px;
}

.print-doc-card {
    background: #ffffff;
    border: 2px dashed #000000;
    border-radius: 6px;
    padding: 7px 12px;
}

.print-doc-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    padding-bottom: 3px;
    border-bottom: 1px dashed #cbd5e1;
}

.print-doc-badge {
    background: #000000;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
}

.print-doc-name {
    font-weight: 800;
    font-size: 13.5px;
    color: #000000;
}

.print-doc-line {
    font-size: 12px;
    display: flex;
    gap: 6px;
    margin-bottom: 2px;
    line-height: 1.35;
}

.print-doc-lbl {
    font-weight: 700;
    color: #000000;
}

.print-doc-val {
    font-weight: 800;
    color: #000000;
}

.print-leg-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 3px 0;
    color: #000000;
}

.print-leg-text {
    font-size: 11px;
    font-weight: 800;
    color: #000000;
}

.print-leg-sub {
    color: #000000 !important;
    font-size: 10.5px;
    font-weight: 800 !important;
}

.print-summary-box {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    margin-top: 12px !important;
    margin-bottom: 6px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.print-summary-title {
    font-size: 12.5px;
    font-weight: 900;
    color: #000000;
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.print-summary-section-title {
    font-size: 10.5px;
    font-weight: 800;
    color: #000000;
    text-transform: uppercase;
    margin-top: 4px;
    margin-bottom: 2px;
}

.print-summary-line {
    font-size: 11.5px;
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
    color: #000000;
    font-weight: 600;
}

.print-summary-line .print-doc-val {
    font-weight: 800;
}

.print-summary-divider {
    height: 1px;
    border-top: 1px dotted #000000;
    margin: 4px 0;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 0;
    }
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    body {
        background: #ffffff !important;
        border: none !important;
    }
    .print-panel-header {
        display: none !important;
    }
    body.print-mode-active #app {
        width: 100vw !important;
        height: 100vh !important;
        border: none !important;
        box-shadow: none !important;
    }
}


/* ==========================================================================
   NEW INTUITIVE SKETCH CARD DESIGN (POINT CARDS & VECTOR POPUP)
   ========================================================================== */

/* 1. Route Point Cards (Header + Dropped-out Sublist) */
.route-point-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.point-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: all 0.15s ease;
    z-index: 2;
    position: relative;
}

.point-card-head:hover {
    border-color: #94a3b8;
}

.route-point-card.is-selected .point-card-head {
    border-color: #2563eb !important;
    background: #eff6ff !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25) !important;
}

.point-num-badge {
    font-size: 11px;
    font-weight: 900;
    color: #ffffff;
    padding: 3px 7px;
    border-radius: 5px;
    flex-shrink: 0;
    letter-spacing: 0.2px;
}

.point-num-badge.badge-vpp {
    background: #2563eb;
}

.point-num-badge.badge-fire {
    background: #dc2626;
}

.point-num-badge.badge-ppm {
    background: #334155;
}

.point-title-input {
    flex: 1;
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    border: none;
    outline: none;
    background: transparent;
    padding: 2px 4px;
    min-width: 80px;
}

.point-head-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-head-icon {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s ease;
    padding: 0;
}

.btn-head-icon:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-head-icon.btn-delete:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.btn-head-icon.btn-toggle-sublist {
    font-size: 13px;
    font-weight: 900;
    color: #2563eb;
    background: #eff6ff;
    border-color: #bfdbfe;
}

/* Dropped-out sublist styling (Narrower, list-styled) */
.point-card-sublist {
    width: calc(100% - 16px);
    margin: -3px auto 0 auto;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 8px 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
    z-index: 1;
    position: relative;
}

.route-point-card.is-selected .point-card-sublist {
    border-color: #93c5fd;
    background: #f8fafc;
}

.card-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}

.card-list-lbl {
    font-size: 11.5px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
    width: 95px;
    flex-shrink: 0;
}

.card-list-input, .card-list-select {
    flex: 1;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #f8fafc;
    outline: none;
    transition: all 0.15s ease;
}

.card-list-input:focus, .card-list-select:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.dwell-input-container {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 90px;
}

.dwell-unit-text {
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
}

/* 2. Vector Map Fire Popup Styles (NO emojis) */
.custom-fire-map-popup .maplibregl-popup-content {
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    border: 1px solid #cbd5e1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.fire-popup-container {
    width: 320px;
    background: #ffffff;
}

.fire-popup-header {
    background: #fef2f2;
    border-bottom: 1.5px solid #fecaca;
    padding: 10px 14px;
}

.fire-popup-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 900;
    color: #b91c1c;
}

.fire-popup-date {
    font-size: 11.5px;
    font-weight: 700;
    color: #7f1d1d;
    margin-top: 2px;
}

.fire-popup-body {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fire-popup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
}

.fire-popup-lbl {
    font-weight: 700;
    color: #475569;
}

.fire-popup-val {
    font-weight: 600;
    color: #0f172a;
}

.fire-popup-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}

.fire-popup-badge.badge-active {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.fire-popup-badge.badge-localized {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

.fire-popup-badge.badge-liquidated {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.btn-fire-popup-add {
    width: calc(100% - 24px);
    margin: 6px 12px 12px 12px;
    background: #ffd836;
    border: 1.5px solid #d97706;
    color: #1e293b;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

.btn-fire-popup-add:hover {
    background: #f5c400;
    transform: translateY(-1px);
}


/* Red Delete Button in Card Head */
.btn-head-icon.btn-delete {
    background: #fee2e2 !important;
    border: 1.5px solid #fca5a5 !important;
    color: #dc2626 !important;
    font-weight: 900 !important;
}

.btn-head-icon.btn-delete:hover {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #b91c1c !important;
    transform: scale(1.08);
}

/* Quality Prominent Close Button for Fire Popup */
.custom-fire-map-popup .maplibregl-popup-close-button {
    font-size: 18px !important;
    font-weight: 900 !important;
    color: #991b1b !important;
    padding: 3px 8px !important;
    right: 6px !important;
    top: 6px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    outline: none !important;
    border: 1px solid #fecaca !important;
    background: #fee2e2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    width: 24px !important;
    height: 24px !important;
    z-index: 10 !important;
}

.custom-fire-map-popup .maplibregl-popup-close-button:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    transform: scale(1.1) !important;
}

/* Fixed Dwell Input in Row (No Overflow) */
.card-list-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
}

.card-list-lbl {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
    width: 110px;
    flex-shrink: 0;
}

.dwell-input-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dwell-input-container .input-dwell {
    width: 65px !important;
    text-align: center;
    font-weight: 800;
    padding: 4px 6px !important;
}

.dwell-unit-text {
    font-size: 11.5px;
    font-weight: 800;
    color: #475569;
}


/* ==========================================================================
   FIX SELECTED CARD OUTLINE & INTERCARD MANDATORY ROUTE BAR
   ========================================================================== */

.route-point-card {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.route-point-card.is-selected {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.route-point-card.is-selected .point-card-head {
    border: 2px solid #2563eb !important;
    border-radius: 8px !important;
    background: #eff6ff !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22) !important;
    outline: none !important;
}

/* Intercard Lock Bar */
.intercard-lock-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 4px 0 8px 0;
}

.route-edge-lock-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 20px;
    padding: 3px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.route-edge-lock-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.route-edge-lock-btn.locked {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25) !important;
}

.btn-lock-main-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.btn-lock-text {
    font-size: 11px;
    font-weight: 800;
    color: #1e293b;
    white-space: nowrap;
}

.route-edge-lock-btn.locked .btn-lock-text {
    color: #92400e !important;
}

.btn-lock-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    cursor: pointer;
    transition: all 0.12s ease;
    padding: 0;
}

.btn-lock-arrow:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    transform: scale(1.1);
}

/* Directional Arrow on Map Flight Leg */
.route-dir-arrow-box {
    cursor: pointer;
    transition: transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.route-dir-arrow-box:hover {
    transform: scale(1.25) !important;
}

/* Badge for Flight Leg */
.route-leg-label-box {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #000000;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
    color: #000000;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.15s ease;
}

.route-leg-label-box.is-locked-badge {
    border: 2px solid #f59e0b !important;
    background: #fffbeb !important;
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.35) !important;
}

.badge-mandatory-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9.5px;
    font-weight: 900;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 5px;
}

/* Card Legs Table (Table inside card sublist) */
.card-legs-table-wrapper {
    margin-top: 8px;
    border-top: 1px dashed #cbd5e1;
    padding-top: 6px;
}

.card-legs-table-title {
    font-size: 11px;
    font-weight: 800;
    color: #475569;
    margin-bottom: 4px;
}

.card-legs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.card-legs-table th {
    background: #f1f5f9;
    padding: 4px 6px;
    font-weight: 800;
    color: #334155;
    text-align: left;
    border-bottom: 1px solid #cbd5e1;
}

.card-legs-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #f1f5f9;
    color: #0f172a;
    font-weight: 600;
}

.card-legs-table tr.row-locked td {
    background: #fef9c3;
    font-weight: 800;
}

.btn-table-lock {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.btn-table-lock:hover {
    background: #e2e8f0;
}

.btn-table-lock.is-locked {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
    font-weight: 800;
}


/* ==========================================================================
   PERFECT SOFT GLOW SELECTION & ACCURATE 1C BADGE STYLING
   ========================================================================== */

/* 1. Point Card Selection Glow (Soft, diffused, NO double boxes!) */
.route-point-card {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 8px !important;
}

.route-point-card.is-selected {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.point-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease;
    position: relative;
    z-index: 2;
}

.route-point-card.is-selected .point-card-head {
    border: 2px solid #2563eb !important;
    background: #f0f7ff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28) !important;
    outline: none !important;
}

.point-card-sublist {
    width: calc(100% - 16px);
    margin: -3px auto 0 auto;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 8px 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
    z-index: 1;
    position: relative;
}

.route-point-card.is-selected .point-card-sublist {
    border: 1.5px solid #93c5fd !important;
    border-top: none !important;
    background: #ffffff !important;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12) !important;
}

/* 2. Marker Pin and Clean Name Box */
.route-point-marker-wrapper {
    position: relative;
    cursor: pointer;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.35));
    display: flex;
    flex-direction: column;
    align-items: center;
}

.route-point-name-box {
    margin-top: 2px;
    background: #ffffff;
    border: 1.5px solid #000000;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 800;
    color: #000000;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    line-height: 1.3;
}

/* 3. Leg Badge on Map (100% stable, no floating, integrated arrow) */
.route-leg-label-box {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border: 1.5px solid #000000;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
    color: #000000;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
    transition: all 0.12s ease;
    user-select: none;
}

.route-leg-label-box:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.route-leg-label-box.is-locked-badge {
    border: 2px solid #f59e0b !important;
    background: #fffbeb !important;
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.4) !important;
}

.badge-arrow-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}


/* Dedicated On-Line Directional Flight Arrow */
.route-flight-arrow-marker {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
    transition: transform 0.12s ease;
    pointer-events: auto;
    user-select: none;
}

.route-flight-arrow-marker:hover {
    transform: scale(1.3) !important;
}


/* Zero-Lag Solid Map Overlay Elements */
.route-flight-arrow-marker {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
    pointer-events: auto;
    user-select: none;
    transition: none !important;
}

.route-leg-label-box {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border: 1.5px solid #000000;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
    color: #000000;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    user-select: none;
    pointer-events: auto;
    transition: none !important;
}

.route-point-marker-wrapper {
    position: relative;
    cursor: pointer;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.35));
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: none !important;
}


/* ==========================================================================
   4-BLOCK STRUCTURED ROUTE PLANNING PANEL (POINTS CARDS AS MAIN FOCUS)
   ========================================================================== */

.route-panel-body {
    flex: 1;
    min-height: 0;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f1f5f9;
    overflow-y: hidden;
    box-sizing: border-box;
}

/* Logical Section Card */
.panel-section {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 6px 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

/* Section Block Header */
.section-block-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}

.section-block-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    background: #0284c7;
    color: #ffffff;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 900;
    margin-right: 5px;
}

.section-block-name {
    color: #1e293b;
}

.points-counter-badge {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 10.5px;
    font-weight: 800;
}

/* Compact Stats Box */
.section-stats .route-stat-box {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 10px;
    margin: 0;
}

.route-stat-divider {
    width: 1px;
    height: 28px;
    background: #cbd5e1;
    margin: 0 10px;
}

.route-stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.route-stat-value {
    font-size: 15px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
}

.route-stat-sub {
    font-size: 9.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

/* Compact Aircraft Settings */
.section-aircraft .route-settings-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 8px;
    margin: 0;
}

.section-aircraft .route-setting-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

/* Main Section 4: Points List taking maximum vertical screen space */
.section-points-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1.5px solid #94a3b8;
    border-radius: 7px;
    padding: 6px 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.section-points-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.route-points-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.route-points-list::-webkit-scrollbar {
    width: 6px;
}
.route-points-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}
.route-points-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.route-points-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* ==========================================================================
   PERFECT SECTION TITLE & GRID ALIGNMENTS (BLOCKS 1, 2, 3, 4)
   ========================================================================== */

.section-block-title {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #334155 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
    margin-bottom: 4px !important;
}

.section-block-num {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 17px !important;
    height: 17px !important;
    background: #0284c7 !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    margin-right: 6px !important;
    flex-shrink: 0 !important;
}

.section-block-name {
    color: #1e293b !important;
    font-weight: 800 !important;
}

.points-counter-badge {
    margin-left: auto !important;
    background: #e0f2fe !important;
    color: #0369a1 !important;
    border: 1px solid #bae6fd !important;
    border-radius: 4px !important;
    padding: 1px 6px !important;
    font-size: 10.5px !important;
    font-weight: 800 !important;
}

/* Control Buttons Grid in Block 1 */
.ctrl-row-main {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
}

.ctrl-row-sub {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    margin-top: 6px !important;
}

.ctrl-row-utils {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    margin-top: 6px !important;
}

.btn-ctrl {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 6px 4px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #334155 !important;
    transition: all 0.12s ease !important;
    user-select: none !important;
    box-sizing: border-box !important;
}

.btn-ctrl:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

.btn-ctrl-add {
    background: #16a34a !important;
    color: #ffffff !important;
    border-color: #15803d !important;
    font-weight: 800 !important;
}
.btn-ctrl-add:hover {
    background: #15803d !important;
}
.btn-ctrl-add.active {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
}

.btn-ctrl-build {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    font-weight: 800 !important;
}
.btn-ctrl-build:hover {
    background: #1d4ed8 !important;
}

.btn-ctrl-yellow {
    background: #ffd836 !important;
    color: #1e293b !important;
    border-color: #eab308 !important;
    font-weight: 800 !important;
}
.btn-ctrl-yellow:hover {
    background: #facc15 !important;
}

.btn-ctrl-red {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border-color: #fecaca !important;
    font-weight: 700 !important;
}
.btn-ctrl-red:hover {
    background: #fee2e2 !important;
    border-color: #f87171 !important;
    color: #b91c1c !important;
}

/* ==========================================================================
   ROUTE PLANNING SIDEBAR PANEL - BULLETPROOF FLEX & SCROLL ARCHITECTURE
   ========================================================================== */

.route-control-panel {
    position: absolute !important;
    top: 10px !important;
    bottom: 54px !important;
    left: 54px !important;
    width: 500px !important;
    min-width: 500px !important;
    max-width: 500px !important;
    height: calc(100% - 64px) !important;
    max-height: calc(100% - 64px) !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    z-index: 1000 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.route-panel-header {
    background: #ffd836 !important;
    padding: 8px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12) !important;
    flex-shrink: 0 !important;
}

.route-panel-body {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 10px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

/* Blocks 1, 2, 3 do not shrink */
.section-controls,
.section-stats,
.section-aircraft {
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

/* Block 4 occupies all remaining height and scrolls */
.section-points-main {
    flex: 1 1 0% !important;
    min-height: 100px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.section-points-header {
    flex-shrink: 0 !important;
}

.route-points-list {
    flex: 1 1 0% !important;
    min-height: 60px !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    width: 100% !important;
    padding-right: 4px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

/* Custom 1C Scrollbar for Points List */
.route-points-list::-webkit-scrollbar {
    width: 6px !important;
}

.route-points-list::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
    border-radius: 3px !important;
}

.route-points-list::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 3px !important;
}

.route-points-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

.route-point-card {
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}


/* ==========================================================================
   POINT EDIT MODAL & ELEGANT CARD EDIT BUTTON
   ========================================================================== */

.point-name-text {
    flex: 1;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-card-edit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    color: #dc2626;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-card-edit:hover {
    background: #fef2f2;
    border-color: #f87171;
    color: #b91c1c;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

/* Modal Overlay and Container */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.point-edit-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    border: 1.5px solid #e2e8f0;
    width: 440px;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.point-edit-header {
    background: #fff5f5;
    border-bottom: 1.5px solid #fecaca;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.point-edit-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #ffffff;
    max-height: 75vh;
    overflow-y: auto;
}

.edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-lbl {
    width: 110px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    flex-shrink: 0;
}

.edit-input, .edit-select {
    flex: 1;
    height: 32px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #0f172a;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.edit-input:focus, .edit-select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Master Fixed Route Block */
.master-fixed-route-box {
    margin-top: 6px;
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-toggle-master {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    color: #92400e;
    cursor: pointer;
    transition: all 0.12s ease;
}

.btn-toggle-master:hover {
    background: #fde68a;
}

.master-fields-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 4px;
}

.master-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.master-lbl {
    width: 60px;
    font-size: 11.5px;
    font-weight: 700;
    color: #78350f;
}

.master-select {
    flex: 1;
    height: 28px;
    border: 1px solid #f59e0b;
    border-radius: 5px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 600;
    background: #ffffff;
}

.btn-apply-fixed-edge {
    background: #d97706;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease;
    margin-top: 4px;
}

.btn-apply-fixed-edge:hover {
    background: #b45309;
}

/* Modal Footer */
.point-edit-footer {
    background: #f8fafc;
    border-top: 1.5px solid #e2e8f0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.btn-modal-cancel {
    padding: 6px 14px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
}

.btn-modal-save {
    padding: 6px 18px;
    background: #2563eb;
    border: 1.5px solid #1d4ed8;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
    cursor: pointer;
}

.btn-modal-save:hover {
    background: #1d4ed8;
}


/* ==========================================================================
   POINT SUMMARY DATA TABLE INSIDE CARD
   ========================================================================== */

.point-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    margin: 0;
}

.point-summary-table tr {
    border-bottom: 1px solid #f1f5f9;
}

.point-summary-table tr:last-child {
    border-bottom: none;
}

.pst-lbl {
    width: 100px;
    padding: 4px 6px;
    color: #475569;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.pst-val {
    padding: 4px 6px;
    color: #1e293b;
    font-weight: 600;
    word-break: break-word;
}

.font-mono {
    font-family: monospace;
    font-size: 11px;
    color: #334155;
}

.pst-dwell-active {
    color: #16a34a !important;
    font-weight: 800 !important;
}

.pst-notes {
    color: #64748b;
    font-style: italic;
}

.pst-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 10.5px;
    font-weight: 800;
}

.pst-unlocked-text {
    color: #94a3b8;
    font-size: 11px;
}


/* ==========================================================================
   SIDE-BY-SIDE POINT EDIT WINDOW (ADJACENT TO ROUTE PANEL, NO SCREEN BLOCKING)
   ========================================================================== */

#pointEditModal {
    position: absolute !important;
    top: 10px !important;
    left: 494px !important;
    width: 410px !important;
    max-width: calc(100vw - 510px) !important;
    height: calc(100vh - 20px) !important;
    max-height: calc(100vh - 20px) !important;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
    z-index: 1050 !important;
    display: none;
    flex-direction: column !important;
    overflow: hidden !important;
    animation: modalFadeIn 0.18s ease-out !important;
    padding: 0 !important;
}

#pointEditModal .point-edit-card {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
}

#pointEditModal .point-edit-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 14px !important;
}

#pointEditModal .point-edit-header {
    background: #fff5f5 !important;
    border-bottom: 1.5px solid #fecaca !important;
    padding: 10px 14px !important;
}

#pointEditModal .point-edit-footer {
    background: #f8fafc !important;
    border-top: 1.5px solid #e2e8f0 !important;
    padding: 10px 14px !important;
    margin-top: auto !important;
}


/* ==========================================================================
   COMPACT LEVEL-4 POINT EDIT WINDOW & PROPORTIONS
   ========================================================================== */

#pointEditModal {
    position: absolute !important;
    top: 245px !important;
    left: 494px !important;
    width: 385px !important;
    max-width: calc(100vw - 510px) !important;
    height: auto !important;
    max-height: calc(100vh - 260px) !important;
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22) !important;
    z-index: 1050 !important;
    display: none;
    flex-direction: column !important;
    overflow: hidden !important;
    animation: modalFadeIn 0.18s ease-out !important;
    padding: 0 !important;
}

#pointEditModal .point-edit-card {
    width: 100% !important;
    max-width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
}

#pointEditModal .point-edit-header {
    background: #fff5f5 !important;
    border-bottom: 1.5px solid #fecaca !important;
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.point-edit-close-btn {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: #fee2e2 !important;
    border: 1px solid #fca5a5 !important;
    color: #b91c1c !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.point-edit-close-btn:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    transform: scale(1.1) !important;
}

#pointEditModal .point-edit-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

#pointEditModal .edit-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

#pointEditModal .edit-lbl {
    width: 95px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    flex-shrink: 0 !important;
}

#pointEditModal .edit-input, 
#pointEditModal .edit-select {
    height: 30px !important;
    font-size: 12px !important;
    padding: 3px 6px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 5px !important;
    box-sizing: border-box !important;
}

#editPointVpp {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: 195px !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

#pointEditModal .point-edit-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 8px 12px !important;
}

/* ==========================================================================
   AUTHENTIC TOAST & CONFIRM NOTIFICATIONS
   ========================================================================== */

.planner-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.planner-toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    background: #ffffff;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 1.5px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.25s ease;
}

.planner-toast.toast-hiding {
    opacity: 0;
    transform: translateX(100%);
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

.planner-toast-success {
    border-left: 4px solid #16a34a;
}
.planner-toast-error {
    border-left: 4px solid #dc2626;
}
.planner-toast-warning {
    border-left: 4px solid #d97706;
}
.planner-toast-info {
    border-left: 4px solid #2563eb;
}

.toast-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 12.5px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
}

.toast-close-btn {
    background: transparent;
    border: none;
    font-size: 12px;
    font-weight: 800;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
}

.toast-close-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Custom Confirm Modal */
.planner-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.planner-confirm-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 1px solid #cbd5e1;
    width: 360px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.confirm-title {
    margin: 0;
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
}

.confirm-close-btn {
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 800;
    color: #64748b;
    cursor: pointer;
}

.confirm-close-btn:hover {
    color: #0f172a;
}

.confirm-body {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
}

.confirm-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.btn-confirm-cancel {
    padding: 5px 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
}

.btn-confirm-ok {
    padding: 5px 14px;
    background: #dc2626;
    border: 1px solid #b91c1c;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
    cursor: pointer;
}

.btn-confirm-ok:hover {
    background: #b91c1c;
}


/* ==========================================================================
   PERFECT PROPORTIONS, NO HORIZONTAL SCROLL & UNLOCK BUTTON
   ========================================================================== */

#pointEditModal {
    overflow-x: hidden !important;
    width: 390px !important;
    box-sizing: border-box !important;
}

#pointEditModal .point-edit-card,
#pointEditModal .point-edit-body {
    overflow-x: hidden !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#pointEditModal .edit-lbl {
    width: 80px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
}

#editPointType {
    width: 65px !important;
    flex-shrink: 0 !important;
}

#editPointVpp {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: 220px !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

/* Master Active Locked Box */
.master-active-locked-box {
    background: #fef3c7;
    border: 1.5px solid #f59e0b;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 6px;
}

.master-locked-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btn-master-unlock {
    background: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-master-unlock:hover {
    background: #dc2626;
    transform: scale(1.05);
}


/* ==========================================================================
   AUTHENTIC 1C YELLOW THEMED EDIT WINDOW HEADER
   ========================================================================== */

#pointEditModal .point-edit-header {
    background: linear-gradient(180deg, #ffd700 0%, #ffcc00 100%) !important;
    border-bottom: 1.5px solid #d4a000 !important;
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

#pointEditModalTitle {
    color: #1e293b !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
}

.point-edit-close-btn {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    color: #1e293b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11.5px !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.point-edit-close-btn:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    transform: scale(1.1) !important;
}


/* ==========================================================================
   ROUTE PLANNING HELP GUIDE MODAL (1C THEMED)
   ========================================================================== */

.route-help-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
    border: 1.5px solid #cbd5e1;
    width: 540px;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.route-help-header {
    background: linear-gradient(180deg, #ffd700 0%, #ffcc00 100%) !important;
    border-bottom: 1.5px solid #d4a000 !important;
    padding: 10px 14px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.route-help-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 70vh;
    overflow-y: auto;
    background: #ffffff;
}

.guide-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}

.guide-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.guide-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #ffcc00;
    color: #1e293b;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 900;
}

.guide-text {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #334155;
}

.guide-text code {
    background: #e2e8f0;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
}

.route-help-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}



/* ==========================================================================
   ROUTE PANEL VISIBILITY CONTROL
   ========================================================================== */

#routeControlPanel.panel-hidden,
.route-control-panel.panel-hidden {
    display: none !important;
}



/* ==========================================================================
   AUTHENTIC VPP MAP POPUP (MATCHING FIRE POPUP QUALITY)
   ========================================================================== */

.custom-vpp-map-popup .maplibregl-popup-content {
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.28);
    border: 1px solid #cbd5e1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.vpp-popup-container {
    width: 310px;
    background: #ffffff;
}

.vpp-popup-header {
    background: #eff6ff;
    border-bottom: 1.5px solid #bfdbfe;
    padding: 10px 14px;
}

.vpp-popup-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 900;
    color: #1e40af;
}

.vpp-popup-subtitle {
    font-size: 11.5px;
    font-weight: 700;
    color: #3b82f6;
    margin-top: 2px;
}

.vpp-popup-body {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vpp-popup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
}

.vpp-popup-lbl {
    font-weight: 700;
    color: #475569;
}

.vpp-popup-val {
    font-weight: 600;
    color: #0f172a;
}

.vpp-popup-badge.badge-vpp-type {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
}

.btn-vpp-popup-add {
    width: calc(100% - 24px);
    margin: 6px 12px 12px 12px;
    background: linear-gradient(180deg, #ffd700 0%, #ffcc00 100%);
    border: 1.5px solid #d4a000;
    color: #1e293b;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(212, 160, 0, 0.3);
}

.btn-vpp-popup-add:hover {
    background: #f5c400;
    transform: translateY(-1px);
}

/* Close Button for VPP Popup */
.custom-vpp-map-popup .maplibregl-popup-close-button {
    font-size: 18px !important;
    font-weight: 900 !important;
    color: #1e40af !important;
    padding: 3px 8px !important;
    right: 6px !important;
    top: 6px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    outline: none !important;
    border: 1px solid #bfdbfe !important;
    background: #dbeafe !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    width: 24px !important;
    height: 24px !important;
    z-index: 10 !important;
}

.custom-vpp-map-popup .maplibregl-popup-close-button:hover {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    transform: scale(1.1) !important;
}



/* ==========================================================================
   AUTHENTIC 1C TOP COMMAND BAR (EXACT 1C BADGE BOX DESIGN)
   ========================================================================== */

#app {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.top-1c-filter-bar {
    height: 44px;
    min-height: 44px;
    background: #f1f5f9;
    border-bottom: 1.5px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    flex-shrink: 0;
    user-select: none;
    gap: 10px;
}

/* Base 1C Badge Box (Identical to bottom Coordinates / Zoom badges) */
.filter-1c-badge {
    background: #ffd836;
    border: 1px solid #d97706;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    padding: 3px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #1e293b;
}

.filter-1c-badge .badge-label {
    font-weight: 800;
    color: #1e293b;
    font-size: 12px;
    white-space: nowrap;
    letter-spacing: 0.1px;
}

/* Inset Grey Pill Fields (Matching .coord-pill) */
.filter-1c-badge .coord-pill {
    background: #e2e8f0;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 6px;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.15s ease;
}

.filter-1c-badge .filter-select-pill {
    height: 24px;
    cursor: pointer;
}

.filter-1c-badge .filter-select-pill:hover,
.filter-1c-badge .filter-date-pill:hover {
    background: #cbd5e1;
    border-color: #94a3b8;
}

.filter-1c-badge .filter-select-pill:focus,
.filter-1c-badge .filter-date-pill:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.filter-brand-badge {
    padding: 4px 10px;
}

.filter-1c-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.filter-date-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-date-inputs-box {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-date-lbl {
    font-size: 11px;
    font-weight: 800;
    color: #1e293b;
}

.filter-date-pill {
    height: 24px;
    padding: 0 4px;
    font-size: 11px;
    cursor: pointer;
}

.filter-1c-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-count-badge .count-pill {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 800;
    color: #0f172a;
    padding: 2px 8px;
}

.filter-reset-btn {
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid #d97706;
}

.filter-reset-btn:hover {
    background: #f5c400;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(217, 119, 6, 0.3);
}

.map-container-wrapper.full-screen {
    flex: 1;
    position: relative;
    width: 100%;
    height: calc(100vh - 44px);
    overflow: hidden;
}

/* ==========================================================================
   AUTHENTIC 1C SCALE BADGE & MONOCHROME PRINT SCALE RULER
   ========================================================================== */

/* Interactive Map Scale Badge (Bottom-Right) */
.scale-pill {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 3px 8px !important;
    cursor: default !important;
}

.scale-ruler-bracket {
    height: 6px;
    border-bottom: 2px solid #0f172a;
    border-left: 2px solid #0f172a;
    border-right: 2px solid #0f172a;
    transition: width 0.15s ease;
    flex-shrink: 0;
}

.scale-ruler-label {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
}

/* Authentic Monochrome Cartographic Scale Ruler for A4 Print */
.print-scale-box {
    display: none;
}

body.print-mode-active .print-scale-box {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    bottom: 14px !important;
    left: 14px !important;
    z-index: 500 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1.5px solid #000000 !important;
    border-radius: 3px !important;
    padding: 6px 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    pointer-events: none !important;
    user-select: none !important;
    box-sizing: border-box !important;
}

.print-scale-ruler-content {
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    box-sizing: border-box !important;
}

.print-scale-ticks-container {
    position: relative !important;
    width: 100% !important;
    height: 14px !important;
    margin-bottom: 2px !important;
}

.scale-tick-lbl {
    position: absolute !important;
    top: 0 !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    color: #000000 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.tick-0 { left: 0% !important; transform: translateX(0) !important; }
.tick-50 { left: 50% !important; transform: translateX(-50%) !important; }
.tick-100 { left: 100% !important; transform: translateX(-100%) !important; }

.print-scale-bar {
    display: flex !important;
    width: 100% !important;
    height: 7px !important;
    border: 1.5px solid #000000 !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    margin-bottom: 5px !important;
}

.scale-block {
    flex: 1 !important;
    height: 100% !important;
    border-right: 1px solid #000000 !important;
}

.scale-block:last-child {
    border-right: none !important;
}

.scale-block.sb-black {
    background: #000000 !important;
}

.scale-block.sb-white {
    background: #ffffff !important;
}

.print-scale-caption {
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #000000 !important;
    text-align: center !important;
    white-space: nowrap !important;
    font-family: Arial, Helvetica, sans-serif !important;
    letter-spacing: 0.1px !important;
}

@media print {
    .print-scale-box {
        display: flex !important;
    }
}

/* Block 2: Informative Route Cycle Toggle Card */
.route-cycle-toggle-card {
    margin-top: 6px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 5px 8px;
    transition: all 0.15s ease;
    user-select: none;
}

.route-cycle-toggle-card:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.route-cycle-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
}

.route-cycle-checkbox {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #2563eb;
    flex-shrink: 0;
}

.route-cycle-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.route-cycle-title {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 800;
    color: #0f172a;
}

.route-cycle-hint {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    line-height: 1.15;
}


/* Block 2: Flight Meta Card (Observer & Flight Date) */
.route-flight-meta-card {
    margin-top: 6px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.print-observer-row {
    font-size: 13px;
    font-weight: 800;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 2px;
}

.print-observer-row .print-doc-lbl {
    font-weight: 700;
}

.print-observer-row .print-doc-val {
    font-weight: 900;
    font-size: 13.5px;
}


/* Layer Panel Styling for Multi-Basemap Support */
.map-layer-panel {
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    width: 280px !important;
}

.map-layer-section-title.maps::before {
    content: "🗺️ " !important;
}

.map-layer-option {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 4px 6px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    transition: background 0.12s ease !important;
}

.map-layer-option:hover {
    background: #f1f5f9 !important;
}

.map-layer-option input[type="radio"],
.map-layer-option input[type="checkbox"] {
    cursor: pointer !important;
    accent-color: #2563eb !important;
}


/* ==========================================================================
   MULTI-PLAN TABS BAR (1C ENTERPRISE WORKSPACE STYLE)
   ========================================================================== */

.route-plans-tabbar {
    display: flex !important;
    align-items: center !important;
    background: #f1f5f9 !important;
    border-bottom: 1.5px solid #cbd5e1 !important;
    padding: 4px 6px 0 6px !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.route-plans-tabs-scroll {
    display: flex !important;
    align-items: flex-end !important;
    gap: 4px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 2px !important;
    scrollbar-width: thin !important;
    scrollbar-color: #cbd5e1 transparent !important;
    scroll-behavior: smooth !important;
}

.route-plans-tabs-scroll::-webkit-scrollbar {
    height: 3px !important;
}

.route-plans-tabs-scroll::-webkit-scrollbar-track {
    background: transparent !important;
}

.route-plans-tabs-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 2px !important;
}

.route-plans-tabs-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

.route-plan-tab {
    flex-shrink: 0 !important;
    min-width: 80px !important;
    max-width: 140px !important;
}

.route-plan-tab {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 5px 9px !important;
    background: #e2e8f0 !important;
    border: 1px solid #cbd5e1 !important;
    border-bottom: none !important;
    border-top-left-radius: 6px !important;
    border-top-right-radius: 6px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    max-width: 130px !important;
    transition: all 0.12s ease !important;
    user-select: none !important;
}

.route-plan-tab:hover {
    background: #ffffff !important;
    color: #0f172a !important;
}

.route-plan-tab.active {
    background: #ffffff !important;
    border-color: #94a3b8 !important;
    border-top: 2.5px solid #d97706 !important;
    color: #0f172a !important;
    font-weight: 800 !important;
    margin-bottom: -1px !important;
    padding-top: 4px !important;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.04) !important;
}

.tab-title-text {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    flex: 1 !important;
}

.tab-badge-pts {
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #64748b !important;
    background: rgba(0, 0, 0, 0.06) !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
}

.route-plan-tab.active .tab-badge-pts {
    color: #d97706 !important;
    background: #fef3c7 !important;
}

.tab-close-btn {
    width: 14px !important;
    height: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    color: #94a3b8 !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    transition: all 0.12s ease !important;
}

.tab-close-btn:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
}

.btn-new-plan-tab {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 4px 8px !important;
    background: #ffd836 !important;
    border: 1px solid #d97706 !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    cursor: pointer !important;
    margin-bottom: 3px !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
}

.btn-new-plan-tab:hover {
    background: #fbbf24 !important;
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.25) !important;
}


body.print-mode-active .kvartal-canvas-labels {
    display: none !important;
}

@media print {
    .kvartal-canvas-labels {
        display: none !important;
    }
}


/* ==========================================================================
   UNIFIED BLOCK 2 WITH ELEGANT DASHED DIVIDERS
   ========================================================================== */

.route-unified-stats-card {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    padding: 2px 0 !important;
}

.route-dashed-divider {
    height: 0px !important;
    border-top: 1.5px dashed #cbd5e1 !important;
    margin: 4px 0 !important;
    width: 100% !important;
}

.route-cycle-row {
    padding: 1px 0 !important;
}

.route-aircraft-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 2px 0 !important;
}

.route-meta-lines {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    padding: 2px 0 !important;
}


/* ==========================================================================
   BLOCK 3: TOP POINT INSPECTOR
   ========================================================================== */

.section-point-inspector {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 7px !important;
    padding: 6px 8px !important;
    flex-shrink: 0 !important;
}

.section-inspector-header {
    border-bottom: 1px dashed #cbd5e1 !important;
    padding-bottom: 4px !important;
    margin-bottom: 4px !important;
}

.inspector-active-badge {
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #1e40af !important;
    background: #dbeafe !important;
    border: 1px solid #bfdbfe !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    max-width: 220px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.inspector-empty-msg {
    font-size: 11px !important;
    color: #64748b !important;
    font-style: italic !important;
    text-align: center !important;
    padding: 6px 4px !important;
}

.inspector-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.inspector-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.insp-row-split {
    justify-content: space-between !important;
}

.insp-col-dwell {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.insp-col-lock {
    display: flex !important;
    align-items: center !important;
}

.insp-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #334155 !important;
    width: 65px !important;
    flex-shrink: 0 !important;
}

.insp-select {
    flex: 1 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 2px 4px !important;
    background: #f8fafc !important;
}

.insp-input-note {
    flex: 1 !important;
    font-size: 11px !important;
    padding: 2px 5px !important;
}

.insp-lock-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: #fef3c7 !important;
    border: 1px solid #fde68a !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
}

/* ==========================================================================
   BLOCK 4: 1C DATAGRID TABLE WITH DRAG & DROP
   ========================================================================== */

.route-table-wrapper {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 5px !important;
    background: #ffffff !important;
}

.route-table-wrapper::-webkit-scrollbar {
    width: 5px !important;
}
.route-table-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
}
.route-table-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 3px !important;
}

.route-grid-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 11px !important;
    table-layout: fixed !important;
}

.route-grid-table thead th {
    position: sticky !important;
    top: 0 !important;
    background: #f1f5f9 !important;
    border-bottom: 1.5px solid #cbd5e1 !important;
    border-right: 1px solid #e2e8f0 !important;
    padding: 4px 3px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #475569 !important;
    text-transform: uppercase !important;
    text-align: center !important;
    z-index: 2 !important;
    user-select: none !important;
}

.route-grid-table tbody tr {
    height: 27px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    cursor: pointer !important;
    transition: background 0.1s ease !important;
}

.route-grid-table tbody tr:hover {
    background: #f8fafc !important;
}

.route-grid-table tbody tr.row-selected {
    background: #dbeafe !important;
    border-bottom: 1px solid #93c5fd !important;
}

.route-grid-table tbody tr.row-dragging {
    opacity: 0.4 !important;
    background: #fef08a !important;
}

.route-grid-table tbody tr.row-drag-over {
    border-top: 2.5px solid #2563eb !important;
}

.route-grid-table tbody td {
    padding: 2px 3px !important;
    text-align: center !important;
    vertical-align: middle !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    border-right: 1px solid #f1f5f9 !important;
}

.td-drag-handle {
    cursor: grab !important;
    cursor: -webkit-grab !important;
    color: #94a3b8 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    user-select: none !important;
}

.td-drag-handle:hover {
    color: #0f172a !important;
}

.td-num-badge {
    font-weight: 800 !important;
    font-size: 10px !important;
    color: #1e293b !important;
}

.td-name-cell {
    text-align: left !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    padding-left: 4px !important;
}

.td-work-badge {
    font-size: 9.5px !important;
    font-weight: 700 !important;
    color: #0369a1 !important;
    background: #e0f2fe !important;
    padding: 1px 4px !important;
    border-radius: 3px !important;
    display: inline-block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.td-dwell-text {
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #16a34a !important;
}

.td-lock-icon {
    font-size: 11px !important;
    color: #d97706 !important;
}

.td-btn-del {
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    border-radius: 3px !important;
    padding: 1px 4px !important;
    transition: all 0.1s ease !important;
}

.td-btn-del:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
}


/* ==========================================================================
   INTEGRATED BLOCKS 3 & 4: LINKED INSPECTOR & DATAGRID TABLE (v5.9.1)
   ========================================================================== */

.route-points-linked-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    background: #fffbeb !important; /* Деликатный 1С янтарно-желтый тон */
    border: 2px solid #ffd836 !important; /* Цвет шапки блока 3 */
    border-left: 5px solid #d97706 !important; /* Акцентный янтарный торец 1С */
    border-radius: 8px !important;
    padding: 6px !important;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.12) !important;
    position: relative !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

.route-points-linked-container .section-point-inspector {
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 0 !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.route-points-linked-container .section-points-main {
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 180px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

/* Шапка Блока 4 полностью в цвет и структуру шапки Блока 3 */
.section-points-header {
    background: #ffd836 !important;
    border-bottom: 1.5px solid #d97706 !important;
    padding: 4px 8px !important;
    height: 28px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-top-left-radius: 5px !important;
    border-top-right-radius: 5px !important;
}

.section-points-header .section-block-name {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    color: #1e293b !important;
}

.section-points-header .points-counter-badge {
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    padding: 1px 6px !important;
    border-radius: 3px !important;
    margin-left: 10px !important;
    flex-shrink: 0 !important;
}

.route-table-wrapper {
    flex: 1 1 auto !important;
    min-height: 140px !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    padding: 0 !important;
}

.section-point-inspector {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 0 !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
}

.inspector-header-bar {
    background: #ffd836 !important;
    border-bottom: 1.5px solid #d97706 !important;
    padding: 4px 8px !important;
    height: 28px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* Оформление номеров блоков 3 и 4: синий квадрат со скругленными краями и белой цифрой */
.inspector-header-bar .section-block-num,
.section-points-header .section-block-num {
    background: #2563eb !important;
    color: #ffffff !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    border: none !important;
}

.inspector-title-text {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.inspector-active-badge {
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    padding: 1px 6px !important;
    border-radius: 3px !important;
    max-width: 140px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.inspector-card-body {
    padding: 6px 8px !important;
}

.inspector-empty-msg {
    font-size: 11px !important;
    color: #64748b !important;
    font-style: italic !important;
    text-align: center !important;
    padding: 10px 4px !important;
}

.inspector-full-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.insp-grid-2col {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 4px 8px !important;
}

.insp-cell {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
}

.insp-full-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    margin-top: 1px !important;
    min-width: 0 !important;
}

.insp-lbl-box {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #334155 !important;
    user-select: none !important;
}

.insp-input,
.insp-select {
    height: 28px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 2px 7px !important;
    font-size: 11.5px !important;
    color: #0f172a !important;
    background: #ffffff !important;
    outline: none !important;
    transition: border-color 0.12s ease, box-shadow 0.12s ease !important;
}

.insp-input:focus,
.insp-select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

.insp-dwell-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    height: 28px !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 0 6px !important;
    transition: border-color 0.12s ease !important;
}

.insp-dwell-wrap:focus-within {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15) !important;
}

.insp-dwell-input {
    flex: 1 !important;
    height: 24px !important;
    border: none !important;
    outline: none !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    text-align: center !important;
    padding: 0 !important;
    background: transparent !important;
    color: #0f172a !important;
}

.insp-dwell-unit {
    font-size: 10.5px !important;
    font-weight: 800 !important;
    color: #16a34a !important;
    user-select: none !important;
}

/* Pin / Fix Position Control Box */
.insp-pin-control-box {
    margin-top: 3px !important;
    border-top: 1px dashed #cbd5e1 !important;
    padding-top: 3px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
}

.btn-toggle-pin {
    height: 27px !important;
    padding: 0 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.12s ease !important;
    outline: none !important;
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    color: #475569 !important;
}

.btn-toggle-pin:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #1e293b !important;
}

.btn-toggle-pin.is-pinned {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
    color: #92400e !important;
    font-weight: 800 !important;
    box-shadow: 0 1px 2px rgba(217, 119, 6, 0.12) !important;
}

.btn-toggle-pin.is-pinned:hover {
    background: #fde68a !important;
    border-color: #d97706 !important;
}

.pin-hint-text {
    font-size: 10px !important;
    color: #64748b !important;
    font-style: italic !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Kvartal & VPP Offline Canvas Label Layer */
.kvartal-canvas-labels {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 2 !important;
}

/* Enhanced 1C Grid Row Selection & Synergy with Inspector */
.route-grid-table tbody tr.row-selected {
    background: #eff6ff !important;
    border-left: 3.5px solid #2563eb !important;
    border-bottom: 1px solid #bfdbfe !important;
}

.route-grid-table tbody tr.row-selected td {
    color: #1e3a8a !important;
    font-weight: 800 !important;
}


/* ==========================================================================
   AUTHENTIC 1C PRINT & A4 FLIGHT SUMMARY STYLES (v5.3.0)
   ========================================================================== */

/* 1. On-Map Route Leg Badges and Directional Arrows */
.route-leg-badge-marker {
    background: transparent !important;
    border: none !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    user-select: none !important;
    z-index: 50 !important;
}

.route-leg-badge-box {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: #ffffff !important;
    border: 1.5px solid #000000 !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #000000 !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
    line-height: 1.2 !important;
}

.route-leg-badge-box.is-mandatory-locked {
    background: #fef08a !important;
    border-color: #d97706 !important;
}

.leg-badge-main {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.leg-badge-course {
    color: #000000 !important;
    font-weight: 900 !important;
}

.leg-badge-dist {
    color: #000000 !important;
    font-weight: 800 !important;
}

.leg-badge-time {
    color: #000000 !important;
    font-weight: 800 !important;
}

.badge-mandatory-pill {
    background: #d97706 !important;
    color: #ffffff !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    padding: 1px 4px !important;
    border-radius: 3px !important;
    margin-left: 3px !important;
}

.route-flight-arrow-marker {
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4)) !important;
    z-index: 40 !important;
}

/* 2. Print Mode: Exact A4 Landscape Proportion (297 / 210 = 1.4142) */
body.print-mode-active {
    background: #1e293b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

body.print-mode-active #app {
    display: flex !important;
    flex-direction: row !important;
    height: 100vh !important;
    width: calc(100vh * 1.4142) !important;
    max-width: 100vw !important;
    background: #ffffff !important;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.75) !important;
    border: 1.5px solid #000000 !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
}

body.print-mode-active #mainContent {
    display: flex !important;
    flex: 1 !important;
    height: 100% !important;
    overflow: hidden !important;
    position: relative !important;
    border-right: 1.5px solid #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.print-mode-active #map {
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
    border: none !important;
    margin: 0 !important;
}

body.print-mode-active #routePrintPanel {
    display: flex !important;
    position: static !important;
    width: 440px !important;
    min-width: 440px !important;
    max-width: 440px !important;
    height: 100% !important;
    background: #ffffff !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    border-left: none !important;
    z-index: 100 !important;
}

body.print-mode-active .route-control-panel,
body.print-mode-active #routeControlPanel,
body.print-mode-active .route-panel,
body.print-mode-active .route-points-linked-container,
body.print-mode-active #routePointsLinkedContainer,
body.print-mode-active .section-point-inspector,
body.print-mode-active #sectionPointInspector,
body.print-mode-active .section-points-main,
body.print-mode-active .route-table-wrapper,
body.print-mode-active .top-1c-filter-bar,
body.print-mode-active .leaflet-control-container,
body.print-mode-active .map-coords-box,
body.print-mode-active .map-home-btn,
body.print-mode-active #hintModalOverlay {
    display: none !important;
}

.print-panel-header {
    padding: 10px 14px;
    background: #ffffff;
    border-bottom: 1.5px solid #000000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.print-btn {
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1.5px solid #000000;
    background: #ffffff;
    color: #000000;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.print-btn:hover {
    background: #f1f5f9;
}

.print-btn-blue {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
}

.print-panel-content {
    flex: 1;
    display: block !important;
    padding: 8px 10px;
    box-sizing: border-box;
    overflow: hidden !important; /* Scaled by JS transform without scrollbars */
    width: 100%;
    background: #ffffff;
    position: relative;
}

.print-cards-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    transform-origin: top center !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* 3. Header Metadata Card (Compact Width, Centered Box & Centered Text) */
.print-doc-header-compact {
    margin: 0 auto 10px auto !important;
    padding: 6px 16px !important;
    border: 1.5px solid #000000 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    width: fit-content !important;
    min-width: 280px !important;
    max-width: 360px !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

.print-doc-header-meta {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 2px !important;
}

.print-header-line {
    font-size: 11.5px !important;
    color: #000000 !important;
    line-height: 1.35 !important;
    text-align: center !important;
}

.print-header-lbl {
    font-weight: 400 !important;
    color: #000000 !important;
}

.print-header-val {
    font-weight: 800 !important;
    color: #000000 !important;
}

/* SOLID 2PX DIVIDERS */


/* 4. Cards List & Item Boxes with BOLD 2PX DASHED BORDER */
.print-cards-list {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0 !important;
    margin-bottom: 2px !important;
}

.print-card-item {
    background: #ffffff !important;
    border: 2px dashed #000000 !important; /* BOLD 2PX DASHED BORDER */
    border-radius: 6px !important;
    padding: 5px 9px !important;
    margin-bottom: 1px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

/* HEADER OF EACH CARD WITH DASHED DIVIDER */
.print-card-top {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding-bottom: 3px !important;
    margin-bottom: 3px !important;
    border-bottom: 1.5px dashed #000000 !important;
}

/* ALL BADGES ARE SOLID BLACK WITH PERFECTLY CENTERED WHITE BOLD TEXT */
.print-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2px 7px !important;
    background: #000000 !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    line-height: 1 !important;
    text-align: center !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.print-point-name {
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #000000 !important;
}

.print-card-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5px !important;
    padding-left: 2px !important;
}

.print-row {
    font-size: 11px !important;
    display: flex !important;
    gap: 6px !important;
    color: #000000 !important;
    line-height: 1.3 !important;
}

/* REGULAR LABELS & BOLD VALUES */
.print-doc-lbl {
    font-weight: 400 !important;
    color: #000000 !important;
}

.print-doc-val {
    font-weight: 800 !important;
    color: #000000 !important;
}

/* 5. Neat Crisp Arrow Transition */
.print-leg-transition {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 1.5px 0 !important;
    font-size: 10.5px !important;
    color: #000000 !important;
    line-height: 1 !important;
}

.print-leg-transition b {
    font-weight: 800 !important;
}

/* 6. Summary Box (Опущен пониже с 2px рамкой) */
.print-summary-box {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    margin-top: 12px !important;
    margin-bottom: 6px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.print-summary-title {
    font-size: 11.5px !important;
    font-weight: 900 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    color: #000000 !important;
    margin-bottom: 3px !important;
}

.print-summary-section-title {
    font-size: 9.5px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    color: #000000 !important;
    margin-top: 3px !important;
    margin-bottom: 1.5px !important;
    letter-spacing: 0.05em !important;
}

.print-summary-line {
    display: flex !important;
    justify-content: space-between !important;
    font-size: 11px !important;
    color: #000000 !important;
    margin-bottom: 1.5px !important;
}

.print-summary-divider {
    border-top: 1.5px solid #000000 !important;
    margin: 3px 0 !important;
}

/* 7. Footer metadata: Bold with date only */
.print-doc-footer-meta {
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #000000 !important;
    text-align: center !important;
    border-top: 1.5px dashed #000000 !important;
    padding-top: 4px !important;
    margin-top: 4px !important;
    width: 100% !important;
}

/* Hide route leg badges & direction arrows in print preview & print */
body.print-mode-active .route-leg-badge-marker,
body.print-mode-active .route-flight-arrow-marker,
body.print-mode-active .route-leg-label-box,
body.print-mode-active .route-flight-arrow {
    display: none !important;
}

.custom-point-name-tag {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #64748b !important;
    border-radius: 3px !important;
    padding: 1px 5px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    white-space: nowrap !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
    pointer-events: none !important;
}

.custom-point-name-tag.is-point-pinned {
    background: #fef3c7 !important;
    border: 1.5px solid #d97706 !important;
    color: #92400e !important;
    font-weight: 900 !important;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35) !important;
}

.route-leg-badge-marker {
    cursor: pointer;
    user-select: none;
    z-index: 10;
}

.route-leg-badge-box {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2px !important;
    background: #ffffff !important;
    border: 1.5px solid #475569 !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    white-space: nowrap !important;
    transition: all 0.15s ease !important;
}

.route-leg-badge-box:hover {
    transform: scale(1.06);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35) !important;
}

.route-leg-badge-box.is-mandatory-locked {
    background: #fffbeb !important;
    border: 1.8px solid #f59e0b !important;
    color: #92400e !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4) !important;
}

.leg-badge-main {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.leg-badge-course {
    color: #1e40af !important;
    font-weight: 900 !important;
}

.leg-badge-sep {
    font-size: 10px !important;
    color: #475569 !important;
    opacity: 0.8 !important;
    margin: 0 1px !important;
    user-select: none !important;
}

.leg-badge-dist {
    color: #0f172a !important;
    font-weight: 800 !important;
}

.leg-badge-time {
    color: #047857 !important;
    font-weight: 800 !important;
}

.badge-mandatory-pill {
    background: #f59e0b !important;
    color: #ffffff !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    padding: 1px 4px !important;
    border-radius: 3px !important;
    letter-spacing: 0.3px !important;
    text-transform: uppercase !important;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 0;
    }
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
        background: #ffffff !important;
    }
    body.print-mode-active #app {
        width: 100vw !important;
        height: 100vh !important;
        border: none !important;
        box-shadow: none !important;
    }
    .print-panel-header {
        display: none !important;
    }
    .route-leg-badge-marker,
    .route-flight-arrow-marker,
    .route-leg-label-box,
    .route-flight-arrow {
        display: none !important;
    }
}
