@font-face {
    font-display: swap;
    font-family: Quantico;
    font-style: normal;
    font-weight: 400;
    src: url("https://terrascale.tech/fonts/quantico.woff2") format("woff2");
}

@font-face {
    font-display: swap;
    font-family: Quantico;
    font-style: normal;
    font-weight: 700;
    src: url("https://terrascale.tech/fonts/quantico-bold.woff2") format("woff2");
}

@font-face {
    font-display: swap;
    font-family: "TerraScale Mono";
    font-style: normal;
    font-weight: 400;
    src: url("https://terrascale.tech/fonts/jetbrains-mono.woff2") format("woff2");
}

:root {
    color-scheme: dark;
    --bg-base: #050505;
    --bg-surface: #0a0a08;
    --bg-panel: rgba(16, 15, 11, 0.86);
    --bg-panel-solid: #10100c;
    --bg-panel-raised: rgba(22, 21, 15, 0.94);
    --bg-input: rgba(0, 0, 0, 0.32);
    --ink: #f7f4ea;
    --ink-strong: #ffffff;
    --muted: #b7ad91;
    --muted-strong: #ddd4bd;
    --line: rgba(238, 214, 143, 0.15);
    --line-strong: rgba(238, 214, 143, 0.28);
    --line-hot: rgba(255, 214, 10, 0.5);
    --accent: #ffd60a;
    --accent-strong: #ffe66d;
    --accent-soft: #f6c800;
    --accent-ink: #171307;
    --green: #10b981;
    --green-light: #34d399;
    --amber: #f59e0b;
    --amber-light: #fcd34d;
    --red: #ef4444;
    --red-light: #f87171;
    --violet: #a78bfa;
    --shadow-soft: 0 20px 70px rgba(0, 0, 0, 0.32);
    --shadow-accent: 0 18px 60px rgba(255, 214, 10, 0.16);
    --font-display: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-body: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: "TerraScale Mono", "Roboto Mono", "SFMono-Regular", Consolas, monospace;
    --radius: 8px;
    --radius-tight: 6px;
    font-family: var(--font-body);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg-base);
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background-color: var(--bg-base);
    background-image:
        radial-gradient(ellipse 78% 48% at 50% -12%, rgba(255, 214, 10, 0.16), transparent 68%),
        radial-gradient(ellipse 42% 36% at 16% 18%, rgba(255, 183, 3, 0.1), transparent 62%),
        radial-gradient(ellipse 42% 36% at 88% 56%, rgba(16, 185, 129, 0.06), transparent 60%),
        linear-gradient(rgba(255, 214, 10, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 214, 10, 0.04) 1px, transparent 1px);
    background-attachment: fixed;
    background-size: auto, auto, auto, 28px 28px, 28px 28px;
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.45;
    text-rendering: optimizeLegibility;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
    min-width: 0;
}

button {
    appearance: none;
}

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

h1,
h2,
p,
dl,
dd {
    margin: 0;
}

code {
    font-family: var(--font-mono);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 3px;
}

::selection {
    background: rgba(255, 214, 10, 0.78);
    color: var(--accent-ink);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    border: 2px solid var(--bg-base);
    border-radius: 6px;
    background: #15151f;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 214, 10, 0.46);
}

.shell {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    height: 100vh;
    padding: 20px 18px;
    border-right: 1px solid var(--line);
    background:
        linear-gradient(90deg, rgba(255, 214, 10, 0.05), transparent 38%),
        linear-gradient(180deg, rgba(18, 17, 12, 0.96), rgba(7, 7, 6, 0.96));
    box-shadow: 18px 0 60px rgba(0, 0, 0, 0.22);
    color: var(--ink);
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 52px;
    margin-bottom: 24px;
}

