/* =========================================================
   CloudSurf - SHARED STYLESHEET
   ========================================================= */


/* ---------- 1. DESIGN VARIABLES ---------- */

:root {
    /* Main backgrounds */
    --bg-main: #0b1120;
    --bg-sidebar: #0d1526;
    --bg-card: #151f32;
    --bg-card-hover: #19263c;

    /* Borders */
    --border-color: #26344d;

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* CloudSurf accents */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent-purple: #8b5cf6;
    --accent-teal: #2dd4bf;

    /* Security status */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #f43f5e;

    /* Sizing */
    --sidebar-width: 230px;
    --card-radius: 12px;
}


/* ---------- 2. GLOBAL ---------- */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}


/* ---------- 3. TYPOGRAPHY ---------- */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    margin-top: 0;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}


/* ---------- 4. SHARED CARDS ---------- */

.cg-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 20px;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.cg-card:hover {
    background: var(--bg-card-hover);
}


/* ---------- 5. BUTTONS ---------- */

.cg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 10px 18px;

    border: none;
    border-radius: 8px;

    font-weight: 600;
    cursor: pointer;

    transition: 0.2s ease;
}

.cg-btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.cg-btn-primary:hover {
    background: var(--primary-hover);
}


/* ---------- 6. FORM ELEMENTS ---------- */

.cg-label {
    display: block;
    margin-bottom: 7px;

    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.cg-input {
    width: 100%;

    padding: 11px 12px;

    background: #0f1829;
    color: var(--text-primary);

    border: 1px solid var(--border-color);
    border-radius: 8px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.cg-input::placeholder {
    color: var(--text-muted);
}

.cg-input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.12);
}


/* ---------- 7. STATUS BADGES ---------- */

.cg-badge {
    display: inline-flex;
    align-items: center;

    padding: 4px 9px;

    border-radius: 999px;

    font-size: 0.75rem;
    font-weight: 600;
}

.cg-badge-success {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
}

.cg-badge-warning {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
}

.cg-badge-danger {
    color: #fda4af;
    background: rgba(244, 63, 94, 0.12);
}


/* ---------- 8. TABLES ---------- */

.cg-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.cg-table {
    width: 100%;
    border-collapse: collapse;
}

.cg-table th {
    padding: 12px;

    color: var(--text-secondary);

    font-size: 0.75rem;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;

    border-bottom: 1px solid var(--border-color);
}

.cg-table td {
    padding: 13px 12px;

    color: var(--text-primary);
    font-size: 0.88rem;

    border-bottom: 1px solid rgba(38, 52, 77, 0.7);
}

.cg-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}


/* ---------- 9. SCROLLABLE DASHBOARD TABLE ---------- */

.cg-table-scroll {
    max-height: 310px;
    overflow-y: auto;
}

.cg-table-scroll::-webkit-scrollbar {
    width: 6px;
}

.cg-table-scroll::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}


/* ---------- 10. UTILITY ---------- */

.cg-flex {
    display: flex;
}

.cg-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cg-gap {
    gap: 16px;
}

.cg-hidden {
    display: none !important;
}


/* =========================================================
   11. APPLICATION SHELL
   ========================================================= */

.app-shell {
    display: flex;
    min-height: 100vh;
}


/* ---------- SIDEBAR ---------- */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;

    position: fixed;
    top: 0;
    left: 0;

    display: flex;
    flex-direction: column;

    padding: 24px 16px;

    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
}

.sidebar-brand {
    padding: 4px 10px 28px;

    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;

    color: var(--text-primary);
}

.sidebar-brand span {
    color: var(--primary);
}


/* ---------- SIDEBAR NAVIGATION ---------- */

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 12px;

    color: var(--text-secondary);

    font-size: 0.9rem;
    font-weight: 500;

    border-radius: 8px;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.nav-item:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
}

.nav-icon {
    width: 20px;

    display: inline-flex;
    justify-content: center;

    font-size: 1rem;
}


