/* ── Project Create Wizard two-panel layout ──────────────────────────────── */

.pc-page {
    display: flex;
    height: calc(100vh - 120px);
    min-height: 560px;
    overflow: hidden;
}

/* ── Left panel ──────────────────────────────────────────────────────────── */

.pc-left-panel {
    width: 280px;
    min-width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 2px solid #e5e5e5;
    background: #f8f9fa;
    overflow-y: auto;
}

.pc-panel-header {
    padding: 14px 16px 12px;
    background: #1a3a5c;
    color: #fff;
    flex-shrink: 0;
}

.pc-panel-logo {
    width: 80px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.pc-panel-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 2px;
}

.pc-panel-subtitle {
    font-size: 12px;
    opacity: 0.75;
}

/* ── Step list ───────────────────────────────────────────────────────────── */

.pc-step-list {
    padding: 14px 12px 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pc-step-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.pc-step-item:hover.pc-step-completed,
.pc-step-item:hover.pc-step-active {
    background: rgba(26, 58, 92, 0.06);
}

.pc-step-item.pc-step-upcoming {
    cursor: default;
    opacity: 0.55;
}

.pc-step-item.pc-step-active {
    background: #eef2f7;
    border-color: #c8d8ec;
}

.pc-step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.pc-step-upcoming .pc-step-circle {
    background: #d8d8d8;
    color: #777;
}

.pc-step-active .pc-step-circle {
    background: #1a3a5c;
    color: #fff;
}

.pc-step-completed .pc-step-circle {
    background: #1e7e34;
    color: #fff;
}

.pc-step-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pc-step-label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.2;
}

.pc-step-sublabel {
    font-size: 11px;
    color: #888;
    margin-top: 1px;
}

.pc-step-connector {
    width: 2px;
    height: 10px;
    background: #d8d8d8;
    margin: 0 0 0 22px;
    border-radius: 1px;
}

/* ── Live summary panel ──────────────────────────────────────────────────── */

.pc-summary-panel {
    margin: 8px 12px 12px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 10px 12px;
}

.pc-summary-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pc-summary-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
}

.pc-summary-row:last-child {
    margin-bottom: 0;
}

.pc-summary-key {
    font-size: 10.5px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.pc-summary-val {
    font-size: 12.5px;
    font-weight: 600;
    color: #1a1a2e;
    min-height: 16px;
    word-break: break-word;
}

.pc-summary-val.pc-summary-empty {
    color: #ccc;
    font-style: italic;
    font-weight: 400;
}

/* ── Right panel ─────────────────────────────────────────────────────────── */

.pc-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    min-width: 0;
}

/* ── Step header (top of right panel) ───────────────────────────────────── */

.pc-step-header {
    flex-shrink: 0;
    padding: 18px 24px 14px;
    border-bottom: 2px solid #e5e5e5;
    background: #fff;
}

/* Standalone header card (not inside .pc-page) */
.pc-step-header.pc-standalone-card {
    border-bottom: none;
}

.pc-step-header-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a3a5c;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.pc-step-header-sub {
    font-size: 12.5px;
    color: #888;
}

.pc-step-badge {
    font-size: 11px;
    font-weight: 700;
    background: #e8f0fa;
    color: #1a3a5c;
    border-radius: 12px;
    padding: 2px 8px;
}

/* ── Step body (scrollable form area) ───────────────────────────────────── */

.pc-step-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pc-step-pane {
    display: none;
    flex-direction: column;
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
}

.pc-step-pane.pc-active {
    display: flex;
}


/* ── Field groups ────────────────────────────────────────────────────────── */

.pc-field-group {
    margin-bottom: 14px;
}

.pc-field-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
    display: block;
}

.pc-field-group .form-control {
    font-size: 13.5px;
}

.pc-field-group > .text-danger,
.pc-field-group span[data-valmsg-for] {
    font-size: 11.5px;
    margin-top: 2px;
    display: block;
}

/* ── Info badge (for "Will be assigned later") ───────────────────────────── */

.pc-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    background: #e8f0fa;
    color: #1a3a5c;
    border: 1px solid #c8d8ec;
    border-radius: 6px;
    padding: 5px 10px;
    margin-top: 4px;
}

.pc-info-badge i {
    font-size: 13px;
    opacity: 0.8;
}

/* ── Section divider ─────────────────────────────────────────────────────── */

.pc-section-divider {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 12px;
}

.pc-section-divider::before,
.pc-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e5e5;
}

/* ── Contractor / contact new-fields panel ───────────────────────────────── */

