:root {
    --bg: #f6f8fb;
    --card: #fff;
    --text: #111827;
    --muted: #667085;
    --line: #e5e7eb;
    --blue: #155eef;
    --green: #079455;
    --red: #d92d20;
    --amber: #dc6803;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
}

main.console-layout {
    width: min(1440px, calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 0 56px;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

main.console-layout.is-public {
    grid-template-columns: 248px minmax(0, 1fr);
}

.console-main {
    min-width: 0;
}

.shell {
    display: grid;
    gap: 18px;
}

.sidebar, .topbar, .card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(16, 24, 40, 0.06);
}

.sidebar {
    position: sticky;
    top: 20px;
    min-height: calc(100vh - 56px);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
}

.topbar {
    display: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    text-decoration: none;
    color: inherit;
}

.mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.side-nav {
    display: grid;
    gap: 18px;
}

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

.nav-section-title {
    margin: 0 0 4px;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-link {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px;
    border-radius: 12px;
    color: #344054;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.nav-link.is-active {
    background: #eff4ff;
    color: var(--blue);
    box-shadow: inset 3px 0 0 var(--blue);
}

.nav-link.is-disabled {
    color: #98a2b3;
    cursor: not-allowed;
}

.nav-link small {
    color: #98a2b3;
    font-size: 11px;
    font-weight: 800;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.signout-link {
    width: 100%;
}

.public-nav {
    display: grid;
    gap: 10px;
}

.public-nav .button {
    width: 100%;
}

.card {
    padding: 24px;
}

.hero {
    padding: 44px;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff4ff;
    color: #155eef;
    font-size: 12px;
    font-weight: 800;
}

h1 {
    margin: 0;
    font-size: clamp(32px, 5vw, 58px);
    line-height: 1;
    letter-spacing: -0.045em;
}

h2 {
    margin: 0 0 14px;
    font-size: 24px;
}

p {
    color: var(--muted);
    line-height: 1.7;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.button, button {
    border: 0;
    border-radius: 999px;
    min-height: 40px;
    padding: 0 15px;
    background: #111827;
    color: #fff;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.button:hover, button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.button.secondary, button.secondary {
    background: #f3f4f6;
    color: #111827;
}

.button.danger, button.danger {
    background: #fee4e2;
    color: #b42318;
}

.button.success, button.success {
    background: #dcfae6;
    color: #067647;
}

.button.warn, button.warn {
    background: #fff4e5;
    color: #b54708;
}

.button.blue, button.blue {
    background: #155eef;
    color: white;
}

.button:disabled, button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button.disabled,
button.disabled:hover {
    background: #eef0f4;
    color: #98a2b3;
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.region-card.is-coming-soon {
    background: #f8fafc;
    border-color: #e4e7ec;
    box-shadow: none;
    color: #667085;
}

.region-card.is-coming-soon h2,
.region-card.is-coming-soon p {
    color: #667085;
}

.region-card.is-coming-soon {
    filter: saturate(0.35);
}

.pill {
    display: inline-flex;
    border-radius: 999px;
    background: #f3f4f6;
    color: #344054;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 750;
}

.pill.green {
    background: #ecfdf3;
    color: #067647;
}

.pill.red {
    background: #fef3f2;
    color: #b42318;
}

.pill.blue {
    background: #eff4ff;
    color: #155eef;
}

.pill.gray {
    background: #f2f4f7;
    color: #667085;
}

.console-beta-card {
    display: grid;
    gap: 16px;
}

.console-beta-header,
.console-beta-actions,
.console-beta-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.console-beta-header h1 {
    margin-bottom: 4px;
}

.console-beta-warning {
    border: 1px solid #fedf89;
    background: #fffaeb;
    color: #93370d;
    padding: 12px 14px;
    border-radius: 14px;
}

.console-terminal {
    width: 100%;
    min-height: 520px;
    border: 1px solid #1f2937;
    border-radius: 16px;
    background: #020617;
    color: #d1fae5;
    padding: 12px;
    overflow: hidden;
    outline: none;
}

body.is-console-maximized,
html.is-console-maximized {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

html.is-console-maximized main.console-layout,
body.is-console-maximized main.console-layout {
    position: fixed;
    inset: 0;
    z-index: 9997;
    width: 100vw;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    background: #020617;
}

html.is-console-maximized .sidebar,
body.is-console-maximized .sidebar,
html.is-console-maximized .console-beta-header,
body.is-console-maximized .console-beta-header,
html.is-console-maximized .console-beta-warning,
body.is-console-maximized .console-beta-warning,
html.is-console-maximized .console-beta-footer .muted,
body.is-console-maximized .console-beta-footer .muted {
    display: none;
}

html.is-console-maximized .console-main,
body.is-console-maximized .console-main,
html.is-console-maximized .shell,
body.is-console-maximized .shell,
html.is-console-maximized .console-beta-card,
body.is-console-maximized .console-beta-card {
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
    border-radius: 0;
}

html.is-console-maximized .shell,
body.is-console-maximized .shell,
html.is-console-maximized .console-beta-card,
body.is-console-maximized .console-beta-card {
    display: flex;
    flex-direction: column;
    gap: 0;
}

html.is-console-maximized .console-terminal,
body.is-console-maximized .console-terminal {
    flex: 1 1 auto;
    width: 100vw;
    min-height: 0;
    border-radius: 0;
    border-width: 0;
    padding: 12px;
}

html.is-console-maximized .console-terminal .xterm,
body.is-console-maximized .console-terminal .xterm,
html.is-console-maximized .console-terminal .xterm-screen,
body.is-console-maximized .console-terminal .xterm-screen,
html.is-console-maximized .console-terminal .xterm-viewport,
body.is-console-maximized .console-terminal .xterm-viewport {
    width: 100% !important;
    height: calc(100vh - 112px) !important;
    height: calc(100dvh - 112px) !important;
}

.console-fit-measure {
    position: absolute;
    visibility: hidden;
    pointer-events: none;
    white-space: pre;
    font: 14px/1.25 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

html.is-console-maximized .console-beta-footer,
body.is-console-maximized .console-beta-footer {
    flex: 0 0 auto;
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid var(--line);
}

.console-terminal:focus,
.console-terminal:focus-within {
    border-color: #155eef;
    box-shadow: 0 0 0 4px rgba(21, 94, 239, 0.16);
}

.console-terminal .xterm {
    height: 520px;
}

.console-terminal .xterm-viewport {
    border-radius: 12px;
}

.console-terminal-fallback {
    overflow: auto;
    white-space: pre;
    font: 14px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.pill.amber {
    background: #fff4e5;
    color: #b54708;
}

.admin-support-message {
    max-width: 280px;
    white-space: normal;
    word-break: break-word;
}

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

.table th, .table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 14px;
}

.table th {
    color: #667085;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table tbody tr:hover {
    background: rgba(21, 94, 239, 0.03);
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.row-actions button,
.row-actions .button {
    min-height: 34px;
    padding: 0 11px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 8px 14px;
}

form {
    display: grid;
    gap: 13px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 750;
    color: #344054;
}

input, select, textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    padding: 0 12px;
    font: inherit;
    background: #fff;
    transition: border-color 0.2s ease;
}

textarea {
    padding-top: 10px;
    resize: vertical;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue);
}

.field-help {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.label-optional {
    color: var(--muted);
    font-weight: 600;
}

.messages {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.messages li {
    padding: 10px 12px;
    border-radius: 12px;
    background: #eff4ff;
    color: #155eef;
    animation: slideIn 0.3s ease;
}

.inline-feedback {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #eff4ff;
    color: #155eef;
    font-size: 14px;
}

.inline-feedback.success {
    background: #dcfae6;
    color: #067647;
}

.inline-feedback.error {
    background: #fee4e2;
    color: #b42318;
}

.inline-feedback.warning {
    background: #fef0c7;
    color: #b54708;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.connection-details {
    display: grid;
    gap: 12px;
    margin: 0;
}

.connection-details div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eaecf0;
}

.connection-details div:last-child {
    border-bottom: 0;
}

.connection-details dt {
    color: var(--muted);
    font-weight: 600;
}

.connection-details dd {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    flex-wrap: wrap;
}

.icon-copy {
    border: 0;
    background: transparent;
    color: #155eef;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
}

.icon-copy:hover,
.icon-copy.copied {
    background: #eff4ff;
}

.password-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.password-top-row,
.password-copy-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.password-top-row {
    width: 100%;
}

.password-copy-row.second-row {
    width: 100%;
}

.password-copy-row.second-row .copy-password {
    width: 100%;
    justify-content: center;
}

.password-value {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    background: #f9fafb;
    color: var(--text);
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    font-size: 14px;
    line-height: 1.4;
}

.copy-password,
.reveal-password {
    flex: 0 0 auto;
}

.reveal-password {
    min-width: 44px;
    padding: 0 12px;
}

.password-value.is-hidden {
    color: #475467;
    letter-spacing: 0.08em;
}

.password-value.is-revealed {
    letter-spacing: normal;
}

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

.muted-card {
    background: #f9fafb;
    border: 1px solid #eaecf0;
    border-radius: 14px;
    color: #475467;
    padding: 14px;
}

.template-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.template-card:hover,
.template-card:has(input:checked) {
    border-color: #84caff;
    box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.10);
    transform: translateY(-1px);
}

.template-card input {
    width: auto;
    margin-top: 3px;
}

.template-card strong,
.template-card small {
    display: block;
}

.template-card strong {
    color: #101828;
    margin-bottom: 4px;
}

.template-card small {
    color: var(--muted);
    line-height: 1.45;
}

.compact-form {
    margin-top: 12px;
}

.api-key-once {
    display: grid;
    gap: 10px;
    margin: 12px 0 18px;
    padding: 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 14px;
}

.api-key-copy-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.api-key-copy-row code {
    overflow-wrap: anywhere;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.check-row input {
    width: auto;
}

.current-plan-card {
    display: grid;
    gap: 4px;
    margin: 0 0 16px;
    padding: 12px 14px;
}

.current-plan-card strong {
    color: #344054;
    font-size: 15px;
}

.danger-zone {
    border-color: #fecdca;
}

.two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
}

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

.console-stack {
    display: grid;
    gap: 18px;
}

.instances-card {
    overflow-x: auto;
}

.instances-heading {
    margin-bottom: 16px;
}

.instances-table th:last-child,
.instances-table td:last-child {
    text-align: right;
}

.row-actions-manage {
    justify-content: flex-end;
}

.manage-button {
    min-width: 92px;
    justify-content: center;
}

.create-instance-card {
    background:
        radial-gradient(circle at top right, rgba(21, 94, 239, 0.08), transparent 34%),
        rgba(255, 255, 255, 0.96);
}

.create-instance-form {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.choice-section {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    background: #fbfcff;
}

.choice-section-heading {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.choice-section-heading h3 {
    margin: 0 0 3px;
    font-size: 16px;
}

.choice-section-heading p,
.choice-card p,
.create-submit-row p {
    margin: 0;
}

.choice-step {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: #101828;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.choice-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid #d0d5dd;
    border-radius: 16px;
    background: #fff;
}

.choice-card.is-selected {
    border-color: #84caff;
    box-shadow: 0 10px 30px rgba(21, 94, 239, 0.08);
}

.choice-card strong {
    color: #101828;
}

.choice-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.os-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.os-card {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-height: 74px;
    padding: 13px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 16px;
    background: #fff;
    color: #101828;
    box-shadow: none;
    text-align: left;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.os-card:hover {
    transform: translateY(-1px);
    border-color: #b2ccff;
    background: #f8fbff;
}

.os-card.is-selected {
    border-color: #2e90fa;
    background: #eff8ff;
    box-shadow: 0 10px 26px rgba(21, 94, 239, .10);
}

.os-logo {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -.03em;
    color: #fff;
    background: #344054;
}

.os-logo-ubuntu { background: #e95420; }
.os-logo-debian { background: #a81d33; }
.os-logo-centos { background: #7f3f98; }
.os-logo-almalinux { background: #0e8f79; }
.os-logo-rocky { background: #10a37f; }

.os-card-text {
    display: grid;
    gap: 3px;
}

.os-card-text strong {
    color: #101828;
    font-size: 14px;
}

.os-card-text span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.compact-field {
    margin: 0;
}

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

.create-submit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 4px;
}

.create-submit-row .blue {
    min-width: 168px;
}

.visually-hidden,
.sr-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.traffic-pools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.traffic-pool-region {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    background: #f8fafc;
}

.traffic-pool-title,
.traffic-pool-usage-text {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.traffic-pool-title h3 {
    margin: 0;
    font-size: 18px;
}

.traffic-pool-usage {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.traffic-pool-breakdown {
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.progress-fill.network {
    background: linear-gradient(90deg, #079455 0%, #12b76a 100%);
}

.traffic-pool-progress {
    height: 9px;
    overflow: hidden;
    display: flex;
    background: #e4e7ec;
    border-radius: 999px;
}

.traffic-pool-progress-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.traffic-pool-progress-fill.included {
    background: linear-gradient(90deg, #079455 0%, #12b76a 100%);
}

.traffic-pool-progress-fill.overage {
    background: linear-gradient(90deg, #fdb022 0%, #f79009 100%);
}

.traffic-pool-overage-note {
    margin: 0;
    color: #b54708;
    font-size: 13px;
    font-weight: 700;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

@media (max-width: 880px) {
    main.console-layout,
    main.console-layout.is-public {
        width: min(100% - 32px, 720px);
        grid-template-columns: 1fr;
        padding-top: 12px;
    }

    .sidebar {
        position: static;
        min-height: auto;
    }

    .side-nav {
        display: flex;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 4px;
    }

    .nav-section {
        min-width: 180px;
    }

    .sidebar-footer {
        margin-top: 0;
    }

    .two {
        grid-template-columns: 1fr;
    }

    .section-heading-row,
    .create-submit-row,
    .choice-card {
        flex-direction: column;
        align-items: stretch;
    }

    .form-grid.two-columns {
        grid-template-columns: 1fr;
    }

    .create-submit-row .blue,
    .instances-heading .button {
        width: 100%;
    }

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

    .hero {
        padding: 28px;
    }
}

/* Monitoring Stats */
.monitoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 16px;
}

.metric h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    margin: 0 0 8px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--line);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

.progress-fill.cpu {
    background: linear-gradient(90deg, #155eef 0%, #3b82f6 100%);
}

.progress-fill.memory {
    background: linear-gradient(90deg, #7c3aed 0%, #a78bfa 100%);
}

.progress-fill.disk {
    background: linear-gradient(90deg, #dc6803 0%, #fb923c 100%);
}

.metric-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.network-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.network-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 8px;
}

.network-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
}

.network-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.row-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.mini-stat {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 42px;
}

.mini-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.mini-value {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .monitoring-grid {
        grid-template-columns: 1fr;
    }
}

/* Customer-safe modals and provisioning progress */
.modal-overlay,
.progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(4px);
}

.modal-overlay.active,
.progress-overlay.active {
    display: flex;
}

.progress-overlay.active {
    cursor: not-allowed;
}

.progress-overlay.active * {
    cursor: not-allowed;
}

.modal-card,
.progress-card {
    width: min(540px, 100%);
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 24px;
    box-shadow: 0 32px 100px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    padding: 30px;
    animation: modalSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-12px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.danger-confirm {
    border-color: #f04438;
    box-shadow: 0 0 0 4px rgba(240, 68, 56, 0.12), 0 24px 80px rgba(180, 35, 24, 0.22);
}

.danger-eyebrow {
    background: #fee4e2;
    color: #b42318;
}

.danger-warning {
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px solid #fecdca;
    border-radius: 14px;
    background: #fffbfa;
    color: #b42318;
    font-weight: 700;
    line-height: 1.6;
}

.warning-modal {
    border: 2px solid #fef0c7;
    box-shadow: 0 0 0 6px rgba(247, 144, 9, 0.12), 0 28px 90px rgba(181, 71, 8, 0.26);
    animation: warningBounce 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes warningBounce {
    0% { transform: scale(0.92); opacity: 0; }
    60% { transform: scale(1.02); }
    100% { transform: scale(1); opacity: 1; }
}

.warning-eyebrow {
    background: #fef0c7;
    color: #b54708;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.warning-message {
    margin: 16px 0 0;
    padding: 16px 18px;
    border: 1.5px solid #fedf89;
    border-radius: 16px;
    background: linear-gradient(135deg, #fffcf5 0%, #fff9eb 100%);
    color: #7a2e0e;
    font-weight: 600;
    line-height: 1.7;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.danger-confirm input {
    margin-top: 8px;
}

.progress-bar.large {
    height: 14px;
    margin: 20px 0;
    background: #f3f4f6;
    border-radius: 999px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.progress-bar.large .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.65, 0, 0.35, 1);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

.progress-steps {
    display: grid;
    gap: 11px;
    margin: 20px 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
}

.progress-steps li {
    position: relative;
    padding-left: 28px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.progress-steps li::before {
    content: '○';
    position: absolute;
    left: 0;
    font-size: 16px;
    color: #d0d5dd;
    transition: all 0.3s ease;
}

.progress-steps li.active {
    color: var(--blue);
    font-weight: 700;
}

.progress-steps li.active::before {
    content: '◉';
    color: var(--blue);
    animation: pulseCircle 1.2s ease-in-out infinite;
}

@keyframes pulseCircle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.progress-steps li.done {
    color: #344054;
    font-weight: 600;
}

.progress-steps li.done::before {
    content: '✓';
    color: var(--green);
    font-weight: 800;
}

body:has(.progress-overlay.active) {
    overflow: hidden;
}

a[aria-disabled="true"] {
    pointer-events: none;
    opacity: 0.55;
}

.button-progress-running {
    gap: 8px;
    min-width: 96px;
    opacity: 0.9 !important;
    cursor: progress !important;
}

.action-progress-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(17, 24, 39, 0.18);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex: 0 0 auto;
}

.button.blue .action-progress-spinner,
button.blue .action-progress-spinner {
    border-color: rgba(255, 255, 255, 0.32);
    border-top-color: #fff;
}

.action-progress-label {
    white-space: nowrap;
}

/* ========== Enhanced Monitoring Dashboard v2 ========== */
.monitoring-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.metric-card {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.metric-card:hover::before {
    opacity: 1;
}

.cpu-card::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.memory-card::before {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.disk-card::before {
    background: linear-gradient(90deg, #06b6d4, #22d3ee);
}

.network-card::before {
    background: linear-gradient(90deg, #10b981, #f59e0b);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.metric-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-big-number {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-big-number .unit {
    font-size: 18px;
    font-weight: 600;
    margin-left: 2px;
}

.chart-container {
    height: 80px;
    margin: 12px 0;
    position: relative;
}

.chart-container canvas {
    max-height: 80px;
}

.progress-bar-large {
    width: 100%;
    height: 12px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
    margin: 16px 0 12px;
}

.network-stats-v2 {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.network-stats-v2 .network-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.network-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.network-dot.in {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.network-dot.out {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.network-stats-v2 .network-label {
    font-size: 12px;
    color: #667085;
    font-weight: 500;
    min-width: 32px;
}

.network-stats-v2 .network-value {
    font-size: 14px;
    color: #111827;
    font-weight: 600;
    margin-left: auto;
}

/* Enhanced Progress Bars */
.metric-card .progress-bar {
    height: 8px;
    margin-bottom: 8px;
}

.metric-card .progress-fill {
    position: relative;
    overflow: visible;
}

.metric-card .progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: inherit;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card:hover .progress-fill::after {
    opacity: 1;
}

.metric-card .metric-value {
    font-size: 12px;
    color: #667085;
    font-weight: 500;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .monitoring-grid-v2 {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .monitoring-grid-v2 {
        grid-template-columns: 1fr;
    }

    .metric-card {
        padding: 16px;
    }

    .chart-container {
        height: 60px;
    }

    .metric-big-number {
        font-size: 28px;
    }
}

/* Plan Details Display */
.plan-details {
    margin-top: 12px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.plan-details p {
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.5;
}

.plan-details .plan-specs {
    font-weight: 500;
    color: #374151;
}

.plan-details .plan-network {
    color: #6b7280;
}

.plan-details .plan-price {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
}

/* ========== Admin Console UI Polish ========== */

/* Admin controls grid: better spacing on narrow screens */
.admin-controls-grid {
    gap: 18px;
}

@media (max-width: 768px) {
    .admin-controls-grid {
        grid-template-columns: 1fr;
    }
}

/* Admin form spacing */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Instance diagnostics: compact inline layout */
.instance-diagnostics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 320px;
}

.diagnostic-item {
    display: inline-block;
    padding: 3px 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    color: #4b5563;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Admin actions container */
.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 280px;
}

.admin-action-primary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-suspend-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-suspend-reason {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 14px;
}

.admin-suspended-reason {
    margin: 4px 0 0;
    padding: 8px 12px;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    font-size: 13px;
    color: #92400e;
}

.admin-action-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}

/* Admin button variants */
.admin-btn-main {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
}

.admin-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
}

/* Admin instances table tweaks */
.admin-instances-table td {
    vertical-align: top;
    padding: 14px 12px;
}

.admin-instances-table thead th {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Responsive table for admin */
@media (max-width: 1024px) {
    .admin-instances-table {
        font-size: 13px;
    }

    .instance-diagnostics {
        max-width: 240px;
    }

    .diagnostic-item {
        font-size: 11px;
        padding: 2px 6px;
    }
}

@media (max-width: 768px) {
    .admin-actions {
        min-width: auto;
    }

    .admin-action-secondary {
        flex-direction: column;
    }

    .admin-btn-sm {
        width: 100%;
    }
}

/* ============================================
   Firewall Groups UI
   ============================================ */

/* Template selector grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.template-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.template-card:hover {
    border-color: #b2ddff;
    transform: translateY(-2px);
}

.template-card:has(input:checked) {
    border-color: #84caff;
    box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.10);
    background: #f0f9ff;
}

.template-card input[type="radio"] {
    width: auto;
    margin-top: 3px;
    flex-shrink: 0;
}

.template-card strong {
    display: block;
    font-size: 15px;
    color: #101828;
    margin-bottom: 4px;
}

.template-card small {
    display: block;
    font-size: 13px;
    color: #667085;
    line-height: 1.5;
}

/* Rule list display */
.rule-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

/* Attach instances panel */
.attach-panel {
    margin-top: 16px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #eaecf0;
    border-radius: 10px;
}

.attach-panel summary {
    cursor: pointer;
    font-weight: 500;
    color: #155eef;
    list-style: none;
    user-select: none;
    padding: 4px 0;
}

.attach-panel summary::-webkit-details-marker {
    display: none;
}

.attach-panel summary::before {
    content: "▸ ";
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.2s ease;
}

.attach-panel[open] summary::before {
    transform: rotate(90deg);
}

.attach-panel summary:hover {
    color: #1849cc;
}

.attach-panel form {
    margin-top: 14px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.checkbox-row:hover {
    background: #ffffff;
    margin: 0 -8px;
    padding: 8px 8px;
    border-radius: 6px;
}

/* Info row for instance detail */
.info-row {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eaecf0;
}

.info-row .label-text {
    display: block;
    font-size: 13px;
    color: #667085;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-weight: 500;
}

.info-row .value-text {
    font-size: 15px;
    color: #101828;
    margin: 0;
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    .template-grid {
        grid-template-columns: 1fr;
    }
}
