:root {
  color-scheme: light;
  --brand-navy: #041c35;
  --brand-navy-2: #09223d;
  --brand-navy-3: #112d49;
  --primary: #0169fb;
  --primary-strong: #0057d6;
  --primary-accessible: #004dbd;
  --primary-soft: #e7f2ff;
  --primary-rgb: 1, 105, 251;
  --cyan: #01d6f9;
  --cyan-strong: #008eb4;
  --cyan-soft: #e5fbff;
  --cyan-rgb: 1, 214, 249;
  --accent: #02e778;
  --accent-strong: #007f4a;
  --accent-soft: #e4fff1;
  --accent-rgb: 2, 231, 120;
  --brand-gradient: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 52%, var(--accent) 100%);
  --brand-action-gradient: linear-gradient(135deg, var(--primary) 0%, var(--cyan-strong) 52%, var(--accent-strong) 100%);
  --success: #008f54;
  --warning: #f18701;
  --danger: #df2636;
  --background: #f2f7fb;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-subtle: #f5f9fd;
  --surface-muted: #edf4fb;
  --text: #081727;
  --text-strong: #04111f;
  --muted: #63758c;
  --muted-strong: #3d5068;
  --border: #d8e6f2;
  --border-strong: #bed0e3;
  --console: var(--brand-navy);
  --shadow: 0 16px 42px rgba(4, 28, 53, .09);
  --shadow-soft: 0 1px 2px rgba(4, 28, 53, .07);
  --sidebar-bg: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-2) 58%, #063526 100%);
  --sidebar-border: rgba(255, 255, 255, .1);
  --sidebar-text: #d8e8fb;
  --sidebar-muted: #8a9bb3;
  --sidebar-hover: rgba(255, 255, 255, .08);
  --sidebar-active: var(--brand-gradient);
  --focus-ring: rgba(1, 105, 251, .2);
  --radius: 8px;
  --sidebar-width: 236px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #2f9cff;
  --primary-strong: #8fd2ff;
  --primary-soft: rgba(1, 105, 251, .18);
  --primary-rgb: 47, 156, 255;
  --cyan: #21e5ff;
  --cyan-strong: #9af5ff;
  --cyan-soft: rgba(1, 214, 249, .16);
  --cyan-rgb: 33, 229, 255;
  --accent: #35f28d;
  --accent-strong: #90ffc4;
  --accent-soft: rgba(2, 231, 120, .14);
  --accent-rgb: 53, 242, 141;
  --brand-action-gradient: linear-gradient(135deg, #147cff 0%, #008eb4 52%, #007f4a 100%);
  --success: #4df09a;
  --warning: #ffb24d;
  --danger: #ff6670;
  --background: #030b16;
  --surface: #071426;
  --surface-elevated: #0b1f38;
  --surface-subtle: #102a49;
  --surface-muted: #173451;
  --text: #edf6ff;
  --text-strong: #ffffff;
  --muted: #9fb4cc;
  --muted-strong: #cfdeee;
  --border: #1e3a5a;
  --border-strong: #315779;
  --console: #030914;
  --shadow: 0 18px 48px rgba(0, 0, 0, .36);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .28);
  --sidebar-bg: linear-gradient(180deg, #020812 0%, var(--brand-navy) 62%, #04271c 100%);
  --sidebar-border: rgba(255, 255, 255, .08);
  --sidebar-text: #dbeeff;
  --sidebar-muted: #8a9bb3;
  --sidebar-hover: rgba(255, 255, 255, .07);
  --focus-ring: rgba(47, 156, 255, .24);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --primary: #2f9cff;
    --primary-strong: #8fd2ff;
    --primary-soft: rgba(1, 105, 251, .18);
    --primary-rgb: 47, 156, 255;
    --cyan: #21e5ff;
    --cyan-strong: #9af5ff;
    --cyan-soft: rgba(1, 214, 249, .16);
    --cyan-rgb: 33, 229, 255;
    --accent: #35f28d;
    --accent-strong: #90ffc4;
    --accent-soft: rgba(2, 231, 120, .14);
    --accent-rgb: 53, 242, 141;
    --brand-action-gradient: linear-gradient(135deg, #147cff 0%, #008eb4 52%, #007f4a 100%);
    --success: #4df09a;
    --warning: #ffb24d;
    --danger: #ff6670;
    --background: #030b16;
    --surface: #071426;
    --surface-elevated: #0b1f38;
    --surface-subtle: #102a49;
    --surface-muted: #173451;
    --text: #edf6ff;
    --text-strong: #ffffff;
    --muted: #9fb4cc;
    --muted-strong: #cfdeee;
    --border: #1e3a5a;
    --border-strong: #315779;
    --console: #030914;
    --shadow: 0 18px 48px rgba(0, 0, 0, .36);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .28);
    --sidebar-bg: linear-gradient(180deg, #020812 0%, var(--brand-navy) 62%, #04271c 100%);
    --sidebar-border: rgba(255, 255, 255, .08);
    --sidebar-text: #dbeeff;
    --sidebar-muted: #8a9bb3;
    --sidebar-hover: rgba(255, 255, 255, .07);
    --focus-ring: rgba(47, 156, 255, .24);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--background); color: var(--text); }
