:root {
  color-scheme: dark;
  --bg: #081014;
  --surface: #0d181e;
  --surface-2: #122129;
  --surface-3: #172a33;
  --line: #233943;
  --line-soft: rgba(129, 177, 191, .16);
  --ink: #eff7f8;
  --muted: #8fa6ad;
  --teal: #25c2b3;
  --teal-strong: #19a99d;
  --teal-soft: rgba(37, 194, 179, .12);
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, .24);
  --sidebar-width: 244px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f6f6;
  --surface: #ffffff;
  --surface-2: #f7fbfb;
  --surface-3: #eaf3f3;
  --line: #d5e2e3;
  --line-soft: rgba(34, 69, 77, .12);
  --ink: #12252b;
  --muted: #667e85;
  --teal-soft: rgba(16, 159, 148, .1);
  --shadow: 0 18px 50px rgba(39, 69, 74, .1);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 0%, rgba(37, 194, 179, .08), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  transition: width .22s ease, padding .22s ease, transform .2s ease;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 7px 26px; }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 13px; background: transparent;
  color: #031719; font-weight: 900; letter-spacing: -.06em;
  box-shadow: none;
}
.brand-mark img { width: 44px; height: 44px; display: block; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.main-nav { display: grid; gap: 6px; }
.main-nav a {
  display: flex; align-items: center; gap: 11px; min-height: 44px;
  padding: 0 13px; border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 650;
}
.main-nav a span { width: 22px; text-align: center; font-size: 17px; }
.main-nav a:hover { color: var(--ink); background: var(--surface-2); }
.main-nav a.active { color: var(--ink); background: var(--teal-soft); box-shadow: inset 3px 0 var(--teal); }
.sidebar-note {
  margin-top: auto; padding: 15px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface-2);
}
.safe-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(74,222,128,.08); }
.sidebar-note strong { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-note p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.sidebar-footer { display: grid; gap: 12px; margin-top: 16px; color: var(--muted); }
.theme-toggle { display: flex; align-items: center; gap: 10px; padding: 9px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); }
.sidebar-footer small { padding-left: 9px; font-size: 10px; }

