:root {
    color-scheme: dark;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #0b1017;
    color: #e6ebf2;
}

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

.sidebar {
    background: #10151d;
    border-right: 1px solid #222b36;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 1.4rem 1rem;
    width: 244px;
}

.brand {
    align-items: center;
    display: flex;
    gap: .75rem;
    margin-bottom: 2.2rem;
}

.brand-mark {
    align-items: center;
    background: #da7e29;
    border-radius: .6rem;
    color: #16191e;
    display: inline-flex;
    font-size: .8rem;
    font-weight: 800;
    height: 2.3rem;
    justify-content: center;
    width: 2.3rem;
}

.brand strong {
    color: #f2f4f7;
    display: block;
    font-size: 1rem;
}

.brand small {
    color: #8490a0;
    font-size: .72rem;
    text-transform: uppercase;
}

.language-picker {
    display: grid;
    gap: .35rem;
    margin: -1.25rem .15rem 1.6rem;
}

.language-picker span {
    color: #8490a0;
    font-size: .72rem;
    text-transform: uppercase;
}

.language-picker select {
    padding: .45rem .55rem;
}

.navigation {
    display: grid;
    gap: .35rem;
}

.navigation a {
    border-radius: .55rem;
    color: #9da8b7;
    padding: .72rem .85rem;
    text-decoration: none;
}

.navigation a:hover {
    background: #171e27;
    color: #f2f4f7;
}

.navigation a.active {
    background: #202936;
    color: #fff;
}

.resource-panel {
    border-top: 1px solid #222b36;
    margin-top: 1.2rem;
    padding: 1rem .2rem 0;
}

.resource-panel h2 {
    color: #8490a0;
    font-size: .72rem;
    letter-spacing: .04em;
    margin: 0 0 .65rem;
    text-transform: uppercase;
}

.resource-panel dl {
    display: grid;
    gap: .35rem .5rem;
    grid-template-columns: auto 1fr;
    margin: 0;
}

.resource-panel dt {
    color: #8490a0;
    font-size: .76rem;
}

.resource-panel dd {
    color: #f2f4f7;
    font-size: .76rem;
    font-weight: 700;
    margin: 0;
    text-align: right;
}

.resource-server-list {
    display: grid;
    gap: .45rem;
    margin-top: .8rem;
}

.resource-server-list .resource-server-card {
    background: #151c26;
    border: 1px solid #222b36;
    border-radius: .5rem;
    color: inherit;
    display: grid;
    gap: .2rem;
    padding: .5rem .55rem;
    text-decoration: none;
}

.resource-server-list .resource-server-card:hover {
    background: #1b2634;
    border-color: #334155;
}

.resource-server-list strong {
    color: #e6ebf2;
    font-size: .78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-server-list span,
.resource-panel small {
    color: #9da8b7;
    font-size: .72rem;
}

.sidebar-footer {
    align-items: center;
    border-top: 1px solid #222b36;
    color: #8490a0;
    display: flex;
    flex-wrap: wrap;
    font-size: .82rem;
    gap: .55rem;
    margin-top: auto;
    padding: 1rem .6rem 0;
}

.link-button {
    background: none;
    border: 0;
    color: #da8730;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.link-button:hover {
    color: #f0a14d;
}

.indicator {
    background: #24b66b;
    border-radius: 50%;
    height: .5rem;
    width: .5rem;
}

.workspace {
    flex: 1;
    min-width: 0;
    padding: 2.1rem 2.4rem;
}

.auth-shell {
    align-items: center;
    background:
        radial-gradient(circle at top left, rgb(218 126 41 / 18%), transparent 30rem),
        #0b1017;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    background: #111821;
    border: 1px solid #263242;
    border-radius: .9rem;
    box-shadow: 0 1rem 3rem rgb(0 0 0 / 30%);
    max-width: 440px;
    padding: 1.6rem;
    width: 100%;
}

.auth-brand {
    margin-bottom: 1.2rem;
}

.checkbox-list {
    display: grid;
    gap: .55rem;
    margin: 1rem 0;
}

.permission-grid {
    display: grid;
    gap: .8rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin: 1rem 0;
}

.permission-category {
    background: #101720;
    border: 1px solid #263242;
    border-radius: .65rem;
    padding: .85rem;
}

.permission-category h4 {
    color: #da8730;
    margin: 0 0 .75rem;
    text-transform: uppercase;
}

.permission-category .checkbox-setting {
    align-items: flex-start;
    margin-bottom: .55rem;
}

.permission-category small,
td small {
    display: block;
}

.busy-overlay {
    align-items: center;
    background: rgb(6 10 15 / 72%);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: 1200;
}

.busy-card {
    align-items: center;
    background: #111821;
    border: 1px solid #303c4a;
    border-radius: .8rem;
    box-shadow: 0 1rem 3rem rgb(0 0 0 / 35%);
    display: flex;
    flex-direction: column;
    gap: .7rem;
    min-width: 290px;
    padding: 1.4rem 1.8rem;
}

.busy-card small {
    color: #8793a4;
}

.busy-spinner {
    animation: busy-spin .9s linear infinite;
    border: .2rem solid #303c4a;
    border-radius: 50%;
    border-top-color: #da8730;
    height: 2.1rem;
    width: 2.1rem;
}

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

.background-activity {
    align-items: center;
    background: #17212d;
    border: 1px solid #324357;
    border-radius: 999px;
    box-shadow: 0 .35rem 1.25rem rgb(0 0 0 / 28%);
    color: #d4dfeb;
    display: flex;
    font-size: .86rem;
    gap: .6rem;
    max-width: min(28rem, calc(100vw - 2rem));
    padding: .65rem 1rem;
    position: fixed;
    right: 1.25rem;
    top: 1.2rem;
    z-index: 1100;
}

.background-pulse {
    animation: activity-pulse 1.2s ease-in-out infinite;
    background: #da8730;
    border-radius: 50%;
    flex: 0 0 .62rem;
    height: .62rem;
    width: .62rem;
}

@keyframes activity-pulse {
    0%, 100% { opacity: .38; transform: scale(.9); }
    50% { opacity: 1; transform: scale(1.15); }
}

#blazor-error-ui {
    background: #842f37;
    bottom: 0;
    box-sizing: border-box;
    color: #fff;
    display: none;
    left: 0;
    padding: .75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .reload {
    color: #fff;
    margin-left: .75rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: .75rem;
    top: .5rem;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    background: #0b1017;
    color: #e6ebf2;
    margin: 0;
    min-height: 100%;
}

body {
    font-size: .95rem;
}

a {
    color: #db913e;
    text-decoration: none;
}

a:hover {
    color: #f4ac59;
}

h1, h2, p {
    margin-top: 0;
}

h1 {
    color: #f5f7fa;
    font-size: clamp(1.7rem, 2.4vw, 2.1rem);
    line-height: 1.15;
    margin-bottom: .45rem;
}

h2 {
    color: #f4f6f9;
    font-size: 1rem;
    margin-bottom: 1.1rem;
}

.page-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.65rem;
}