body { font-size: 15px; line-height: 1.45; text-rendering: optimizeLegibility; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(var(--primary-rgb), .038) 1px, transparent 1px),
    linear-gradient(180deg, rgba(var(--cyan-rgb), .032) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 72%);
}
button, input, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary-strong); text-decoration: none; }
a:hover { color: var(--primary); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: 27px; line-height: 1.2; letter-spacing: 0; color: var(--text-strong); }
h2 { margin: 0; font-size: 19px; line-height: 1.25; letter-spacing: 0; color: var(--text-strong); }
h3 { font-size: 16px; }
small { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:where(a, button, input, select):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: 0 0 0 5px var(--focus-ring); }
::selection { color: white; background: var(--primary); }

.app-shell { min-height: 100vh; background: var(--background); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border); display: flex; flex-direction: column; z-index: 20; box-shadow: 18px 0 50px rgba(4, 17, 35, .12); }
.brand { height: 148px; margin: 0 16px; border-bottom: 1px solid var(--sidebar-border); display: grid; place-items: center; overflow: hidden; }
.brand img { width: 132px; height: 132px; border-radius: 8px; object-fit: contain; filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .26)) drop-shadow(0 0 18px rgba(var(--cyan-rgb), .18)); }
.primary-nav { padding: 16px 12px; display: grid; gap: 5px; }
.primary-nav a { min-height: 46px; padding: 0 14px; border-radius: 8px; display: flex; align-items: center; gap: 13px; color: var(--sidebar-text); font-size: 15px; font-weight: 600; outline: none; }
.primary-nav a:hover { background: var(--sidebar-hover); color: #fff; }
.primary-nav a:focus-visible { box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .28); }
.primary-nav a.active { color: #fff; background: var(--sidebar-active); box-shadow: 0 12px 28px rgba(1, 105, 251, .25); }
.primary-nav .ui-icon { width: 20px; height: 20px; }
.version { margin-top: auto; padding: 20px 24px 30px; color: var(--sidebar-muted); font-size: 13px; }
.workspace { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { height: 72px; padding: 0 28px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent); display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 15; backdrop-filter: blur(16px); }
.topbar-title { min-width: 0; font-size: 23px; font-weight: 750; margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-spacer { flex: 1; min-width: 8px; }
.dropdown-control { position: relative; z-index: 30; flex: 0 0 auto; display: inline-flex; }
.dropdown-scrim { position: fixed; inset: 0; z-index: 35; border: 0; background: transparent; cursor: default; }
.dropdown-trigger { min-width: 118px; height: 40px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--surface-elevated); color: var(--muted-strong); box-shadow: var(--shadow-soft); cursor: pointer; white-space: nowrap; outline: none; transition: border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease; }
.language-trigger { width: 108px; min-width: 108px; }
.theme-trigger { width: 146px; min-width: 146px; }
.theme-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.dropdown-trigger:hover, .dropdown-trigger[aria-expanded="true"], .dropdown-trigger[aria-expanded="True"] { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); }
.dropdown-trigger:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.dropdown-trigger .ui-icon { width: 18px; height: 18px; }
.dropdown-trigger .ui-icon:last-child { width: 15px; height: 15px; margin-left: 2px; transition: transform .16s ease; }
.dropdown-trigger[aria-expanded="true"] .ui-icon:last-child,
.dropdown-trigger[aria-expanded="True"] .ui-icon:last-child { transform: rotate(180deg); }
.dropdown-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; min-width: 196px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; display: grid; gap: 2px; background: var(--surface-elevated); box-shadow: var(--shadow); }
.language-menu { min-width: 212px; }
.theme-menu { min-width: 196px; }
.dropdown-option { width: 100%; min-height: 42px; padding: 0 10px; border: 0; border-radius: 6px; display: grid; grid-template-columns: 28px minmax(0, 1fr) 18px; align-items: center; gap: 10px; background: transparent; color: var(--text); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; outline: none; }
.dropdown-option:hover, .dropdown-option:focus-visible { background: var(--surface-subtle); }
.dropdown-option.active { color: var(--primary-strong); background: var(--primary-soft); font-weight: 700; }
.dropdown-option .ui-icon { width: 18px; height: 18px; }
.dropdown-option .ui-icon:last-child { justify-self: end; color: var(--accent-strong); }
.dropdown-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.option-kicker { width: 28px; height: 22px; border-radius: 5px; display: inline-grid; place-items: center; color: var(--primary-strong); background: var(--primary-soft); font-size: 11px; font-weight: 800; }
.profile-button { min-height: 42px; padding: 0 8px 0 3px; border: 0; border-radius: 8px; background: none; display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--muted-strong); font-size: 14px; font-weight: 600; outline: none; }
.profile-button:hover, .profile-button:focus-visible { background: var(--surface-subtle); }
.profile-button .ui-icon { width: 16px; height: 16px; }
.avatar { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--brand-gradient); color: white; font-size: 16px; font-weight: 800; }
.avatar.secondary { background: var(--primary-soft); color: var(--primary-strong); }
.page-content { padding: 22px 20px 32px; max-width: 1680px; margin: 0 auto; }

