/* ===== MAP AREA ===== */
.map-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
}

.map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--gray-200);
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

#map {
    flex: 1;
    z-index: 1;
}

/* ===== MAP NOTIFICATION ===== */
.map-notification {
    display: none;
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    align-items: center;
    gap: 12px;
    font-size: var(--text-base);
}

.map-notification.active {
    display: flex;
}

.map-notification i {
    color: var(--primary-light);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== MAP LEGEND ===== */
.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 160px;
    overflow: hidden;
}

.legend-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--gray-50);
    cursor: pointer;
    font-weight: 600;
    font-size: var(--text-sm);
}

.legend-header i:first-child {
    color: var(--primary);
}

.legend-header span {
    flex: 1;
}

.legend-header .toggle-icon {
    color: var(--gray-400);
    transition: transform var(--transition-normal);
}

.map-legend.collapsed .legend-body {
    display: none;
}

.map-legend.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.legend-body {
    padding: 8px;
    max-height: 260px;
    overflow-y: auto;
}

/* Legend group filter tabs */
.legend-group-tabs {
    display: flex;
    gap: 2px;
    padding: 0 0 6px 0;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--gray-200);
}

.legend-tab {
    flex: 1;
    padding: 4px 6px;
    font-size: var(--text-3xs);
    font-weight: 600;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.legend-tab:hover {
    background: var(--gray-50);
    color: var(--gray-700);
}

.legend-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.legend-tab i {
    font-size: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.legend-item:hover {
    background: var(--gray-50);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* ===== MAP CONTROLS PANEL ===== */
.map-controls-panel {
    position: absolute;
    bottom: 30px;
    right: 10px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 900;
    padding: 8px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
}

.control-item:hover {
    background: var(--gray-50);
}

.control-item input {
    accent-color: var(--primary);
}

.control-item i {
    width: 16px;
    color: var(--gray-400);
}

/* ===== DETAILS PANEL ===== */
.details-panel {
    width: var(--details-width);
    background: var(--bg-surface);
    border-left: 1px solid var(--gray-200);
    display: none;
    flex-direction: column;
    flex-shrink: 0;
}

.details-panel.active {
    display: flex;
}

.details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.details-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.details-title .tech-color-dot {
    width: 16px;
    height: 16px;
}

.details-title h2 {
    font-size: var(--text-lg);
    font-weight: 600;
}

.details-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* ===== DETAILS SECTIONS ===== */
.detail-section {
    margin-bottom: 20px;
}

.detail-section-header {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hotel-search-box {
    position: relative;
}

.hotel-search-box input {
    width: 100%;
    padding: 10px 12px;
    padding-left: 36px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: var(--text-base);
}

.hotel-search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.hotel-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.hotel-suggestions.active {
    display: block;
}

.hotel-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: var(--text-base);
    border-bottom: 1px solid var(--gray-100);
}

.hotel-suggestion-item:hover {
    background: var(--gray-50);
}

.hotel-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ===== DAY SCHEDULE ===== */
.day-schedule {
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}

.day-schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--gray-100);
    font-weight: 600;
    font-size: var(--text-base);
}

.day-schedule-body {
    padding: 8px;
}

.schedule-task {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: var(--text-sm);
}

.schedule-task:last-child {
    margin-bottom: 0;
}

.schedule-time {
    font-weight: 600;
    color: var(--gray-600);
    min-width: 45px;
}

.schedule-address {
    flex: 1;
    line-height: 1.4;
}

.schedule-travel {
    font-size: var(--text-xs);
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--gray-100);
}

.day-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--gray-100);
    font-weight: 600;
    font-size: var(--text-sm);
}

/* ===== WEEK SUMMARY ===== */
.week-summary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius);
    padding: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: var(--text-base);
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-row.total {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 12px;
    margin-top: 12px;
    font-size: var(--text-lg);
    font-weight: 600;
}

/* Week summary in task list */
.week-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: var(--text-sm);
}

.week-summary-row .label {
    opacity: 0.95;
    font-size: var(--text-base);
}

.week-summary-row .value {
    font-weight: 700;
    font-size: var(--text-base);
    color: #ffffff;
}

/* Tech progress bar in task list */
.tech-progress {
    padding: 8px 12px;
}

.tech-progress:empty {
    display: none;
    padding: 0;
}

/* ===== SUGGESTIONS LIST ===== */
.suggestions-container {
    margin-top: 16px;
}

.suggestion-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.suggestion-card:hover {
    background: var(--gray-100);
    transform: translateX(4px);
}

