/* Kanban pipeline layout */

.pipeline-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.pipeline-header-left {
    min-width: 0;
}

.pipeline-header-title-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.pipeline-header-title-row h1 {
    margin: 0;
}

.pipeline-counts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pipeline-views {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    margin: 8px 0 14px 0;
}

.pipeline-views-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.pipeline-view-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.pipeline-view-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.12);
    background: #fff;
    color: rgba(0,0,0,0.72);
    font-weight: 800;
    font-size: 0.86rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.pipeline-view-tab:hover {
    border-color: rgba(0, 51, 102, 0.25);
    color: var(--main-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.pipeline-view-tab.is-active {
    background: var(--main-color);
    border-color: var(--main-color);
    color: #fff;
}

.pipeline-view-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    flex: 0 1 auto;
}

.pipeline-search-wrap {
    min-width: 420px;
    flex: 1 1 640px;
}

.pipeline-search-wrap .input-group {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
}

.pipeline-search-wrap .input-group-text {
    font-family: "Oswald", sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    background: rgba(0,0,0,0.03);
    color: rgba(0,0,0,0.62);
    border: 1px solid rgba(0,0,0,0.12);
    border-right: none;
    letter-spacing: 0.02em;
}

.pipeline-search-wrap .input-group-text.pipeline-search-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

.pipeline-search-wrap .form-control {
    border: 1px solid rgba(0,0,0,0.12);
    border-left: none;
    border-right: none;
    font-size: 0.9rem;
    padding: 8px 12px;
    min-width: 360px;
}

.pipeline-search-wrap .form-control:focus {
    border-color: var(--main-color);
    box-shadow: none;
}

.pipeline-search-wrap .btn {
    border: 1px solid rgba(0,0,0,0.12);
    border-left: none;
    background: #fff;
    color: rgba(0,0,0,0.65);
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.pipeline-search-wrap .btn:hover {
    background: rgba(0,0,0,0.04);
    color: var(--main-color);
    border-color: rgba(0,0,0,0.15);
}

.pipeline-view-mode-toggle {
    display: flex;
    gap: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.10);
}

.pipeline-view-mode-toggle .btn {
    border-radius: 0;
    border: none;
    font-family: "Oswald", sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 8px 16px;
    letter-spacing: 0.02em;
    transition: all 0.15s ease;
}

.pipeline-view-mode-toggle .btn:first-child {
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
}

.pipeline-view-mode-toggle .btn:last-child {
    border-top-right-radius: 999px;
    border-bottom-right-radius: 999px;
}

.pipeline-view-mode-toggle .btn-outline-secondary {
    background: transparent;
    color: rgba(0,0,0,0.70);
}

.pipeline-view-mode-toggle .btn-outline-secondary:hover {
    background: rgba(0, 51, 102, 0.06);
    color: var(--main-color);
}

.pipeline-view-mode-toggle .btn-secondary {
    background: #fff;
    color: var(--main-color);
    box-shadow: 0 3px 10px rgba(0,0,0,0.10);
}

.pipeline-view-mode-toggle .btn-secondary:hover {
    background: #fff;
    color: var(--main-color);
}

/* Keep the toolbar from stacking on normal screens; allow wrap on very small widths. */
@media (max-width: 720px) {
    .pipeline-views {
        flex-wrap: wrap;
    }
    .pipeline-view-actions {
        flex-wrap: wrap;
        width: 100%;
        justify-content: flex-start;
    }
    .pipeline-search-wrap {
        flex: 1 1 100%;
        min-width: 0;
    }

    .pipeline-search-wrap .form-control {
        min-width: 0;
    }
}

.pipeline-stage-filter-dropdown {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
}

.pipeline-stage-filter-dropdown .btn {
    font-family: "Oswald", sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 8px 16px;
    letter-spacing: 0.02em;
    border: 1px solid rgba(0,0,0,0.12);
    background: #fff;
    color: rgba(0,0,0,0.65);
    transition: all 0.15s ease;
}

.pipeline-stage-filter-dropdown .btn:hover {
    background: rgba(0, 51, 102, 0.04);
    color: var(--main-color);
    border-color: rgba(0, 51, 102, 0.15);
}

.pipeline-stage-filter-dropdown .dropdown-menu {
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    padding: 12px;
}

.pipeline-stage-filter-dropdown .dropdown-menu label {
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.12s ease;
}

.pipeline-stage-filter-dropdown .dropdown-menu label:hover {
    background: rgba(0, 51, 102, 0.04);
}

.pipeline-stage-filter-dropdown .dropdown-menu .form-check-input {
    cursor: pointer;
}

.pipeline-stage-filter-dropdown .dropdown-menu .form-check-input:checked {
    background-color: var(--main-color);
    border-color: var(--main-color);
}

.pipeline-table-wrap {
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.08);
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    padding: 16px;
}