.pc-new-fields-panel {
    background: #f8f9fa;
    border: 1px solid #e0e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 12px;
}

.pc-new-fields-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a3a5c;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Inline error message ────────────────────────────────────────────────── */

.pc-ajax-error {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: #ffeef0;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #dc3545;
    font-size: 12.5px;
    font-weight: 600;
    margin-top: 8px;
}

.pc-ajax-error.pc-visible {
    display: flex;
}

/* ── Bottom bar ──────────────────────────────────────────────────────────── */

.pc-bottom-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 24px;
    border-top: 2px solid #e5e5e5;
    background: #fff;
}

.pc-bottom-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pc-bottom-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pc-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    background: #fff;
    border: 1.5px solid #d0d0d0;
    color: #555;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.pc-btn-back:hover {
    background: #f4f4f4;
    border-color: #bbb;
    color: #333;
}

.pc-btn-next {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 22px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    background: #1a3a5c;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.pc-btn-next:hover {
    background: #15304e;
}

.pc-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 22px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 6px;
    background: #1e7e34;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.pc-btn-submit:hover {
    background: #196a2b;
}

.pc-step-progress {
    font-size: 11.5px;
    color: #aaa;
    font-weight: 500;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .pc-page {
        flex-direction: column;
        height: auto;
        min-height: unset;
    }

    .pc-left-panel {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 2px solid #e5e5e5;
        overflow-y: visible;
    }

    .pc-step-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .pc-step-connector {
        display: none;
    }

    .pc-right-panel {
        overflow: visible;
    }

    .pc-step-body {
        overflow: visible;
    }

    .pc-step-pane {
        overflow-y: visible;
    }

.pc-page {
        overflow: visible;
    }
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */

[data-theme="dark"] .pc-page {
    background: #1a1a2e;
}

[data-theme="dark"] .pc-left-panel {
    background: #12122a;
    border-right-color: #2e2e4a;
}

[data-theme="dark"] .pc-panel-header {
    background: #0f2540;
}

[data-theme="dark"] .pc-step-item.pc-step-active {
    background: rgba(26, 58, 92, 0.35);
    border-color: #2a4a6c;
}

[data-theme="dark"] .pc-step-label {
    color: #e0e0f0;
}

[data-theme="dark"] .pc-step-sublabel {
    color: #778;
}

[data-theme="dark"] .pc-step-connector {
    background: #2e2e4a;
}

[data-theme="dark"] .pc-summary-panel {
    background: #1e1e38;
    border-color: #2e2e4a;
}

[data-theme="dark"] .pc-summary-title {
    color: #778;
}

[data-theme="dark"] .pc-summary-val {
    color: #d0d0e8;
}

[data-theme="dark"] .pc-right-panel {
    background: #1a1a2e;
}

[data-theme="dark"] .pc-step-header {
    background: #1a1a2e;
    border-bottom-color: #2e2e4a;
}

[data-theme="dark"] .pc-step-header-title {
    color: #b0c8e8;
}

[data-theme="dark"] .pc-step-badge {
    background: #1e3050;
    color: #7ab0e0;
}

[data-theme="dark"] .pc-step-header-sub {
    color: #668;
}

[data-theme="dark"] .pc-step-body {
    background: #1a1a2e;
}

[data-theme="dark"] .pc-field-group label {
    color: #b0b0cc;
}

[data-theme="dark"] .pc-field-group .form-control {
    background: #12122a;
    border-color: #2e2e4a;
    color: #d0d0e8;
}

[data-theme="dark"] .pc-field-group .form-control:focus {
    background: #16163a;
    border-color: #3a5a8a;
    color: #e0e0f0;
    box-shadow: 0 0 0 0.2rem rgba(26, 58, 92, 0.35);
}

[data-theme="dark"] .pc-info-badge {
    background: #1e3050;
    color: #7ab0e0;
    border-color: #2a4a6c;
}

[data-theme="dark"] .pc-section-divider {
    color: #668;
}

[data-theme="dark"] .pc-section-divider::before,
[data-theme="dark"] .pc-section-divider::after {
    background: #2e2e4a;
}

[data-theme="dark"] .pc-new-fields-panel {
    background: #12122a;
    border-color: #2a3a5a;
}

[data-theme="dark"] .pc-new-fields-title {
    color: #7ab0e0;
}

[data-theme="dark"] .pc-bottom-bar {
    background: #1a1a2e;
    border-top-color: #2e2e4a;
}

[data-theme="dark"] .pc-btn-back {
    background: #1e1e38;
    border-color: #3a3a5a;
    color: #b0b0cc;
}

[data-theme="dark"] .pc-btn-back:hover {
    background: #26263e;
    border-color: #4a4a6a;
    color: #d0d0e8;
}

[data-theme="dark"] .pc-step-progress {
    color: #558;
}

[data-theme="dark"] .pc-ajax-error {
    background: #3a1a1a;
    border-color: #7a2a2a;
    color: #f08080;
}

[data-theme="dark"] .pc-step-upcoming {
    opacity: 0.4;
}

/* ── Maps ──────────────────────────────────────────────────────────────────── */

.pc-map-search-group {
    position: relative;
}

.pc-map-search-wrap {
    position: relative;
}

.pc-map-suggestions {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 210px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}

.pc-map-suggestions.pc-visible {
    display: block;
}

.pc-map-suggestions li {
    padding: 9px 13px;
    font-size: 12.5px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.4;
}

.pc-map-suggestions li:last-child {
    border-bottom: none;
}

.pc-map-suggestions li:hover {
    background: #eef5ff;
    color: #1a3a5c;
}

.pc-map-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 6px;
    margin-bottom: 4px;
}