/* ---------- BOTTOM SIDEBAR ---------- */

.sidebar-bottom {
    margin-top: auto;

    padding-top: 18px;

    border-top: 1px solid var(--border-color);

    display: flex;
    flex-direction: column;
    gap: 6px;
}


/* ---------- MAIN AREA ---------- */

.main-area {
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;

    margin-left: var(--sidebar-width);

    background: var(--bg-main);
}


/* ---------- TOPBAR ---------- */

.topbar {
    height: 72px;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    padding: 0 28px;

    background: rgba(11, 17, 32, 0.96);

    border-bottom: 1px solid var(--border-color);
}


/* ---------- SEARCH ---------- */

.topbar-search {
    width: 320px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 9px 12px;

    background: #101a2c;

    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.search-icon {
    color: var(--text-muted);
}

.topbar-search input {
    width: 100%;

    background: transparent;
    border: none;
    outline: none;

    color: var(--text-primary);

    font-size: 0.88rem;
}

.topbar-search input::placeholder {
    color: var(--text-muted);
}


/* ---------- TOPBAR RIGHT ---------- */

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.icon-button {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;

    color: var(--text-secondary);

    border: 1px solid var(--border-color);
    border-radius: 8px;

    cursor: pointer;
}

.icon-button:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}


/* ---------- USER PROFILE ---------- */

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;

    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 50%;

    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: var(--text-primary);

    font-size: 0.86rem;
    font-weight: 600;
}

.user-role {
    color: var(--text-muted);

    font-size: 0.72rem;
}


/* ---------- PAGE CONTENT ---------- */

.page-content {
    padding: 28px;
}


/* ---------- BASIC RESPONSIVENESS ---------- */

@media (max-width: 900px) {

    :root {
        --sidebar-width: 190px;
    }

    .topbar-search {
        width: 220px;
    }
}

/* =========================================================
   12. AUTHENTICATION PAGES
   ========================================================= */

.auth-body {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(
            circle at top,
            rgba(59, 130, 246, 0.08),
            transparent 35%
        ),
        var(--bg-main);

    padding: 24px;
}


/* ---------- AUTH WRAPPER ---------- */

.auth-wrapper {
    width: 100%;
    max-width: 430px;
}


/* ---------- AUTH CARD ---------- */

.auth-card {
    width: 100%;

    padding: 38px;

    background: var(--bg-card);

    border: 1px solid var(--border-color);
    border-radius: 16px;

    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.28);
}


/* ---------- BRAND ---------- */

.auth-brand {
    margin-bottom: 34px;

    text-align: center;

    color: var(--text-primary);

    font-size: 1.5rem;
    font-weight: 700;
}

.auth-brand span {
    color: var(--primary);
}


/* ---------- AUTH HEADER ---------- */

.auth-header {
    margin-bottom: 28px;
}

.auth-header h1 {
    margin-bottom: 8px;

    font-size: 1.7rem;
}

.auth-header p {
    margin: 0;

    color: var(--text-secondary);

    font-size: 0.92rem;
    line-height: 1.5;
}


/* ---------- FIELDS ---------- */

.auth-field {
    margin-bottom: 18px;
}


/* ---------- SUBMIT BUTTON ---------- */

.auth-submit {
    width: 100%;

    margin-top: 8px;

    padding: 11px 18px;
}


/* ---------- AUTH FOOTER ---------- */

.auth-footer {
    margin-top: 24px;

    text-align: center;

    color: var(--text-secondary);

    font-size: 0.88rem;
}

.auth-footer a {
    margin-left: 4px;

    color: #93c5fd;

    font-weight: 600;
}

.auth-footer a:hover {
    color: #bfdbfe;
}


/* ---------- AUTH ALERTS ---------- */

.auth-alert {
    margin-bottom: 20px;

    padding: 11px 13px;

    border-radius: 8px;

    font-size: 0.86rem;
}

.auth-alert-error {
    color: #fecdd3;

    background: rgba(244, 63, 94, 0.10);

    border: 1px solid rgba(244, 63, 94, 0.25);
}