.ui-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex: 0 0 auto; }
.icon-button { width: 42px; height: 42px; padding: 0; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 7px; cursor: pointer; }
.icon-button:hover { background: var(--surface-subtle); }
.icon-button.bordered { border: 1px solid var(--border); background: var(--surface); }
.icon-button.compact { width: 31px; height: 31px; }
.button { min-height: 42px; padding: 0 18px; border-radius: 7px; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; gap: 9px; background: var(--surface-elevated); color: var(--primary-strong); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; outline: none; box-shadow: var(--shadow-soft); }
.button:hover { border-color: var(--primary); background: var(--primary-soft); }
.button:focus-visible, .icon-button:focus-visible { box-shadow: 0 0 0 3px var(--focus-ring); }
.button.primary { color: white; border-color: transparent; background: var(--brand-action-gradient); box-shadow: 0 10px 24px rgba(1, 105, 251, .24); }
.button.primary:hover { filter: brightness(1.02); }
.button.outline { min-width: 160px; background: var(--surface); color: var(--primary-strong); border-color: color-mix(in srgb, var(--primary) 46%, var(--border)); }
.button.quiet { background: var(--surface); }
.button.secondary { background: var(--surface-elevated); color: var(--text); border-color: var(--border-strong); }
.button.secondary:hover { color: var(--primary-strong); background: var(--primary-soft); }
.button:disabled,
.button:disabled:hover,
button:disabled {
  opacity: .52;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

.panel { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.panel-heading { min-height: 60px; padding: 0 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: linear-gradient(180deg, color-mix(in srgb, var(--surface-elevated) 92%, var(--primary-soft)), var(--surface)); }
.panel-heading.stacked { min-height: 120px; padding-top: 21px; padding-bottom: 18px; align-items: flex-start; flex-direction: column; }
.heading-actions { display: flex; gap: 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 14px; }
.dashboard-main { display: grid; gap: 14px; min-width: 0; }
.table-wrap { min-width: 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.data-table th { height: 54px; padding: 0 20px; text-align: left; font-size: 13px; font-weight: 750; color: var(--muted); white-space: nowrap; background: var(--surface-subtle); }
.data-table td { height: 86px; padding: 0 20px; border-top: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:hover td { background: color-mix(in srgb, var(--primary-soft) 56%, transparent); }
.data-table small { display: block; margin-top: 4px; white-space: nowrap; }
.resource-cell, .task-name { display: flex; align-items: center; gap: 14px; color: var(--text); }
.resource-cell > .ui-icon { width: 22px; height: 22px; }
.resource-cell strong, .task-name strong { color: var(--primary-strong); font-weight: 700; }
.agent-version { display: flex; gap: 10px; align-items: flex-start; }
.status-dot { display: inline-block; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; }
.status-dot.success { background: var(--accent-strong); }
.status-dot.warning { background: var(--warning); }
.status-dot.danger { background: var(--danger); }
.state { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.state .ui-icon { width: 22px; height: 22px; }
.state.success, .green-text { color: var(--accent-strong); }
.state.warning { color: var(--warning); }
.state.danger { color: var(--danger); }
.state.primary { color: var(--primary); }
.state-cross { width: 22px; height: 22px; display: inline-grid; place-items: center; border: 1.7px solid currentColor; border-radius: 50%; font-size: 18px; line-height: 1; }
.metric-cell > span { display: block; margin-bottom: 10px; }
.metric-track, .inline-progress, .stat-progress, .task-progress { height: 6px; border-radius: 99px; background: var(--surface-muted); overflow: hidden; }
.metric-track { width: 63px; }
.metric-track span, .inline-progress span, .stat-progress span, .task-progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand-gradient); }
.metric-track span.warning { background: var(--warning); }
.panel-footer { min-height: 59px; padding: 0 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.pagination { display: flex; gap: 9px; }
.pagination button { width: 39px; height: 39px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--muted); }
.pagination button.active { color: white; background: var(--primary); border-color: var(--primary); }
.tasks-panel .data-table td { height: 103px; }
.task-icon { width: 28px; height: 28px; display: grid; place-items: center; }
.task-icon.blue { color: var(--primary); }
.task-icon.danger { color: var(--danger); }
.inline-progress { display: inline-block; width: 95px; margin: 11px 7px 0 0; }
.spinner { width: 19px; height: 19px; border: 2px solid color-mix(in srgb, var(--primary) 22%, var(--surface-muted)); border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.activity-panel { min-width: 0; display: flex; flex-direction: column; }
.activity-panel select, .list-toolbar select, .list-toolbar input, .settings-form select, .settings-form input, .modal input { min-height: 40px; border: 1px solid var(--border); background: var(--surface-elevated); border-radius: 7px; padding: 0 12px; outline: none; }
.activity-panel select:focus, input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.timeline { padding: 8px 18px 0 20px; }
.activity-item { display: grid; grid-template-columns: 28px 1fr; gap: 12px; min-height: 135px; position: relative; }
.activity-item::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 1px; background: var(--border); }
.activity-marker { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: white; z-index: 1; }
.activity-marker .ui-icon { width: 16px; height: 16px; stroke-width: 2.3; }
.activity-item.success .activity-marker { background: var(--accent-strong); }
.activity-item.primary .activity-marker { background: var(--primary); }
.activity-item.warning .activity-marker { background: var(--warning); }
.activity-item time { color: var(--muted); display: block; margin-bottom: 8px; font-size: 13px; }
.activity-item strong { display: block; font-size: 14px; }
.activity-item p { margin: 7px 0 2px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.activity-more { margin: auto 18px 17px; }

.page-heading { min-height: 76px; margin: 2px 4px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-heading p { margin: 0; color: var(--muted); }
.list-panel { overflow: hidden; }
.list-toolbar { min-height: 72px; padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; background: var(--surface-subtle); }
.search-input { min-width: 280px; flex: 1; }
.simple-table-row { min-height: 74px; padding: 12px 22px; display: grid; grid-template-columns: 1.3fr .8fr .5fr 1fr 1fr; align-items: center; gap: 18px; border-top: 1px solid var(--border); }
.simple-table-row:hover:not(.header) { background: color-mix(in srgb, var(--primary-soft) 56%, transparent); }
.simple-table-row.header { min-height: 48px; border-top: 0; background: var(--surface-subtle); font-size: 13px; font-weight: 750; color: var(--muted); }
.simple-table-row small { display: block; }
.simple-table-row.servers-row { grid-template-columns: 1.1fr .9fr .45fr .6fr .85fr auto; }
.game-row { min-height: 92px; padding: 14px 21px; display: grid; grid-template-columns: 50px 1.5fr .8fr .8fr .8fr 22px; align-items: center; gap: 16px; border-top: 1px solid var(--border); color: var(--text); }
.game-row:hover { background: color-mix(in srgb, var(--primary-soft) 58%, transparent); color: var(--text); }
.game-main small { display: block; margin-top: 5px; }
.game-mark { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; font-weight: 800; }
.game-mark.minecraft { color: var(--accent-strong); background: var(--accent-soft); }
.game-mark.satisfactory { color: #c75816; background: color-mix(in srgb, var(--warning) 15%, var(--surface)); }

.game-titlebar { min-height: 88px; padding: 0 2px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.breadcrumbs { margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.breadcrumbs span { padding: 0 10px; }
.game-titlebar h1 { margin: 0; }
.running-label { margin-left: 12px; color: var(--accent-strong); font-size: 16px; font-weight: 600; }
.running-label i { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--accent-strong); }
.game-actions { display: flex; gap: 15px; }
.detail-tabs { height: 47px; border-bottom: 1px solid var(--border); display: flex; gap: 2px; overflow-x: auto; }
.detail-tabs button { padding: 0 15px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); white-space: nowrap; cursor: pointer; }
.detail-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.health-strip { min-height: 85px; margin: 16px 0; padding: 12px 20px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: 8px; background: linear-gradient(90deg, var(--accent-soft), color-mix(in srgb, var(--primary-soft) 36%, transparent)); display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; align-items: center; }
.health-strip > div { display: flex; align-items: center; gap: 14px; min-width: 0; }
.health-strip .ui-icon { width: 28px; height: 28px; color: var(--accent-strong); }
.health-strip strong, .health-strip small, .health-strip em { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-strip strong { font-size: 13px; }
.health-strip small { margin-top: 5px; font-size: 12px; }
.health-strip em { color: var(--accent-strong); font-size: 11px; font-style: normal; }
.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 14px; }
.summary-stats { grid-template-columns: repeat(3, 1fr); }
.stat-card { min-height: 118px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.stat-label { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.stat-label .ui-icon { color: var(--primary); }
.stat-card > strong { display: block; margin: 11px 0 3px 38px; font-size: 24px; font-weight: 600; white-space: nowrap; }
.stat-card > small { margin-left: 38px; }
.stat-progress { margin: 12px 0 0; }
.stat-progress span { background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.game-detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, .95fr); gap: 14px; }
.game-primary-column, .game-side-column { display: grid; align-content: start; gap: 14px; min-width: 0; }
.console-panel { padding: 12px; }
.console-title { padding: 0 0 10px 2px; font-weight: 600; }
.console-title span { color: var(--muted); font-weight: 400; }
.console-panel pre { height: 223px; margin: 0; padding: 15px; border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent); border-radius: 7px; background: var(--console); color: #e8ecf2; overflow: auto; font: 12px/1.4 "Cascadia Mono", Consolas, monospace; }
.console-controls { padding-top: 10px; display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 10px; }
.console-controls input { min-height: 39px; padding: 0 12px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); }
.settings-editor { width: 100%; min-height: 160px; margin: 0 0 12px; padding: 15px; border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent); border-radius: 7px; background: var(--console); color: #e8ecf2; font: 12px/1.4 "Cascadia Mono", Consolas, monospace; resize: vertical; box-sizing: border-box; }
.settings-editor:disabled { opacity: .6; }
.console-controls label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.access-panel { padding: 16px; }
.access-panel h2 { margin-bottom: 13px; font-size: 14px; }
.access-role-group { margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.access-role-group strong { flex-basis: 100%; font-size: 12px; color: var(--muted); font-weight: 600; }
.access-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-elevated); font-size: 12px; }
.access-chip .icon-button { min-width: 18px; min-height: 18px; padding: 0; line-height: 1; }
.access-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.access-grid > div { min-height: 130px; padding: 3px 16px 0; border-right: 1px solid var(--border); display: flex; align-items: flex-start; flex-direction: column; }
.access-grid > div:first-child { padding-left: 0; }
.access-grid > div:last-child { border: 0; }
.access-grid span { color: var(--muted); font-size: 11px; }
.access-grid strong { margin-top: 10px; font-size: 19px; }
.access-grid .button { min-height: 33px; margin-top: auto; padding: 0 12px; font-size: 11px; }
.active-task-card { padding: 16px; }
.active-task-title { display: flex; justify-content: space-between; }
.active-task-title h2 { font-size: 14px; }
.active-task-card h3 { margin: 12px 0 8px; }
.task-progress span { background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.active-task-card ol { padding: 11px 0 0 26px; margin: 0; list-style: none; }
.active-task-card li { min-height: 31px; color: var(--muted); position: relative; }
.active-task-card li::before { content: ""; position: absolute; width: 15px; height: 15px; left: -24px; top: 2px; border: 1.5px solid var(--border-strong); border-radius: 50%; }
.active-task-card li.done::before { content: "✓"; display: grid; place-items: center; background: var(--accent-strong); color: white; border-color: var(--accent-strong); font-size: 10px; }
.active-task-card li.current::before { border-color: var(--primary); border-top-color: transparent; }
.active-task-card time { float: right; font-size: 11px; }
.task-card-footer { margin-top: 7px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.info-panel { padding: 16px; }
.info-panel h2 { font-size: 14px; margin-bottom: 12px; }
.info-panel dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 0; font-size: 11px; }
.info-panel dt { color: var(--muted); }
.info-panel dd { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.align-right { float: right; min-height: 32px; margin-top: 12px; font-size: 11px; }
.mobile-brand, .mobile-only, .mobile-nav { display: none; }

.permissions-grid { display: grid; grid-template-columns: minmax(340px, .8fr) minmax(420px, 1.2fr); gap: 16px; }
.permissions-grid h2, .settings-form h2, .list-panel > h2 { padding: 20px 22px; border-bottom: 1px solid var(--border); }
.identity-row { min-height: 74px; padding: 12px 20px; display: grid; grid-template-columns: 45px 1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.identity-row.selected { background: var(--primary-soft); }
.permission-editor { padding-bottom: 20px; }
.permission-block { padding: 20px 22px; border-bottom: 1px solid var(--border); display: grid; gap: 12px; }
.permission-block strong { margin-bottom: 4px; }
.permission-editor > .button { margin: 20px 22px 0; }
.plugin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.plugin-card { min-height: 160px; padding: 22px; display: grid; grid-template-columns: 52px 1fr auto; grid-template-rows: 1fr auto; gap: 10px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.plugin-card:hover { border-color: color-mix(in srgb, var(--primary) 42%, var(--border)); }
.plugin-card h2 { margin-bottom: 8px; }
.plugin-card p { color: var(--muted); }
.plugin-card code { color: var(--muted); }
.plugin-card .button { grid-column: 3; }
.version-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.version-list li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.version-list li strong { color: var(--text); }
.settings-layout { display: grid; grid-template-columns: 230px minmax(0, 760px); gap: 18px; }
.settings-nav { display: grid; align-content: start; gap: 4px; }
.settings-nav button, .settings-nav a { min-height: 44px; padding: 0 14px; border: 0; border-radius: 7px; background: none; color: var(--muted-strong); display: flex; align-items: center; text-align: left; cursor: pointer; }
.settings-nav button:hover:not(:disabled), .settings-nav a:hover { background: var(--surface-subtle); color: var(--text); }
.settings-nav button.active { color: var(--primary-strong); background: var(--primary-soft); }
.settings-nav button:disabled { color: var(--muted); }
.settings-form { padding-bottom: 22px; }
.settings-form fieldset, .settings-form > label { margin: 20px 22px; padding: 0; border: 0; display: grid; gap: 9px; }
.settings-form legend { margin-bottom: 10px; font-weight: 600; }
.settings-form > .button { margin-left: 22px; }
.settings-provider-list { margin-top: 22px; border-top: 1px solid var(--border); }
.schedule-fields { margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 7px; }
.schedule-days { display: flex; flex-wrap: wrap; gap: 10px; }
.schedule-days label { margin: 0; display: inline-flex; align-items: center; gap: 5px; }
.segmented { display: inline-flex; width: fit-content; max-width: 100%; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-elevated); box-shadow: var(--shadow-soft); }
.segmented button { min-height: 40px; padding: 0 16px; border: 0; border-right: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: transparent; color: var(--muted-strong); cursor: pointer; white-space: nowrap; }
.segmented button:last-child { border-right: 0; }
.segmented button:hover:not(.active) { background: var(--surface-subtle); color: var(--text); }
.segmented button.active { color: white; background: var(--brand-action-gradient); }
.theme-segmented .ui-icon { width: 17px; height: 17px; }
.theme-segmented button { min-width: 118px; }
.language-segmented .ui-icon { width: 17px; height: 17px; }
.language-segmented button { min-width: 100px; }
.toggle-row { grid-template-columns: 1fr auto !important; align-items: center; }
.toggle-row small { display: block; }
.audit-list { padding: 20px; }
.task-list-row { grid-template-columns: 36px 1.4fr .8fr .4fr auto; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(8, 18, 34, .52); backdrop-filter: blur(4px); }
.modal { width: min(480px, calc(100vw - 32px)); padding: 22px; background: var(--surface-elevated); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 24px 70px rgba(0,0,0,.24); }
.modal-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal label { display: grid; gap: 8px; margin: 15px 0; font-weight: 600; }
.form-hint { color: var(--muted); font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.empty-state { min-height: 65vh; display: grid; place-items: center; align-content: center; text-align: center; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 42%) 1fr; background: var(--background); }
.login-brand-panel { position: relative; overflow: hidden; padding: 54px 64px; display: flex; flex-direction: column; justify-content: space-between; color: white; background: linear-gradient(155deg, #030b16 0%, var(--brand-navy) 44%, var(--brand-navy-2) 68%, #043526 100%); }
.login-brand-panel::before { content: ""; position: absolute; inset: 0; opacity: .24; background: linear-gradient(90deg, rgba(var(--primary-rgb), .6) 1px, transparent 1px), linear-gradient(180deg, rgba(var(--cyan-rgb), .48) 1px, transparent 1px); background-size: 42px 42px; }
.login-brand-panel::after { content: ""; position: absolute; inset: auto 0 0; height: 9px; background: var(--brand-gradient); }
.login-brand-panel > * { position: relative; z-index: 1; }
.login-brand-panel > img { width: 126px; height: 126px; object-fit: contain; border-radius: 8px; filter: drop-shadow(0 18px 34px rgba(0, 0, 0, .32)) drop-shadow(0 0 24px rgba(var(--cyan-rgb), .22)); }
.login-brand-panel h1 { max-width: 620px; margin: 18px 0 22px; color: #fff; font-size: 52px; line-height: 1.04; letter-spacing: 0; }
.login-brand-panel p:not(.eyebrow) { max-width: 560px; color: rgba(255,255,255,.82); font-size: 18px; line-height: 1.55; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.primary-text { color: var(--primary-strong); }
.login-version { color: rgba(255,255,255,.64); font-size: 13px; }
.login-form-panel { padding: 40px; display: grid; place-items: center; }
.login-card { width: min(430px, 100%); }
.login-card h2 { margin: 10px 0 9px; font-size: 34px; letter-spacing: 0; }
.login-intro, .login-footnote { color: var(--muted); line-height: 1.55; }
.login-card form { margin-top: 30px; }
.login-card label { margin: 17px 0; display: grid; gap: 8px; font-weight: 650; }
.login-card input { min-height: 48px; padding: 0 13px; color: var(--text); background: var(--surface-elevated); border: 1px solid var(--border); border-radius: 7px; font: inherit; outline: none; }
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.login-submit { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; }
.login-error { margin: 0 0 14px; padding: 11px 13px; color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border)); border-radius: 7px; }
.login-divider { margin: 24px 0; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.login-footnote { margin-top: 24px; font-size: 12px; text-align: center; }
.login-local { margin-top: 24px; }
.login-local > summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.login-mobile-brand { display: none; }

@media (max-width: 1250px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .activity-panel { min-height: 500px; }
  .activity-panel .timeline { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .activity-panel .activity-item { min-height: 120px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .health-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1100px) {
  :root { --sidebar-width: 220px; }
  .topbar { padding: 0 20px; gap: 10px; }
  .profile-button > span:not(.avatar) { display: none; }
  .profile-button > .ui-icon { display: none; }
  .theme-trigger { width: 136px; min-width: 136px; }
}

@media (max-width: 920px) and (min-width: 821px) {
  .topbar { padding: 0 16px; gap: 8px; }
  .topbar-title { max-width: 18ch; font-size: 21px; }
  .theme-trigger { width: 84px; min-width: 84px; }
  .theme-trigger span { display: none; }
}

@media (max-width: 820px) {
  body { padding-bottom: 78px; }
  .sidebar, .topbar, .desktop-only, .detail-tabs { display: none !important; }
  .workspace { margin-left: 0; }
  .page-content { padding: 16px; }
  .mobile-only, .mobile-brand { display: block; }
  .mobile-nav { position: fixed; inset: auto 0 0; height: 76px; padding: 7px 18px max(7px, env(safe-area-inset-bottom)); z-index: 30; background: color-mix(in srgb, var(--surface) 96%, transparent); border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(4, 1fr); backdrop-filter: blur(18px); }
  .mobile-nav a { color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 12px; }
  .mobile-nav a.active { color: var(--primary); }
  .mobile-nav .ui-icon { width: 25px; height: 25px; }
  .dashboard-grid { display: block; }
  .dashboard-main { gap: 12px; }
  .activity-panel { margin-top: 12px; }
  .activity-panel .timeline { display: block; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .list-toolbar { flex-direction: column; }
  .search-input { min-width: 0; width: 100%; }
  .game-row { grid-template-columns: 48px 1fr auto; }
  .game-row > :nth-child(4), .game-row > :nth-child(5) { display: none; }
  .simple-table-row { grid-template-columns: 1fr auto; }
  .simple-table-row > :nth-child(n+3) { display: none; }
  .permissions-grid, .plugin-grid, .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { grid-auto-flow: column; overflow-x: auto; }
  .settings-nav button { white-space: nowrap; }
  .theme-segmented { width: 100%; }
  .theme-segmented button { flex: 1 1 0; min-width: 0; padding: 0 10px; }
  .language-segmented { width: 100%; }
  .language-segmented button { flex: 1 1 0; min-width: 0; padding: 0 10px; }

  .game-titlebar { min-height: 133px; display: grid; grid-template-columns: 125px 1fr; gap: 8px 17px; }
  .mobile-brand { grid-row: 1; grid-column: 1; }
  .mobile-brand img { width: 116px; height: 100px; object-fit: contain; }
  .game-titlebar > div:nth-child(2) { grid-column: 2; }
  .breadcrumbs { display: none; }
  .game-titlebar h1 { font-size: 24px; }
  .running-label { display: block; margin: 9px 0 0; font-size: 18px; }
  .game-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .game-actions .button { height: 53px; min-width: 0; font-size: 16px; }
  .game-actions .icon-button { display: none; }
  .health-strip { min-height: 300px; margin: 15px 0 18px; padding: 10px 20px; display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .health-strip > div { min-height: 89px; border-bottom: 1px solid var(--border); }
  .health-strip > div:last-child { border: 0; }
  .health-strip > div:nth-child(3) { order: 2; }
  .health-strip > div:nth-child(4) { order: 3; }
  .health-strip > div:nth-child(5) { order: 1; }
  .health-strip em { margin-left: auto; font-size: 15px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; overflow-x: auto; }
  .stat-card { min-width: 145px; min-height: 150px; padding: 16px 15px; }
  .stat-card > strong { margin: 18px 0 4px; font-size: 23px; }
  .stat-card > small { margin-left: 0; font-size: 15px; }
  .game-detail-grid { display: block; }
  .active-task-card { padding: 20px; }
  .active-task-card h2, .active-task-card h3 { font-size: 19px; }
  .active-task-card li { min-height: 39px; font-size: 15px; }
  .task-card-footer { font-size: 14px; }
  .mobile-audit { margin-top: 18px; padding: 20px; }
  .mobile-audit h2 { margin-bottom: 20px; }
  .mobile-audit .activity-item { min-height: 140px; }
  .mobile-desktop-note { margin: 18px 0 8px; padding: 15px; border-radius: 7px; color: var(--muted); background: var(--primary-soft); text-align: center; }
  .mobile-desktop-note .ui-icon { margin-right: 8px; color: var(--primary); }
  .login-shell { display: block; padding: 28px 20px; }
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: calc(100vh - 56px); padding: 0; }
  .login-mobile-brand { display: block; margin-bottom: 28px; }
  .login-mobile-brand img { width: 96px; height: 96px; object-fit: contain; }
}

@media (max-width: 520px) {
  .page-content { padding: 12px; }
  .panel-heading { padding: 0 14px; }
  .heading-actions .button span { display: none; }
  .stats-grid { margin-right: -12px; padding-right: 12px; }
  .activity-item { grid-template-columns: 27px 1fr; }
  .game-titlebar { grid-template-columns: 110px 1fr; }
  .mobile-brand img { width: 104px; }
  .game-titlebar h1 { font-size: 21px; }
  .game-actions .button { padding: 0 8px; }
  .theme-segmented { width: 100%; flex-direction: column; }
  .theme-segmented button { width: 100%; justify-content: flex-start; border-right: 0; border-bottom: 1px solid var(--border); }
  .theme-segmented button:last-child { border-bottom: 0; }
  .language-segmented { width: 100%; flex-direction: column; }
  .language-segmented button { width: 100%; justify-content: flex-start; border-right: 0; border-bottom: 1px solid var(--border); }
  .language-segmented button:last-child { border-bottom: 0; }
  .login-card h2 { font-size: 30px; }
}

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