@import url("https://fonts.googleapis.com/css2?family=Alatsi&family=Instrument+Sans:wght@400;500;600;700&family=Red+Hat+Mono:wght@400;500;600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=block");

/* CyberHUB — componentes. Toda cor, espaço e raio vem de tokens.css. */
body { margin: 0; background: var(--surface); color: var(--on-surface); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }

/* utilitários */
.ch-icon { font-family: "Material Symbols Outlined"; font-weight: normal; font-style: normal; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; width: 1em; height: 1em; overflow: hidden; white-space: nowrap; direction: ltr; vertical-align: middle; flex-shrink: 0; font-feature-settings: "liga"; }
.ch-muted { color: var(--on-surface-variant); }
.ch-upper { text-transform: uppercase; }
.ch-num { font-variant-numeric: tabular-nums; }
.ch-tone-primary { color: var(--primary); }
.ch-tone-error { color: var(--error); }
.ch-tone-success { color: var(--success-text); }
.ch-tone-warning { color: var(--warning-text); }
.ch-tone-muted { color: var(--on-surface-variant); }
.ch-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ch-btn:focus-visible, .ch-tab:focus-visible, .ch-nav__item:focus-visible, .ch-check:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ch-btn, .ch-tab, .ch-nav__item, .ch-table tbody tr { transition: none !important; } }

/* Button */
.ch-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--gutter-sm); border: 1px solid transparent; border-radius: var(--radius-default); font-family: var(--font-body); color: var(--on-surface); background: transparent; cursor: pointer; white-space: nowrap; transition: background-color var(--duration-state-change) var(--ease-state-change), border-color var(--duration-state-change) var(--ease-state-change), opacity var(--duration-state-change) var(--ease-state-change); }
.ch-btn--md { height: var(--control-height); padding: 0 var(--gutter-md); }
.ch-btn--sm { padding: var(--gutter-xs) var(--pad-control); }
.ch-btn--block { width: 100%; }
.ch-btn--primary { background: var(--primary-container); color: var(--on-primary-container); }
.ch-btn--primary:hover { opacity: .9; }
.ch-btn--secondary { background: var(--bg-card); border-color: var(--outline-variant); }
.ch-btn--secondary:hover { background: var(--bg-button-hover); }
.ch-btn--outline { border-color: var(--outline-variant); }
.ch-btn--outline:hover { border-color: var(--primary); }
.ch-btn--destructive { background: var(--error); color: var(--on-error); }
.ch-btn--destructive:hover { opacity: .9; }
.ch-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Badge */
.ch-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--radius-sm); white-space: nowrap; }
.ch-badge__dot { width: 6px; height: 6px; border-radius: var(--radius-full); flex-shrink: 0; }
.ch-badge--success { background: var(--success-container); color: var(--on-success-container); }
.ch-badge--success .ch-badge__dot { background: var(--success); }
.ch-badge--warning { background: var(--warning-container); color: var(--on-warning-container); }
.ch-badge--warning .ch-badge__dot { background: var(--warning); }
.ch-badge--error { background: var(--error-container); color: var(--on-error-container); }
.ch-badge--error .ch-badge__dot { background: var(--error); }
.ch-badge--neutral { border-radius: var(--radius-full); background: var(--surface-container-high); color: var(--on-surface-variant); }

/* superfícies */
.ch-card { box-sizing: border-box; border: 1px solid var(--outline-variant); border-radius: var(--radius-lg); background: var(--bg-card); color: var(--on-surface); }
.ch-card h2, .ch-card h3, .ch-card h4 { margin: 0; }

/* KpiCard */
.ch-kpi { height: 100%; padding: var(--pad-card); display: flex; flex-direction: column; justify-content: space-between; gap: var(--gutter-sm); }
.ch-kpi__head, .ch-kpi__body { display: flex; align-items: center; justify-content: space-between; gap: var(--gutter-sm); }
.ch-kpi__label { color: var(--on-surface-variant); }
.ch-kpi__value { font-family: var(--font-display); }

/* ServiceTile */
.ch-tile { height: 100%; padding: var(--pad-tile); display: flex; flex-direction: column; justify-content: space-between; gap: var(--gutter-sm); }
.ch-tile__head { display: flex; align-items: center; justify-content: space-between; gap: var(--gutter-sm); }
.ch-dot { width: 10px; height: 10px; border-radius: var(--radius-full); flex-shrink: 0; }
.ch-dot--ok { background: var(--success); }
.ch-dot--warn { background: var(--warning); }
.ch-dot--down { background: var(--error); }

/* Tabs */
.ch-tabs { display: inline-flex; align-items: center; gap: var(--gutter-xs); padding: var(--gutter-xs); width: fit-content; max-width: 100%; overflow-x: auto; border: 1px solid var(--outline-variant); border-radius: var(--radius-default); background: var(--bg-tab-track); box-sizing: border-box; }
.ch-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px var(--pad-control); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--on-surface-variant); font-family: var(--font-body); cursor: pointer; white-space: nowrap; transition: background-color var(--duration-state-change) var(--ease-state-change), color var(--duration-state-change) var(--ease-state-change); }
.ch-tab:hover { color: var(--on-surface); }
.ch-tab.is-active { background: var(--bg-tab-active); color: var(--on-surface); }

