/* M3E theme imported from bio.aezo.loc.cc — tokens are the single source of truth. */
@font-face{font-family:"Roboto Flex";src:url("/static/vendor/rf-4eadd9c3.woff2") format("woff2");font-weight:300 1000;font-stretch:25% 151%;font-style:normal;font-display:swap}
:root{
  --primary:#6b4fa8;--on-primary:#fff;--pc:#ebddff;--on-pc:#25005a;
  --secondary:#635b70;--sc:#e9def8;--on-sc:#1f182b;
  --tertiary:#7e525e;--tc:#ffd9e1;--on-tc:#31101b;
  --bg:#fdf7ff;--c0:#f8f1fc;--c1:#f2ecf6;--c2:#ece6f0;--c3:#e6e0ea;
  --fg:#1d1b20;--fg2:#4a4550;--outline:#7b757f;--ov:#cbc4cf;--inv:#322f35;--on-inv:#f5eff7;
  --spring:cubic-bezier(.34,1.56,.64,1);--spring2:cubic-bezier(.22,1.4,.36,1);--emph:cubic-bezier(.2,0,0,1);
  --bg-deep:var(--bg);--bg-surface:var(--c0);--bg-card:var(--c1);--bg-card-hover:var(--c2);--bg-input:var(--c0);
  --border-default:var(--ov);--border-subtle:color-mix(in srgb,var(--ov) 42%,transparent);
  --text-primary:var(--fg);--text-secondary:var(--fg2);--text-muted:var(--outline);
  --accent:var(--primary);--accent-glow:color-mix(in srgb,var(--primary) 12%,transparent);
  --mint:var(--primary);--success:var(--primary);--success-bg:var(--pc);
  --warning:var(--on-sc);--warning-bg:var(--sc);--danger:var(--on-tc);--danger-bg:var(--tc);--info:var(--on-pc);--info-bg:var(--pc);
  --radius:16px;--radius-lg:28px;--sidebar-w:256px;--mobile-nav-h:76px;--transition:.4s var(--emph);
}
[data-theme=dark]{
  --primary:#d4bbff;--on-primary:#3b1e75;--pc:#52378e;--on-pc:#ebddff;
  --secondary:#cdc2db;--sc:#4b4358;--on-sc:#e9def8;
  --tertiary:#f0b7c5;--tc:#643b47;--on-tc:#ffd9e1;
  --bg:#141218;--c0:#1a1720;--c1:#211e26;--c2:#2b2930;--c3:#36333b;
  --fg:#e7e0e8;--fg2:#cbc4cf;--outline:#958e99;--ov:#4a4550;--inv:#e7e0e8;--on-inv:#322f35;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Layout === */
.app-layout { display: flex; min-height: 100vh; }

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo .logo-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.sidebar-logo .logo-subtitle {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-nav .nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.sidebar-nav .nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.sidebar-nav .nav-item .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-user {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

/* === Main Content === */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 24px 28px 80px;
  min-height: 100vh;
}

.section { display: none; }
.section.active { display: block; }

.section-header {
  margin-bottom: 24px;
}

.section-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-header .section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition);
}

