.menubar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}
.menubar-wrapper ul[role="menu-bar"] {
    width: 100%;
    box-sizing: border-box;
}
.menubar-wrapper ul[role="menu-bar"] > li {
    font-size: 22px !important;
    line-height: 1 !important;
    padding: 10px 16px !important;
}
.menubar-wrapper ul[role="menu-bar"] > li > a {
    font-size: 22px !important;
}

.page-content {
    margin-top: 48px;
    padding: 16px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.calc-rate-hint {
    font-size: 11px;
    color: #555;
    margin-bottom: 8px;
}
.calc-item {
    border: 1px solid #000;
    padding: 8px 10px;
    margin-bottom: 8px;
}
.calc-item:last-child {
    margin-bottom: 0;
}
.calc-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.calc-row:last-child {
    margin-bottom: 0;
}
.calc-row label {
    width: 90px;
    flex-shrink: 0;
    font-size: 11px;
}
.calc-row input[type="number"] {
    width: 80px;
}
.calc-row select {
    width: auto;
    flex-shrink: 0;
}
.calc-unit {
    font-size: 11px;
    color: #555;
    min-width: 52px;
}
.calc-fill {
    flex: 1;
}
.calc-cost {
    font-weight: bold;
    font-size: 12px;
    white-space: nowrap;
}
.calc-rm {
    margin-left: 4px;
    min-width: 24px;
    text-align: center;
}
.calc-empty {
    font-size: 11px;
    color: #555;
    font-style: italic;
    margin: 0 0 4px;
}

.badge-preserved {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid #000;
    padding: 0 4px;
    line-height: 1.6;
    vertical-align: middle;
    white-space: nowrap;
}

details {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #000;
}
details:last-child {
    border-bottom: none;
}
details summary {
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}
details[open] summary {
    margin-bottom: 8px;
}
details ol,
details ul {
    margin: 4px 0;
    padding-left: 20px;
}

.franchise-row { cursor: pointer; }
.franchise-row td { font-weight: bold; }
.franchise-toggle { display: inline-block; width: 14px; font-size: 9px; }
.franchise-count { font-size: 10px; font-weight: normal; color: #555; margin-left: 6px; }
.franchise-child td:first-child { padding-left: 24px; }
.franchise-row:hover td,
.franchise-row:active td { background: #000; color: #fff; }
.franchise-row:active .franchise-count { color: #ccc; }
.game-row { cursor: pointer; }
.game-row:hover td { background: #000; color: #fff; }
.game-row:hover .badge-preserved { border-color: #fff; color: #fff; }
.game-row[data-open="true"] td { background: #000; color: #fff; }
.game-row[data-open="true"] .badge-preserved { border-color: #fff; color: #fff; }
.game-detail td { padding: 0; }
.game-detail-pane { padding: 10px 14px; border-top: 1px solid #999; background: #f0ede8; }

.lobby-split {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 12px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}
.lobby-split > * { min-width: 0; }
.server-row { cursor: pointer; }
.server-row:hover td,
.server-row.selected td { background: #000; color: #fff; }
.ping-low  { color: #006400; }
.ping-mid  { color: #886600; }
.ping-high { color: #cc0000; }
.server-row:hover td.ping-low,
.server-row:hover td.ping-mid,
.server-row:hover td.ping-high,
.server-row.selected td.ping-low,
.server-row.selected td.ping-mid,
.server-row.selected td.ping-high { color: #fff; }
.players-full  { color: #cc0000; }
.players-empty { color: #999; }
.server-row:hover td.players-full,
.server-row:hover td.players-empty,
.server-row.selected td.players-full,
.server-row.selected td.players-empty { color: #fff; }
.player-bar-track { width: 100%; height: 8px; border: 1px solid #000; background: #fff; }
.player-bar-fill  { height: 100%; background: #000; }
.sort-ind { font-size: 9px; }
.server-inet td { background: #f5f8f2; }
.server-inet:hover td,
.server-inet.selected td { background: #000; color: #fff; }
.inet-dot { color: #2a6e1a; font-size: 8px; margin-right: 2px; vertical-align: middle; }
.server-row:hover .inet-dot,
.server-row.selected .inet-dot { color: #7dca65; }

@media (max-width: 720px) {
    .two-col,
    .three-col {
        grid-template-columns: 1fr;
    }
    .page-content {
        padding: 8px;
    }
}

/* ── Cloud console layout ──────────────────────────────────────────────────── */

.cloud-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    align-items: start;
}

.cloud-nav {
    position: sticky;
    top: 60px;
}

.cloud-nav .window-pane {
    padding: 0;
}

.cloud-nav-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    padding: 8px 10px 2px;
}

.cloud-nav a,
.cloud-nav-item {
    display: block;
    padding: 5px 10px;
    font-size: 12px;
    text-decoration: none;
    color: #000;
    border-bottom: 1px solid #eee;
}
.cloud-nav a:last-child,
.cloud-nav-item:last-child { border-bottom: none; }
.cloud-nav a:hover,
.cloud-nav-item:hover { background: #000; color: #fff; }
.cloud-nav a.active,
.cloud-nav-item.active { background: #000; color: #fff; font-weight: bold; }

.cloud-main > .window { margin-bottom: 12px; }
.cloud-main > .window:last-child { margin-bottom: 0; }

/* ── Resource tables ───────────────────────────────────────────────────────── */

.resource-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.resource-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    padding: 6px 10px;
    border-bottom: 1px solid #ccc;
    white-space: nowrap;
}
.resource-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.resource-table tr:last-child td { border-bottom: none; }
.resource-table tr:hover td { background: #f5f5f5; cursor: pointer; }
.resource-table tr.clickable:hover td { background: #000; color: #fff; }
.resource-table .col-actions { text-align: right; white-space: nowrap; }
.resource-table .col-name { font-weight: bold; white-space: nowrap; }
.resource-table .col-mono { font-family: Monaco, monospace; font-size: 11px; }
.resource-table .col-muted { color: #666; font-size: 11px; }

/* ── Status badges ─────────────────────────────────────────────────────────── */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    white-space: nowrap;
}
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-running  .status-dot { background: #3a9a3a; }
.status-stopped  .status-dot { background: #ccc; }
.status-starting .status-dot { background: #e0a020; }
.status-error    .status-dot { background: #cc2020; }
.status-pending  .status-dot { background: #8888cc; }

/* ── Vendor / platform badges ──────────────────────────────────────────────── */

.vendor-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border: 1px solid #000;
    padding: 1px 5px;
    line-height: 1.5;
    white-space: nowrap;
}

/* ── Quota / usage bar ─────────────────────────────────────────────────────── */

.quota-bar-track {
    width: 100%;
    height: 8px;
    border: 1px solid #000;
    background: #fff;
    display: inline-block;
}
.quota-bar-fill {
    height: 100%;
    background: #000;
    display: block;
}
.quota-bar-fill.warn  { background: #cc8800; }
.quota-bar-fill.crit  { background: #cc2020; }
.quota-label {
    font-size: 10px;
    color: #555;
    margin-top: 2px;
}

/* ── Severity badges ───────────────────────────────────────────────────────── */

.severity-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid currentColor;
    padding: 1px 5px;
    line-height: 1.5;
}
.severity-critical { color: #cc2020; }
.severity-high     { color: #cc6600; }
.severity-medium   { color: #aa8800; }
.severity-low      { color: #336633; }
.severity-info     { color: #336699; }

/* ── Form helpers ──────────────────────────────────────────────────────────── */

.form-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ddd;
}
.form-section:last-child { border-bottom: none; margin-bottom: 0; }
.form-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 8px;
}
.field-row-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Cloud console action bar ──────────────────────────────────────────────── */

.action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.action-bar .spacer { flex: 1; }

/* ── Terminal / log viewer ─────────────────────────────────────────────────── */

.terminal-pane {
    background: #111;
    color: #d4d4d4;
    font-family: Monaco, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    padding: 12px;
    min-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.terminal-pane .log-ts { color: #666; user-select: none; }
.terminal-pane .log-err { color: #f87171; }
.terminal-pane .log-warn { color: #fbbf24; }
.terminal-pane .log-info { color: #d4d4d4; }

/* ── Price / market colours ────────────────────────────────────────────────── */

.price-down { color: #2a7a2a; }
.price-up   { color: #cc2020; }
.price-same { color: #555; }

/* ── Stub / coming-soon ────────────────────────────────────────────────────── */

.coming-soon-pane {
    padding: 48px 16px;
    text-align: center;
    color: #888;
    font-size: 13px;
    font-style: italic;
}

@media (max-width: 860px) {
    .cloud-layout {
        grid-template-columns: 1fr;
    }
    .cloud-nav {
        position: static;
    }
}