.main-content { min-height: 100vh; margin-left: var(--sidebar-width); transition: margin-left .22s ease; }
.sidebar-collapsed .sidebar { width: 76px; padding-inline: 12px; }
.sidebar-collapsed .main-content { margin-left: 76px; }
.sidebar-collapsed .brand { justify-content: center; padding-inline: 0; }
.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .sidebar-note,
.sidebar-collapsed .theme-label,
.sidebar-collapsed .sidebar-footer small { display: none; }
.sidebar-collapsed .main-nav a { justify-content: center; padding-inline: 0; }
.sidebar-collapsed .main-nav a span:first-child { width: 38px; }
.sidebar-collapsed .theme-toggle { justify-content: center; padding-inline: 0; }
.topbar {
  min-height: 91px; display: flex; align-items: center; gap: 16px;
  padding: 18px clamp(22px, 4vw, 54px); border-bottom: 1px solid var(--line-soft);
}
.topbar h1 { margin: 3px 0 0; font-size: clamp(19px, 2.2vw, 26px); letter-spacing: -.025em; }
.eyebrow, .section-kicker { color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.local-badge {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.local-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar-actions .local-badge { margin-left: 0; }
.shortcuts-menu { position: relative; }
.shortcuts-button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); cursor: pointer; transition: border-color .18s ease, color .18s ease, transform .18s ease; }
.shortcuts-button:hover, .shortcuts-button[aria-expanded="true"] { border-color: var(--teal); color: var(--teal); }
.shortcuts-button[aria-expanded="true"] { transform: rotate(28deg); }
.shortcuts-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.shortcuts-button:focus-visible, .shortcuts-list a:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.shortcuts-list { position: absolute; z-index: 30; top: calc(100% + 10px); right: 0; display: grid; width: max-content; min-width: 220px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.shortcuts-list[hidden] { display: none; }
.shortcuts-list a { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 12px; border-radius: 8px; color: var(--ink); font-size: 13px; text-decoration: none; }
.shortcuts-list a:hover { background: var(--surface-2); color: var(--teal); }
.shortcuts-list a span { color: var(--muted); font-size: 12px; }
.menu-toggle { display: none; border: 0; background: transparent; font-size: 20px; }
.content { width: min(1460px, 100%); margin: 0 auto; padding: 32px clamp(22px, 4vw, 54px) 56px; }

.hero-panel {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 32px;
  min-height: 248px; padding: clamp(28px, 4vw, 46px);
  border: 1px solid var(--line); border-radius: 18px;
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--surface-2) 96%, transparent), color-mix(in srgb, var(--teal) 7%, var(--surface))),
    repeating-linear-gradient(90deg, transparent 0 54px, var(--line-soft) 55px);
  box-shadow: var(--shadow);
}
.hero-panel::after {
  content: ""; position: absolute; right: 9%; top: -50%; width: 310px; height: 310px;
  border: 1px solid rgba(37,194,179,.18); border-radius: 50%; box-shadow: 0 0 0 42px rgba(37,194,179,.025), 0 0 0 84px rgba(37,194,179,.018);
}
.hero-panel > div { position: relative; z-index: 1; }
.central-home-logo {
  width: clamp(250px, 38vw, 470px);
  margin: 0 0 24px;
}
.central-home-logo img {
  display: block;
  width: 100%;
  height: auto;
}
.central-home-logo-light { display: none !important; }
[data-theme="light"] .central-home-logo-dark { display: none; }
[data-theme="light"] .central-home-logo-light { display: block !important; }
.hero-panel h2 { max-width: 760px; margin: 13px 0 15px; font-size: clamp(28px, 4vw, 48px); line-height: 1.02; letter-spacing: -.045em; }
.hero-panel h2 em { color: var(--teal); font-style: normal; }
.hero-panel p { max-width: 680px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.hero-seal {
  flex: 0 0 116px; width: 116px; height: 116px; display: grid; place-content: center; text-align: center;
  border: 1px solid rgba(37,194,179,.38); border-radius: 50%; background: rgba(37,194,179,.06);
}
.hero-seal span { font-size: 41px; font-weight: 300; line-height: 1; }
.hero-seal small { margin-top: 8px; color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .15em; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 42px; }
.summary-card { padding: 17px 19px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.summary-card span, .summary-card small { display: block; }
.summary-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.summary-card strong { display: block; margin: 9px 0 4px; font-size: 28px; font-weight: 500; }
.summary-card small { color: var(--muted); font-size: 10px; }
.summary-card strong.positive, .shield-count { color: var(--teal); }
.summary-card strong.attention { color: var(--amber); }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 17px; }
.section-heading h2, .diagnostic-table-card h2 { margin: 5px 0 0; font-size: 23px; letter-spacing: -.03em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.module-card {
  position: relative; min-height: 330px; display: flex; flex-direction: column; padding: 20px;
  border: 1px solid var(--line); border-radius: 15px; background: var(--surface);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.module-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 15px 0 0 15px;
  background: var(--module-color); opacity: .72;
}
.module-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--module-color) 35%, var(--line)); box-shadow: var(--shadow); }
.module-card-top { display: flex; justify-content: space-between; align-items: start; }
.module-icon {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px;
  background: color-mix(in srgb, var(--module-color) 14%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--module-color) 28%, var(--line));
  font-size: 22px; filter: saturate(.85);
}
.module-icon.large { width: 68px; height: 68px; flex: 0 0 68px; border-radius: 17px; font-size: 31px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px; width: max-content;
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); background: var(--surface-2); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-online, .status-executando, .status-pronto { color: var(--green); border-color: rgba(74,222,128,.23); background: rgba(74,222,128,.06); }
.status-starting { color: var(--amber); border-color: rgba(251,191,36,.25); background: rgba(251,191,36,.07); }
.status-error { color: var(--amber); border-color: rgba(251,191,36,.32); background: rgba(251,191,36,.08); }
.status-offline { color: var(--red); border-color: rgba(251,113,133,.2); background: rgba(251,113,133,.06); }
.status-monitorado { color: var(--teal); border-color: rgba(37,194,179,.22); background: var(--teal-soft); }
.module-type { margin-top: 21px; color: var(--module-color); font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.module-card h3 { margin: 7px 0 9px; font-size: 18px; letter-spacing: -.025em; }
.module-card p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.62; }
.module-meta { display: flex; gap: 18px; margin-top: auto; padding: 17px 0 14px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.module-meta strong { color: var(--ink); }
.module-actions { display: flex; gap: 8px; }
.portal-menu { position: relative; }
.portal-menu-list { position: absolute; right: 0; bottom: calc(100% + 7px); z-index: 15; min-width: 145px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); box-shadow: var(--shadow); }
.portal-menu-list a, .portal-menu-list button { width: 100%; display: block; padding: 10px 12px; border: 0; background: transparent; color: var(--ink); text-align: left; font: inherit; font-size: 10px; cursor: pointer; }
.portal-menu-list a:hover, .portal-menu-list button:hover { background: var(--teal-soft); }
.portal-log-dialog { width: min(880px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.portal-log-dialog::backdrop { background: rgba(0,0,0,.55); }
.portal-log-dialog header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.portal-log-dialog header button { border: 0; background: transparent; color: var(--ink); font-size: 22px; cursor: pointer; }
.portal-log-dialog pre { max-height: 580px; overflow: auto; margin: 0; padding: 16px; background: #071014; color: #b9cbcf; font: 10.5px/1.6 Consolas, monospace; white-space: pre-wrap; }
.backup-quick-controls { display: grid; gap: 7px; margin-top: 9px; }
.backup-quick-controls .button { width: 100%; min-height: 34px; font-size: 10px; }
.button {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 14px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-2); color: var(--ink); font-size: 10.5px; font-weight: 750; cursor: pointer;
}
.button:hover { filter: brightness(1.08); border-color: color-mix(in srgb, var(--teal) 36%, var(--line)); }
.button.primary { flex: 1; border-color: var(--teal-strong); background: var(--teal); color: #05201f; }
.button.secondary { background: var(--surface); }
.button.danger { border-color: rgba(251,113,133,.4); color: var(--red); }
.button.disabled { flex: 1; color: var(--muted); cursor: not-allowed; opacity: .72; }
.icon-button { width: 38px; padding: 0; font-size: 17px; }
button:disabled { opacity: .58; cursor: wait; }

.protection-banner {
  display: flex; align-items: center; gap: 15px; margin-top: 28px; padding: 18px 20px;
  border: 1px solid rgba(37,194,179,.2); border-radius: 13px; background: var(--teal-soft);
}
.protection-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--teal); color: #04201f; }
.protection-banner strong { font-size: 12px; }
.protection-banner p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; }
.protection-banner a { margin-left: auto; color: var(--teal); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }

.back-link { display: inline-flex; margin-bottom: 18px; color: var(--muted); font-size: 11px; font-weight: 700; }
.back-link:hover { color: var(--teal); }
.module-hero {
  display: flex; align-items: center; gap: 20px; padding: 28px;
  border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(110deg, color-mix(in srgb, var(--module-color) 7%, var(--surface)), var(--surface));
}
.module-hero-copy { flex: 1; }
.module-hero-copy h2 { margin: 10px 0 7px; font-size: 29px; }
.module-hero-copy p { max-width: 680px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.module-hero-actions { display: flex; gap: 9px; }
.module-hero-actions .button { min-width: 130px; }
.backup-control-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 15px; margin-top: 16px; }
.backup-service-card { grid-column: 1 / -1; }
.backup-mode-status, .backup-server-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.backup-mode-status { margin: 16px 0; }
.backup-mode-status span { border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; }
.backup-action-card { background: linear-gradient(145deg, rgba(139,92,246,.08), var(--surface)); }
.button.backup-running { position: relative; overflow: hidden; min-width: 235px; }
.button.backup-running::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.16) 48%, transparent 76%);
  transform: translateX(-110%); animation: backup-working 1.7s linear infinite;
}
@keyframes backup-working { to { transform: translateX(110%); } }
.backup-schedule-form { display: grid; gap: 13px; margin-top: 18px; }
.backup-time-list { display: grid; gap: 8px; }
.backup-time-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto; gap: 8px; }
.backup-time-row input {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-2); color: var(--ink); color-scheme: inherit;
}
.backup-time-row input:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }
.backup-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 3px; }
.detail-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 15px; margin-top: 16px; }
.detail-card { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.detail-card h3 { margin: 7px 0 12px; font-size: 18px; }
.detail-card > p { color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.detail-card dl { display: grid; gap: 10px; margin: 20px 0 0; }
.detail-card dl div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.detail-card dt { color: var(--muted); font-size: 10px; }
.detail-card dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 10px; }
.backup-snapshot-card.has-warning { border-color: rgba(251,191,36,.42); }
.backup-snapshot-card dl div { grid-template-columns: 132px 1fr; }
.backup-snapshot-card dd strong { color: var(--ink); font-size: 11px; }
.backup-warning {
  margin: 16px 0 0; padding: 10px 12px; border: 1px solid rgba(251,191,36,.28); border-radius: 9px;
  background: rgba(251,191,36,.07); color: var(--amber) !important;
}
.backup-timezone-note { margin: 10px 0 0 !important; font-size: 9.5px !important; }
.data-list { display: grid; gap: 10px; padding: 0; margin: 18px 0; list-style: none; }
.data-list li { display: flex; gap: 9px; color: var(--muted); font-size: 11px; }
.data-list span { color: var(--teal); }
.quiet { font-size: 10px !important; }
.resource-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.resource-row a { display: grid; grid-template-columns: 35px 1fr; column-gap: 10px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.resource-row a > span { grid-row: span 2; width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; background: var(--teal-soft); color: var(--teal); }
.resource-row strong { align-self: end; font-size: 11px; }
.resource-row small { color: var(--muted); font-size: 9.5px; }

.page-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.page-toolbar .back-link { margin: 0; }
.markdown-document { max-width: 960px; padding: clamp(24px, 4vw, 48px); border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.markdown-document h1 { margin: 0 0 28px; font-size: 31px; }
.markdown-document h2 { margin: 34px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 20px; }
.markdown-document h3 { margin: 25px 0 9px; font-size: 15px; }
.markdown-document p, .markdown-document li { color: var(--muted); font-size: 12px; line-height: 1.75; }
.markdown-document code { padding: 2px 5px; border-radius: 5px; background: var(--surface-3); color: var(--teal); }
.markdown-document pre { overflow: auto; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: #071014; }
.markdown-document pre code { padding: 0; background: transparent; color: #d9e9eb; }

.log-stack { display: grid; gap: 14px; }
.log-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.log-panel header { display: flex; justify-content: space-between; gap: 20px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.log-panel header strong, .log-panel header small { display: block; }
.log-panel header strong { font-size: 11px; }
.log-panel header small, .log-panel header > span { margin-top: 4px; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.log-panel pre { max-height: 430px; overflow: auto; margin: 0; padding: 16px; background: #071014; color: #b9cbcf; font: 10.5px/1.6 Consolas, monospace; white-space: pre-wrap; }
.log-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.log-summary article { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.log-summary article.has-errors { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.log-summary span, .log-summary strong { display: block; }
.log-summary span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.log-summary strong { margin-top: 6px; font-size: 24px; }
.log-summary .has-errors strong { color: var(--red); }
.log-toolbar { display: flex; align-items: end; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.log-toolbar label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; }
.log-toolbar select, .log-toolbar input[type="search"] { min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--ink); }
.log-toolbar select { max-width: 310px; }
.log-search-label { flex: 1; }
.log-auto-refresh { display: flex !important; grid-template-columns: auto 1fr; align-items: center; min-height: 38px; white-space: nowrap; }
.log-security-note { margin: 10px 2px 14px; color: var(--muted); font-size: 9.5px; }
.global-log-panel summary { display: flex; justify-content: space-between; gap: 20px; padding: 14px 16px; cursor: pointer; list-style-position: inside; }
.global-log-panel summary strong, .global-log-panel summary small { display: block; }
.global-log-panel summary strong { font-size: 11px; }
.global-log-panel summary small, .log-panel-meta { margin-top: 4px; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.global-log-panel.log-has-errors { border-color: color-mix(in srgb, var(--red) 38%, var(--line)); }
.log-panel-meta { display: grid; align-content: center; justify-items: end; flex: 0 0 auto; }
.log-error-count { color: var(--red); font-weight: 800; }
.global-log-panel[hidden] { display: none; }

.diagnostic-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.diagnostic-intro h2 { margin: 6px 0; font-size: 27px; }
.diagnostic-intro p { margin: 0; color: var(--muted); font-size: 11px; }
.system-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.system-grid article { padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.system-grid span, .system-grid strong { display: block; }
.system-grid span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.system-grid strong { margin-top: 8px; font-size: 13px; overflow-wrap: anywhere; }
.diagnostic-table-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.diagnostic-table-card > header { padding: 19px 21px; border-bottom: 1px solid var(--line); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 12px 16px; color: var(--muted); text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; background: var(--surface-2); }
td { padding: 14px 16px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.check { display: inline-flex; padding: 4px 7px; border-radius: 6px; font-size: 9px; font-weight: 800; }
.check.ok { color: var(--green); background: rgba(74,222,128,.07); }
.check.bad { color: var(--red); background: rgba(251,113,133,.07); }
details summary { color: var(--red); cursor: pointer; }
details small { display: block; max-width: 390px; margin-top: 7px; color: var(--muted); overflow-wrap: anywhere; }
.path-card { display: grid; gap: 10px; margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.path-card div { display: grid; grid-template-columns: 120px 1fr; gap: 14px; }
.path-card span { color: var(--muted); font-size: 10px; }
.path-card code { color: var(--teal); font-size: 10px; overflow-wrap: anywhere; }

.toast {
  position: fixed; right: 25px; bottom: 25px; z-index: 100; max-width: 420px;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-3); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(15px); pointer-events: none; transition: .2s ease;
  font-size: 11px; line-height: 1.5;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.success { border-color: rgba(74,222,128,.35); }
.toast.error { border-color: rgba(251,113,133,.45); }

@media (max-width: 1200px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .sidebar,
  .sidebar-collapsed .sidebar { width: var(--sidebar-width); padding: 24px 18px; transform: translateX(-100%); box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .main-content, .sidebar-collapsed .main-content { margin-left: 0; }
  .sidebar-collapsed .brand { justify-content: flex-start; padding: 0 7px 26px; }
  .sidebar-collapsed .brand-copy,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .sidebar-note,
  .sidebar-collapsed .theme-label,
  .sidebar-collapsed .sidebar-footer small { display: initial; }
  .sidebar-collapsed .sidebar-note { display: block; }
  .sidebar-collapsed .main-nav a { justify-content: flex-start; padding: 0 13px; }
  .sidebar-collapsed .main-nav a span:first-child { width: 22px; }
  .sidebar-collapsed .theme-toggle { justify-content: flex-start; padding: 9px; }
  .menu-toggle { display: block; }
  .local-badge { display: none; }
  .topbar-actions { gap: 8px; }
  .summary-grid, .system-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .backup-control-grid { grid-template-columns: 1fr; }
  .module-hero { align-items: flex-start; flex-wrap: wrap; }
  .module-hero-actions { width: 100%; }
  .log-toolbar { align-items: stretch; flex-direction: column; }
  .log-toolbar select, .log-toolbar input[type="search"], .log-toolbar .button { width: 100%; max-width: none; }
}
@media (max-width: 580px) {
  .topbar { min-height: 76px; }
  .content { padding-top: 20px; }
  .hero-panel { min-height: 0; padding: 27px 23px; }
  .central-home-logo { width: min(100%, 390px); margin-bottom: 20px; }
  .hero-panel h2 { font-size: 30px; }
  .hero-seal { display: none; }
  .summary-grid, .module-grid, .system-grid, .resource-row, .log-summary { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .module-card { min-height: 310px; }
  .module-hero-actions { flex-direction: column; }
  .module-hero-actions .button { width: 100%; }
  .backup-form-actions { flex-direction: column; }
  .backup-form-actions .button { width: 100%; }
  .protection-banner { align-items: flex-start; flex-wrap: wrap; }
  .protection-banner a { margin-left: 53px; }
  .path-card div { grid-template-columns: 1fr; gap: 5px; }
  .global-log-panel summary { align-items: flex-start; flex-direction: column; }
  .log-panel-meta { justify-items: start; }
}

/* Botão de recolher padronizado */
@media(min-width:851px){.menu-toggle{display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--line);border-radius:9px;background:var(--surface-2);color:var(--ink);cursor:pointer}}
