@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --bg: #f5f5f7;
  --win: #fbfbfd;
  --sidebar: #ececf0;
  --surface: #ffffff;
  --surface-2: #f2f2f5;
  --card: #ffffff;
  --field: #ffffff;
  --text: #1d1d1f;
  --fg: #1d1d1f;
  --text2: #6e6e73;
  --text3: #a1a1a6;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --sep: rgba(0, 0, 0, 0.08);
  --line: rgba(0, 0, 0, 0.08);
  --hover: rgba(0, 0, 0, 0.05);
  --code: #f2f2f5;
  --accent: #007aff;
  --accent-soft: rgba(0, 122, 255, 0.12);
  --brand: #007aff;
  --brand-fg: #ffffff;
  --green: #34c759;
  --ok: #34c759;
  --green-soft: rgba(52, 199, 89, 0.14);
  --orange: #ff9f0a;
  --warn: #ff9f0a;
  --orange-soft: rgba(255, 159, 10, 0.15);
  --red: #ff3b30;
  --danger: #ff3b30;
  --red-soft: rgba(255, 59, 48, 0.12);
  --purple: #af52de;
  --teal: #30b0c7;
  --indigo: #5e5ce6;
  --gray: #8e8e93;
  --chart: #007aff;
  --chart-fill: rgba(0, 122, 255, 0.08);
  --side: #ececf0;
  --side-fg: #1d1d1f;
  --side-muted: #6e6e73;
  --btn-radius: 8px;
  --btn-h: 36px;
  --btn-h-sm: 30px;
  --btn-fill: rgba(0, 0, 0, 0.05);
  --btn-fill-hover: rgba(0, 0, 0, 0.08);
  --btn-fill-active: rgba(0, 0, 0, 0.12);
  --btn-primary: #007aff;
  --btn-primary-fg: #ffffff;
  --btn-primary-hover: #0066d6;
  --btn-danger-fill: rgba(255, 59, 48, 0.12);
  --btn-danger-fg: #ff3b30;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 0.5px rgba(0, 0, 0, 0.07);
  --radius: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
body.is-app { padding: 0; }
body.is-auth {
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  display: grid;
  place-items: center;
  min-height: 100%;
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; border: 0; background: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
svg.i {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}

/* Auth */
.auth-wrap { width: min(420px, 100%); }
.auth-card {
  background: var(--card);
  border: 0.5px solid var(--sep);
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.18);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-brand img { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; }
.auth-brand .title { font-weight: 800; font-size: 18px; }
.auth-brand .sub { color: var(--muted); font-size: 12px; }
.client-chip, .auth-status { color: var(--muted); margin: 0 0 12px; }
.stack { display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 600; font-size: 12px; margin-top: 8px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 0.5px solid var(--sep); padding: 10px 12px; outline: none; border-radius: 8px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Apple-style toggles for all checkboxes */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 51px;
  height: 31px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #e9e9eb;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  position: relative;
  cursor: pointer;
  flex: none;
  vertical-align: middle;
  transition: background 0.2s ease;
  outline: none;
}
input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.15),
    0 1px 1px rgba(0, 0, 0, 0.06),
    0 0 0 0.5px rgba(0, 0, 0, 0.04);
  transition: transform 0.22s cubic-bezier(0.2, 0.85, 0.25, 1);
}
input[type="checkbox"]:checked {
  background: var(--green);
  box-shadow: none;
}
input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}
input[type="checkbox"]:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="checkbox"]:active::before {
  width: 30px;
}
input[type="checkbox"]:checked:active::before {
  transform: translateX(17px);
}
input[type="checkbox"]:disabled {
  opacity: 0.45;
  cursor: default;
}

[hidden] { display: none !important; }

.switch,
.switch-row,
label.switch,
.prefs-grid > label.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}
.switch-row > input[type="checkbox"],
label.switch > input[type="checkbox"],
.prefs-grid > label > input[type="checkbox"] {
  order: 2;
  margin-left: auto;
}
.ops-live { display: none !important; }
.prefs-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  padding: 0 !important;
}
.prefs-grid > label {
  padding: 12px 14px;
  min-height: 46px;
  position: relative;
}
.prefs-grid > label + label::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14px;
  right: 0;
  height: 0.5px;
  background: var(--sep);
}
.prefs-grid > div {
  padding: 12px 14px;
  border-top: 0.5px solid var(--sep);
  display: flex;
  justify-content: flex-end;
}
.card .prefs-grid {
  box-shadow: none;
  border: 0.5px solid var(--sep);
}
td:has(> input[type="checkbox"]),
td input[type="checkbox"].acl-enable {
  display: flex;
  align-items: center;
  justify-content: center;
}
td > input[type="checkbox"] {
  width: 51px;
  margin: 0 auto;
}