.brand-mark {
    position: relative;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 214, 10, 0.62);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 72% 24%, #111111 0 4px, transparent 5px),
        radial-gradient(circle at 25% 72%, #111111 0 5px, transparent 6px),
        radial-gradient(circle at 62% 78%, #111111 0 3px, transparent 4px),
        linear-gradient(135deg, #ffe66d 0%, #ffd60a 52%, #e4a900 100%);
    box-shadow: 0 12px 34px rgba(255, 214, 10, 0.22);
    color: var(--accent-ink);
    font-family: var(--font-display);
    font-weight: 700;
}

.brand-mark img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.16);
}

.brand-mark::before,
.brand-mark::after {
    position: absolute;
    content: "";
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.95);
}

.brand-mark::before {
    width: 22px;
    height: 9px;
    transform: translate(-15px, -13px) rotate(-24deg);
}

.brand-mark::after {
    width: 18px;
    height: 8px;
    transform: translate(16px, 12px) rotate(27deg);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    color: var(--ink-strong);
    font-size: 1.08rem;
    line-height: 1.1;
}

.brand small {
    color: var(--muted);
    font-size: 0.8rem;
}

.nav {
    display: grid;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
}

.nav-section {
    display: grid;
    gap: 4px;
}

.nav-label {
    padding: 0 10px 2px;
    color: rgba(221, 212, 189, 0.68);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    text-transform: uppercase;
}

.nav a {
    position: relative;
    min-height: 36px;
    padding: 9px 12px 9px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-tight);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 780;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.active {
    border-color: rgba(255, 214, 10, 0.3);
    background: rgba(255, 214, 10, 0.1);
    color: var(--ink-strong);
    outline: none;
}

.nav a.active::before {
    position: absolute;
    left: 6px;
    width: 3px;
    height: 16px;
    border-radius: 999px;
    background: var(--accent);
    content: "";
}

.main {
    min-width: 0;
    padding: 22px;
}

.dashboard-body {
    display: grid;
    gap: 14px;
    max-width: 1680px;
    margin: 0 auto;
}

.workspace-header {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    justify-content: space-between;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 96% 20%, rgba(255, 214, 10, 0.12) 0 4px, transparent 5px),
        radial-gradient(circle at 91% 55%, rgba(255, 214, 10, 0.08) 0 7px, transparent 8px),
        linear-gradient(135deg, rgba(255, 214, 10, 0.12), rgba(16, 185, 129, 0.035) 54%, rgba(255, 255, 255, 0.045)),
        var(--bg-panel);
    box-shadow: var(--shadow-accent);
}

.workspace-header > div {
    min-width: 0;
}

.workspace-header h1 {
    max-width: 980px;
    color: var(--ink-strong);
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.2vw, 3.05rem);
    font-weight: 700;
    line-height: 0.96;
    letter-spacing: 0;
}

.subtle,
td span,
small,
.key-value dd,
.row-card span,
.credential span,
.region-row span,
.role-grid span,
.alert span {
    color: var(--muted);
}

.workspace-header .subtle {
    max-width: 820px;
    margin-top: 12px;
    color: var(--muted-strong);
    font-size: 0.98rem;
    overflow-wrap: anywhere;
}

.page-header {
    min-height: 148px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 214, 10, 0.28);
    border-radius: 4px;
    background: rgba(255, 214, 10, 0.1);
    color: var(--accent-strong);
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    padding: 5px 8px;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 2px;
    background: var(--accent);
    box-shadow: 0 0 16px rgba(255, 214, 10, 0.75);
}

.header-actions,
.panel-header,
.panel-tools,
.actions,
.legend {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-actions,
.panel-header {
    justify-content: space-between;
}

.header-actions,
.panel-tools,
.actions {
    flex-wrap: wrap;
}

.header-actions {
    justify-content: flex-end;
    min-width: 300px;
}

.button,
button,
input,
select,
textarea {
    min-height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-tight);
    background: rgba(0, 0, 0, 0.28);
    color: var(--ink);
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    cursor: pointer;
    font-weight: 900;
}