.card:hover { border-color: var(--border-default); }

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

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === Grids === */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* === Stat card === */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* === Progress bar === */
.progress-bar {
  height: 6px;
  background: var(--bg-deep);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar .progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-fill.low { background: var(--success); }
.progress-fill.medium { background: var(--warning); }
.progress-fill.high { background: var(--danger); }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:hover { background: var(--bg-card-hover); border-color: var(--text-muted); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-accent { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.btn-accent:hover { background: #b8f02e; }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #16a34a; }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* === Badge === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-active { background: var(--success-bg); color: var(--success); }
.badge-inactive { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

.status-dot.online { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.offline { background: var(--danger); }
.status-dot.warning { background: var(--warning); }

/* === Service cards === */
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}

.service-card:hover { border-color: var(--border-default); }

.service-card .svc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.service-card .svc-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.service-card .svc-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.service-card .svc-meta {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.service-card .svc-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* === Table === */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* === Forms === */
input, select, textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

select { cursor: pointer; appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238b949e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }

textarea { resize: vertical; min-height: 200px; font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace; font-size: 12px; line-height: 1.6; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.04em; }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* Toggle switch */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle input { display: none; }

.toggle .toggle-track {
  width: 36px;
  height: 20px;
  background: var(--border-default);
  border-radius: 10px;
  position: relative;
  transition: background var(--transition);
}

.toggle input:checked + .toggle-track {
  background: var(--success);
}

.toggle .toggle-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(16px);
}

/* === Tabs === */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* === Toast === */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toast-in 0.25s ease;
  font-size: 13px;
}

.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--danger); }
.toast.toast-warning { border-left: 3px solid var(--warning); }

.toast .toast-icon { font-size: 18px; flex-shrink: 0; }
.toast .toast-msg { flex: 1; color: var(--text-primary); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.15s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.modal h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: var(--text-primary); }
.modal p { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }

.modal .modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* === Confirm dialog === */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.15s ease;
}

.confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--danger);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.confirm-box .confirm-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.confirm-box h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.confirm-box p { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }

.confirm-box .confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* === Mobile nav === */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  z-index: 100;
}

.mobile-nav .mnav-inner {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-around;
}

.mobile-nav .mnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  transition: color var(--transition);
}

.mobile-nav .mnav-item.active { color: var(--accent); }
.mobile-nav .mnav-item .mnav-icon { font-size: 20px; }

/* === Terminal section === */
.terminal-container {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-default);
}

.terminal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  gap: 10px;
}

.terminal-toolbar .term-status {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

#terminal {
  height: 480px;
  padding: 4px;
}

/* === Log viewer === */
.log-viewer {
  background: #000;
  color: #c9d1d9;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
  padding: 14px;
  border-radius: var(--radius);
  max-height: 360px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid var(--border-default);
}

/* === Empty & loading states === */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 14px; }
.empty-state .empty-sub { font-size: 12px; margin-top: 4px; color: var(--text-muted); }

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* === Upload area === */
.upload-area {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.upload-area:hover { border-color: var(--accent); background: var(--accent-glow); }
.upload-area.dragover { border-color: var(--accent); background: var(--accent-glow); }

.upload-area .upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-area .upload-text { font-size: 13px; color: var(--text-secondary); }
.upload-area .upload-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* === Progress === */
.upload-progress {
  margin-top: 12px;
  display: none;
}

.upload-progress .progress-bar {
  height: 8px;
}

.upload-progress .progress-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === MC console === */
.mc-console-input {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.mc-console-input input {
  flex: 1;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
}

/* === Audit list === */
.audit-list {
  max-height: 300px;
  overflow-y: auto;
}

.audit-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
}

.audit-item:last-child { border-bottom: none; }

.audit-item .audit-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.audit-item .audit-time {
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 60px;
}

.audit-item .audit-action {
  font-weight: 600;
  color: var(--text-primary);
}

.audit-item .audit-detail {
  color: var(--text-secondary);
  margin-left: 4px;
}

/* === Properties grid (MC) === */
.props-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.props-grid .form-group { margin-bottom: 0; }

/* === File list === */
.file-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  gap: 10px;
}

.file-list-item:last-child { border-bottom: none; }

.file-list-item .file-name { flex: 1; color: var(--text-primary); }
.file-list-item .file-meta { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.file-list-item .file-actions { display: flex; gap: 4px; }

/* === Responsive === */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px 16px 80px; }
  .mobile-nav { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .toast-container { top: 8px; right: 8px; left: 8px; max-width: none; }
  .modal, .confirm-box { width: 95%; }
  #terminal { height: 320px; }
  .props-grid { grid-template-columns: 1fr; }
  .tabs { gap: 0; }
  .tab-btn { padding: 8px 12px; font-size: 12px; }
}