/* Shell */
.app-frame.app,
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--win);
  overflow: hidden;
}
body.nav-lock { overflow: hidden; }

.mobile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + var(--safe-top)) 14px 10px;
  background: var(--win);
  border-bottom: 0.5px solid var(--sep);
  position: sticky;
  top: 0;
  z-index: 30;
}
.mobile-brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 800; font-size: 17px; letter-spacing: -0.02em;
}
.nav-toggle {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; background: var(--hover); border-radius: 10px; cursor: pointer; padding: 0;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block; width: 16px; height: 2px; background: var(--text);
  margin: 0 auto; position: relative; border-radius: 2px;
}
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }
.nav-backdrop {
  display: none; position: fixed; inset: 0; z-index: 40; border: 0;
  background: rgba(0, 0, 0, 0.28); cursor: pointer;
}
.app-frame.nav-open .nav-backdrop { display: block; }

/* Sidebar — light */
.side, .sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(260px, 86vw); z-index: 50;
  background: var(--sidebar);
  color: var(--side-fg);
  display: flex; flex-direction: column;
  padding: calc(14px + var(--safe-top)) 0 calc(12px + var(--safe-bottom));
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.12);
  border-right: 0.5px solid var(--sep);
}
.app-frame.nav-open .side { transform: translateX(0); }
.logo, .side-brand {
  font-weight: 800; font-size: 17px; letter-spacing: -0.02em;
  padding: 6px 18px 16px; color: var(--text);
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.logo b, .side-brand b { color: var(--text); display: block; line-height: 1.1; }
.brand-mark {
  display: block;
  width: 32px;
  height: auto;
  flex: none;
  object-fit: contain;
}
.brand-mark-wave {
  width: 32px;
  height: auto;
  border-radius: 0;
  box-shadow: none;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.brand-text small {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 0.01em;
}
.mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}
.mobile-brand .brand-mark-wave {
  width: 22px;
}
.side-scroll, .nav {
  display: flex; flex-direction: column; gap: 1px;
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 10px 10px;
}
.side-label {
  font-size: 11px; font-weight: 600; color: var(--text3);
  padding: 14px 10px 5px;
}
.side-item, .nav a.side-item, .nav a {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 7px 10px; min-height: 34px;
  border-radius: 8px; text-align: left; text-decoration: none;
  color: var(--text); font-weight: 500; background: none; border: 0;
}
.side-item:hover, .nav a:hover { background: var(--hover); color: var(--text); }
.side-item svg.i, .nav a svg.i { color: var(--accent); width: 16px; height: 16px; }
.side-item.active, .nav a.active, .nav a[aria-current="page"],
.side-item.active:hover, .nav a.active:hover {
  background: var(--accent); color: #fff;
}
.side-item.active svg.i, .nav a.active svg.i, .nav a[aria-current="page"] svg.i { color: #fff; }
.side-item .count, .nav .count {
  margin-left: auto; font-size: 12px; color: var(--text2); font-weight: 500;
}
.side-item.active .count, .nav a.active .count { color: rgba(255, 255, 255, 0.85); }
.side-item .lbl, .nav-label, .nav .grow { flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-project .dot, .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--green-soft);
}
.dot.off { background: var(--gray); box-shadow: 0 0 0 3px rgba(142, 142, 147, 0.18); }
.side-project.active .dot { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25); }

.user, .side-user {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 0; border-top: 0.5px solid var(--sep);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #5ac8fa, #007aff);
  display: grid; place-items: center;
  font-weight: 600; color: #fff; font-size: 13px; flex: none;
}
.user small, .side-user-meta small { display: block; color: var(--text2); font-weight: 500; font-size: 11px; }
.user .who, .side-user-meta { flex: 1; font-weight: 600; min-width: 0; color: var(--text); }
.side-user-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); }
.icon-btn {
  background: var(--hover); border: 0; color: var(--text2);
  width: 32px; height: 32px; display: grid; place-items: center;
  padding: 0; border-radius: 8px;
}
.icon-btn:hover { color: var(--text); background: rgba(0, 0, 0, 0.08); }

/* Main content */
.main, .content.detail-pane, .content.content-full, .home-main {
  min-width: 0; overflow: auto; -webkit-overflow-scrolling: touch;
  background: var(--win);
}
.content.content-full {
  padding: calc(18px + var(--safe-top)) 18px calc(28px + var(--safe-bottom));
}
.home-main { padding: 0; }
.home-panel { min-height: 100%; }
.home-wrap, .wrap {
  width: 100%; max-width: 1100px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 18px calc(36px + var(--safe-bottom));
}
.tab-panel[hidden] { display: none !important; }