button:hover,
.button:hover,
button:focus-visible,
.button:focus-visible {
    border-color: rgba(255, 214, 10, 0.72);
    background: rgba(255, 214, 10, 0.1);
    outline: none;
}

input,
select,
textarea {
    min-width: 0;
    padding: 0 12px;
}

textarea {
    width: 100%;
    min-height: 72px;
    padding-top: 9px;
    resize: vertical;
}

select {
    appearance: none;
    -webkit-appearance: none;
    min-height: 42px;
    padding-right: 44px;
    background:
        linear-gradient(180deg, rgba(28, 26, 18, 0.88), rgba(5, 5, 5, 0.82)),
        var(--bg-input);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.045),
        0 10px 24px rgba(0, 0, 0, 0.12);
    color: var(--ink-strong);
    cursor: pointer;
    font-weight: 750;
}

select:hover {
    border-color: rgba(255, 214, 10, 0.62);
    background:
        linear-gradient(180deg, rgba(40, 36, 22, 0.9), rgba(5, 5, 5, 0.82)),
        var(--bg-input);
}

select option {
    background: var(--bg-panel-solid);
    color: var(--ink);
}

select option:checked {
    background: #b88600;
    color: #111111;
}

select::-ms-expand {
    display: none;
}

.field:has(> select),
.settings-form label:has(> select) {
    position: relative;
}

.field:has(> select)::after,
.settings-form label:has(> select)::after {
    content: "";
    position: absolute;
    right: 15px;
    bottom: 16px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--accent-strong);
    border-bottom: 2px solid var(--accent-strong);
    pointer-events: none;
    transform: rotate(45deg);
}

input::placeholder {
    color: rgba(155, 172, 203, 0.74);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: rgba(255, 214, 10, 0.78);
    box-shadow: 0 0 0 3px rgba(255, 214, 10, 0.14);
    outline: none;
}

.primary {
    border-color: rgba(255, 214, 10, 0.95);
    background: linear-gradient(135deg, #ffe66d 0%, #ffd60a 58%, #e1a900 100%);
    box-shadow: 0 10px 30px rgba(255, 214, 10, 0.24);
    color: var(--accent-ink);
}

.primary:hover,
.primary:focus-visible {
    border-color: rgba(255, 230, 109, 0.95);
    background: linear-gradient(135deg, #fff1a6 0%, #ffd60a 100%);
}

.icon-button {
    width: 38px;
    padding: 0;
    color: var(--accent-strong);
    font-size: 1.02rem;
}

.search {
    width: 220px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.metric,
.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.006)),
        var(--bg-panel);
    box-shadow: var(--shadow-soft);
}

.metric {
    display: grid;
    gap: 8px;
    min-height: 116px;
    padding: 14px;
    border-top: 3px solid var(--accent);
}

.metric span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 850;
}

.metric strong {
    color: var(--ink-strong);
    font-family: var(--font-mono);
    font-size: 1.8rem;
    line-height: 1;
}

.metric small {
    font-size: 0.86rem;
}

.metric.good {
    border-top-color: var(--green);
}

.metric.warning {
    border-top-color: var(--amber);
}

.metric.danger {
    border-top-color: var(--red);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 370px);
    gap: 14px;
    align-items: start;
}