/* === Utility === */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === Bio M3E component language === */
html,body{font-family:"Roboto Flex",system-ui,sans-serif;background:var(--bg);color:var(--fg);transition:background .5s var(--emph),color .5s var(--emph)}
body{overflow-x:hidden}
a{color:var(--primary)}
::selection{background:var(--pc);color:var(--on-pc)}
button,input,select,textarea{font-family:inherit}
:focus-visible{outline:2px solid var(--primary)!important;outline-offset:3px}
.app-layout{background:var(--bg)}
.sidebar{background:var(--c0);border-right:0}
.sidebar-logo{padding:28px 22px 20px;border-bottom:0}
.sidebar-logo .logo-title{font-size:18px;font-weight:850;letter-spacing:-.02em;font-variation-settings:"wdth" 125,"opsz" 144}
.sidebar-logo .logo-subtitle{font-size:10px;color:var(--primary);letter-spacing:.16em;font-weight:750;margin-top:6px;font-variation-settings:"wdth" 125}
.sidebar-nav{padding:12px 14px}
.sidebar-nav .nav-item{min-height:52px;padding:10px 16px;border-radius:999px;font-size:14px;font-weight:600;transition:background .3s var(--emph),color .3s var(--emph),border-radius .45s var(--spring),transform .3s var(--spring)}
.sidebar-nav .nav-item:hover{background:var(--c2);color:var(--fg);border-radius:18px}
.sidebar-nav .nav-item.active{background:var(--sc);color:var(--on-sc)}
.sidebar-nav .nav-item:active{transform:scale(.97)}
.sidebar-user{padding:16px 20px 22px;border-top:0;color:var(--fg2);gap:10px;flex-wrap:wrap}
.main-content{padding:32px clamp(20px,3vw,48px) 72px;min-width:0}
.section.active{animation:m3e-in .55s var(--spring2)}
.section-header{margin-bottom:28px}
.section-header h1{font-size:clamp(36px,4vw,58px);line-height:.98;font-weight:850;letter-spacing:-.045em;font-variation-settings:"wdth" 120,"opsz" 144}
.section-header .section-subtitle{font-size:15px;color:var(--fg2);margin-top:12px;letter-spacing:.01em}
.card,.stat-card,.service-card{background:var(--c1);border:0;border-radius:28px;box-shadow:none;transition:border-radius .55s var(--spring),background .3s var(--emph),transform .5s var(--spring)}
.card:hover,.service-card:hover{border-color:transparent;border-radius:18px}
.card{padding:24px}
.card-header{margin-bottom:20px}
.card-title{font-size:14px;color:var(--fg);font-weight:750;text-transform:none;letter-spacing:.01em;font-variation-settings:"wdth" 115}
.stat-card{padding:22px 24px;min-height:124px}
.stat-card .stat-label{font-size:12px;color:var(--fg2);font-weight:650;letter-spacing:.03em;text-transform:none}
.stat-card .stat-value{font-size:clamp(28px,3vw,40px);font-weight:850;letter-spacing:-.035em;line-height:1.15;font-variation-settings:"wdth" 125,"opsz" 144}
.stat-card .stat-sub{color:var(--fg2)}
.grid-4 .stat-card:nth-child(4n+2){background:var(--pc);color:var(--on-pc)}
.grid-4 .stat-card:nth-child(4n+3){background:var(--sc);color:var(--on-sc)}
.grid-4 .stat-card:nth-child(4n+2) :is(.stat-label,.stat-value,.stat-sub),.grid-4 .stat-card:nth-child(4n+3) :is(.stat-label,.stat-value,.stat-sub){color:inherit}
.progress-bar{height:8px;background:var(--c3);border-radius:999px;margin-top:12px}
.progress-bar .progress-fill{border-radius:999px;transition:width .5s var(--emph)}
.progress-fill.low,.progress-fill.medium{background:var(--primary)}
.progress-fill.high{background:var(--tertiary)}
.btn{min-height:40px;padding:8px 20px;border-radius:999px;border:1px solid var(--outline);background:transparent;color:var(--primary);font-size:14px;font-weight:650;font-variation-settings:"wdth" 110;transition:background .25s var(--emph),color .25s,border-radius .45s var(--spring),transform .35s var(--spring),border-color .25s}
.btn:hover{background:color-mix(in srgb,var(--primary) 10%,transparent);border-color:var(--primary);border-radius:14px}
.btn:active{transform:scale(.95)}
.btn-accent,.btn-success{background:var(--primary);color:var(--on-primary);border-color:transparent}
.btn-accent:hover,.btn-success:hover{background:var(--primary);color:var(--on-primary);box-shadow:0 0 0 5px color-mix(in srgb,var(--primary) 10%,transparent)}
.btn-danger{background:var(--tc);color:var(--on-tc);border-color:transparent}
.btn-danger:hover{background:var(--tc);color:var(--on-tc);box-shadow:0 0 0 5px color-mix(in srgb,var(--tertiary) 10%,transparent)}
.btn-ghost{background:transparent;border-color:transparent;color:var(--fg2)}
.btn-ghost:hover{background:var(--c2);color:var(--fg)}
.btn-sm{min-height:36px;padding:6px 16px;font-size:13px}
.btn-xs{min-height:30px;padding:4px 12px;font-size:12px}
.badge{min-height:26px;padding:3px 11px;border-radius:999px;font-size:12px;font-weight:650}
.badge-active{background:var(--pc);color:var(--on-pc)}
.badge-inactive{background:var(--tc);color:var(--on-tc)}
.badge-warning{background:var(--sc);color:var(--on-sc)}
.badge-info{background:var(--pc);color:var(--on-pc)}
.status-dot.online{background:var(--primary);box-shadow:none}
.status-dot.offline{background:var(--tertiary)}
.service-card{padding:24px}
.service-card .svc-name{font-size:20px;font-weight:750;letter-spacing:-.02em;font-variation-settings:"wdth" 115}
.service-card .svc-desc{font-size:13px;color:var(--fg2);margin-top:5px}
.service-card .svc-meta{color:var(--fg2);gap:14px;flex-wrap:wrap}
.service-card .svc-actions{gap:8px;margin-top:18px}
.table-wrap{border:0;border-radius:28px;background:var(--c1);padding:4px}
table{font-size:14px;border-collapse:separate;border-spacing:0}
th{padding:14px 16px;background:transparent;color:var(--fg2);border-bottom:1px solid var(--ov);font-size:11px;font-weight:700;letter-spacing:.07em}
td{padding:14px 16px;border-bottom:1px solid color-mix(in srgb,var(--ov) 45%,transparent)}
tr:hover td{background:color-mix(in srgb,var(--primary) 6%,transparent)}
input,select,textarea{background:var(--c0);border:1px solid var(--outline);border-radius:16px;color:var(--fg);padding:12px 16px;font-size:14px;transition:border-color .25s,background .25s,border-radius .4s var(--spring)}
input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:none;background:var(--bg);border-radius:12px}
select{appearance:auto;background-image:none;padding-right:16px}
.form-group label{color:var(--fg2);font-size:12px;font-weight:650;text-transform:none;letter-spacing:.02em;margin-bottom:8px}
.toggle .toggle-track{width:52px;height:32px;background:var(--c3);border:2px solid var(--outline);border-radius:999px;transition:background .3s,border-color .3s}
.toggle .toggle-track::after{top:6px;left:6px;width:16px;height:16px;background:var(--outline);transition:transform .45s var(--spring),width .35s var(--spring),height .35s var(--spring),background .3s}
.toggle input:checked + .toggle-track{background:var(--primary);border-color:var(--primary)}
.toggle input:checked + .toggle-track::after{background:var(--on-primary);width:24px;height:24px;top:2px;left:2px;transform:translateX(20px)}
.tabs{gap:8px;border-bottom:0;margin-bottom:24px;padding:4px;background:var(--c0);border-radius:999px;width:max-content;max-width:100%}
.tab-btn{min-height:40px;padding:8px 20px;border:0;border-radius:999px;color:var(--fg2);font-size:14px;font-weight:650;transition:background .3s,color .3s,border-radius .4s var(--spring),transform .3s}
.tab-btn:hover{background:var(--c2);color:var(--fg);border-radius:14px}
.tab-btn.active{background:var(--sc);color:var(--on-sc);border:0}
.tab-btn:active{transform:scale(.95)}
.toast-container{top:20px;right:20px;gap:10px}
.toast{background:var(--inv);color:var(--on-inv);border:0;border-radius:20px;padding:14px 18px;box-shadow:0 8px 28px color-mix(in srgb,var(--inv) 24%,transparent);animation:toast-in .4s var(--spring2)}
.toast .toast-msg{color:var(--on-inv)}
.toast.toast-success,.toast.toast-error,.toast.toast-warning{border-left:0}
.modal-overlay,.confirm-overlay{background:color-mix(in srgb,var(--inv) 48%,transparent);backdrop-filter:blur(4px)}
.modal,.confirm-box{background:var(--c2);border:0;border-radius:28px;padding:28px;box-shadow:0 12px 40px color-mix(in srgb,var(--inv) 32%,transparent)}
.modal h3,.confirm-box h3{font-size:24px;font-weight:750;letter-spacing:-.02em}
.modal p,.confirm-box p{font-size:14px;color:var(--fg2)}
.confirm-box .confirm-icon{display:grid;place-items:center;width:52px;height:52px;border-radius:18px;background:var(--tc);font-size:26px}
.mobile-nav{background:var(--c3);border:0}
.terminal-container{border:0;border-radius:28px;background:var(--c0)}
.terminal-toolbar{background:var(--c2);border-bottom:0;padding:12px 16px}
#terminal{height:min(62vh,620px);padding:12px;background:var(--c0)}
.log-viewer{background:var(--c0);color:var(--fg);border:0;border-radius:20px;padding:18px}
.empty-state{color:var(--fg2)}
.empty-state .empty-icon{display:inline-grid;place-items:center;width:72px;height:72px;border-radius:28px;background:var(--pc);font-size:32px}
.upload-area{border:2px dashed var(--outline);border-radius:28px;background:var(--c1);padding:28px;transition:border-radius .5s var(--spring),background .3s,border-color .3s}
.upload-area:hover,.upload-area.dragover{border-color:var(--primary);background:var(--pc);border-radius:16px}
.audit-item{border-bottom:1px solid color-mix(in srgb,var(--ov) 45%,transparent);padding:12px 0}
.audit-item .audit-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:12px;background:var(--pc)}
.file-list-item{padding:12px 10px;border-bottom:1px solid color-mix(in srgb,var(--ov) 45%,transparent)}
.file-list-item .file-name{font-weight:550}
@keyframes m3e-in{from{opacity:0;transform:translateY(16px) scale(.99)}to{opacity:1;transform:none}}
@media (max-width:1024px){
  .main-content{padding:24px 14px calc(126px + env(safe-area-inset-bottom))}
  .section-header h1{font-size:40px}
  .section-header .section-subtitle{font-size:14px}
  .card,.service-card{padding:20px;border-radius:24px}
  .stat-card{padding:20px;min-height:112px;border-radius:24px}
  .mobile-nav{display:block;left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom));height:76px;border-radius:32px;background:var(--c3);box-shadow:0 4px 20px color-mix(in srgb,var(--inv) 22%,transparent)}
  .mobile-nav .mnav-inner{gap:4px;padding:8px}
  .mobile-nav .mnav-item{height:60px;flex:1;justify-content:center;padding:6px 8px;border-radius:24px;color:var(--fg2);font-size:10px;font-weight:650;transition:background .3s,color .3s,border-radius .4s var(--spring)}
  .mobile-nav .mnav-item.active{background:var(--sc);color:var(--on-sc)}
  .tabs{border-radius:24px}
  .tab-btn{padding:8px 16px}
  .table-wrap{border-radius:24px}
  .btn{min-height:42px}
  .btn-xs{min-height:32px}
  #terminal{height:52vh}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* === Operate surfaces: quiet M3 lists, progressive disclosure === */