.eyebrow {
    color: #da8730;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    margin-bottom: .5rem;
    text-transform: uppercase;
}

.subline, .muted {
    color: #8793a4;
}

.subline {
    margin: 0;
    max-width: 660px;
}

.button {
    border: 1px solid #303c4a;
    border-radius: .5rem;
    color: #ebeff4;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 600;
    justify-content: center;
    padding: .72rem 1rem;
}

.button.primary {
    background: #d27b27;
    border-color: #d27b27;
    color: #14171d;
}

.button.primary:hover {
    background: #e38a34;
    color: #14171d;
}

.button.full {
    margin-top: 1.15rem;
    width: 100%;
}

.stats {
    display: grid;
    gap: .9rem;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    margin-bottom: 1.35rem;
}

.metric, .panel {
    background: #111821;
    border: 1px solid #202a35;
    border-radius: .7rem;
}

.metric {
    padding: 1.1rem 1.2rem;
}

.metric span {
    color: #8793a4;
    display: block;
    font-size: .84rem;
    margin-bottom: .45rem;
}

.metric strong {
    font-size: 1.85rem;
}

.metric.success strong {
    color: #38c57b;
}

.metric.warning strong {
    color: #f0bc45;
}

.metric.players strong {
    color: #70b9ef;
}

.metric.danger strong {
    color: #e25e62;
}

.grid-panels {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
    padding: 1.25rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.comparison-grid {
    margin-bottom: 1rem;
}

.statistics-comparison table {
    margin-top: .75rem;
}

.statistics-comparison th,
.statistics-comparison td {
    white-space: nowrap;
}

.statistics-comparison td:first-child {
    color: var(--muted);
}

.chart-panel {
    overflow: hidden;
}

.statistics-chart {
    width: 100%;
    height: 13rem;
    margin-top: .75rem;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(51, 137, 255, .08), transparent);
}

.statistics-chart polyline {
    fill: none;
    stroke: var(--accent);
    stroke-width: 4;
    vector-effect: non-scaling-stroke;
}

.statistics-chart.fps polyline {
    stroke: #54c98b;
}

.statistics-chart.new-players polyline {
    stroke: #f0bc45;
}

.chart-with-axis {
    display: grid;
    gap: .35rem;
    grid-template-columns: 1.25rem minmax(0, 1fr);
    margin-top: .75rem;
}

.chart-axis-y {
    align-self: center;
    color: var(--muted);
    font-size: .72rem;
    grid-row: 1;
    transform: rotate(-90deg);
    white-space: nowrap;
}

.chart-with-axis .statistics-chart {
    grid-column: 2;
    margin-top: 0;
}

