:root {
    --ink: #13213c;
    --navy: #142746;
    --blue: #3367e8;
    --mist: #f3f6fb;
    --line: #dfe6f1;
    --accent: #f37021;
    --muted: #9ca3af;
}

body {
    background: var(--mist);
    color: var(--ink);
    min-height: 100vh;
    overflow-x: hidden;
}

.intelliconops-nav {
    background: linear-gradient(100deg, #10213d, #183861);
    min-height: 64px;
    box-shadow: 0 2px 15px rgba(16, 33, 61, .18);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: white;
    background: linear-gradient(145deg, #4a7cff, #25b7cd);
    box-shadow: 0 5px 15px rgba(37, 183, 205, .25);
}

.brand-mark-lg {
    width: 54px;
    height: 54px;
    font-size: 1.5rem;
}

.brand-muted {
    color: var(--muted);
    font-weight: 500;
}

.brand-accent {
    color: var(--accent);
    font-weight: 700;
}

.role-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.eyebrow {
    color: #4370d9;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .13em;
}

.page-title {
    font-size: clamp(1.65rem, 3vw, 2.2rem);
    font-weight: 750;
    letter-spacing: -.035em;
    margin: .2rem 0;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 3px 14px rgba(31, 57, 92, .04);
    height: 100%;
}

.metric-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f2f5fa;
    font-size: 1.25rem;
}

.metric-value {
    font-weight: 800;
    font-size: 1.7rem;
    line-height: 1;
}

.panel-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 3px 14px rgba(31, 57, 92, .04);
    overflow: hidden;
}

.panel-card .card-header {
    background: white;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--line);
}

.table> :not(caption)>*>* {
    padding: .9rem 1.1rem;
}