/* Buttons */
.btn, a.btn, button.btn, button[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--btn-h); padding: 0 13px; border-radius: 8px; border: 0;
  background: var(--card); color: var(--text); font-weight: 500;
  box-shadow: var(--card-shadow), 0 1px 1px rgba(0, 0, 0, 0.05);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: filter 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
}
.btn:hover, a.btn:hover, button.btn:hover { filter: brightness(0.97); }
.btn:active { transform: scale(0.97); }
.btn.primary, button.primary, a.btn.primary,
button[type="submit"]:not(.btn):not(.secondary):not(.danger):not(.small):not(.ghost):not(.tab):not(.icon-btn),
.auth-card button[type="submit"]:not(.secondary):not(.danger) {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(0, 122, 255, 0.3);
}
.btn.primary:hover, a.btn.primary:hover { filter: brightness(1.05); color: #fff; }
.btn.secondary, button.secondary, a.btn.secondary { background: var(--btn-fill); box-shadow: none; }
.btn.danger, button.danger, a.btn.danger {
  background: var(--btn-danger-fill); color: var(--btn-danger-fg); box-shadow: none;
}
.btn.small, button.small { min-height: var(--btn-h-sm); padding: 0 10px; font-size: 12px; }
.btn.ghost, button.ghost, .tab.ghost {
  background: transparent !important; box-shadow: none !important; color: var(--text2) !important;
}
.btn:disabled, button:disabled { opacity: 0.45; pointer-events: none; }
.link { color: var(--accent); font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; }

/* Flash / badges */
.flash {
  padding: 12px 14px; border-radius: 10px; margin-bottom: 14px;
  background: var(--accent-soft); color: var(--accent); font-weight: 500;
}
.flash.error, .flash.danger { background: var(--red-soft); color: var(--red); }
.flash.success, .flash.ok { background: var(--green-soft); color: var(--green); }
.flash.warning { background: var(--orange-soft); color: var(--orange); }
.badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
  background: var(--green-soft); color: var(--green); white-space: nowrap;
  min-width: 0; height: auto; display: inline-flex; align-items: center;
}
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.gray, .badge.error { background: var(--hover); color: var(--text2); }
.badge.blue, .badge.created { background: var(--accent-soft); color: var(--accent); }
.badge.running { background: var(--green-soft); color: var(--green); }
.tag {
  font-family: var(--mono); font-size: 11px; padding: 2px 7px; border-radius: 5px;
  background: var(--hover); color: var(--text2); white-space: nowrap;
}
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
  background: var(--green-soft); color: var(--green);
}