.suggestion-card.highlighted {
    background: #dbeafe;
    box-shadow: inset 3px 0 0 var(--primary);
}

.suggestion-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.suggestion-info {
    flex: 1;
}

.suggestion-name {
    font-weight: 600;
    font-size: var(--text-base);
    margin-bottom: 2px;
}

.suggestion-time {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.suggestion-time.exact {
    color: var(--success);
    font-weight: 500;
}

.suggestion-actions {
    display: flex;
    gap: 4px;
}

/* ===== PROGRESS BAR ===== */
.progress-container {
    margin: 12px 0;
}

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.progress-text {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 4px;
    text-align: center;
}


/* ===== LEAFLET LAYER CONTROL ===== */
.leaflet-control-layers {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: none !important;
    min-width: 150px;
}

.leaflet-control-layers-toggle {
    width: 36px !important;
    height: 36px !important;
    background-size: 20px 20px !important;
}

.leaflet-control-layers-expanded {
    padding: 10px 14px;
}

.leaflet-control-layers-base label {
    display: flex;
    align-items: center;
    padding: 6px 4px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition-normal);
    font-size: var(--text-base);
}

.leaflet-control-layers-base label:hover {
    background: var(--gray-100);
}

.leaflet-control-layers-base input {
    margin-right: 8px;
}

.leaflet-control-layers-separator {
    border-top: 1px solid var(--gray-200);
    margin: 6px 0;
}

/* ===== PREVIEW MARKER (pulsujący) ===== */
.preview-marker-icon {
    background: transparent;
}

.preview-marker-dot {
    width: 16px;
    height: 16px;
    background: var(--danger);
    border: 3px solid white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

.preview-marker-pulse {
    width: 40px;
    height: 40px;
    background: rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* ===== GEOCODE REVIEW PANEL ===== */
.geocode-review-panel {
    display: none;
    flex-direction: column;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
    z-index: 1001;
    width: 460px;
    max-width: calc(100vw - 40px);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    animation: gcr-slide-up 0.3s ease;
}

@keyframes gcr-slide-up {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.gcr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
}

.gcr-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: var(--text-sm);
}

.gcr-title i {
    font-size: 14px;
    opacity: 0.9;
}

.gcr-counter {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: var(--radius-xl);
    font-size: var(--text-xs);
    font-weight: 700;
}

.gcr-stats {
    display: flex;
    gap: 10px;
    font-size: var(--text-xs);
}

.gcr-stat {
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
}

.gcr-stat-ok { color: #86efac; }
.gcr-stat-no { color: #fca5a5; }
.gcr-stat-wait { color: rgba(255,255,255,0.7); }

.gcr-body {
    padding: 12px 16px;
}

.gcr-address {
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--text-color);
    margin-bottom: 6px;
    line-height: 1.3;
}

.gcr-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.gcr-meta i {
    margin-right: 3px;
    opacity: 0.7;
}

.gcr-subject {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gcr-coords-old,
.gcr-coords-new {
    font-size: var(--text-xs);
    font-family: 'Courier New', monospace;
    padding: 3px 0;
}

.gcr-coords-old {
    color: var(--gray-400);
}

.gcr-coords-old i {
    color: var(--gray-400);
    margin-right: 4px;
}

.gcr-coords-new {
    color: var(--success);
    font-weight: 600;
}

.gcr-coords-new i {
    color: var(--success);
    margin-right: 4px;
}

.gcr-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.gcr-nav {
    display: flex;
    gap: 4px;
}

.gcr-buttons {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.gcr-bulk {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

/* GCR map markers */
.gcr-marker-icon {
    background: transparent;
}

.gcr-marker-dot {
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.gcr-marker-new {
    width: 18px;
    height: 18px;
    background: var(--success, #22c55e);
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.5);
}

.gcr-marker-old {
    width: 12px;
    height: 12px;
    background: var(--gray-400, #9ca3af);
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    opacity: 0.7;
}

.gcr-marker-pulse {
    width: 44px;
    height: 44px;
    background: rgba(34, 197, 94, 0.25);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: gcr-pulse 1.5s ease-out infinite;
}

@keyframes gcr-pulse {
    0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* Responsive — mniejsze ekrany */
@media (max-width: 600px) {
    .geocode-review-panel {
        width: calc(100vw - 20px);
        bottom: 10px;
    }
    .gcr-bulk { 
        flex-basis: 100%;
        justify-content: center;
    }
}