.chart-axis {
    stroke: var(--line);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.chart-axis-x {
    color: var(--muted);
    display: flex;
    font-size: .72rem;
    grid-column: 2;
    justify-content: space-between;
}

.chart-axis-x strong {
    color: var(--muted);
    font-weight: 600;
}

.chart-range {
    margin: .35rem 0 0;
    color: var(--muted);
    font-size: .8rem;
}

.load-analysis {
    margin-top: 1rem;
}

.load-analysis h3 {
    margin-top: 1.4rem;
}

.compact-stats {
    margin-bottom: .5rem;
}

.dual-chart {
    display: grid;
    gap: .35rem;
    grid-template-columns: 1.25rem minmax(0, 1fr) 1.25rem;
    margin-top: .75rem;
}

.dual-chart .statistics-chart {
    grid-column: 2;
    margin-top: 0;
}

.dual-chart .chart-axis-y.left {
    grid-column: 1;
    grid-row: 1;
}

.dual-chart .chart-axis-y.right {
    grid-column: 3;
    grid-row: 1;
}

.dual-chart .chart-axis-x {
    grid-column: 2;
}

.statistics-chart.dual .fps-line {
    stroke: #54c98b;
}

.statistics-chart.dual .player-line {
    stroke: #70b9ef;
}

.chart-legend {
    display: flex;
    gap: 1rem;
    margin: .45rem 0 .75rem 1.6rem;
}

.chart-legend span {
    color: var(--muted);
    font-size: .78rem;
}

.chart-legend span::before {
    border-radius: 50%;
    content: "";
    display: inline-block;
    height: .65rem;
    margin-right: .35rem;
    width: .65rem;
}

.chart-legend .fps::before {
    background: #54c98b;
}

.chart-legend .players::before {
    background: #70b9ef;
}

.panel-title {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.panel-title h2 {
    margin: 0;
}

.panel-title a {
    font-size: .86rem;
}

.empty {
    border: 1px dashed #263240;
    border-radius: .55rem;
    color: #8996a8;
    padding: 1.7rem 1.2rem;
    text-align: center;
}

.empty strong {
    color: #e5e9ee;
    display: block;
    margin-bottom: .5rem;
}

.empty p {
    margin: 0;
}

.empty.compact {
    padding: 1.25rem;
}

.server-row {
    align-items: center;
    border-top: 1px solid #1f2833;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    padding: .78rem 0;
}

.server-row:first-of-type {
    border-top: 0;
}

.server-row small, .event-row small {
    color: #8793a4;
    display: block;
    font-size: .8rem;
    margin-top: .2rem;
}

.server-row small.fault {
    color: #f27878;
}

td small.fault {
    color: #f27878;
}

.server-link {
    align-items: center;
    color: #eef2f6;
    display: flex;
    flex: 1;
    gap: .7rem;
    justify-content: space-between;
}

.row-actions, .detail-actions {
    display: flex;
    gap: .45rem;
}

.server-table .actions-heading {
    text-align: right;
    width: 9.5rem;
}

.server-table .actions-cell {
    white-space: nowrap;
}

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

.clickable-server-row {
    cursor: pointer;
}

.clickable-server-row:hover {
    background: #151d27;
}

.action {
    background: #202934;
    border: 1px solid #2d3947;
    border-radius: .35rem;
    color: #dfe5ed;
    cursor: pointer;
    font: inherit;
    font-size: .78rem;
    padding: .38rem .55rem;
}

.action.open {
    background: #182c40;
    border-color: #294866;
    color: #76b9ed;
    text-decoration: none;
}

.action.open:hover {
    background: #203a53;
    color: #a6d4f6;
}

.action.start {
    background: #1b382b;
    color: #53cd90;
}

.action.danger, .button.destructive {
    background: #381e24;
    border-color: #62313a;
    color: #f07b7e;
}

.action:disabled, .button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.badge {
    background: #232c37;
    border-radius: 999px;
    color: #aeb8c5;
    display: inline-block;
    font-size: .76rem;
    font-weight: 600;
    padding: .3rem .62rem;
    white-space: nowrap;
}

.badge.online {
    background: #163828;
    color: #47d68b;
}

.badge.starting, .badge.stopping, .badge.updating {
    background: #3f2e18;
    color: #f3be55;
}

.badge.crashed, .badge.frozen, .badge.failed, .badge.updatefailed {
    background: #3c2025;
    color: #f27878;
}

.badge.notconfigured, .badge.offline {
    background: #202934;
    color: #adbac9;
}

.event-row {
    align-items: start;
    border-top: 1px solid #1f2833;
    display: flex;
    gap: .75rem;
    padding: .7rem 0;
}

.event-row:first-of-type {
    border-top: 0;
}

.event-area {
    background: #202934;
    border-radius: .25rem;
    color: #9eaaba;
    font-size: .7rem;
    padding: .2rem .35rem;
    text-transform: uppercase;
}

.server-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(500px, 1fr) 390px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th {
    color: #7f8d9e;
    font-size: .74rem;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
}

td, th {
    border-bottom: 1px solid #202a35;
    padding: .72rem .4rem;
}

td:first-child, th:first-child {
    padding-left: 0;
}

td:last-child, th:last-child {
    padding-right: 0;
}

td small.pending {
    color: #efb43e;
    display: block;
    font-size: .76rem;
}

.create-panel form {
    display: grid;
    gap: .42rem;
}

.picker-title {
    color: #f4f6f9;
    font-size: .95rem;
    margin: 1rem 0 .15rem;
}

.server-checkbox-list {
    background: #0c1219;
    border: 1px solid #293542;
    border-radius: .42rem;
    display: grid;
    gap: .35rem;
    margin-top: .4rem;
    max-height: 220px;
    overflow-y: auto;
    padding: .55rem;
}

label {
    color: #a8b3bf;
    font-size: .84rem;
    margin-top: .45rem;
}

input, select {
    background: #0c1219;
    border: 1px solid #293542;
    border-radius: .42rem;
    color: #edf1f5;
    font: inherit;
    padding: .68rem .7rem;
    width: 100%;
}

input:focus, select:focus {
    border-color: #da8730;
    outline: none;
}

.create-panel form label.server-checkbox {
    align-items: center;
    border-radius: .3rem;
    display: flex;
    flex-direction: row;
    gap: .7rem;
    margin: 0;
    padding: .45rem .5rem;
}

.create-panel form label.server-checkbox:hover {
    background: #151d27;
}

.create-panel form .server-select-checkbox {
    flex: 0 0 auto;
    height: 1rem;
    margin: 0;
    padding: 0;
    width: 1rem;
}

.server-checkbox-content {
    display: block;
    line-height: 1.25;
}

.server-checkbox-content strong {
    color: #e6ebf2;
    display: block;
    font-size: .9rem;
    font-weight: 500;
}

.server-checkbox-content small {
    color: #8793a4;
    display: block;
    font-size: .76rem;
}

.workshop-id {
    display: block;
    white-space: nowrap;
}

.workshop-link {
    display: block;
    font-size: .78rem;
    margin-top: .28rem;
    white-space: nowrap;
}

textarea {
    background: #0c1219;
    border: 1px solid #293542;
    border-radius: .42rem;
    color: #edf1f5;
    font: 0.9rem Consolas, "Courier New", monospace;
    padding: .68rem .7rem;
    width: 100%;
}

textarea:focus {
    border-color: #da8730;
    outline: none;
}

.derived-path {
    background: #0c1219;
    border: 1px solid #293542;
    border-radius: .42rem;
    color: #dce6f0;
    display: block;
    overflow-wrap: anywhere;
    padding: .68rem .7rem;
}

.ports {
    display: grid;
    gap: .6rem;
    grid-template-columns: repeat(3, 1fr);
}

.ports div {
    display: grid;
    gap: .42rem;
}

.span-2 {
    grid-column: 1 / -1;
}

.alert.error, .validation-summary-errors {
    background: #361d23;
    border: 1px solid #74323c;
    border-radius: .45rem;
    color: #f0888c;
    font-size: .86rem;
    margin: .5rem 0;
    padding: .65rem .75rem;
}

.alert.success {
    background: #17352a;
    border: 1px solid #286249;
    border-radius: .45rem;
    color: #59d793;
    margin: 0 0 1rem;
    padding: .65rem .75rem;
}

.alert.warning {
    background: #3a2b12;
    border: 1px solid #8a641e;
    border-radius: .45rem;
    color: #f0c36c;
    margin: .5rem 0 1rem;
    padding: .65rem .75rem;
}

.security-warning {
    font-size: .9rem;
}

.certificate-restart-warning {
    display: grid;
    gap: .25rem;
    font-size: .95rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 1.2rem;
}

.validation-message {
    color: #f0888c;
}

.detail-nav {
    border-bottom: 1px solid #202a35;
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
    overflow-x: auto;
}

.detail-nav button,
.detail-nav a {
    background: transparent;
    border: 0;
    color: #8491a1;
    cursor: pointer;
    font: inherit;
    padding: .6rem 0 .8rem;
    text-decoration: none;
    white-space: nowrap;
}

.detail-nav .active {
    border-bottom: 2px solid #d27b27;
    color: #f2f4f7;
}

.tab-hidden {
    display: none;
}

.details {
    display: grid;
    font-size: .88rem;
    gap: .7rem 1.4rem;
    grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
    margin: 0;
}

.details dt {
    color: #8491a1;
    white-space: nowrap;
}

.details dd {
    color: #e2e8ee;
    margin: 0;
    overflow-wrap: anywhere;
}

.notice {
    background: #171f29;
    border-radius: .45rem;
    color: #9ba6b4;
    font-size: .86rem;
    margin-top: 1.25rem;
    padding: .8rem;
}

.notice.warning {
    border: 1px solid rgba(245, 158, 11, .35);
    color: #fbbf24;
}

.update-history {
    margin: 1rem 0 1.1rem;
}

.update-history h3 {
    font-size: .95rem;
    margin: 0 0 .6rem;
}

.compact-table {
    display: grid;
    gap: .25rem;
}

.compact-table .table-header,
.compact-table .table-row {
    align-items: center;
    display: grid;
    gap: .8rem;
}

.update-history-table .table-header,
.update-history-table .table-row {
    grid-template-columns: 155px minmax(220px, 1fr) 120px;
}

.compact-table .table-header {
    color: #8491a1;
    font-size: .75rem;
    text-transform: uppercase;
}

.compact-table .table-row {
    background: #101923;
    border: 1px solid #1f2a37;
    border-radius: .45rem;
    color: #e2e8ee;
    font-size: .84rem;
    padding: .45rem .55rem;
}

.action-panel {
    grid-column: 1 / -1;
}

.config-panel {
    grid-column: 1 / -1;
}

.raw-config {
    display: block;
    margin: .9rem 0 1rem;
    min-height: 260px;
    resize: vertical;
}

.pending-label {
    color: #efb43e;
    font-size: .8rem;
}

.compact-toggle {
    margin-bottom: .8rem;
}

.backup-save {
    margin-top: 1rem;
}

.backup-details {
    margin-top: 1.25rem;
}

.file-browser-panel {
    grid-column: 1 / -1;
}

.file-browser-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(300px, .85fr) minmax(360px, 1.15fr);
}

.file-list-card,
.file-preview-card {
    background: #0d141c;
    border: 1px solid #202a35;
    border-radius: .65rem;
    min-width: 0;
    padding: .8rem;
}

.file-path-bar {
    display: grid;
    gap: .3rem;
    margin-bottom: .75rem;
}

.file-path-bar span {
    color: #8491a1;
    font-size: .78rem;
    text-transform: uppercase;
}

.file-path-bar code {
    color: #e2e8ee;
    overflow-wrap: anywhere;
}

.file-list {
    display: grid;
    gap: .35rem;
    max-height: 560px;
    overflow: auto;
}

.file-search {
    display: grid;
    gap: .5rem;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: .75rem;
}

.file-search-results {
    background: #071019;
    border: 1px solid #202a35;
    border-radius: .5rem;
    display: grid;
    gap: .3rem;
    margin-bottom: .75rem;
    max-height: 220px;
    overflow: auto;
    padding: .65rem;
}

.file-search-row {
    background: transparent;
    border: 0;
    color: #dce5ee;
    cursor: pointer;
    padding: .25rem 0;
    text-align: left;
}

.file-search-row:hover {
    color: #f0a43d;
}

.file-search-row.content-match {
    display: grid;
    gap: .2rem;
}

.file-search-row.content-match small {
    color: #8491a1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row {
    align-items: center;
    background: #111a24;
    border: 1px solid transparent;
    border-radius: .45rem;
    color: #dce5ee;
    cursor: pointer;
    display: grid;
    gap: .6rem;
    grid-template-columns: minmax(180px, 1fr) 90px 90px 145px;
    padding: .55rem .65rem;
    text-align: left;
}

.file-row-wrapper {
    align-items: center;
    display: grid;
    gap: .5rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

.file-row-actions {
    display: flex;
    gap: .35rem;
}

.file-upload-button {
    cursor: pointer;
}

.file-upload-button.disabled {
    cursor: not-allowed;
    opacity: .65;
}

.visually-hidden {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.file-row:hover,
.file-row:focus {
    border-color: #334155;
    outline: none;
}

.file-row.parent {
    color: #f0a43d;
}

.file-name {
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-directory {
    color: #7dd3fc;
}

.file-regular {
    color: #d8b4fe;
}

.file-meta {
    color: #8491a1;
    font-size: .78rem;
    white-space: nowrap;
}

.file-preview-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.file-preview-header h3 {
    margin: 0 0 .25rem;
}

.file-preview-header small {
    color: #8491a1;
    overflow-wrap: anywhere;
}

.file-preview-actions {
    flex-wrap: nowrap;
    margin: 0;
}

.file-toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin: 0;
}

.file-editor {
    background: #071019;
    border: 1px solid #334155;
    border-radius: .5rem;
    color: #dce5ee;
    display: block;
    font-family: Consolas, "Liberation Mono", monospace;
    font-size: .82rem;
    min-height: 520px;
    resize: vertical;
    white-space: pre;
}

.file-editor-tools {
    display: grid;
    gap: .5rem;
    grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) auto auto auto;
    margin-bottom: .65rem;
}

.file-preview-content {
    background: #071019;
    border: 1px solid #202a35;
    border-radius: .5rem;
    color: #dce5ee;
    font-size: .82rem;
    max-height: 560px;
    overflow: auto;
    padding: .85rem;
    white-space: pre;
}

.file-backup-panel {
    border-top: 1px solid #202a35;
    display: grid;
    gap: .75rem;
    margin-top: .9rem;
    padding-top: .9rem;
}

.file-backup-title {
    display: grid;
    gap: .25rem;
}

.file-backup-title h4 {
    margin: 0;
}

.file-backup-title small {
    color: #8491a1;
}

.file-backup-list {
    display: grid;
    gap: .35rem;
    max-height: 220px;
    overflow: auto;
}

.file-backup-row {
    align-items: center;
    background: #111a24;
    border: 1px solid transparent;
    border-radius: .45rem;
    color: #dce5ee;
    cursor: pointer;
    display: grid;
    gap: .6rem;
    grid-template-columns: 150px 90px 90px minmax(100px, 1fr);
    padding: .5rem .65rem;
    text-align: left;
}

.file-backup-row:hover,
.file-backup-row:focus {
    border-color: #334155;
    outline: none;
}

.file-backup-preview {
    display: grid;
    gap: .5rem;
}

@media (max-width: 1100px) {
    .file-browser-layout {
        grid-template-columns: 1fr;
    }

    .file-editor-tools {
        grid-template-columns: 1fr;
    }
}

.webhook-template {
    display: block;
    margin: .55rem 0 .7rem;
    min-height: 96px;
    resize: vertical;
}

.webhook-rule-list {
    display: grid;
    gap: .45rem;
    margin-top: 1.1rem;
}

.webhook-rule {
    align-items: center;
    background: #0d141c;
    border: 1px solid #202a35;
    border-radius: .48rem;
    display: flex;
    gap: .8rem;
    justify-content: space-between;
    padding: .7rem .8rem;
}

.webhook-rule small {
    color: #8793a4;
    display: block;
    font-size: .77rem;
    margin-top: .25rem;
}

.bridge-rule-list {
    display: grid;
    gap: .75rem;
}

.bridge-rule {
    background: #0d141c;
    border: 1px solid #202a35;
    border-radius: .55rem;
    display: grid;
    gap: .75rem;
    grid-template-columns: minmax(170px, 1.2fr) minmax(120px, .55fr) minmax(170px, .7fr) minmax(260px, 2fr);
    padding: .85rem;
}

.bridge-rule strong,
.bridge-rule small {
    display: block;
}

.bridge-rule small {
    color: #8793a4;
    font-size: .77rem;
    margin-top: .25rem;
}

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

.webhook-mirror {
    background: #0d141c;
    border: 1px solid #293542;
    border-radius: .55rem;
    margin-top: 1rem;
    padding: .9rem;
}

.webhook-mirror h3 {
    font-size: .9rem;
    margin: 0 0 .7rem;
}

.incident-table {
    margin-top: .8rem;
}

.mod-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(500px, 1fr) 390px;
}

.field-note {
    font-size: .8rem;
    margin: .35rem 0 0;
}

.notes-input {
    min-height: 76px;
}

.message-template {
    display: block;
    margin: .45rem 0 .35rem;
    min-height: 70px;
    resize: vertical;
}

.path-picker-row {
    align-items: center;
    display: flex;
    gap: .55rem;
}

.path-picker-row input {
    flex: 1;
}

.path-picker-row .button {
    flex: none;
}

.hook-preview code {
    overflow-wrap: anywhere;
}

.hook-warning {
    margin: .7rem 0;
}

.mod-config-panel code {
    color: #efb43e;
}

.local-servermods-settings {
    background: #101821;
    border: 1px solid var(--border);
    border-radius: .55rem;
    margin: 1rem 0 1.2rem;
    padding: 1rem;
}

.local-servermods-settings h3 {
    margin: 0 0 .85rem;
}

.local-servermods-settings .details {
    margin: 1rem 0;
}

.mod-add-row {
    display: flex;
    gap: .55rem;
    margin: 1rem 0;
}

.mod-add-row select {
    flex: 1;
}

.mod-picker {
    display: grid;
    gap: .65rem;
    margin: .75rem 0 1rem;
}

.mod-search {
    width: 100%;
}

.mod-results {
    border: 1px solid var(--border);
    border-radius: .45rem;
    max-height: 18rem;
    overflow-y: auto;
}

.mod-result {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: .7rem;
    padding: .6rem .7rem;
}

.mod-result:last-child {
    border-bottom: 0;
}

.mod-result input {
    flex: none;
    width: auto;
}

.mod-result span,
.mod-result small {
    display: block;
}

.mod-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mod-list li {
    align-items: center;
    border-top: 1px solid #1f2833;
    display: flex;
    gap: .65rem;
    justify-content: space-between;
    padding: .75rem 0;
}

.assigned-mod-card small {
    color: #8793a4;
    font-size: .78rem;
}

.mod-state {
    border-radius: 999px;
    flex: none;
    font-size: .73rem;
    font-weight: 600;
    padding: .2rem .48rem;
}

.mod-state.current {
    background: #173629;
    color: #55d38f;
}

.mod-state.pending {
    background: #442c17;
    color: #efb43e;
}

.assigned-mod-card {
    background: #101821;
    border: 1px solid var(--border);
    border-radius: .5rem;
    margin-bottom: .55rem;
    padding: .7rem !important;
}

.assigned-mod-group {
    border-top: 1px solid var(--border);
    margin-top: 1rem;
    padding-top: 1rem;
}

.jump-target {
    scroll-margin-top: 1rem;
}

.assigned-mod-group h3 {
    align-items: center;
    display: flex;
    gap: .5rem;
    margin: 0 0 .35rem;
}

.group-count {
    background: #1d2a38;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #b8c3d4;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
    padding: .2rem .5rem;
}

.assigned-mod-actions {
    flex: none;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.usage-toggle {
    min-width: 7.5rem;
}

.compact-copy {
    font-size: .78rem;
    margin: .35rem 0 0;
}

.mod-toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: 1rem;
}

.assigned-mod-body {
    min-width: 0;
}

.assigned-mod-body strong,
.assigned-mod-body .folder-name {
    display: block;
}

.assigned-mod-body .folder-name {
    margin: .15rem 0 .45rem;
}

.mod-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.mod-tags span {
    background: #1a2430;
    border-radius: 999px;
    color: #9faabc;
    font-size: .72rem;
    padding: .2rem .45rem;
}

.mod-tags .mod-state {
    font-weight: 600;
}

.mod-list li:first-child {
    border-top: 0;
}

.mod-list small {
    color: #8793a4;
    display: block;
    font-size: .8rem;
    margin-top: .18rem;
}

.runtime-details {
    grid-template-columns: max-content minmax(0, 1fr);
    margin-top: 1.2rem;
    max-width: 640px;
}

.rcon-status {
    grid-template-columns: max-content minmax(0, 1fr);
}

.rcon-actions {
    flex-wrap: wrap;
    margin-top: .8rem;
}

.rcon-table {
    overflow-x: auto;
}

.rcon-sensitive {
    color: #9faabc;
    font-family: Consolas, "Courier New", monospace;
    font-size: .78rem;
    max-width: 18rem;
    overflow-wrap: anywhere;
}

.rcon-response {
    background: #0c1219;
    border: 1px solid #293542;
    border-radius: .5rem;
    margin-top: 1rem;
    padding: .85rem;
}

.rcon-response h3 {
    font-size: .92rem;
    margin: 0;
}

.rcon-response pre {
    color: #dce6f0;
    margin: .75rem 0 0;
    max-height: 22rem;
    overflow: auto;
    white-space: pre-wrap;
}

.settings-panel {
    max-width: 1040px;
}

.settings-nav {
    margin-bottom: 1rem;
}

.settings-panel .details {
    gap: .85rem 2rem;
    grid-template-columns: minmax(160px, 230px) minmax(0, 1fr);
    margin-top: 1.2rem;
}

.settings-panel .details dt {
    min-width: 0;
}

.settings-panel .details dd {
    line-height: 1.45;
    min-width: 0;
}

.settings-panel .setting-grid {
    margin-bottom: 1.25rem;
}

.settings-panel .detail-actions {
    margin-top: 1.3rem;
}

.steam-settings {
    margin-top: 0;
}

.steam-details {
    margin-top: 1.3rem;
}

.steam-actions {
    margin-top: 1.2rem;
}

.checkbox-setting {
    align-items: center;
    display: flex !important;
    gap: .6rem;
}

.checkbox-setting input {
    width: auto;
}

.toggle-list {
    display: grid;
    gap: .75rem;
    margin-bottom: 1.4rem;
}

.toggle-list label {
    align-items: center;
    display: flex;
    gap: .65rem;
    margin: 0;
}

.toggle-list input {
    width: auto;
}

.setting-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    margin-bottom: 1.25rem;
}