/* Hero + tiles */
.hero {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.server-ic {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(160deg, #4a4a4f, #1d1d1f);
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); color: #fff; flex: none;
}
.server-ic svg.i { width: 28px; height: 28px; stroke-width: 1.6; }
.hero-body { min-width: 0; flex: 1; }
.hero-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  color: var(--text2); margin-top: 3px; font-size: 12.5px;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  background: var(--green-soft); color: var(--green);
  font-weight: 600; font-size: 12px;
}
.pill .dot { width: 6px; height: 6px; box-shadow: none; animation: pulse 2s infinite; }
.pill.warn { background: var(--orange-soft); color: var(--orange); }
.pill.warn .dot { background: var(--orange); }
.pill[data-level="warning"] { background: var(--orange-soft); color: var(--orange); }
.pill[data-level="warning"] .dot { background: var(--orange); }
.pill[data-level="critical"] { background: var(--red-soft); color: var(--red); }
.pill[data-level="critical"] .dot { background: var(--red); }
@keyframes pulse { 50% { opacity: 0.35; } }
.hero-acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.tile {
  background: var(--card); border-radius: 14px;
  padding: 16px 16px 12px; box-shadow: var(--card-shadow);
  display: flex; flex-direction: column; gap: 6px; min-height: 150px;
}
.tile-h {
  display: flex; align-items: center; gap: 7px;
  color: var(--text2); font-size: 12px; font-weight: 500;
}
.tile-h .sq { width: 20px; height: 20px; border-radius: 6px; }
.tile-h .sq svg.i { width: 12px; height: 12px; stroke-width: 2; color: #fff; }
.tile-h .right { margin-left: auto; font-size: 11px; color: var(--text3); }
.big { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.big small { font-size: 14px; color: var(--text2); font-weight: 500; margin-left: 2px; }
.spark, .chart-wrap, .chart-wrap .chart, .chart-wrap svg {
  width: 100%; height: 44px; margin-top: auto; display: block;
}
.chart-wrap .chart { height: 44px; }
.ring-row { display: flex; align-items: center; gap: 14px; margin-top: auto; }
.legend { font-size: 12px; color: var(--text2); line-height: 1.7; }
.legend b { color: var(--text); font-weight: 600; }
.net-row { display: flex; gap: 16px; }
.net-row div { font-size: 12px; color: var(--text2); }
.net-row b { display: block; font-size: 20px; color: var(--text); font-weight: 600; }
.tile-foot { font-size: 11px; color: var(--text3); margin-top: 2px; }
.bar {
  width: 120px; height: 6px; border-radius: 3px;
  background: var(--hover); overflow: hidden;
}
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.6s; }

/* Sections / rows */
.section h3 {
  font-size: 13px; font-weight: 600; color: var(--text2);
  padding: 0 4px 8px; display: flex; align-items: center; gap: 8px;
}
.section h3 .right {
  margin-left: auto; font-weight: 400; font-size: 12px; color: var(--text3);
}
.section .foot { font-size: 11.5px; color: var(--text3); padding: 7px 4px 0; line-height: 1.45; }
.group {
  background: var(--card); border-radius: 12px;
  box-shadow: var(--card-shadow); overflow: hidden;
}
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; min-height: 46px; position: relative;
  width: 100%; text-align: left; color: var(--text); text-decoration: none;
}
.row + .row::before {
  content: ""; position: absolute; top: 0;
  left: var(--inset, 14px); right: 0; height: 0.5px; background: var(--sep);
}
.row.hov:hover { background: var(--hover); }
.row .v {
  margin-left: auto; color: var(--text2); text-align: right;
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.row .t { min-width: 0; }
.row .t b { display: block; font-weight: 500; }
.row .t span { display: block; font-size: 12px; color: var(--text2); margin-top: 1px; }
.row .t span.mono { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq {
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center; color: #fff; flex-shrink: 0;
  font-weight: 700; font-size: 12px;
}
.sq.sq-lg { width: 34px; height: 34px; border-radius: 9px; }
.cols {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px;
}
.empty {
  padding: 40px 20px; text-align: center; color: var(--text2);
}
.empty .ei {
  width: 44px; height: 44px; border-radius: 12px; background: var(--hover);
  display: grid; place-items: center; margin: 0 auto 10px; color: var(--text3);
}
.empty b { display: block; color: var(--text); font-weight: 600; font-size: 14px; margin-bottom: 3px; }

/* Fleet cards */
.section-fleet { min-height: 0; }
.containers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 2px;
  min-height: 0;
  overflow: auto;
  align-content: start;
}
.ctr {
  --ctr: #2f6fed;
  --ctr-deep: #1d4ed8;
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.ctr:hover { transform: translateY(-2px); }
.ctr:active { transform: translateY(0) scale(0.995); }
.ctr-shell {
  display: block;
  min-height: 168px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--ctr);
  overflow: hidden;
}
.ctr-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 14px;
  min-width: 0;
  height: 100%;
}
.ctr-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ctr-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: #94a3b8;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.ctr.is-up .ctr-led {
  background: #22c55e;
  box-shadow:
    0 0 0 2px rgba(34, 197, 94, 0.16),
    0 0 8px rgba(34, 197, 94, 0.45);
  animation: ctrPulse 1.8s ease-in-out infinite;
}
.ctr.is-down .ctr-led {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12);
}
@keyframes ctrPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}
.ctr-id {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text2);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ctr-env {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--ctr-deep);
  border-radius: 5px;
  padding: 2px 6px;
}
.ctr-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
  text-transform: lowercase;
}
.ctr-route {
  font-size: 11px;
  color: var(--text2);
}
.ctr-gauges {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.ctr-g {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.ctr-g span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text3);
}
.ctr-g b {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.ctr-g i {
  display: block;
  height: 4px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.ctr-g i em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ctr), var(--ctr-deep));
}
.ctr-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}
.ctr-meta > span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text2);
  background: var(--hover);
  border-radius: 999px;
  padding: 3px 8px;
}
.ctr-state {
  margin-left: auto;
  color: #fff !important;
  background: #8e8e93 !important;
}
.ctr.is-up .ctr-state { background: var(--green) !important; }
.ctr.is-down .ctr-state { background: var(--red) !important; }
.ctr-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 28px 16px;
  text-align: center;
  color: var(--text2);
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}
.ctr-empty-box {
  width: 56px;
  height: 36px;
  border-radius: 8px;
  background: var(--hover);
  margin-bottom: 4px;
}
.ctr-empty b { color: var(--text); font-size: 14px; }

