@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&display=swap');

:root {
    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-soft: #f9fafc;
    --sidebar: #10121a;
    --sidebar-soft: #1a1d29;
    --text: #191c26;
    --muted: #737889;
    --line: #e7e9f0;
    --primary: #6954e8;
    --primary-dark: #5540d1;
    --green: #22a874;
    --blue: #3a83ed;
    --orange: #ed8b3a;
    --danger: #d95468;
    --shadow: 0 12px 32px rgba(29, 34, 53, .07);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    color: var(--text);
    background: var(--bg);
    font-family: "DM Sans", sans-serif;
}

body {
    min-height: 100vh;
}

h1, h2, h3, p {
    margin-top: 0;
}

h1, h2, h3, .brand strong {
    font-family: "Space Grotesk", sans-serif;
}

h1:focus {
    outline: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    width: 250px;
    display: flex;
    flex-direction: column;
    color: #fff;
    background:
        radial-gradient(circle at 20% 0, rgba(105, 84, 232, .22), transparent 28%),
        var(--sidebar);
    overflow: hidden;
}

.brand {
    height: 76px;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    background: linear-gradient(145deg, #846ef7, #5740d4);
    box-shadow: 0 8px 24px rgba(105, 84, 232, .35);
}

.brand strong, .brand span {
    display: block;
}

.brand strong {
    font-size: 17px;
}

.brand span {
    margin-top: 1px;
    color: #858a9d;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav-scrollable {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar .nav {
    min-height: 0;
    flex: 1 1 auto;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar .nav-section {
    display: block;
    padding: 14px 12px 7px;
    color: #626778;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.sidebar .nav-link {
    min-height: 40px;
    width: 100%;
    min-width: 0;
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 2px 0;
    padding: 0 12px;
    color: #aeb2c0;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    transition: .18s ease;
}

.sidebar .nav-link > span {
    width: 18px;
    flex: 0 0 18px;
    color: #858b9d;
    text-align: center;
    font-size: 17px;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .055);
}

.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(105, 84, 232, .26), rgba(105, 84, 232, .1));
    box-shadow: inset 3px 0 var(--primary);
}

.sidebar .nav-link.active > span {
    color: #9787ff;
}

.sidebar .nav-link small {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 2px 6px;
    color: #6f7486;
    border-radius: 4px;
    background: rgba(255, 255, 255, .04);
    font-size: 8px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.sidebar .nav-link small.nav-badge {
    color: #fff;
    background: var(--primary);
    font-weight: 700;
}

.sidebar .nav-link.disabled {
    cursor: default;
    opacity: .68;
    pointer-events: none;
}

.navbar-toggler {
    display: none;
}

.sidebar-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.user-block {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 9px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 9px;
    color: #d9d4ff;
    background: rgba(105, 84, 232, .2);
    font-weight: 700;
}

.user-block strong, .user-block span {
    display: block;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-block strong {
    font-size: 11px;
}

.user-block span {
    margin-top: 2px;
    color: #6f7485;
    font-size: 9px;
}

.logout-button {
    color: #7f8495;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.main-content {
    min-width: 0;
    grid-column: 2;
}

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(14px);
}

.environment-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
}

.environment-select {
    min-width: 170px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #26bd80;
    box-shadow: 0 0 0 4px rgba(38, 189, 128, .12);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.version-label {
    padding: 5px 9px;
    color: #7667d7;
    border: 1px solid #e4e0ff;
    border-radius: 6px;
    background: #f6f4ff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.topbar-button {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 7px;
    font-size: 12px;
}

.content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 38px 42px 70px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.page-heading h1 {
    margin-bottom: 7px;
    font-size: clamp(28px, 3vw, 38px);
    letter-spacing: -.035em;
}

.page-heading p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 14px;
}

.heading-actions {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
    align-items: center;
}

.eyebrow {
    display: block;
    margin-bottom: 7px;
    color: #7d70d0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: .18s ease;
}

.button-primary {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 7px 16px rgba(105, 84, 232, .2);
}

.button-primary:hover {
    color: #fff;
    background: var(--primary-dark);
}