.primary-column,
.side-column {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.side-column {
    position: sticky;
    top: 16px;
}

.panel {
    min-width: 0;
    padding: 14px;
}

.panel.large {
    padding: 0;
    overflow: hidden;
}

.panel.large > .panel-header,
.panel.large > .provision-form,
.panel.large > .data-layout,
.panel.large > .empty-state,
.panel.large > .table-wrap {
    margin-right: 14px;
    margin-left: 14px;
}

.panel.large > .panel-header {
    margin-top: 14px;
}

.panel.large > .table-wrap,
.panel.large > .data-layout,
.panel.large > .empty-state {
    margin-bottom: 14px;
}

.panel.compact {
    padding: 14px;
}

.panel h2 {
    color: var(--ink-strong);
    font-family: var(--font-display);
    font-size: 1rem;
    line-height: 1.1;
}

.panel h3 {
    color: var(--ink-strong);
    font-family: var(--font-display);
    font-size: 0.92rem;
    line-height: 1.15;
}

.panel-header {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.panel-header > div {
    min-width: 0;
}

.panel-header .eyebrow {
    margin-bottom: 7px;
}

.compact-header {
    margin-top: 18px;
}

.provision-form,
.settings-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    align-items: center;
    margin-top: 14px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 214, 10, 0.035), rgba(255, 255, 255, 0.006)),
        rgba(0, 0, 0, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.compact-form {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

#databases-panel .provision-form {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.auth-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
}

#auth-panel .auth-form {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 214, 10, 0.025), rgba(255, 255, 255, 0.006)),
        rgba(0, 0, 0, 0.14);
}

#auth-panel .auth-form + .auth-form {
    margin-top: 10px;
}

#auth-panel .key-value,
#auth-panel .settings-section,
#auth-panel .chip-list {
    margin-top: 14px;
}

.settings-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 850;
}

.settings-form {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: end;
}

.settings-form label:has(textarea),
.settings-form button {
    grid-column: 1 / -1;
}

.settings-form button {
    justify-self: start;
    width: auto;
}

.settings-section {
    display: grid;
    gap: 12px;
}

.field {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 850;
}

.field span,
.settings-form label {
    line-height: 1.25;
}

.field input,
.field select {
    width: 100%;
}

.table-wrap {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.12);
}

table {
    width: 100%;
    min-width: 960px;
    margin-top: 0;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

td {
    color: var(--ink);
}

td code {
    display: inline-block;
    max-width: 360px;
    overflow: hidden;
    color: var(--muted-strong);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    text-overflow: ellipsis;
    vertical-align: middle;
}

td[colspan] {
    padding: 18px 12px;
    color: var(--muted);
    text-align: center;
}

tbody tr:last-child td {
    border-bottom: 0;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(14, 13, 10, 0.98);
    backdrop-filter: blur(10px);
}

td strong,
td span {
    display: block;
}

.environment-list {
    display: flex;
    max-width: 280px;
    flex-wrap: wrap;
    gap: 6px;
}

.environment-create-form {
    display: grid;
    width: min(100%, 280px);
    grid-template-columns: minmax(92px, 1fr) 88px 48px;
    gap: 6px;
}

.environment-create-form input,
.environment-create-form select,
.environment-create-form button {
    min-height: 30px;
    padding: 0 8px;
    font-size: 0.76rem;
}

.environment-create-form button {
    justify-content: center;
}

.environment-chip {
    display: inline-flex;
    width: fit-content;
    align-items: baseline;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 214, 10, 0.22);
    border-radius: 999px;
    background: rgba(255, 214, 10, 0.11);
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 900;
    line-height: 1.1;
}

.environment-chip.current {
    border-color: rgba(52, 211, 153, 0.32);
    background: rgba(16, 185, 129, 0.14);
    color: var(--green-light);
}

.environment-chip small {
    color: var(--muted-strong);
    font-size: 0.68rem;
}

.environment-chip button {
    display: inline-grid;
    width: 18px;
    height: 18px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.34);
    color: var(--muted-strong);
    cursor: pointer;
    font: inherit;
    line-height: 1;
}

.environment-chip button:hover,
.environment-chip button:focus-visible {
    background: rgba(248, 113, 113, 0.2);
    color: var(--red-light);
}

.environment-chip button.environment-switch:hover,
.environment-chip button.environment-switch:focus-visible {
    background: rgba(52, 211, 153, 0.16);
    color: var(--green-light);
}

.data-create-form {
    grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(220px, 1.2fr) 128px auto;
}

.data-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
    gap: 14px;
    align-items: start;
    margin-top: 14px;
}

.data-repositories,
.data-documents {
    min-width: 0;
}

.data-table {
    min-width: 780px;
    margin-top: 0;
}