.home-main[data-mode="geral"] .home-wrap > .section-fleet {
  flex: 1.2 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.home-main[data-mode="geral"] .home-wrap > .section-fleet > .containers {
  flex: 1;
}

/* Bottom tab block — content swaps below the tab bar */
.home-bottom {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}
.home-bottom .bottom-panel {
  animation: bottomIn 0.18s ease;
}
.home-bottom .bottom-panel[hidden] {
  display: none !important;
}
@keyframes bottomIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Home tabs (alerts/logs) */
.home-tabs, .detail-tabs.home-tabs {
  display: flex; align-items: center; gap: 4px;
  border-top: 0.5px solid var(--sep); padding-top: 14px; margin-top: 0;
  position: sticky; top: 0; z-index: 5;
  background: var(--win);
}
.tabs .tab, .detail-tabs .tab, .home-tabs .tab {
  padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 13px;
  color: var(--text2); background: transparent; border: 0; min-height: 34px;
}
.tabs .tab.active, .detail-tabs .tab.active {
  background: var(--hover); color: var(--text);
}
.tabs .gear, .detail-tabs .tab-meta {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
}
.panel-msg { padding-top: 8px; }
.ops-list { display: flex; flex-direction: column; gap: 10px; }
.ops-alert {
  display: flex; gap: 12px; justify-content: space-between; align-items: flex-start;
  padding: 12px 14px; background: var(--card); border-radius: 12px;
  box-shadow: var(--card-shadow);
}
.ops-alert.sev-critical { border-left: 3px solid var(--red); }
.ops-alert.sev-warning { border-left: 3px solid var(--orange); }
.alert-actions { display: flex; gap: 6px; flex-shrink: 0; }
.log-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.log-controls select, .log-controls input { width: auto; min-width: 120px; }
pre.log, .log, .log-feed {
  background: var(--code); border-radius: 10px; padding: 10px 12px;
  font-family: var(--mono); font-size: 11.5px; overflow: auto;
  max-height: 420px; white-space: pre-wrap; box-shadow: 0 0 0 0.5px var(--sep);
}
.log-feed { display: flex; flex-direction: column; gap: 4px; white-space: normal; }
.log-summary {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.log-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--hover); color: var(--text2);
}
.log-chip.critical { background: var(--red-soft); color: var(--red); }
.log-chip.warning { background: var(--orange-soft); color: var(--orange); }
.log-chip.info { background: var(--accent-soft); color: var(--accent); }
.log-chip.high { background: var(--red-soft); color: var(--red); }
.log-chip.medium { background: var(--orange-soft); color: var(--orange); }
.log-chip.low { background: var(--green-soft); color: var(--green); }
.log-line, .term-line, .ops-error {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: start;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}
.log-line.sev-critical, .term-line.sev-critical, .ops-error.sev-critical {
  background: rgba(255, 59, 48, 0.08);
  border-left: 3px solid var(--red);
}
.log-line.sev-warning, .term-line.sev-warning, .ops-error.sev-warning {
  background: rgba(255, 159, 10, 0.08);
  border-left: 3px solid var(--orange);
}
.log-line.sev-info, .term-line.sev-info, .ops-error.sev-info {
  border-left: 3px solid transparent;
}
.log-tag, .log-risk {
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
  padding: 2px 6px; border-radius: 6px; text-transform: uppercase;
  white-space: nowrap; line-height: 1.3;
}
.log-tag.critical { background: var(--red-soft); color: var(--red); }
.log-tag.warning { background: var(--orange-soft); color: var(--orange); }
.log-tag.info { background: var(--accent-soft); color: var(--accent); }
.log-tag.debug { background: var(--hover); color: var(--text3); }
.log-risk.high { background: var(--red-soft); color: var(--red); }
.log-risk.medium { background: var(--orange-soft); color: var(--orange); }
.log-risk.low { background: var(--green-soft); color: var(--green); }
.log-msg { min-width: 0; word-break: break-word; color: var(--text); font-size: 11.5px; line-height: 1.45; }
.log-meta { color: var(--text3); font-size: 10.5px; margin-top: 2px; }
.log-errors-title {
  font-size: 13px; font-weight: 600; color: var(--text2);
  margin: 16px 0 0; padding: 0 2px;
}
.ops-error {
  grid-template-columns: auto auto auto 1fr;
  background: var(--card);
  box-shadow: var(--card-shadow);
}

