.container-fluid {
    padding: 0 1.25rem;
}

/* Header Section */
.h2 {
    font-size: var(--ds-h2);
    font-weight: var(--ds-fw-semibold);
    line-height: var(--ds-lh-h2);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

/* Professional Table Styling */
.environment-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.environment-table thead th {
    height: var(--tbl-head-h);
    padding: 0 var(--tbl-cell-px);
    background-color: var(--surface-cool-gray);
    color: var(--text-secondary);
    font-weight: var(--ds-fw-bold);
    font-size: var(--tbl-head-size);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-medium);
    border-top: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 10;
    vertical-align: middle;
    white-space: nowrap;
}

.environment-table thead th:first-child {
    border-left: 1px solid var(--border-light);
    border-top-left-radius: 8px;
}

.environment-table thead th:last-child {
    border-right: 1px solid var(--border-light);
    border-top-right-radius: 8px;
}

/* Table Rows */
.environment-table tbody tr {
    transition: all 0.1s ease;
    cursor: pointer;
    background-color: var(--surface-white);
    height: var(--tbl-row-h);
}

.environment-table tbody tr.table-disabled {
    background-color: #fcfcfc;
    opacity: 0.6;
}

.environment-table tbody tr.table-disabled td {
    color: var(--text-muted);
}

.environment-table tbody tr.table-disabled .env-icon {
    color: var(--text-muted);
    filter: grayscale(1);
}

.environment-table tbody td {
    height: var(--tbl-row-h);
    padding: 0 var(--tbl-cell-px);
    vertical-align: middle;
    color: var(--text-secondary);
    font-size: var(--tbl-body-size);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Visual Hierarchy */
.env-icon {
    font-size: var(--ds-body);
    color: var(--brand-primary);
    margin-right: var(--sp-2);
    font-weight: var(--ds-fw-bold);
}

.env-name {
    color: var(--text-primary);
    font-size: var(--ds-body);
    font-weight: var(--ds-fw-semibold);
}

.db-name {
    color: var(--text-secondary);
    font-size: var(--ds-body);
    font-weight: var(--ds-fw-medium);
}

/* Status Icons - Large Wifi Style */
.status-icon {
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.status-icon.success {
    color: var(--status-success);
}

.status-icon.danger {
    color: var(--status-error);
}

.status-icon.muted {
    color: var(--text-muted);
}

/* Drawer Styling - High Quality Slide-out Panel */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1040;
    animation: authFadeIn 0.3s ease;
    backdrop-filter: blur(2px);
}

.drawer {
    position: fixed;
    top: 0;
    right: -500px;
    width: 500px;
    height: 100vh;
    background: var(--surface-white);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-light);
}

.drawer-open {
    right: 0;
}

.drawer-header {
    background-color: var(--surface-light);
    padding: 12px 20px;
    border-bottom: 2px solid var(--brand-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h4 {
    margin: 0;
    font-size: var(--ds-h3);
    font-weight: var(--ds-fw-semibold);
    line-height: var(--ds-lh-h3);
    color: var(--brand-primary);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: var(--surface-white);
}

.drawer-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
    background: var(--surface-light);
    display: flex;
    gap: 8px;
    align-items: center;
}

.section-header {
    color: var(--brand-primary);
    border-bottom: 2px solid var(--brand-primary-light);
    font-weight: var(--ds-fw-bold);
    font-size: var(--ds-small);
    margin-bottom: var(--sp-3);
    padding-bottom: var(--sp-1);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: var(--sp-1);
}

/* Form Styling */
.form-label {
    font-size: var(--ds-label);
    font-weight: var(--ds-fw-semibold);
    font-family: var(--ds-font);
    color: var(--text-secondary);
    margin-bottom: var(--sp-1);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control,
.form-select {
    font-size: var(--ds-body);
    font-family: var(--ds-font);
    padding: 7px 10px;
    border-color: var(--border-medium);
    border-radius: var(--ds-radius-sm);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(1, 118, 211, 0.1);
}

.mb-3 {
    margin-bottom: 10px !important;
}

/* Compact Switch */
.form-switch {
    padding-left: 2.5em;
    min-height: auto;
    display: flex;
    align-items: center;
}

.form-switch .form-check-input {
    width: 2em;
    margin-left: -2.5em;
}

.form-check-label {
    font-size: var(--ds-body);
    font-family: var(--ds-font);
    color: var(--text-primary);
    padding-top: 1px;
}

/* Drawer Footer Buttons */
.drawer-footer .btn {
    font-size: var(--ds-label);
    font-family: var(--ds-font);
    padding: 6px 14px;
    font-weight: var(--ds-fw-semibold);
    border-radius: var(--ds-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1);
    height: 34px;
    transition: all 0.2s;
}

.drawer-footer .btn-secondary {
    background-color: #64748b;
    border-color: #64748b;
    color: white;
}

.drawer-footer .btn-secondary:hover {
    background-color: #475569;
    border-color: #475569;
}

.drawer-footer .btn-outline-secondary {
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

.drawer-footer .btn-outline-secondary:hover {
    background-color: var(--surface-cool-gray);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}


/* Action Toolbar Spacing */
.btn-group-circular {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 2px;
}

/* Icon Buttons - Clean & Minimal Circular */
.btn-icon {
    width: 30px;
    height: 30px;
    border: none !important;
    background: transparent !important;
    /* No permanent background */
    color: #4b5563 !important;
    /* Soft Slate/Black - Little black, not dark */
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    padding: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-icon:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.06) !important;
    /* Smooth circular ghost hover */
    color: #111827 !important;
    /* Sharper focus on hover */
    transform: scale(1.1);
}

.btn-icon:disabled {
    opacity: 0.2 !important;
    color: #9ca3af !important;
    cursor: not-allowed;
}

.btn-icon .bi {
    filter: none !important;
    margin: 0 !important;
}

/* Remove variant colors as per 'single colour' request */
.btn-outline-primary.btn-icon,
.btn-outline-success.btn-icon,
.btn-outline-warning.btn-icon,
.btn-outline-danger.btn-icon {
    color: inherit;
    border-color: inherit;
}

/* Alert Compactness */
.alert {
    padding: 8px 12px !important;
    font-size: 12px !important;
    border-radius: 4px !important;
    margin-bottom: 10px !important;
}

.alert-dismissible .btn-close {
    padding: 10px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .env-table-wrap {
        overflow-x: auto;
    }
}

@media (max-width: 640px) {
    .drawer {
        width: 85vw;
        right: -85vw;
    }
    .drawer-open {
        right: 0;
    }
}