.table thead th {
    background: #f8faff;
    color: #60708a;
    font-size: .72rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cloud-provider {
    --cloud-provider-color: #60708a;
    --cloud-provider-bg: #eef2f7;
    --cloud-provider-border: #d6dee9;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
}

.cloud-provider-icon {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    border: 1px solid var(--cloud-provider-border);
    border-radius: .65rem;
    color: var(--cloud-provider-color);
    background: var(--cloud-provider-bg);
    font-size: 1rem;
    box-shadow: 0 2px 6px rgba(19, 33, 60, .06);
}

.cloud-provider-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.cloud-provider-name {
    color: var(--cloud-provider-color);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .035em;
}

.cloud-provider-account {
    max-width: 12rem;
    margin-top: .15rem;
    overflow: hidden;
    color: #6c7890;
    font-size: .74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cloud-provider-aws {
    --cloud-provider-color: #d97706;
    --cloud-provider-bg: #fff7df;
    --cloud-provider-border: #f8c65b;
}

.cloud-provider-azure {
    --cloud-provider-color: #0078d4;
    --cloud-provider-bg: #e6f3fc;
    --cloud-provider-border: #8bc9ee;
}

.cloud-provider-gcp {
    --cloud-provider-color: #1a73e8;
    --cloud-provider-bg: #fff;
    --cloud-provider-border: #c9d7ee;
}

.cloud-provider-gcp .cloud-provider-icon i {
    color: transparent;
    background: linear-gradient(110deg, #4285f4 0 35%, #34a853 35% 53%, #fbbc05 53% 70%, #ea4335 70% 100%);
    background-clip: text;
    -webkit-background-clip: text;
}

.status {
    display: inline-block;
    border-radius: 999px;
    padding: .28rem .58rem;
    background: #e9edf4;
    color: #49566a;
    font-size: .75rem;
    font-weight: 700;
    text-transform: capitalize;
}

.status-running,
.status-succeeded {
    background: #def7e9;
    color: #177344;
}

.status-failed,
.status-rejected,
.status-cancelled {
    background: #ffe1e4;
    color: #a32939;
}

.status-pending_approval,
.status-queued {
    background: #fff0c9;
    color: #8a5b00;
}

.login-shell {
    min-height: calc(100vh - 115px);
    display: grid;
    place-items: center;
    padding: 2rem 0;
}

.login-card {
    width: min(100%, 470px);
    border-radius: 20px;
}

.form-control,
.form-select {
    border-color: #ccd6e5;
}

.empty-state {
    text-align: center;
    color: #718096;
    padding: 3rem !important;
}

.detail-list dt {
    color: #6c7890;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.detail-list dd {
    font-weight: 600;
    margin-bottom: 1rem;
    overflow-wrap: anywhere;
}

code {
    color: #285cc4;
}

.remote-console {
    min-height: 260px;
    max-height: 520px;
    overflow: auto;
    padding: 1.25rem;
    color: #d8f3dc;
    background: #07111f;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.remote-console pre {
    color: inherit;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ── Sidebar layout ─────────────────────────────────────────────────────── */

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

.app-sidebar {
    width: 240px;
    min-width: 240px;
    background: linear-gradient(180deg, #10213d 0%, #183861 100%);
    color: #c8d6e5;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform .25s ease;
}

/* The hostname is mapped to one of these classes by the shared layout. The
   production modifier intentionally has no override, preserving the original
   navy scheme exactly. */
.app-sidebar--development {
    background: linear-gradient(180deg, #202428 0%, #343a40 100%);
}

.app-sidebar--development .sidebar-heading,
.app-sidebar--development .sidebar-heading.sidebar-toggle,
.app-sidebar--development .sidebar-subheading {
    color: #c7cdd3;
}

.app-sidebar--development .sidebar-heading.sidebar-toggle:hover,
.app-sidebar--development .sidebar-link:hover {
    color: #fff;
}

.app-sidebar--development .sidebar-link {
    color: #e2e6ea;
}

.app-sidebar--staging {
    background: linear-gradient(180deg, #245780 0%, #2d6c9c 100%);
}

.app-sidebar--staging .sidebar-heading,
.app-sidebar--staging .sidebar-heading.sidebar-toggle,
.app-sidebar--staging .sidebar-subheading {
    color: #d7ecfa;
}

.app-sidebar--staging .sidebar-heading.sidebar-toggle:hover,
.app-sidebar--staging .sidebar-link:hover {
    color: #fff;
}

.app-sidebar--staging .sidebar-link {
    color: #f4f9fd;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-nav {
    flex: 1;
    padding: .75rem 0;
}

.sidebar-section {
    margin-bottom: .25rem;
}

.sidebar-heading {
    padding: .5rem 1.25rem .25rem;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #5a7aaa;
}

.sidebar-heading.sidebar-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: .6rem 1.25rem;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #5a7aaa;
    transition: color .15s;
}

.sidebar-heading.sidebar-toggle:hover {
    color: #8bb0e0;
}

.sidebar-heading.sidebar-toggle i {
    font-size: .7rem;
}

.sidebar-subheading {
    padding: .35rem 1.25rem .15rem;
    font-size: .6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #4a6a9a;
    opacity: .7;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem 1.25rem;
    color: #b0c4de;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background .15s, border-color .15s, color .15s;
}

.sidebar-link:hover {
    background: rgba(255,255,255,.06);
    color: #e8eff8;
}

.sidebar-link.active {
    background: rgba(255,255,255,.1);
    color: #fff;
    border-left-color: var(--accent);
    font-weight: 600;
}

.sidebar-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
}

/* ── Main content area ──────────────────────────────────────────────────── */

.app-main {
    flex: 1;
    min-width: 0;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.permission-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

.app-topbar {
    display: flex;
    align-items: center;
    padding: .6rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    min-height: 56px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-content {
    flex: 1;
    padding: 1.5rem;
}

/* ── Mobile: off-canvas sidebar ─────────────────────────────────────────── */

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        width: 260px;
        min-width: 260px;
    }

    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,.3);
    }

    .app-main {
        margin-left: 0;
    }

    .app-content {
        padding: 1rem;
    }

    .app-topbar {
        padding: .5rem 1rem;
        min-height: 48px;
    }

    /* Backdrop overlay when sidebar is open */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 1035;
    }

    .app-sidebar.open + .sidebar-backdrop {
        display: block;
    }
}

/* ── Responsive card-style tables on mobile ─────────────────────────────── */

@media (max-width: 767.98px) {
    table.card-responsive,
    table.card-responsive thead,
    table.card-responsive tbody,
    table.card-responsive th,
    table.card-responsive td,
    table.card-responsive tr {
        display: block;
    }

    table.card-responsive thead {
        display: none;
    }

    table.card-responsive tbody tr {
        margin-bottom: .75rem;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff;
        padding: .5rem .75rem;
        box-shadow: 0 1px 4px rgba(0,0,0,.03);
    }

    table.card-responsive tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-width: 0;
        padding: .35rem .75rem;
        border: none;
        font-size: .85rem;
        text-align: right;
    }

    table.card-responsive tbody td > :not(.permission-badges) {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    table.card-responsive .permission-badges {
        min-width: 0;
        justify-content: flex-end;
    }

    table.card-responsive .permission-badges .badge {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: left;
    }

    table.card-responsive tbody td:not(:last-child) {
        border-bottom: 1px solid #f0f3f8;
    }

    table.card-responsive tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #5a7aaa;
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .04em;
        margin-right: .75rem;
        flex-shrink: 0;
        text-align: left;
    }

    /* Hide pagination collapse rows from card view */
    table.card-responsive tr.collapse,
    table.card-responsive tr.collapse td {
        display: none !important;
    }
}

/* ── Connectivity step dependency highlighting ── */
.step-affected .accordion-button {
    border-left: 4px solid var(--bs-warning, #ffc107);
    background-color: rgba(255, 193, 7, 0.08);
}
.step-affected .accordion-button::after {
    content: " ⚠";
}
.step-unaffected {
    opacity: 0.45;
    pointer-events: none;
}
.step-unaffected .accordion-button {
    cursor: default;
}
.step-unaffected .run-btn,
.step-unaffected .copy-btn {
    display: none;
}
