:root {
    --lane-bg: #f6f7f9;
    --lane-border: #dee2e6;
    --card-border: #d8dee4;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.env-page {
    max-width: 100%;
}

.summary-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.summary-tile {
    background: #fff;
    border: 1px solid var(--lane-border);
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
}

.summary-label {
    color: #6c757d;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.summary-value {
    color: #212529;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.filter-panel {
    background: #fff;
    border: 1px solid var(--lane-border);
    border-radius: 8px;
    padding: 0.9rem;
}

.kanban-board {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(5, minmax(300px, 1fr));
    min-height: 560px;
    overflow-x: auto;
    padding-bottom: 0.75rem;
}

.kanban-lane {
    background: var(--lane-bg);
    border: 1px solid var(--lane-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 285px);
    min-height: 520px;
    min-width: 260px;
}

.lane-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--lane-border);
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    padding: 0.75rem;
}

.lane-title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.lane-subtitle {
    color: #6c757d;
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.2rem;
}

.lane-count {
    background: #fff;
    border: 1px solid var(--lane-border);
    border-radius: 999px;
    color: #495057;
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    min-width: 2rem;
    padding: 0.35rem 0.5rem;
    text-align: center;
}

.lane-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.65rem;
    overflow-y: auto;
    padding: 0.75rem;
}

.lane-body.drag-over {
    background: #eef3f8;
    outline: 2px dashed #6c8ebf;
    outline-offset: -6px;
}

.empty-lane {
    border: 1px dashed #c7ced6;
    border-radius: 8px;
    color: #6c757d;
    font-size: 0.82rem;
    padding: 1rem;
    text-align: center;
}

.env-card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-left: 4px solid #6c757d;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    padding: 0.75rem;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.env-card:hover,
.env-card:focus {
    border-color: #9aa5b1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    outline: none;
    transform: translateY(-1px);
}

.env-card.is-dragging {
    opacity: 0.55;
}

.env-card.lane-free-for-use {
    border-left-color: #198754;
}

.env-card.lane-active-development {
    border-left-color: #0d6efd;
}

.env-card.lane-stale {
    border-left-color: #f0ad4e;
}

.env-card.lane-restricted {
    border-left-color: #dc3545;
}

.env-card.lane-archived-inactive {
    border-left-color: #6c757d;
}

.env-card-title-row {
    align-items: flex-start;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    min-width: 0;
}

.env-name {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.env-branch,
.env-db,
.env-card-meta {
    color: #495057;
    font-size: 0.8rem;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.env-db {
    color: #6c757d;
}

.copy-btn {
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 0.78rem;
    line-height: 1;
    padding: 0 0.15rem;
}

.copy-btn:hover,
.copy-btn:focus {
    color: #0d6efd;
    outline: none;
}

.copy-btn.copied {
    color: #198754;
}

.copyable-row {
    align-items: center;
    display: flex;
    gap: 0.25rem;
}

.copyable-row > .copyable-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.env-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-height: 1.5rem;
}

.badge-status {
    font-size: 0.67rem;
    font-weight: 700;
}

.badge-free {
    background: #d1e7dd;
    color: #0f5132;
}

.badge-active {
    background: #e7f1ff;
    color: #084298;
}

.badge-merged {
    background: #d1e7dd;
    color: #0f5132;
}

.badge-stale {
    background: #fff3cd;
    color: #664d03;
}

.badge-restricted {
    background: #dc3545;
    color: #fff;
}

.badge-archived {
    background: #e9ecef;
    color: #495057;
}

.badge-manual {
    background: #343a40;
    color: #fff;
}

.env-card-actions {
    display: flex;
    gap: 0.35rem;
    margin-top: auto;
}

.env-card-actions .btn {
    align-items: center;
    display: inline-flex;
    font-size: 0.76rem;
    gap: 0.25rem;
    min-height: 30px;
}

.offcanvas.env-detail {
    width: min(560px, 100vw);
}

.detail-label {
    color: #6c757d;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.detail-value {
    overflow-wrap: anywhere;
}

.detail-block {
    border-bottom: 1px solid #edf0f2;
    padding: 0.75rem 0;
}

.toast-container {
    z-index: 1090;
}

@media (max-width: 991.98px) {
    .kanban-lane {
        max-height: none;
        min-height: 420px;
    }
}