.data-table tr.selected td {
    background: rgba(255, 214, 10, 0.1);
}

.query-form,
.schema-form {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.2);
}

.query-form textarea,
.schema-form textarea {
    min-height: 108px;
    font-family: var(--font-mono);
    font-size: 0.86rem;
}

.schema-form {
    margin-bottom: 12px;
}

.schema-form-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px;
    gap: 12px;
    align-items: end;
}

.schema-form-header strong,
.schema-form-header span {
    display: block;
}

.schema-form-header strong {
    color: var(--ink-strong);
}

.schema-form-header span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
}

.query-controls {
    display: grid;
    grid-template-columns: 110px 110px auto;
    gap: 10px;
    align-items: end;
}

.data-result-header {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.data-result-header strong {
    color: var(--ink-strong);
}

.data-result-header span {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.empty-state {
    display: grid;
    gap: 4px;
    margin-top: 14px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 18px 18px, rgba(255, 214, 10, 0.1) 0 4px, transparent 5px),
        rgba(0, 0, 0, 0.18);
}

.empty-state.compact {
    margin-top: 12px;
}

.empty-state strong {
    color: var(--ink-strong);
}

.empty-state span {
    color: var(--muted);
}

.document-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.document-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.18);
}

.document-card header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    min-width: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

.document-card header div {
    min-width: 0;
}

.document-card strong,
.document-card span {
    display: block;
    overflow-wrap: anywhere;
}

.document-card strong {
    color: var(--ink-strong);
    font-family: var(--font-mono);
    font-size: 0.86rem;
}

.document-card span,
.document-card code {
    color: var(--muted);
    font-size: 0.76rem;
}

.document-card code {
    max-width: 44%;
    overflow-wrap: anywhere;
}

.document-card pre {
    max-height: 360px;
    margin: 0;
    overflow: auto;
    padding: 12px;
    color: var(--muted-strong);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.muted {
    color: var(--muted);
}

tr:hover td {
    background: rgba(255, 214, 10, 0.045);
}

.status {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid rgba(255, 214, 10, 0.22);
    border-radius: 999px;
    background: rgba(255, 214, 10, 0.13);
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
}

.status.healthy,
.status.active,
.status.current,
.status.enabled,
.status.open,
.status.good {
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.14);
    color: var(--green-light);
}

.status.neutral {
    border-color: rgba(255, 214, 10, 0.24);
    background: rgba(255, 214, 10, 0.12);
    color: var(--accent-strong);
}

.status.degraded,
.status.review,
.status.scaling,
.status.lagging,
.status.queued,
.status.provisioning,
.status.warning,
.status.constrained,
.status.dormant {
    border-color: rgba(245, 158, 11, 0.34);
    background: rgba(245, 158, 11, 0.14);
    color: var(--amber-light);
}

.status.expired,
.status.revoked,
.status.disabled,
.status.critical,
.status.waitlist,
.status.danger {
    border-color: rgba(239, 68, 68, 0.34);
    background: rgba(239, 68, 68, 0.14);
    color: var(--red-light);
}

.actions button,
.credential button,
.alert button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.82rem;
}

.actions button:last-child:not(:only-child),
.credential button:last-child:not(:only-child),
.alert button:last-child:not(:only-child) {
    border-color: rgba(239, 68, 68, 0.28);
    color: var(--red-light);
}

.actions button:last-child:not(:only-child):hover,
.actions button:last-child:not(:only-child):focus-visible,
.credential button:last-child:not(:only-child):hover,
.credential button:last-child:not(:only-child):focus-visible,
.alert button:last-child:not(:only-child):hover,
.alert button:last-child:not(:only-child):focus-visible {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.12);
}

.stack-list,
.timeline,
.key-value {
    display: grid;
    gap: 0;
    margin-top: 12px;
    border-top: 1px solid var(--line);
}