/* DataTable */
.ch-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--outline-variant); border-radius: var(--radius-lg); background: var(--bg-card); box-sizing: border-box; }
.ch-table { width: 100%; border-collapse: collapse; text-align: left; color: var(--on-surface); }
.ch-table thead { background: var(--bg-table-head); border-bottom: 1px solid var(--outline-variant); }
.ch-table th { padding: var(--pad-control) var(--gutter-md); color: var(--on-surface-variant); font-weight: inherit; }
.ch-table td { padding: var(--pad-tile) var(--gutter-md); vertical-align: middle; }
.ch-table tbody tr + tr { border-top: 1px solid var(--outline-variant); }
.ch-table tbody tr { transition: background-color var(--duration-state-change) var(--ease-state-change); }
.ch-table tbody tr:hover, .ch-table tbody tr.is-selected { background: var(--bg-row-hover); }
.ch-table .is-right { text-align: right; }
.ch-table__check { width: 40px; }
.ch-check { width: 16px; height: 16px; margin: 0; accent-color: var(--primary-container); vertical-align: middle; }

/* EntityCell */
.ch-entity { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* ActionCard */
.ch-action { height: 100%; padding: var(--pad-card); display: flex; flex-direction: column; justify-content: space-between; gap: var(--gutter-md); }
.ch-action__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--gutter-sm); }
.ch-action--detail .ch-action__head { padding-bottom: var(--pad-control); border-bottom: 1px solid var(--outline-variant); }
.ch-action__titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ch-action__body { display: flex; flex-direction: column; gap: var(--gutter-sm); }
.ch-action__foot { padding-top: var(--pad-control); border-top: 1px solid var(--outline-variant); display: flex; align-items: center; justify-content: space-between; gap: var(--gutter-sm); flex-wrap: wrap; }
.ch-action__foot--stack { flex-direction: column; align-items: stretch; }

/* MetaList */
.ch-meta { margin: 0; display: flex; flex-direction: column; gap: var(--gutter-sm); }
.ch-meta__row { display: flex; align-items: center; justify-content: space-between; gap: var(--gutter-md); }
.ch-meta dt { margin: 0; }
.ch-meta dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

/* EventChain */
.ch-chain { display: flex; flex-direction: column; gap: var(--gutter-sm); padding-top: var(--gutter-sm); border-top: 1px solid var(--outline-variant); }
.ch-chain h4 { margin: 0; }
.ch-chain__list { list-style: none; margin: 0; padding: var(--pad-control); border-radius: var(--radius-default); background: var(--bg-inset); display: flex; flex-direction: column; gap: var(--gutter-sm); }
.ch-chain__item { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--gutter-sm); }

/* Sidebar */
.ch-sidebar { box-sizing: border-box; width: var(--sidebar-width); flex-shrink: 0; min-height: 100%; padding: var(--gutter-md); display: flex; flex-direction: column; justify-content: space-between; gap: var(--gutter-lg); border-right: 1px solid var(--outline-variant); background: var(--bg-sidebar); color: var(--on-surface); }
.ch-sidebar__top { display: flex; flex-direction: column; gap: var(--gutter-lg); }
.ch-brand { display: flex; align-items: center; gap: var(--pad-control); padding: var(--gutter-xs) var(--gutter-sm); }
.ch-brand__mark { width: var(--control-height); height: var(--control-height); border-radius: var(--radius-default); background: var(--primary-container); color: var(--on-primary-container); display: flex; align-items: center; justify-content: center; }
.ch-brand__text { display: flex; flex-direction: column; }
.ch-panel { padding: var(--pad-control); border: 1px solid var(--outline-variant); border-radius: var(--radius-lg); background: var(--bg-card); display: flex; flex-direction: column; gap: var(--gutter-xs); }
.ch-sidebar__foot { gap: var(--gutter-sm); }
.ch-nav { display: flex; flex-direction: column; gap: var(--gutter-xs); }
.ch-nav__item { display: flex; align-items: center; gap: var(--pad-control); padding: var(--gutter-sm) var(--pad-control); border-radius: var(--radius-default); color: var(--on-surface-variant); text-decoration: none; transition: background-color var(--duration-state-change) var(--ease-state-change); }
.ch-nav__item:hover { background: var(--bg-nav-hover); }
.ch-nav__item.is-current { background: var(--primary-container); color: var(--on-primary-container); }
.ch-nav__count { margin-left: auto; }

/* PageHeader */
.ch-header { box-sizing: border-box; height: var(--header-height); padding: 0 var(--page-margin); display: flex; align-items: center; justify-content: space-between; gap: var(--gutter-md); border-bottom: 1px solid var(--outline-variant); background: var(--bg-header); color: var(--on-surface); }
.ch-header h1 { margin: 0; }
.ch-header__title, .ch-header__actions { display: flex; align-items: center; gap: var(--pad-control); min-width: 0; }

/* moldura dos previews */
.ch-preview { padding: var(--gutter-md); display: flex; flex-wrap: wrap; align-items: center; gap: var(--pad-control); }
.ch-preview--grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: stretch; gap: var(--gutter-md); }
.ch-preview--stack { flex-direction: column; align-items: stretch; }