.auth-alert-success {
    color: #bbf7d0;

    background: rgba(34, 197, 94, 0.10);

    border: 1px solid rgba(34, 197, 94, 0.25);
}

.logout-form {
    margin: 0;
}

.logout-button {
    width: 100%;

    background: transparent;
    border: none;

    text-align: left;
    cursor: pointer;

    font-family: inherit;
}

/* =========================================================
   13. AWS ENVIRONMENT PAGE
   ========================================================= */

.page-header {
    margin-bottom: 26px;
}

.page-header h1 {
    margin-bottom: 6px;
    font-size: 1.8rem;
}

.page-header p {
    margin: 0;
}


/* ---------- PAGE GRID ---------- */

.aws-connect-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr);
    gap: 22px;
    align-items: start;
}


/* ---------- SECTION HEADING ---------- */

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 28px;
}

.section-heading h2 {
    margin-bottom: 6px;
    font-size: 1.25rem;
}

.section-heading p {
    margin: 0;
}


/* ---------- CONNECTION PROGRESS ---------- */

.aws-progress {
    display: grid;
    grid-template-columns: repeat(4, 1fr);

    margin-bottom: 34px;
}

.aws-step {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}

.aws-step::after {
    content: "";

    position: absolute;
    top: 17px;
    left: 50%;

    width: 100%;
    height: 1px;

    background: var(--border-color);

    z-index: 0;
}

.aws-step:last-child::after {
    display: none;
}

.aws-step span {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    z-index: 1;

    background: #111b2d;
    color: var(--text-secondary);

    border: 1px solid var(--border-color);
    border-radius: 50%;

    font-size: 0.82rem;
    font-weight: 700;
}

.aws-step.active span {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;

    border-color: rgba(59, 130, 246, 0.4);
}

.aws-step p {
    margin: 9px 0 0;

    color: var(--text-secondary);

    font-size: 0.78rem;
}


/* ---------- SETUP SECTIONS ---------- */

.setup-section {
    padding: 22px 0;

    border-top: 1px solid var(--border-color);
}

.setup-section h3 {
    margin-bottom: 8px;

    font-size: 1rem;
}

.setup-section p {
    margin-bottom: 14px;

    font-size: 0.9rem;
    line-height: 1.6;
}


/* ---------- AWS INFORMATION BOX ---------- */

.aws-info-box {
    margin-top: 12px;

    padding: 14px;

    background: #101a2c;

    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.aws-info-box code {
    display: block;

    margin-top: 5px;

    color: #93c5fd;

    font-size: 0.82rem;

    word-break: break-word;
}

.aws-info-label {
    display: block;

    color: var(--text-secondary);

    font-size: 0.75rem;
    font-weight: 600;

    text-transform: uppercase;
}


/* ---------- GUIDE LINK ---------- */

.aws-guide-link {
    color: #93c5fd;

    font-size: 0.86rem;
    font-weight: 600;
}

.aws-guide-link:hover {
    color: #bfdbfe;
}


/* ---------- RIGHT CONNECTION CARD ---------- */

.aws-connect-card {
    position: sticky;
    top: 96px;
}

.aws-connect-card h2 {
    margin-bottom: 8px;

    font-size: 1.2rem;
}

.aws-connect-card > p {
    margin-bottom: 24px;

    line-height: 1.5;
}

.aws-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 20px;

    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;

    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: 10px;

    font-size: 1.3rem;
}

.aws-connect-button {
    width: 100%;

    margin-top: 8px;
}


/* ---------- READ ONLY MESSAGE ---------- */

.aws-readonly-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    margin-top: 20px;
    padding-top: 18px;

    border-top: 1px solid var(--border-color);
}

.aws-readonly-note span {
    color: var(--success);

    font-weight: 700;
}

.aws-readonly-note p {
    margin: 0;

    color: var(--text-secondary);

    font-size: 0.82rem;
    line-height: 1.5;
}