.button-secondary {
    color: #535868;
    border-color: var(--line);
    background: #fff;
}

.button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.engine-banner {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 22px;
    padding: 15px 18px;
    border: 1px solid;
    border-radius: 11px;
}

.engine-banner.online {
    border-color: #caecdf;
    background: #f3fcf8;
}

.engine-banner.offline {
    border-color: #f1ced4;
    background: #fff7f8;
}

.status-orb {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.online .status-orb {
    background: var(--green);
    box-shadow: 0 0 0 5px rgba(34, 168, 116, .1);
}

.offline .status-orb {
    background: var(--danger);
    box-shadow: 0 0 0 5px rgba(217, 84, 104, .1);
}

.engine-banner strong, .engine-banner span {
    display: block;
}

.engine-banner strong {
    font-size: 12px;
}

.engine-banner span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.engine-pill {
    margin-left: auto;
    padding: 5px 9px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .7);
    font-weight: 700;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.metric-card {
    min-height: 130px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 11px;
    font-size: 19px;
}

.metric-card.purple .metric-icon { color: var(--primary); background: #f1efff; }
.metric-card.green .metric-icon { color: var(--green); background: #ecfaf4; }
.metric-card.blue .metric-icon { color: var(--blue); background: #edf5ff; }
.metric-card.orange .metric-icon { color: var(--orange); background: #fff5eb; }

.metric-card span, .metric-card strong, .metric-card small {
    display: block;
}

.metric-card span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.metric-card strong {
    margin: 2px 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 26px;
}

.metric-card small {
    color: #9296a5;
    font-size: 9px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
    gap: 18px;
}

.panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}

.panel-header h2 {
    margin: 0;
    font-size: 17px;
}

.panel-header .eyebrow {
    margin-bottom: 3px;
}

.text-link, .back-link {
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
}

button.text-link {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

button.text-link:disabled {
    cursor: default;
    opacity: .6;
}

.resource-row {
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    border-bottom: 1px solid #f0f1f5;
}

.resource-row:last-child {
    border: 0;
}

.resource-avatar {
    width: 35px;
    height: 35px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #6f5cdf;
    border: 1px solid #e3dfff;
    border-radius: 9px;
    background: #f5f3ff;
    font-size: 11px;
    font-weight: 800;
}

.resource-avatar.small {
    width: 31px;
    height: 31px;
}

.resource-main {
    min-width: 0;
    flex: 1;
}

.resource-main strong, .resource-main span {
    display: block;
}

.resource-main strong {
    font-size: 11px;
}

.resource-main span {
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge.success {
    color: #17885d;
    background: #eaf8f2;
}

.status-badge.neutral {
    color: #717687;
    background: #f0f1f5;
}

.status-badge.danger {
    color: #9e3345;
    background: #fdeef0;
}

.status-badge.warning {
    color: #8a6d1f;
    background: #fdf6e6;
}

.quick-panel {
    padding-bottom: 8px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 6px 10px;
    padding: 10px 12px;
    border-radius: 9px;
    transition: background .15s ease;
}

.quick-action:hover {
    background: var(--surface-soft);
}

.quick-action > span:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.quick-action strong, .quick-action small {
    display: block;
}

.quick-action strong {
    font-size: 11px;
}

.quick-action small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
}

.quick-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    font-weight: 700;
}

.quick-icon.purple { color: var(--primary); background: #f1efff; }
.quick-icon.green { color: var(--green); background: #ecfaf4; }
.quick-icon.blue { color: var(--blue); background: #edf5ff; }

.loading-panel, .empty-state {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 30px;
    color: var(--muted);
    text-align: center;
}

.loading-panel {
    min-height: 120px;
}

.empty-state.compact {
    min-height: 220px;
}

.empty-state strong {
    color: var(--text);
    font-size: 13px;
}

.empty-state span {
    font-size: 11px;
}

.empty-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    margin-bottom: 4px;
    color: var(--primary);
    border-radius: 13px;
    background: #f2f0ff;
    font-size: 21px;
}

.toolbar, .catalog-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.search-box {
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.search-box.large {
    min-width: 320px;
}

.search-box input {
    width: 100%;
    height: 36px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 11px;
}

.count-label {
    margin-left: auto;
    color: var(--muted);
    font-size: 10px;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 11px 18px;
    color: #8a8e9d;
    background: var(--surface-soft);
    font-size: 9px;
    letter-spacing: .06em;
    text-align: left;
    text-transform: uppercase;
}

.data-table td {
    padding: 13px 18px;
    border-top: 1px solid #f0f1f5;
    font-size: 10px;
}

.table-primary {
    display: flex;
    align-items: center;
    gap: 9px;
}

.table-primary strong, .table-primary small {
    display: block;
}

.table-primary small {
    margin-top: 2px;
    color: var(--muted);
}

.muted {
    color: var(--muted);
}

.environment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
}

.environment-card {
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.environment-card.current {
    border-color: #d9d3ff;
    background: #f7f5ff;
    box-shadow: inset 3px 0 var(--primary);
}

.environment-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.environment-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 15px;
}

.environment-facts div {
    min-width: 0;
}

.environment-facts dt {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.environment-facts dd {
    margin: 3px 0 0;
    overflow: hidden;
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.environment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 20px;
}

.stack-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.stack-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stack-card h3 {
    margin: 16px 0 5px;
    font-size: 15px;
}

.stack-card p {
    min-height: 32px;
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
}

.stack-actions {
    display: flex;
    gap: 8px;
}

.stack-actions .button {
    flex: 1;
}

.icon-button {
    width: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.catalog-hero {
    position: relative;
    overflow: hidden;
    min-height: 170px;
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    padding: 30px 36px;
    color: #fff;
    border-radius: 14px;
    background:
        radial-gradient(circle at 80% 20%, rgba(166, 145, 255, .5), transparent 24%),
        linear-gradient(120deg, #31256f, #6750df);
    box-shadow: 0 18px 38px rgba(65, 49, 153, .2);
}

.catalog-hero h2 {
    margin-bottom: 7px;
    font-size: 27px;
}

.catalog-hero p {
    max-width: 540px;
    margin-bottom: 0;
    color: #d6d0ff;
    font-size: 12px;
}

.catalog-hero .eyebrow {
    color: #c9c0ff;
}

.catalog-orbit {
    position: absolute;
    right: 7%;
    color: rgba(255, 255, 255, .16);
    font-size: 130px;
    transform: rotate(18deg);
}

.catalog-toolbar {
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 0;
    border: 0;
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    height: 32px;
    padding: 0 12px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 10px;
    cursor: pointer;
}

.chip.active {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.app-card {
    position: relative;
    overflow: hidden;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 17px 38px rgba(29, 34, 53, .11);
}

.app-accent {
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
}

.app-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.app-logo {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: var(--app-color);
    border: 1px solid color-mix(in srgb, var(--app-color) 24%, white);
    border-radius: 13px;
    background: color-mix(in srgb, var(--app-color) 9%, white);
    font-family: "Space Grotesk", sans-serif;
    font-size: 13px;
    font-weight: 700;
}

.category-label {
    display: inline-block;
    padding: 4px 7px;
    color: #74798b;
    border-radius: 5px;
    background: #f2f3f7;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.compact-button {
    padding: 0.35rem 0.55rem;
    font-size: 0.84rem;
}

.button-danger {
    background: #b42318;
    border-color: #b42318;
    color: #fff;
}

.button-danger:hover {
    background: #912018;
    border-color: #912018;
}

.security-panel-gap {
    margin-top: 1rem;
}

.security-ban-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.security-ban-form .form-control {
    max-width: 22rem;
}

.security-user-agent {
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-card h3 {
    margin: 18px 0 7px;
    font-size: 16px;
}

.app-card > p {
    min-height: 48px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 13px 0 18px;
}

.tag-list span {
    padding: 4px 7px;
    color: #7e8291;
    border-radius: 5px;
    background: #f5f6f9;
    font-size: 8px;
}

.app-card-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid #f0f1f5;
}

.app-card-footer small {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: #979aa7;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-button {
    min-height: 32px;
    padding: 0 12px;
    font-size: 10px;
}

.back-link {
    display: inline-block;
    margin-bottom: 22px;
}

.app-detail-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 26px;
}

.large-logo {
    width: 66px;
    height: 66px;
    font-size: 18px;
}

.app-detail-heading h1 {
    margin: 5px 0;
    font-size: 30px;
}

.app-detail-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.deploy-grid {
    display: grid;
    grid-template-columns: minmax(320px, .8fr) minmax(400px, 1.2fr);
    gap: 18px;
}

.form-grid {
    display: grid;
    gap: 16px;
    padding: 22px;
}

.replication-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
}

.replication-form .toggle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    grid-column: 1 / -1;
}

.form-grid label > span, .form-grid label > small {
    display: block;
}

.form-grid label > span {
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 700;
}

.form-grid label > small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 9px;
}

.optional-tag {
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--line);
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.form-control {
    width: 100%;
    min-height: 39px;
    padding: 0 11px;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    font-size: 11px;
}

.form-control:focus {
    border-color: #aea2f3;
    box-shadow: 0 0 0 3px rgba(105, 84, 232, .08);
}

/* Identity pages share the console shell but come from the framework template. */
.content > h1 {
    margin-bottom: 22px;
    font-size: 30px;
    letter-spacing: -.03em;
}

.content > .row {
    max-width: 850px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}

.content > .row h2,
.content > .row h3 {
    font-size: 16px;
}

.content > .row hr {
    color: var(--line);
    opacity: 1;
}

.content > .row .form-control {
    min-height: 48px;
}

.content > .row .btn-primary {
    min-height: 44px;
    border-color: var(--primary);
    border-radius: 8px;
    background: var(--primary);
    font-size: 13px;
}

.content > .row p,
.content > .row a,
.content > .row label {
    font-size: 11px;
}

.content > .row a {
    color: var(--primary);
}

.setup-shell {
    min-height: 100vh;
    padding: 28px;
    background:
        radial-gradient(circle at 15% 10%, rgba(105, 84, 232, .09), transparent 28%),
        var(--bg);
}

.setup-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.setup-brand span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 9px;
    background: linear-gradient(145deg, #846ef7, #5740d4);
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
}

.setup-brand strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 17px;
}

.setup-content {
    max-width: 900px;
    margin: 9vh auto 0;
}

.setup-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 850px;
    margin-bottom: 22px;
}

.setup-heading h1 {
    margin-bottom: 6px;
    font-size: 30px;
}

.setup-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.setup-mark {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 14px;
    background: linear-gradient(145deg, #846ef7, #5740d4);
    box-shadow: 0 10px 24px rgba(105, 84, 232, .25);
    font-family: "Space Grotesk", sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.content > .setup-card {
    align-items: center;
}

.setup-notes {
    padding-left: 30px;
    color: var(--muted);
    font-size: 11px;
}

.setup-notes h2 {
    color: var(--text);
}

.setup-notes li {
    margin: 8px 0;
}

.notice {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0 22px 16px;
    padding: 12px;
    color: #765e20;
    border: 1px solid #f0dfaa;
    border-radius: 8px;
    background: #fffaf0;
}

.notice strong {
    font-size: 10px;
}

.notice span {
    font-size: 9px;
}

.success-notice {
    color: #176f50;
    border-color: #bde6d5;
    background: #f1fbf7;
}

.error-notice {
    color: #9e3345;
    border-color: #efc4cc;
    background: #fff5f7;
}

.full-button {
    width: calc(100% - 44px);
    margin: 0 22px 22px;
}

.compose-preview pre {
    max-height: 620px;
    margin: 0;
    padding: 22px;
    overflow: auto;
    color: #c9d1e2;
    background: #171923;
    font: 10px/1.7 Consolas, monospace;
}

.stacked-panel {
    margin-bottom: 18px;
}

.detached-notice {
    margin: 0 0 18px;
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 18px 22px;
}

.confirm-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.danger-button {
    color: var(--danger);
    border-color: #f1ced4;
    background: #fff;
}

.button-primary.danger-button {
    color: #fff;
    border-color: transparent;
    background: var(--danger);
    box-shadow: 0 7px 16px rgba(217, 84, 104, .2);
}

.editor-pane {
    padding: 18px 22px 22px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.crumb-sep {
    color: var(--muted);
}

.code-input {
    min-height: 320px;
    padding: 14px;
    font: 12px/1.6 Consolas, monospace;
    white-space: pre;
    overflow-wrap: normal;
    overflow: auto;
    resize: vertical;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid var(--danger);
}

.validation-message {
    color: var(--danger);
    font-size: 11px;
}

#blazor-error-ui {
    position: fixed;
    z-index: 1000;
    right: 20px;
    bottom: 20px;
    display: none;
    padding: 12px 16px;
    color: #fff;
    border-radius: 8px;
    background: #282b36;
    box-shadow: var(--shadow);
    font-size: 11px;
}

#blazor-error-ui .dismiss {
    margin-left: 12px;
    cursor: pointer;
}

.blazor-error-boundary {
    padding: 18px;
    color: #fff;
    border-radius: 8px;
    background: var(--danger);
}

/* Resource detail tabs */
.tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.tab {
    padding: 9px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 24px;
    padding: 22px;
}

.detail-grid > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.detail-grid span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.detail-grid strong {
    font-size: 13px;
    word-break: break-word;
}

.detail-wide {
    grid-column: 1 / -1;
}

.detail-wide strong {
    font: 12px/1.5 Consolas, monospace;
}

.log-view {
    max-height: 520px;
    margin: 0;
    padding: 16px;
    overflow: auto;
    font: 12px/1.55 Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.toolbar-controls {
    display: flex;
    align-items: center;
    gap: 18px;
}

.inline-control {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.form-control.compact {
    width: auto;
    min-height: 32px;
    padding: 0 8px;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 22px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.stat-card span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.stat-card strong {
    font-size: 18px;
    font-family: "Space Grotesk", sans-serif;
}

.stat-card small {
    color: var(--muted);
    font-size: 11px;
}

.spark {
    width: 100%;
    height: 44px;
    margin-top: 6px;
}

.spark-note {
    padding: 0 22px 18px;
    font-size: 11px;
}

.terminal-host {
    height: 460px;
    margin: 4px 18px 18px;
    padding: 10px;
    border-radius: 10px;
    background: #10121a;
}

.cell-action {
    text-align: right;
    white-space: nowrap;
}

.compact-button {
    padding: 5px 14px;
    font-size: 11px;
}

.create-row {
    display: flex;
    gap: 12px;
    padding: 0 22px 6px;
}

.create-row .form-control {
    flex: 1;
}

.inline-tag {
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--line);
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

@media (max-width: 1100px) {
    .metric-grid, .app-grid, .environment-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stack-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .deploy-grid {
        grid-template-columns: 1fr;
    }

    .replication-form {
        grid-template-columns: 1fr;
    }

    .detail-grid, .stat-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }

    .brand {
        height: 62px;
    }

    .navbar-toggler {
        position: absolute;
        top: 19px;
        right: 18px;
        display: block;
        width: 24px;
        height: 20px;
        margin: 0;
        border: 0;
        appearance: none;
        background:
            linear-gradient(#b8bdcc, #b8bdcc) 50% 2px / 20px 2px no-repeat,
            linear-gradient(#b8bdcc, #b8bdcc) 50% 9px / 20px 2px no-repeat,
            linear-gradient(#b8bdcc, #b8bdcc) 50% 16px / 20px 2px no-repeat;
        cursor: pointer;
    }

    .nav-scrollable {
        display: none;
    }

    .navbar-toggler:checked ~ .nav-scrollable {
        display: flex;
    }

    .topbar {
        padding: 0 20px;
    }

    .content {
        padding: 28px 20px 50px;
    }

    .content-grid, .metric-grid, .app-grid, .stack-grid, .environment-grid, .environment-facts {
        grid-template-columns: 1fr;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .catalog-toolbar, .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box, .search-box.large {
        min-width: 0;
        width: 100%;
    }

    .catalog-orbit {
        display: none;
    }
}