/* Tables / misc pages */
.tablewrap { overflow: auto; border-radius: 12px; box-shadow: var(--card-shadow); background: var(--card); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 0.5px solid var(--sep); }
th { color: var(--text2); font-size: 12px; font-weight: 600; }
.page-head, .phead, .topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h1, .phead h2, .topbar h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
.page-head p, .phead p, .topbar p { color: var(--text2); margin: 4px 0 0; max-width: 640px; line-height: 1.45; }
.grid.two { display: grid; gap: 16px; }
@media (min-width: 760px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
}
.card, .panel {
  background: var(--card); border-radius: 12px; box-shadow: var(--card-shadow); padding: 16px;
}
.card h2, .panel h2 { font-size: 15px; margin-bottom: 12px; }
.card table { width: 100%; }
.card + .card, .grid.two > .card { margin-top: 0; }
.actions, .action-row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.form-grid { display: grid; gap: 10px; max-width: 560px; }
code { font-family: var(--mono); font-size: 11.5px; background: var(--hover); padding: 1px 5px; border-radius: 4px; }

/* Site preview */
.site-preview {
  background: var(--card); border-radius: 14px; box-shadow: var(--card-shadow); overflow: hidden;
}
.site-preview-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 12px 14px; border-bottom: 0.5px solid var(--sep);
}
.site-preview-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.site-preview-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.site-preview-sizes { display: inline-flex; gap: 4px; }
.site-preview-frame-wrap {
  padding: 0; background:
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px) 0 0 / 16px 16px,
    var(--surface-2);
}
.site-preview-frame-wrap[data-preview-size="tablet"],
.site-preview-frame-wrap[data-preview-size="mobile"] { padding: 12px; display: grid; place-items: center; }
.site-preview-frame {
  width: 100%; min-height: 52vh; height: min(68vh, 780px);
  border: 0; background: #fff; display: block;
}
.site-preview-frame-wrap[data-preview-size="tablet"] .site-preview-frame {
  width: min(100%, 768px); border-radius: 16px; border: 0.5px solid var(--sep);
}
.site-preview-frame-wrap[data-preview-size="mobile"] .site-preview-frame {
  width: min(100%, 390px); border-radius: 20px; border: 0.5px solid var(--sep);
}
.site-preview-offline {
  min-height: 40vh; display: grid; place-content: center; gap: 12px;
  text-align: center; color: var(--muted); padding: 24px;
}