/* ---------- RESPONSIVE ---------- */

@media (max-width: 1000px) {

    .aws-connect-grid {
        grid-template-columns: 1fr;
    }

    .aws-connect-card {
        position: static;
    }
}

/* =========================================================
   14. DASHBOARD
   ========================================================= */

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 26px;
}

.dashboard-header h1 {
    margin-bottom: 6px;

    font-size: 1.75rem;
}

.dashboard-header p {
    margin: 0;
}


/* ---------- SUMMARY CARDS ---------- */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 22px;
}

.stat-card {
    min-height: 145px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-label {
    color: var(--text-secondary);

    font-size: 0.85rem;
    font-weight: 600;
}

.stat-value {
    margin: 7px 0;

    color: var(--text-primary);

    font-size: 2rem;
    font-weight: 700;
}

.stat-note {
    color: var(--text-muted);

    font-size: 0.75rem;
}

.stat-high .stat-value {
    color: #fb7185;
}

.stat-ids .stat-value {
    color: #c084fc;
}


/* ---------- AWS STATUS CARD ---------- */

.aws-status-card {
    gap: 10px;
}

.aws-status-line {
    display: flex;
    align-items: center;
    gap: 9px;

    font-weight: 600;
}

.status-dot {
    width: 9px;
    height: 9px;

    background: var(--warning);

    border-radius: 50%;
}

.status-dot.connected {
    background: var(--success);

    box-shadow:
        0 0 8px rgba(34, 197, 94, 0.4);
}

.dashboard-scan-button {
    width: 100%;

    padding: 8px 12px;

    font-size: 0.82rem;
}


/* ---------- CHART GRID ---------- */

.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 18px;

    margin-bottom: 22px;
}

.dashboard-chart-card {
    min-height: 320px;
}

.dashboard-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}

.dashboard-section-header h2 {
    margin-bottom: 5px;

    font-size: 1rem;
}

.dashboard-section-header p {
    margin: 0;

    font-size: 0.8rem;
}


/* ---------- CHART AREA ---------- */

.chart-area {
    height: 220px;

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-area canvas {
    max-height: 210px;
}

.chart-empty {
    color: var(--text-muted);

    font-size: 0.85rem;
    text-align: center;
}


/* ---------- DASHBOARD TABLE CARDS ---------- */

.dashboard-table-card {
    margin-bottom: 22px;

    padding-bottom: 8px;
}

.history-link {
    color: #93c5fd;

    font-size: 0.8rem;
    font-weight: 600;

    white-space: nowrap;
}

.history-link:hover {
    color: #bfdbfe;
}

.dashboard-empty-row {
    padding: 30px !important;

    color: var(--text-muted) !important;

    text-align: center;
}


/*
 Dashboard tables:
 about six rows visible,
 remaining rows scroll internally.
*/

.dashboard-table-card .cg-table-scroll {
    max-height: 340px;
    overflow-y: auto;
}


/* ---------- MODAL ---------- */

.cg-modal {
    position: fixed;

    inset: 0;

    z-index: 2000;

    display: flex;
    align-items: center;
    justify-content: center;
}

.cg-modal-overlay {
    position: absolute;

    inset: 0;

    background: rgba(3, 7, 18, 0.72);
}

.cg-modal-content {
    width: min(520px, calc(100% - 40px));

    position: relative;
    z-index: 1;

    padding: 26px;

    background: var(--bg-card);

    border: 1px solid var(--border-color);
    border-radius: 14px;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.45);
}

.cg-modal-content h2 {
    margin-top: 10px;
    margin-bottom: 22px;

    font-size: 1.25rem;
}