.setting-grid label {
    display: grid;
    gap: .45rem;
    margin: 0;
}

.map-tracker-panel {
    margin-top: 1.25rem;
}

.tracker-list {
    display: grid;
    gap: .85rem;
    margin: 1rem 0;
}

.tracker-card {
    background: rgba(15, 23, 42, .55);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: grid;
    gap: .85rem;
    padding: 1rem;
}

.tracker-card-main {
    display: grid;
    gap: .85rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.tracker-card .wide {
    display: grid;
    gap: .45rem;
}

.tracker-table {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.tracker-table-head,
.tracker-table-row {
    align-items: center;
    display: grid;
    gap: .75rem;
    grid-template-columns: 80px 110px 120px 130px minmax(130px, 1fr) minmax(180px, 2fr) auto;
    padding: .65rem .8rem;
}

.tracker-table-head {
    background: rgba(15, 23, 42, .78);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tracker-table-row {
    background: rgba(15, 23, 42, .42);
    border-top: 1px solid var(--border);
}

.tracker-classnames {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tracker-color-swatch {
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    display: inline-block;
    height: .85rem;
    margin-right: .4rem;
    vertical-align: -.1rem;
    width: .85rem;
}

.tracker-editor-row {
    background: rgba(15, 23, 42, .62);
    border-top: 1px solid var(--border);
    display: grid;
    gap: .85rem;
    padding: 1rem;
}

.tracker-editor-row .wide {
    display: grid;
    gap: .45rem;
}

.live-map-controls {
    background: rgba(15, 23, 42, .45);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: grid;
    gap: .85rem;
    margin: 1rem 0;
    padding: 1rem;
}

.live-map-layer-list,
.live-map-filter-row {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
}

.live-map-layer-list label {
    align-items: center;
    display: flex;
    gap: .45rem;
}

.live-map-filter-row label {
    display: grid;
    gap: .35rem;
    min-width: 220px;
}

.admin-marker-panel {
    margin: 1rem 0;
}

.admin-marker-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.admin-marker-list {
    display: grid;
    gap: .6rem;
    margin-top: 1rem;
}

.admin-marker-row {
    align-items: center;
    background: rgba(15, 23, 42, .45);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: grid;
    gap: .75rem;
    grid-template-columns: auto 1fr auto;
    padding: .75rem;
}

.admin-marker-row small {
    color: var(--muted);
    display: block;
}

.admin-marker-dot {
    border-radius: 999px;
    display: inline-block;
    height: .85rem;
    width: .85rem;
}

.live-map-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .65rem;
}

.live-map-action {
    background: #1f2937;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e5e7eb;
    cursor: pointer;
    font-size: .78rem;
    padding: .25rem .45rem;
}

.live-map-action:hover {
    background: #334155;
}

.live-map-action-danger {
    background: #3c2025;
    border-color: #7f1d1d;
    color: #fecaca;
}

.live-map-icon {
    background: transparent;
    border: 0;
}

.live-map-icon-badge {
    align-items: center;
    background: var(--marker-color, #a78bfa);
    border: 2px solid rgba(255, 255, 255, .88);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .38);
    color: #020617;
    display: flex;
    height: 28px;
    justify-content: center;
    line-height: 1;
    width: 28px;
}

.live-map-icon-badge svg {
    fill: none;
    height: 18px;
    stroke: #020617;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.1;
    width: 18px;
}

.level {
    border-radius: 999px;
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    padding: .25rem .55rem;
}

.level.info {
    background: #183149;
    color: #70b9ef;
}

.level.warning {
    background: #3f2e18;
    color: #f3be55;
}

.level.error, .level.critical {
    background: #3c2025;
    color: #f27878;
}

.log-actions {
    align-items: center;
}

.log-table {
    overflow-x: auto;
}

.log-search-row {
    align-items: center;
    display: flex;
    gap: .65rem;
    margin: .8rem 0 1rem;
}

.log-search-row input {
    flex: 1;
}

.log-filter-row th {
    padding-top: .25rem;
}

.log-filter-row input,
.log-filter-row select {
    font-size: .78rem;
    min-width: 7rem;
    padding: .4rem .45rem;
    width: 100%;
}

.log-details {
    color: #8793a4;
    max-width: 28rem;
    overflow-wrap: anywhere;
}

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

.map-panel .details-list {
    margin-top: 1rem;
}

.map-panel {
    grid-column: 1 / -1;
}

.map-panel > form,
.map-panel > .subpanel,
.map-panel > .details {
    margin-top: 1.25rem;
}

.map-import-panel {
    margin: 1.25rem 0;
}

.map-import-grid {
    margin-top: .8rem;
}

.map-import-grid .wide {
    grid-column: 1 / -1;
}

.map-import-actions {
    margin-top: .8rem;
}

.map-pbo-candidate-list {
    display: grid;
    gap: .5rem;
    margin-top: .75rem;
}

.map-pbo-candidate-list .compact-card {
    align-items: center;
    border: 1px solid #263445;
    border-radius: .55rem;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: .75rem;
}

.map-coordinate-readout {
    align-items: center;
    color: #9fb0c7;
    display: flex;
    gap: .65rem;
    margin: 1rem 0 .6rem;
}

.map-coordinate-readout strong {
    color: #f4f7fb;
}

.map-live-layout {
    align-items: stretch;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 480px);
    height: clamp(520px, calc(100vh - 18rem), 980px);
}

.map-chat-panel {
    background: rgba(15, 23, 42, .72);
    border: 1px solid #253143;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.map-chat-panel .panel-title {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    padding: .7rem .9rem;
}

.map-chat-list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: .1rem;
    font-size: .82rem;
    overflow-y: auto;
    padding: .65rem .8rem;
}

.map-chat-entry {
    align-items: baseline;
    border-bottom: 1px solid rgba(51, 65, 85, .45);
    display: grid;
    gap: .55rem;
    grid-template-columns: 4.4rem minmax(0, 1fr);
    padding: .22rem .15rem;
}

.map-chat-entry p {
    color: #cfe0ff;
    margin: 0;
    overflow-wrap: anywhere;
}

.map-chat-meta {
    display: contents;
}

.map-chat-meta time {
    color: #93a4bb;
    font-size: .64rem;
    white-space: nowrap;
}

.map-chat-message {
    font-weight: 600;
}

.map-chat-message.chat {
    color: #60a5fa;
}

.map-chat-message.join,
.map-chat-message.loaded {
    color: #34d399;
}

.map-chat-message.left {
    color: #fbbf24;
}

.map-chat-message.killed {
    color: #fb7185;
}

.server-map {
    background: #0a111b;
    border: 1px solid #253143;
    border-radius: 12px;
    height: min(62vh, 620px);
    min-height: 420px;
    overflow: hidden;
    width: 100%;
}

.server-map-large {
    height: 100%;
    max-height: 980px;
    min-height: 0;
}

.map-grid-placeholder {
    background:
        linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px),
        #101a27;
    background-size: 64px 64px;
}

@media (max-width: 1120px) {
    .map-live-layout {
        grid-template-columns: 1fr;
    }

    .server-layout, .mod-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .shell {
        display: block;
    }

    .sidebar {
        padding: .85rem 1rem;
        width: auto;
    }

    .brand {
        margin-bottom: .75rem;
    }

    .navigation {
        display: flex;
        overflow-x: auto;
    }

    .sidebar-footer {
        display: none;
    }

    .workspace {
        padding: 1.25rem 1rem;
    }

    .page-header {
        display: block;
    }

    .page-header .button {
        margin-top: 1rem;
    }

    .stats, .grid-panels {
        grid-template-columns: 1fr 1fr;
    }

    .server-table {
        overflow-x: auto;
    }
}

@media (max-width: 540px) {
    .stats, .grid-panels {
        grid-template-columns: 1fr;
    }

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