.pc-map-card-header {
    background: #f4f6f9;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pc-map-container {
    height: 320px;
    width: 100%;
}

/* ── Standalone form card (used outside the wizard, e.g. Edit/Create delivery) ── */

.pc-standalone-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
}

/* ── 2-column delivery layout: form left, map right ─────────────────────── */

.pc-delivery-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 480px;
    border-top: 1px solid #e5e5e5;
}

.pc-delivery-form {
    border-right: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.pc-delivery-map {
    display: flex;
    flex-direction: column;
}

.pc-delivery-map-header {
    padding: 12px 18px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #aaa;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pc-delivery-map-body {
    flex: 1;
    min-height: 400px;
    position: relative;
}

.pc-delivery-map-body > #eda-map,
.pc-delivery-map-body > #del-map,
.pc-delivery-map-body > #ctr-map {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
}

/* ── Map step panes (steps 2 and 3 in the wizard) ────────────────────────── */

.pc-step-pane.pc-map-step {
    padding: 0;
    overflow: hidden;
}

.pc-step-pane.pc-map-step > .pc-delivery-layout {
    flex: 1;
    min-height: 0;
}

.pc-map-step-top {
    padding: 20px 24px 0;
    flex-shrink: 0;
}

.pc-map-step .pc-delivery-form {
    padding: 20px 24px;
    overflow-y: auto;
}

.pc-map-step .pc-ajax-error {
    margin: 8px 24px 0;
    flex-shrink: 0;
}

.pc-delivery-map-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ccc;
    font-size: 13px;
    pointer-events: none;
}

.pc-delivery-map-placeholder i {
    font-size: 40px;
}

@media (max-width: 900px) {
    .pc-delivery-layout {
        grid-template-columns: 1fr;
    }
    .pc-delivery-form {
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
    }
    .pc-delivery-map-body {
        min-height: 280px;
    }

    .pc-step-pane.pc-map-step {
        overflow-y: auto;
    }

    .pc-step-pane.pc-map-step > .pc-delivery-layout {
        flex: none;
    }
}

/* Dark mode — map */
[data-theme="dark"] .pc-map-suggestions {
    background: #12122a;
    border-color: #2e2e4a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}

[data-theme="dark"] .pc-map-suggestions li {
    border-bottom-color: #1e1e38;
    color: #d0d0e8;
}

[data-theme="dark"] .pc-map-suggestions li:hover {
    background: #1e2e48;
    color: #7ab0e0;
}

[data-theme="dark"] .pc-map-card {
    border-color: #2e2e4a;
}

[data-theme="dark"] .pc-standalone-card {
    background: #1a1a2e;
    border-color: #2e2e4a;
}

[data-theme="dark"] .pc-delivery-layout {
    border-top-color: #2e2e4a;
}

[data-theme="dark"] .pc-delivery-form {
    border-right-color: #2e2e4a;
}

[data-theme="dark"] .pc-delivery-map-header {
    color: #444;
    border-bottom-color: #2e2e4a;
}

[data-theme="dark"] .pc-delivery-map-placeholder {
    color: #333;
}

[data-theme="dark"] .pc-map-card-header {
    background: #0f2540;
    border-bottom-color: #2e2e4a;
    color: #b0b0cc;
}

[data-theme="dark"] .pc-map-container .leaflet-tile-pane {
    filter: invert(100%) hue-rotate(180deg);
}