.modal-close {
    background: transparent;

    color: var(--text-secondary);

    border: none;

    font-size: 1.7rem;

    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-detail {
    display: flex;
    justify-content: space-between;

    gap: 20px;

    padding: 11px 0;

    border-bottom: 1px solid var(--border-color);

    font-size: 0.86rem;
}

.modal-detail span {
    color: var(--text-secondary);
}

.modal-section {
    margin-top: 20px;
}

.modal-section h3 {
    margin-bottom: 7px;

    font-size: 0.85rem;
}

.modal-section p {
    margin: 0;

    color: var(--text-secondary);

    font-size: 0.86rem;
    line-height: 1.6;
}

.remediation-section {
    padding: 15px;

    background: rgba(59, 130, 246, 0.06);

    border: 1px solid rgba(59, 130, 246, 0.14);
    border-radius: 8px;
}


/* ---------- RESPONSIVE ---------- */

@media (max-width: 1200px) {

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 900px) {

    .dashboard-charts {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 700px) {

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

}

/* =========================================================
   FINDING ACTION BUTTON
   ========================================================= */

.view-fix-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 8px 14px;

    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 8px;

    background: rgba(59, 130, 246, 0.10);

    color: #8bbcff;

    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.view-fix-button:hover {

    background: rgba(59, 130, 246, 0.18);

    border-color: rgba(96, 165, 250, 0.60);

    transform: translateY(-1px);
}


.view-fix-button:active {

    transform: translateY(0);

}

/* =========================================================
   CLOUDSURF SIDEBAR LOGO
   ========================================================= */

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    width: 150px;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* =========================================================
   CLOUDSURF AUTH LOGO
   ========================================================= */

.auth-logo {
    width: 170px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 18px;
    object-fit: contain;
}

/* =========================================================
   PAGE HEADER + USER PROFILE
   ========================================================= */

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.dashboard-heading {
    min-width: 0;
}

.page-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.page-user-profile .user-info {
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

}

/* =========================================================
   AUTH BACK LINK
   ========================================================= */

.auth-back-link {
    position: absolute;
    top: 24px;
    left: 32px;

    color: #8fb8ff;
    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    transition: opacity 0.2s ease;
}

.auth-back-link:hover {
    opacity: 0.75;
}


/* =========================================================
   CLOUD ENVIRONMENT DETAIL / CONNECTION MANAGEMENT
   ========================================================= */

.environment-detail-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


/* ---------- BACK LINK ---------- */

.environment-back-link {
    display: inline-block;
    width: fit-content;

    color: #93c5fd;

    font-size: 0.86rem;
    font-weight: 600;
}

.environment-back-link:hover {
    color: #bfdbfe;
}


/* ---------- HEADER ---------- */

.environment-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.environment-detail-header h1 {
    margin: 5px 0 6px;

    font-size: 1.8rem;
}

.environment-provider {
    color: var(--text-muted);

    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}


/* ---------- NEUTRAL STATUS ---------- */

.environment-status-neutral {
    display: inline-flex;
    align-items: center;

    padding: 4px 9px;

    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.08);

    border: 1px solid var(--border-color);
    border-radius: 999px;

    font-size: 0.75rem;
    font-weight: 600;
}


/* ---------- DETAIL CARD ---------- */

.environment-detail-card h2 {
    margin-bottom: 18px;

    font-size: 1.15rem;
}


/* ---------- ENVIRONMENT INFORMATION ---------- */

.environment-info-grid,
.connected-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.connected-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));

    margin: 20px 0;
}

.environment-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    color: var(--text-secondary);

    font-size: 0.78rem;
    font-weight: 600;
}

.info-value {
    color: var(--text-primary);

    font-size: 0.88rem;
    font-weight: 600;

    overflow-wrap: anywhere;
}


/* ---------- CONNECTION DESCRIPTION ---------- */

.connection-description {
    margin: 0 0 22px;

    color: var(--text-secondary);

    font-size: 0.9rem;
    line-height: 1.6;
}


/* ---------- CONNECTION PROGRESS ---------- */

.connection-progress {
    display: flex;
    align-items: flex-start;

    margin: 28px 0 30px;
}

.progress-step {
    min-width: 90px;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}

.progress-step span {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #111b2d;
    color: var(--text-secondary);

    border: 1px solid var(--border-color);
    border-radius: 50%;

    font-size: 0.82rem;
    font-weight: 700;
}