.row-card,
.credential,
.timeline article,
.key-value div,
.region-row,
.alert {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    max-width: 100%;
    min-width: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.stack-list .row-card,
.stack-list .credential {
    padding: 12px;
    border: 1px solid transparent;
    border-bottom-color: var(--line);
}

.stack-list .row-card:hover,
.stack-list .credential:hover {
    border-color: rgba(255, 214, 10, 0.18);
    background: rgba(255, 214, 10, 0.045);
}

.row-card > *,
.credential > *,
.timeline article > *,
.key-value div > *,
.region-row > *,
.alert > * {
    max-width: 100%;
    min-width: 0;
}

.credential code,
.credential span,
.row-card span {
    display: block;
}

.credential code,
.document-card code,
td span,
.row-card span {
    max-width: 100%;
}

.operation p,
.credential code,
.credential span,
.row-card strong,
.row-card span,
.role-grid small,
.timeline article,
.key-value dd,
.region-row span,
.alert strong,
.alert span,
.alert small {
    overflow-wrap: anywhere;
}

.right {
    min-width: 150px;
    text-align: right;
}

.right small,
.right span {
    display: block;
}

.right button {
    margin-top: 8px;
    margin-left: 6px;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.chip-list span {
    padding: 5px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 214, 10, 0.07);
    color: var(--muted-strong);
    font-size: 0.76rem;
    font-weight: 900;
}

.operation {
    border-left: 4px solid var(--green);
}

.operation.neutral {
    border-left-color: var(--accent);
}

.operation.warning {
    border-left-color: var(--amber);
}

.operation.danger {
    border-left-color: var(--red);
}

.operation p {
    margin-top: 10px;
    color: var(--muted-strong);
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.role-grid article {
    display: grid;
    gap: 5px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.role-grid strong,
.row-card strong,
.credential strong,
.timeline strong,
.alert strong,
.region-row strong,
.key-value dt {
    color: var(--ink-strong);
}

.billing {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.billing div {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.16);
}

.billing span,
.billing strong {
    display: block;
}

.billing span {
    color: var(--muted);
    font-size: 0.78rem;
}

.billing strong {
    color: var(--ink-strong);
}

.quota-section {
    margin-top: 18px;
}

.quota-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.quota-card {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.16);
}

.quota-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.quota-card-header strong,
.quota-amount,
.quota-remaining {
    display: block;
    min-width: 0;
}

.quota-card-header strong {
    color: var(--ink-strong);
    overflow-wrap: anywhere;
}

.quota-amount {
    margin-top: 8px;
    color: var(--ink-strong);
    font-size: 1.08rem;
    font-weight: 850;
}

.quota-remaining {
    color: var(--muted);
    font-size: 0.78rem;
}

.quota-meter {
    height: 7px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
}

.quota-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
}

.quota-card:has(.status.constrained) .quota-meter span {
    background: var(--amber);
}

.quota-card:has(.status.danger) .quota-meter span {
    background: var(--red);
}

.apex-chart-host {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.apex-chart {
    min-height: 280px;
}

.realtime-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.realtime-kpis div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.16);
}

.realtime-kpis span,
.realtime-kpis strong {
    display: block;
}

.realtime-kpis span {
    color: var(--muted);
    font-size: 0.78rem;
}

.realtime-kpis strong {
    color: var(--ink-strong);
    font-family: var(--font-mono);
    font-size: 1.18rem;
}

.realtime-empty {
    margin-top: 16px;
}

.admin-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.admin-kpis div,
.admin-denied {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.16);
}

.admin-kpis span,
.admin-kpis strong,
.admin-denied strong,
.admin-denied p {
    display: block;
}

.admin-kpis span {
    color: var(--muted);
    font-size: 0.78rem;
}

.admin-kpis strong {
    color: var(--ink-strong);
    font-family: var(--font-mono);
    font-size: 1.25rem;
}