/* Preview fullscreen */
body.preview-fs {
  overflow: hidden;
}
body.preview-fs .site-preview {
  position: fixed;
  inset: 0;
  z-index: 90;
  border-radius: 0;
  box-shadow: none;
  background: #0b0b0c;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
body.preview-fs .site-preview-bar {
  background: rgba(28, 28, 30, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: #f5f5f7;
}
body.preview-fs .site-preview-title strong,
body.preview-fs .site-preview-title a {
  color: #f5f5f7;
}
body.preview-fs .site-preview-frame-wrap {
  flex: 1;
  min-height: 0;
  height: auto;
  background: #111;
}
body.preview-fs .site-preview-frame,
body.preview-fs .site-preview-offline {
  min-height: 0;
  height: 100%;
}
body.preview-fs .site-preview-frame-wrap[data-preview-size="desktop"] .site-preview-frame {
  border-radius: 0;
}
body.preview-fs [data-preview-fs] {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

/* Floating log window */
.project-workspace.is-log-float {
  grid-template-columns: 1fr;
}
.term.is-float {
  position: fixed;
  z-index: 96;
  width: min(560px, calc(100vw - 24px));
  height: min(440px, calc(100vh - 48px));
  right: 18px;
  bottom: 18px;
  margin: 0;
  resize: both;
  overflow: hidden;
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.45),
    0 0 0 0.5px rgba(255, 255, 255, 0.12);
}
.term.is-float .term-chrome {
  cursor: grab;
  user-select: none;
}
.term.is-float .term-chrome:active {
  cursor: grabbing;
}
.term.is-float .term-dock {
  display: inline-flex !important;
}
.term .term-dock[hidden] {
  display: none !important;
}
body.preview-fs .term.is-float {
  z-index: 97;
}

/* Home + project — fill available viewport */
.home-main[data-mode="geral"],
.home-main[data-mode="project"] {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.home-main[data-mode="geral"] #panel,
.home-main[data-mode="geral"] .home-shell,
.home-main[data-mode="project"] #panel,
.home-main[data-mode="project"] .home-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.home-main[data-mode="geral"] .home-wrap {
  max-width: none;
  width: 100%;
  flex: 1;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 14px 18px calc(14px + var(--safe-bottom));
  gap: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.home-main[data-mode="geral"] .home-wrap > .hero,
.home-main[data-mode="geral"] .home-wrap > .tiles {
  flex: none;
}
.home-main[data-mode="geral"] .home-wrap > .section {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.home-main[data-mode="geral"] .home-wrap > .section > .group {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.home-main[data-mode="geral"] .home-bottom {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.home-main[data-mode="geral"] .home-bottom .home-tabs {
  flex: none;
  position: static;
  background: var(--win);
}
.home-main[data-mode="geral"] .home-bottom .bottom-panel:not([hidden]) {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.home-main[data-mode="geral"] .home-bottom .bottom-panel .cols {
  flex: 1;
  min-height: 0;
  align-items: stretch;
}
.home-main[data-mode="geral"] .home-bottom .bottom-panel .cols > .section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.home-main[data-mode="geral"] .home-bottom .bottom-panel .cols .group {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.home-main[data-mode="geral"] .home-bottom .log-feed {
  flex: 1;
  min-height: 180px;
}

.project-detail.home-wrap {
  max-width: none;
  width: 100%;
  flex: 1;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 14px 18px calc(14px + var(--safe-bottom));
  gap: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.project-hero { flex: none; }
.project-hero h2 { font-size: 22px; }
.quota-launcher {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.quota-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}
.quota-sheet[hidden] { display: none !important; }
.quota-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.quota-sheet-card {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  margin: 0;
  padding: 18px 18px 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}
.quota-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.quota-sheet-head h3 {
  margin: 0;
  font-size: 17px;
}
.quota-sheet .quota-form {
  grid-template-columns: 1fr;
}
.quota-status {
  grid-column: 1 / -1;
  min-height: 1.2em;
  margin: 0;
  font-size: 12px;
}
.quota-status.is-error { color: var(--red); }
.quota-status.is-ok { color: var(--green); }
body.quota-open { overflow: hidden; }
.project-workspace {
  flex: 1.25 1 0;
  min-height: 220px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  gap: 12px;
}
.project-detail > .home-bottom {
  flex: 1 1 0;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  overflow: hidden;
}
.project-detail > .home-bottom .home-tabs {
  flex: none;
  position: static;
  background: var(--win);
}
.project-detail > .home-bottom .bottom-panel:not([hidden]) {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.project-detail > .home-bottom .bottom-panel .project-bottom {
  flex: 1;
  min-height: 0;
  height: 100%;
  align-items: stretch;
}
.project-workspace .site-preview-cell,
.project-workspace .site-preview {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.project-workspace .site-preview-frame-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.project-workspace .site-preview-frame,
.project-workspace .site-preview-offline {
  flex: 1;
  min-height: 0;
  height: auto;
}
.project-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: stretch;
}
.project-bottom > .project-stats-cols {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  height: 100%;
}
.project-bottom > .project-stats-cols > .section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.project-bottom > .project-stats-cols .group {
  flex: 1;
}
.project-bottom > .project-actions-sec {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.project-bottom > .project-actions-sec .project-actions {
  flex: 1;
  align-content: start;
}
.project-stat-card { padding: 12px 14px; }
.project-stat-card .big { font-size: 22px; }
.project-actions {
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quota-form {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: end;
}
.quota-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.quota-form input {
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.quota-form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
@media (max-width: 720px) {
  .quota-form { grid-template-columns: 1fr; }
}

/* macOS Terminal */
.term {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  background: #1c1c1e;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.22),
    0 0 0 0.5px rgba(0, 0, 0, 0.35);
  color: #f5f5f7;
}
.term-chrome {
  flex: none;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: linear-gradient(180deg, #3a3a3c 0%, #2c2c2e 100%);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
}
.term-dots { display: flex; gap: 7px; flex: none; }
.term-dots span {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.25);
}
.term-dots .c { background: #ff5f57; }
.term-dots .y { background: #febc2e; }
.term-dots .g { background: #28c840; }
.term-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.term-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.term-seg {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 2px;
}
.term-seg button {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}
.term-seg button.on {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.term-live {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
  cursor: pointer;
  width: auto !important;
  max-width: none;
  justify-content: flex-start !important;
  flex: none;
  white-space: nowrap;
  line-height: 1;
  padding: 2px 0;
}
.term-live > span { order: 0; }
.term-live input[type="checkbox"] {
  order: 1 !important;
  margin: 0 !important;
  width: 34px;
  height: 20px;
  flex: none;
}
.term-live input[type="checkbox"]::before {
  width: 16px;
  height: 16px;
  top: 2px;
  left: 2px;
}
.term-live input[type="checkbox"]:checked::before {
  transform: translateX(14px);
}
.term-live input[type="checkbox"]:checked:active::before {
  transform: translateX(11px);
}
.tbtn.term-clear {
  width: 28px;
  height: 24px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.65);
  display: grid;
  place-items: center;
}
.tbtn.term-clear:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.term-body {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 10px 10px 14px;
  overflow: auto;
  background: #0b0b0c;
  color: #d7dbdf;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 3px;
  tab-size: 2;
}
.term-body .term-line {
  background: transparent;
  padding: 4px 6px;
  border-radius: 6px;
}
.term-body .term-line.sev-critical { background: rgba(255, 69, 58, 0.12); }
.term-body .term-line.sev-warning { background: rgba(255, 159, 10, 0.1); }
.term-body .log-msg { color: #d7dbdf; }
.term-body .log-tag.critical,
.term-body .log-risk.high { background: rgba(255, 69, 58, 0.22); color: #ff8a80; }
.term-body .log-tag.warning,
.term-body .log-risk.medium { background: rgba(255, 159, 10, 0.2); color: #ffcc80; }
.term-body .log-tag.info,
.term-body .log-risk.low { background: rgba(255, 255, 255, 0.08); color: #a1a1a6; }
.term-body::-webkit-scrollbar { width: 10px; }
.term-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  border: 2px solid #0b0b0c;
}
.term-foot {
  flex: none;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  background: #161618;
  border-top: 0.5px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
}

/* Hide legacy mid-pane if present */
.list, .mid-pane { display: none !important; }

/* Responsive */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: 1fr; }
  .project-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 1fr) minmax(200px, 0.9fr);
  }
  .project-bottom { grid-template-columns: 1fr; }
  .home-main[data-mode="geral"] .home-wrap {
    overflow: auto;
  }
  .home-main[data-mode="geral"] .home-wrap > .section,
  .home-main[data-mode="geral"] .home-bottom {
    flex: none;
    min-height: auto;
    overflow: visible;
  }
}
@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .home-wrap, .wrap { padding: 16px 14px calc(28px + var(--safe-bottom)); }
  .home-main[data-mode="geral"] .home-wrap,
  .project-detail.home-wrap { padding: 12px 12px calc(12px + var(--safe-bottom)); overflow: auto; }
  .project-detail > .home-bottom {
    flex: none;
    min-height: auto;
    overflow: visible;
  }
  .project-workspace { min-height: 360px; }
  .hero h2 { font-size: 20px; }
  .hero-acts { margin-left: 0; width: 100%; }
  .hero-acts .btn { flex: 1; }
  .bar { width: 70px; }
  .content.content-full { padding: 16px 14px calc(24px + var(--safe-bottom)); }
  .term-title { display: none; }
  .term-seg { display: none; }
}
@media (max-width: 480px) {
  .tiles { grid-template-columns: 1fr; }
}

@media (min-width: 760px) {
  .mobile-top { display: none; }
  .nav-backdrop { display: none !important; }
  .nav-toggle { display: none; }
  body.nav-lock { overflow: auto; }

  .app-frame.app,
  .app,
  body.is-home .app-frame.app,
  body.is-home .app {
    grid-template-columns: 236px minmax(0, 1fr);
    grid-template-rows: 1fr;
  }

  .side, .sidebar {
    position: sticky; top: 0;
    height: 100vh; height: 100dvh;
    width: auto; transform: none; transition: none;
    box-shadow: none; z-index: 1;
  }
  .app-frame.nav-open .side { transform: none; }

  .main, .content.detail-pane, .content.content-full, .home-main {
    height: 100vh; height: 100dvh;
  }
  .content.content-full { padding: 24px 28px 40px; }
  .home-wrap, .wrap { padding: 24px 28px 48px; }
  .project-detail.home-wrap { padding: 16px 20px 18px; }
}

/* Projects table mobile labels */
@media (max-width: 759px) {
  .projects-table thead { display: none; }
  .projects-table tr {
    display: block; margin-bottom: 10px; padding: 12px;
    background: var(--card); border-radius: 12px; box-shadow: var(--card-shadow);
  }
  .projects-table td {
    display: flex; justify-content: space-between; gap: 12px;
    border: 0; padding: 6px 0;
  }
  .projects-table td::before {
    content: attr(data-label); color: var(--text2); font-weight: 600;
  }
}