.progress-step p {
    margin: 9px 0 0;

    color: var(--text-secondary);

    font-size: 0.78rem;
    font-weight: 600;
}

.progress-step.active span {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;

    border-color: rgba(59, 130, 246, 0.4);
}

.progress-step.active p {
    color: #93c5fd;
}

.progress-step.complete span {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;

    border-color: rgba(34, 197, 94, 0.25);
}

.progress-step.complete p {
    color: #86efac;
}

.progress-line {
    flex: 1;

    height: 1px;

    margin-top: 17px;

    background: var(--border-color);
}


/* ---------- WIZARD PANEL ---------- */

.connection-step-panel {
    padding-top: 24px;

    border-top: 1px solid var(--border-color);
}

.connection-step-panel.hidden {
    display: none;
}

.connection-step-panel h3 {
    margin: 6px 0 10px;

    font-size: 1rem;
}

.connection-step-panel > p {
    color: var(--text-secondary);

    font-size: 0.9rem;
    line-height: 1.6;
}

.step-eyebrow {
    color: #93c5fd;

    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}


/* ---------- SETUP INFORMATION ---------- */

.setup-instruction-box {
    margin: 18px 0;
    padding: 14px;

    background: #101a2c;

    border: 1px solid var(--border-color);
    border-radius: 8px;

    color: var(--text-secondary);

    font-size: 0.86rem;
}

.setup-instruction-box strong {
    color: var(--text-primary);
}

.setup-instruction-box ul {
    margin: 10px 0 0;
    padding-left: 20px;
}

.setup-instruction-box li {
    margin: 7px 0;

    line-height: 1.5;
}

.setup-instruction-box code {
    color: #93c5fd;
}


/* ---------- EXTERNAL ID ---------- */

.external-id-box {
    margin: 18px 0 0;
    padding: 14px;

    background: #101a2c;

    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.copy-value-row {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-top: 8px;
}

.copy-value-row code {
    flex: 1;

    color: #93c5fd;

    font-size: 0.82rem;

    overflow-wrap: anywhere;
}


/* ---------- SECONDARY BUTTON ---------- */

.environment-secondary-button {
    background: transparent;

    color: #93c5fd;

    border: 1px solid rgba(59, 130, 246, 0.35);
}

.environment-secondary-button:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.08);

    border-color: rgba(59, 130, 246, 0.55);
}

.environment-secondary-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}


/* ---------- STEP ACTIONS ---------- */

.step-actions {
    display: flex;
    gap: 10px;

    margin-top: 22px;
}


/* ---------- NOTES / MESSAGES ---------- */

.connection-note {
    margin: 10px 0 0;

    color: var(--text-muted);

    font-size: 0.8rem;
    line-height: 1.5;
}

.connection-message {
    min-height: 20px;

    margin: 14px 0 0;

    color: var(--text-secondary);

    font-size: 0.8rem;
    font-weight: 600;
}

.connection-message.success {
    color: #86efac;
}

.connection-message.error {
    color: #fda4af;
}


/* ---------- SUCCESS ---------- */

.connection-success-box {
    padding: 15px;

    background: rgba(34, 197, 94, 0.08);

    border: 1px solid rgba(34, 197, 94, 0.22);
    border-radius: 8px;
}

.connection-success-box strong {
    color: #86efac;
}

.connection-success-box p {
    margin: 6px 0 0;

    color: var(--text-secondary);

    font-size: 0.86rem;
    line-height: 1.5;
}


/* ---------- RESPONSIVE ---------- */

@media (max-width: 900px) {

    .environment-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 600px) {

    .environment-detail-header {
        flex-direction: column;
    }

    .environment-info-grid,
    .connected-detail-grid {
        grid-template-columns: 1fr;
    }

    .connection-progress {
        overflow-x: auto;
    }

    .progress-line {
        min-width: 30px;
    }

    .copy-value-row {
        flex-direction: column;
        align-items: stretch;
    }

}