.icon{width:20px;height:20px;flex:0 0 auto}
.btn .icon{width:18px;height:18px}
.btn-icon{width:40px;height:40px;min-height:40px;padding:0;justify-content:center;border-color:transparent}
#section-services .section-header h1,#section-sites .section-header h1,#section-mc .section-header h1,#section-terminal .section-header h1{font-size:36px;letter-spacing:-.025em;line-height:1.15;font-variation-settings:"wdth" 110,"opsz" 48}
#section-services .section-subtitle,#section-sites .section-subtitle,#section-mc .section-subtitle,#section-terminal .section-subtitle{font-size:14px;margin-top:8px}
.filter-control{display:flex;align-items:center;gap:10px;color:var(--fg2);font-size:13px;white-space:nowrap}
.filter-control select{min-width:128px;padding:9px 12px;background:var(--c1)}
.m3-group{display:flex;flex-direction:column;gap:3px}
.m3-list-item{min-width:0;background:var(--c1);border-radius:8px;overflow:hidden;transition:background .2s var(--emph),border-radius .25s var(--emph)}
.m3-list-item:first-child{border-radius:28px 28px 8px 8px}
.m3-list-item:last-child{border-radius:8px 8px 28px 28px}
.m3-list-item:only-child{border-radius:28px}
.m3-list-item:hover{background:var(--c2);border-radius:18px}
.m3-list-item.open{background:var(--c2)}
.m3-row{display:flex;align-items:stretch;min-width:0}
.m3-list-main{display:flex;align-items:center;gap:16px;flex:1;min-width:0;padding:14px 16px;border:0;background:transparent;color:var(--fg);text-align:left;cursor:pointer}
.m3-list-main>.icon:last-child{margin-left:4px;color:var(--fg2);transition:transform .2s var(--emph)}
.open .m3-list-main>.icon:last-child{transform:rotate(180deg)}
.m3-list-main.m3-static{cursor:default;padding-right:0}
.m3-item-icon{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border-radius:16px;background:var(--pc);color:var(--on-pc)}
.m3-item-copy{display:block;flex:1;min-width:0}
.m3-item-copy strong{display:block;overflow:hidden;color:var(--fg);font-size:16px;font-weight:650;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}
.m3-item-copy small{display:block;overflow:hidden;margin-top:4px;color:var(--fg2);font-size:13px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}
.m3-row-trailing{display:flex;align-items:center;justify-content:flex-end;flex:0 0 auto;gap:14px;padding:0 18px 0 10px}
.m3-state{color:var(--fg2);font-size:13px;font-weight:600;white-space:nowrap}
.m3-state.is-active{color:var(--primary)}
.m3-state.is-failed{color:var(--tertiary)}
.m3-power{flex:0 0 auto}
.m3-item-details{display:none;padding:2px 20px 20px 84px}
.open .m3-item-details{display:block;animation:detail-in .18s ease-out}
.m3-meta-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:0 0 18px}
.m3-meta-grid dt{color:var(--fg2);font-size:12px}
.m3-meta-grid dd{margin:4px 0 0;color:var(--fg);font-size:14px;font-weight:650;overflow-wrap:anywhere}
.m3-detail-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.m3-site-addresses{margin-bottom:12px;color:var(--fg);font-size:14px;line-height:1.6;overflow-wrap:anywhere}
.m3-site-path{display:block;margin-bottom:14px;color:var(--fg2);font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.mc-tabs.tabs{width:100%;max-width:100%;gap:4px;margin-bottom:28px;padding:0;border-bottom:1px solid var(--ov);border-radius:0;background:transparent}
.mc-tabs .tab-btn{min-height:48px;padding:10px 16px;border:0;border-bottom:3px solid transparent;border-radius:12px 12px 0 0;color:var(--fg2)}
.mc-tabs .tab-btn:hover{border-radius:12px 12px 0 0;background:var(--accent-glow);color:var(--fg)}
.mc-tabs .tab-btn.active{border-bottom-color:var(--primary);background:transparent;color:var(--primary)}
.mc-status-card{display:flex;align-items:center;justify-content:space-between;gap:32px;padding:28px;border-radius:28px;background:var(--c1)}
.mc-status-copy{display:flex;align-items:center;gap:18px;min-width:0}
.mc-status-copy .m3-item-icon{flex-basis:56px;width:56px;height:56px;border-radius:20px}
.mc-status-copy h2{margin:0;font-size:28px;font-weight:750;letter-spacing:-.02em;line-height:1.15}
.mc-status-copy p{margin:8px 0 0;color:var(--fg2);font-size:14px;line-height:1.5}
.mc-status-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.settings-surface{padding:28px;border-radius:28px;background:var(--c1)}
.surface-heading{margin:0 0 24px}
.content-section>.surface-heading{padding:0 4px;margin-bottom:20px}
.surface-heading h2{margin:0;color:var(--fg);font-size:24px;font-weight:750;letter-spacing:-.02em;line-height:1.2}
.surface-heading p{margin:8px 0 0;color:var(--fg2);font-size:14px;line-height:1.5}
.settings-surface .props-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.settings-surface input,.settings-surface select{width:100%;min-height:48px}
.boolean-field{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:72px;padding:12px 16px;border-radius:16px;background:var(--c0)}
.boolean-field>span{color:var(--fg);font-size:14px;font-weight:600}
.form-actions{display:flex;justify-content:flex-end;margin-top:24px}
.inline-create{display:flex;align-items:center;gap:12px;margin-top:20px}
.inline-create input{flex:1;min-width:0;min-height:48px}
.section-upload{margin-top:16px}
.upload-area{display:flex;align-items:center;gap:16px;flex-wrap:wrap;min-height:76px;padding:14px 18px;border:1px dashed var(--outline);border-radius:20px;background:transparent;text-align:left;transition:background .2s,border-color .2s,border-radius .2s}
.upload-area:hover,.upload-area.dragover{border-color:var(--primary);border-radius:16px;background:var(--accent-glow)}
.upload-area .upload-icon{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;margin:0;border-radius:14px;background:var(--pc);color:var(--on-pc);font-size:inherit}
.upload-copy{flex:1;min-width:180px}
.upload-copy strong{display:block;color:var(--fg);font-size:14px;font-weight:650}
.upload-copy small{display:block;margin-top:4px;color:var(--fg2);font-size:12px}
.upload-area .upload-progress{flex:0 0 100%;margin:2px 0 0}
.inline-empty{padding:28px 4px;color:var(--fg2);font-size:14px;line-height:1.5}
.content-section .log-viewer{max-height:55vh}
@keyframes detail-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@media(max-width:800px){
  .mc-status-card{align-items:flex-start;flex-direction:column;gap:24px}
  .mc-status-actions{justify-content:flex-start}
  .settings-surface .props-grid{grid-template-columns:minmax(0,1fr)}
  .m3-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
  #section-services .section-header>.flex{align-items:flex-start;gap:16px;flex-direction:column}
  .filter-control{width:100%;justify-content:space-between}
  .filter-control select{min-width:160px}
  .m3-list-main{gap:12px;padding:12px}
  .m3-item-icon{flex-basis:44px;width:44px;height:44px;border-radius:15px}
  .m3-item-copy strong{font-size:15px}
  .m3-row-trailing{gap:8px;padding:0 12px 0 8px}
  .service-list .m3-state,.site-list .m3-state{display:none}
  .m3-item-details{padding:2px 12px 16px}
  .m3-detail-actions .btn{flex:1;justify-content:center}
  .m3-detail-actions .btn-ghost{flex:0}
  .mc-tabs .tab-btn{padding:10px 14px}
  .mc-status-card,.settings-surface{padding:20px;border-radius:24px}
  .mc-status-copy{align-items:flex-start}
  .mc-status-copy h2{font-size:24px}
  .mc-status-actions{width:100%;flex-direction:column}
  .mc-status-actions .btn{width:100%;justify-content:center}
  .surface-heading h2{font-size:22px}
  .inline-create{align-items:stretch;flex-direction:column}
  .inline-create .btn{width:100%;justify-content:center}
  .upload-copy{min-width:0}
  .m3-row-trailing .btn-icon{width:36px;min-height:36px;height:36px}
}