.admin-denied {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.admin-denied p {
    color: var(--muted-strong);
}

.admin-users {
    min-width: 1120px;
}

.inline-form {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.inline-form button {
    justify-self: start;
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.82rem;
}

.support-note-form {
    margin-top: 8px;
}

.admin-actions {
    align-items: flex-start;
}

.legend {
    flex-wrap: wrap;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.82rem;
}

.legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 2px;
    background: var(--accent);
}

.legend .storage {
    background: var(--green);
}

.legend .egress {
    background: var(--amber);
}

.timeline article {
    display: grid;
    justify-content: stretch;
}

.key-value div {
    display: grid;
    grid-template-columns: minmax(90px, 0.7fr) minmax(0, 1.3fr);
}

.key-value dt {
    font-weight: 850;
}

.region-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.region-row meter {
    grid-column: 1 / -1;
    width: 100%;
    height: 8px;
}

meter {
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
}

meter::-webkit-meter-bar {
    border: 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
}

meter::-webkit-meter-optimum-value {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--green), var(--accent-strong));
}

meter::-webkit-meter-suboptimum-value {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--amber), var(--accent));
}

meter::-webkit-meter-even-less-good-value {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--red), var(--amber));
}

.alert {
    align-items: flex-start;
}

.alert > div {
    display: grid;
    gap: 5px;
}

.alert.critical {
    border-left: 4px solid var(--red);
    padding-left: 10px;
}

.alert.warning {
    border-left: 4px solid var(--amber);
    padding-left: 10px;
}

.alert.info {
    border-left: 4px solid var(--accent);
    padding-left: 10px;
}

.alert.acknowledged {
    opacity: 0.66;
}

.loading {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 40px;
    background: var(--bg-base);
}

.loading-state {
    display: grid;
    gap: 20px;
    place-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--line-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 700;
}

.error-state {
    display: grid;
    gap: 16px;
    place-items: center;
    text-align: center;
    max-width: 420px;
}

.error-state .error-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(239, 68, 68, 0.34);
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.14);
    color: var(--red-light);
    font-size: 1.6rem;
    line-height: 1;
}

.error-state h1 {
    color: var(--ink-strong);
    font-family: var(--font-display);
    font-size: 1.5rem;
}

.error-state .error-detail {
    color: var(--muted-strong);
    font-size: 0.95rem;
}

.error-page {
    display: grid;
    min-height: 60vh;
    place-items: center;
    padding: 40px;
}

.error-page-content {
    display: grid;
    gap: 16px;
    place-items: center;
    text-align: center;
    max-width: 480px;
    padding: 40px 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.006)),
        var(--bg-panel);
    box-shadow: var(--shadow-soft);
}

.error-page-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(239, 68, 68, 0.34);
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.14);
    color: var(--red-light);
    font-size: 1.8rem;
    line-height: 1;
}

.error-page-icon.not-found-icon {
    border-color: rgba(255, 214, 10, 0.34);
    background: rgba(255, 214, 10, 0.14);
    color: var(--accent-strong);
}

.error-page h1 {
    color: var(--ink-strong);
    font-family: var(--font-display);
    font-size: 1.75rem;
}

.error-page-subtitle {
    color: var(--muted-strong);
    font-size: 1rem;
    max-width: 360px;
}

.error-page-request-id {
    display: flex;
    gap: 8px;
    justify-content: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.error-page-request-id code {
    color: var(--muted-strong);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.error-page-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.text-danger {
    color: var(--red-light);
}

.auth-main {
    min-height: 100vh;
    padding: clamp(16px, 3vw, 32px);
}

.auth-landing {
    display: grid;
    min-height: calc(100vh - 64px);
    max-width: 1720px;
    margin: 0 auto;
    align-content: center;
}

.auth-hero {
    display: grid;
    grid-template-columns: minmax(280px, 0.78fr) minmax(420px, 1.22fr);
    gap: 24px;
    align-items: start;
}

.auth-copy {
    position: sticky;
    top: 28px;
    display: grid;
    gap: 16px;
    padding: 20px 0 0;
}

.auth-copy h1 {
    max-width: 720px;
    color: var(--ink-strong);
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4vw, 3rem);
    line-height: 1;
}

.auth-mascot {
    width: min(100%, 420px);
    aspect-ratio: 1.45;
    margin-top: 8px;
    border: 1px solid rgba(255, 214, 10, 0.2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-accent);
    object-fit: cover;
    object-position: center 34%;
}

.auth-copy .subtle {
    max-width: 620px;
    color: var(--muted-strong);
    font-size: 1rem;
}

.auth-status-strip {
    display: flex;
    max-width: 620px;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.2);
    color: var(--muted);
    font-size: 0.86rem;
}