.pipeline-table-wrap thead th {
    font-family: "Oswald", sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--main-color);
    background: rgba(0, 51, 102, 0.04);
    border-bottom: 2px solid var(--main-color);
    padding: 12px 10px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.pipeline-table-wrap tbody td {
    padding: 12px 10px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 0.9rem;
}

.pipeline-table-wrap tbody td a {
    color: var(--main-color);
    font-weight: 800;
    text-decoration: none;
    transition: color 0.15s ease;
}

.pipeline-table-wrap tbody td a:hover {
    color: #0066cc;
    text-decoration: underline;
}

.pipeline-table-wrap tbody tr:hover {
    background: rgba(0, 51, 102, 0.03);
}

.pipeline-table-wrap tbody tr {
    transition: background 0.12s ease;
}

.pipeline-table-stage-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    background: rgba(0, 51, 102, 0.08);
    border: 1px solid rgba(0, 51, 102, 0.15);
    color: var(--main-color);
    white-space: nowrap;
}

.pipeline-table-age-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    background: rgba(0, 51, 102, 0.06);
    border: 1px solid rgba(0, 51, 102, 0.12);
    color: rgba(0,0,0,0.75);
    white-space: nowrap;
}

.pipeline-table-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.10);
    color: rgba(0,0,0,0.75);
    white-space: nowrap;
}

.pipeline-table-title {
    font-weight: 700;
    color: rgba(0,0,0,0.88);
}

.pipeline-table-address {
    color: rgba(0,0,0,0.65);
    font-size: 0.88rem;
}

.pipeline-park-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(255,255,255,0.95);
    color: rgba(0,0,0,0.72);
    font-weight: 800;
    font-size: 0.86rem;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.pipeline-park-toggle:hover {
    border-color: rgba(0, 51, 102, 0.25);
    color: var(--main-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.pipeline-park-toggle.is-on {
    background: rgba(0, 51, 102, 0.08);
    border-color: rgba(0, 51, 102, 0.18);
    color: var(--main-color);
}

.pipeline-board {
    display: grid;
    /* On wide screens, make columns share available width (no horizontal scroll). */
    grid-template-columns: repeat(var(--pipeline-cols, 12), minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
    overflow-x: auto;
    padding-bottom: 20px;
    /* Fill remaining viewport so columns can stretch to bottom */
    min-height: calc(100vh - 260px);
}

.pipeline-col {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    padding: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Allow grid columns to shrink without content forcing overflow */
    min-width: 0;
}

/* On smaller viewports, keep columns readable and allow horizontal scroll. */
@media (max-width: 1500px) {
    .pipeline-board {
        grid-template-columns: repeat(var(--pipeline-cols, 12), minmax(240px, 1fr));
    }
}

@media (max-width: 1200px) {
    .pipeline-board {
        grid-template-columns: repeat(var(--pipeline-cols, 12), minmax(260px, 1fr));
    }
}

.pipeline-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--main-color);
    color: #fff;
    border-radius: 8px;
    padding: 10px 10px;
    margin: -10px -10px 10px -10px; /* full-bleed header inside column */
    gap: 10px;
}

.pipeline-col-title {
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
}

.pipeline-col-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-weight: 700;
    font-size: 0.8rem;
}

.pipeline-col-body {
    flex: 1;
    min-height: 0;
}

.wo-card {
    background: #fff;
    border-radius: 8px;
    padding: 12px 12px 10px 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.08);
    border-left: 4px solid var(--main-color);
    transition: all 0.15s ease;
    margin-bottom: 10px;
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.wo-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.10);
    border-color: rgba(0,0,0,0.10);
    border-left-color: var(--main-color);
}

.wo-address-line {
    font-weight: 800;
    color: rgba(0,0,0,0.88);
    font-size: 0.92rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.wo-title-line {
    color: rgba(0,0,0,0.62);
    font-size: 0.88rem;
    line-height: 1.25;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid rgba(0,0,0,0.08);
    padding-top: 10px;
}

.wo-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.wo-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(255,255,255,0.9);
    color: rgba(0,0,0,0.75);
}

.wo-pill i {
    font-size: 0.75rem;
    color: rgba(0,0,0,0.55);
}

.wo-pill-age {
    background: rgba(0, 51, 102, 0.06);
    border-color: rgba(0, 51, 102, 0.15);
}

.wo-pill-type {
    background: rgba(0,0,0,0.03);
}

.wo-quick-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 0.82rem;
    color: var(--main-color);
    white-space: nowrap;
    flex-shrink: 0;
}

.wo-quick-action-label {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wo-quick-action-arrow {
    font-weight: 900;
    font-size: 1.05rem;
    line-height: 1;
}