.auth-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 96% 28px, rgba(255, 214, 10, 0.09) 0 5px, transparent 6px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
        var(--bg-panel);
    box-shadow: var(--shadow-soft);
}

.auth-card-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.auth-card-header h2 {
    color: var(--ink-strong);
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1.1;
}

.auth-flow {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.auth-switcher {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    min-width: min(100%, 260px);
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.18);
}

.auth-switcher a {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: calc(var(--radius) - 3px);
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
}

.auth-switcher a.active {
    background: var(--accent);
    color: #1b1600;
}

.auth-form.auth-form-card {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.14);
}

.auth-form.auth-form-card.wide {
    grid-column: auto;
}

.auth-primary-form {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.auth-secondary-form {
    background: rgba(255, 255, 255, 0.03);
}

.form-heading {
    display: grid;
    gap: 2px;
}

.form-heading strong {
    color: var(--ink-strong);
    font-family: var(--font-display);
    font-size: 1rem;
}

.form-heading span {
    color: var(--muted);
    font-size: 0.82rem;
}

.two-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.auth-card #operation-feed {
    margin-top: 16px;
}

@media (max-width: 1180px) {
    .shell,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .side-column {
        position: static;
        height: auto;
    }

    .sidebar {
        display: grid;
        gap: 14px;
        padding: 16px;
    }

    .brand {
        margin-bottom: 0;
    }

    .nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .nav-section {
        align-content: start;
    }

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

    .billing {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .admin-kpis,
    .realtime-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-hero {
        grid-template-columns: 1fr;
    }

    .auth-copy {
        position: static;
        padding: 0;
    }

    .auth-mascot {
        max-height: 220px;
    }
}

@media (max-width: 820px) {
    .main {
        padding: 14px;
    }

    .workspace-header,
    .panel-header,
    .header-actions,
    .panel-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-header {
        padding: 16px;
    }

    .page-header {
        min-height: 0;
    }

    .header-actions {
        min-width: 0;
        width: 100%;
    }

    .button,
    button {
        width: 100%;
    }

    .icon-button {
        width: 38px;
    }

    .nav,
    .metric-grid,
    .billing,
    .quota-grid,
    .admin-kpis,
    .realtime-kpis,
    .role-grid,
    .two-fields,
    .provision-form,
    .compact-form {
        grid-template-columns: 1fr;
    }

    .nav {
        display: flex;
        gap: 8px;
        max-width: calc(100vw - 28px);
        min-width: 0;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .nav-section {
        display: contents;
    }

    .nav-label {
        display: none;
    }

    .nav a {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .auth-copy h1 {
        font-size: 2.35rem;
    }

    .auth-mascot {
        display: none;
    }

    .auth-card-header {
        align-items: stretch;
        flex-direction: column;
    }

    .search {
        width: 100%;
    }

    .row-card,
    .credential,
    .alert {
        display: grid;
        max-width: 100%;
        min-width: 0;
    }

    .right {
        min-width: 0;
        text-align: left;
    }

    .key-value div,
    .region-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .sidebar {
        padding: 14px;
    }

    .nav a {
        min-height: 34px;
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .workspace-header h1 {
        font-size: 2rem;
    }

    .auth-copy h1 {
        font-size: 2rem;
    }

    .panel,
    .panel.compact {
        padding: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
