/* =============================================================================
   Base / Reset
   ============================================================================= */
:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
    color: #e8eef7;
    background: #08111f;
    line-height: 1.5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at 85% 10%, #153354 0, transparent 34%), #08111f;
}

/* =============================================================================
   Header & Navegação
   ============================================================================= */
header {
    height: 72px;
    padding: 0 5vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #20334a;
    background: #0a1728dd;
    backdrop-filter: blur(12px);
}

header strong {
    letter-spacing: .12em;
    font-size: 14px;
    color: #78d5ff;
}

nav {
    display: flex;
    gap: 20px;
}

a {
    color: #78d5ff;
    text-decoration: none;
}

/* =============================================================================
   Layout principal
   ============================================================================= */
main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 7vh 5vw;
}

/* =============================================================================
   Componentes base (Auth / Panel / Forms)
   ============================================================================= */
.auth {
    max-width: 560px;
    margin: 5vh auto;
    padding: 42px;
    background: #0d1d31;
    border: 1px solid #254362;
    border-radius: 24px;
    box-shadow: 0 20px 60px #0005;
}

.panel {
    background: #0d1d31;
    border: 1px solid #254362;
    border-radius: 24px;
    padding: 36px;
    box-shadow: 0 20px 60px #0004;
}

.narrow {
    max-width: 780px;
    margin: 0 auto;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: .16em;
    color: #5ac8ee;
    font-weight: 700;
}

h1 {
    font-size: clamp(30px, 5vw, 54px);
    line-height: 1.05;
    margin: 12px 0 14px;
}

h2 {
    margin-top: 0;
}

.muted {
    color: #91a5bd;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: #c3d2e4;
    font-size: 14px;
}

input {
    width: 100%;
    padding: 12px 13px;
    border-radius: 10px;
    border: 1px solid #304d6b;
    background: #091727;
    color: #fff;
    font: inherit;
}

button,
.button {
    display: inline-block;
    border: 0;
    border-radius: 10px;
    padding: 12px 18px;
    margin-top: 22px;
    background: #5ac8ee;
    color: #06121d;
    font-weight: 800;
    cursor: pointer;
}

.button {
    margin-top: 0;
}

/* =============================================================================
   Cards genéricos
   ============================================================================= */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 36px 0;
}

.cards > div {
    padding: 22px;
    border-radius: 16px;
    background: #112941;
    border: 1px solid #294867;
}

.cards small,
.cards strong {
    display: block;
}

.cards small {
    color: #91a5bd;
}

.cards strong {
    font-size: 25px;
    margin-top: 8px;
}

.green {
    color: #71e0a0;
}

.next {
    padding: 24px;
    border-radius: 16px;
    background: #0a1728;
    border: 1px dashed #3d6b8a;
}

/* =============================================================================
   Tabelas & Status
   ============================================================================= */
.section-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.table-wrap {
    overflow: auto;
    margin-top: 28px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 15px;
    border-bottom: 1px solid #223b56;
}

th {
    color: #8da5bf;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.status {
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
}

.active {
    background: #164a39;
    color: #86f0b4;
}

.pending {
    background: #594719;
    color: #ffd77d;
}

.revoked {
    background: #542b35;
    color: #ff9eaa;
}

.empty {
    color: #91a5bd;
    text-align: center;
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
    padding: 18px;
    border-radius: 12px;
    background: #06101c;
    color: #a8e9ff;
    border: 1px solid #284b69;
}

.warning {
    color: #ffd77d;
}

/* =============================================================================
   Responsivo base
   ============================================================================= */
@media (max-width: 700px) {
    .grid,
    .cards {
        grid-template-columns: 1fr;
    }

    .section-head {
        display: block;
    }

    nav {
        gap: 10px;
        font-size: 13px;
    }

    .panel,
    .auth {
        padding: 24px;
    }
}

/* =============================================================================
   Mapas – cards e canvas básico
   ============================================================================= */
.map-card {
    display: grid;
    gap: 8px;
    padding: 22px;
    background: #112941;
    border: 1px solid #294867;
    border-radius: 16px;
    color: #e8eef7;
}

.map-card span {
    color: #91a5bd;
}

.map-toolbar {
    display: flex;
    gap: 12px;
    margin: 18px 0;
}

.map-canvas {
    position: relative;
    height: 520px;
    overflow: hidden;
    border: 1px solid #294867;
    border-radius: 16px;
    background-color: #091827;
    background-image: radial-gradient(#28435f 1px, transparent 1px);
    background-size: 24px 24px;
}

.map-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.map-node {
    position: absolute;
    width: 132px;
    min-height: 62px;
    padding: 12px;
    border-radius: 50%;
    border: 3px solid #64748b;
    background: #14263a;
    box-shadow: 0 10px 22px #0007;
    cursor: grab;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}

.map-node span,
.map-node small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-node small {
    font-size: 11px;
    color: #b5c6d8;
    margin-top: 3px;
}

.map-node.up {
    border-color: #45e18c;
    background: #103d32;
}

.map-node.down {
    border-color: #ff6577;
    background: #4a1f2b;
}

.map-node.unknown {
    border-color: #f0c45c;
}

.map-forms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.map-forms > div {
    padding: 20px;
    border: 1px solid #294867;
    border-radius: 16px;
}

.connection-list {
    margin-top: 24px;
    color: #b5c6d8;
}

/* Modal genérico */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: #0009;
    z-index: 20;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.open {
    display: flex;
}

.modal-box {
    position: relative;
    width: min(520px, 100%);
    background: #0d1d31;
    border: 1px solid #42627f;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 25px 80px #0008;
}

.close {
    position: absolute;
    right: 12px;
    top: 8px;
    background: transparent;
    color: #fff;
    font-size: 26px;
    margin: 0;
}

.danger {
    background: #b84255;
    color: #fff;
}

@media (max-width: 800px) {
    .map-forms {
        grid-template-columns: 1fr;
    }

    .map-canvas {
        height: 420px;
    }
}

/* =============================================================================
   Editor de mapa profissional
   ============================================================================= */
.professional-map {
    min-height: 760px;
}

.map-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.secondary {
    background: #203b57;
    color: #bfe8ff;
    margin-top: 0;
}

.selected {
    outline: 2px solid #f0c45c;
    outline-offset: 3px;
}

.map-help {
    margin: 20px 0;
    padding: 13px 16px;
    border-radius: 10px;
    background: #112941;
    color: #a9bdd2;
}

.editor-canvas {
    position: relative;
    height: 620px;
    overflow: hidden;
    border: 1px solid #315575;
    border-radius: 18px;
    background-color: #081827;
    background-image:
        linear-gradient(#18324b 1px, transparent 1px),
        linear-gradient(90deg, #18324b 1px, transparent 1px);
    background-size: 32px 32px;
}

.editor-canvas svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.equipment-node {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 148px;
    height: 112px;
    border-radius: 50%;
    border: 4px solid #f0c45c;
    background: #142a40;
    color: #edf7ff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: grab;
    z-index: 3;
    box-shadow: 0 8px 25px #0008;
    padding: 14px 12px;
    transition: transform .15s ease, box-shadow .15s ease;
}

.equipment-node:hover {
    transform: translate(-50%, -50%) scale(1.06);
    box-shadow: 0 12px 32px #000b;
}

.equipment-node b,
.equipment-node small {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.equipment-node small {
    font-size: 11px;
    color: #aac0d4;
}

.equipment-node .node-latency {
    font-size: 10px;
    color: #d8e9f5;
}

.equipment-node em {
    font-style: normal;
    font-size: 9px;
    letter-spacing: .12em;
}

.equipment-node.up {
    border-color: #45e18c;
    background: #103c31;
}

.equipment-node.down {
    border-color: #ff6577;
    background: #4b202d;
}

.equipment-node.unknown {
    border-color: #f0c45c;
}

.node-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #f0c45c;
}

.up .node-dot {
    background: #45e18c;
    box-shadow: 0 0 10px #45e18c;
}

.down .node-dot {
    background: #ff6577;
    box-shadow: 0 0 10px #ff6577;
}

.connectable {
    cursor: crosshair;
}

.selected-node {
    outline: 4px solid #78d5ff;
    outline-offset: 6px;
}

.cable-line {
    stroke: #78d5ff;
    stroke-width: 4;
}

.wireless-line {
    stroke: #f0c45c;
    stroke-width: 4;
    stroke-dasharray: 10 8;
}

.map-legend {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    padding: 16px 0;
    color: #a9bdd2;
    font-size: 12px;
}

.map-legend span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.legend {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    background: #f0c45c;
}

.legend.up {
    background: #45e18c;
}

.legend.down {
    background: #ff6577;
}

.legend.wireless {
    background: #f0c45c;
    border-radius: 0;
}

.modal-box form + form {
    margin-top: 14px;
}

.modal-box label {
    margin-top: 14px;
}

@media (max-width: 700px) {
    .editor-canvas {
        height: 520px;
    }

    .equipment-node {
        width: 125px;
        height: 84px;
    }

    .map-actions {
        margin-top: 14px;
    }
}

/* Camada de conexões interativa */
#connectionsLayer {
    pointer-events: auto !important;
}

.cable-line,
.wireless-line {
    stroke-width: 10;
    cursor: pointer;
    pointer-events: stroke;
}

.cable-line:hover,
.wireless-line:hover {
    stroke: #fff;
}

/* =============================================================================
   Cards de mapas (listagem)
   ============================================================================= */
.map-grid {
    align-items: stretch;
}

.map-card {
    position: relative;
    gap: 14px;
}

.map-card-main {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    align-items: center;
    color: #e8eef7;
}

.map-card-main strong {
    grid-column: 2;
}

.map-card-main > span:not(.map-status-dot) {
    grid-column: 2;
}

.map-status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f0c45c;
    box-shadow: 0 0 12px #f0c45c;
    grid-row: 1 / span 2;
}

.map-card.up .map-status-dot {
    background: #45e18c;
    box-shadow: 0 0 12px #45e18c;
}

.map-card.down .map-status-dot {
    background: #ff6577;
    box-shadow: 0 0 12px #ff6577;
}

.map-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.map-card-actions button {
    margin-top: 0;
}

.map-card-actions form {
    margin: 0;
}

.map-card-actions form button {
    margin-top: 0;
}

.map-card-actions .secondary {
    padding: 10px 14px;
}

.map-card-actions .danger {
    padding: 10px 14px;
}

.modal-box textarea {
    width: 100%;
    padding: 12px 13px;
    border-radius: 10px;
    border: 1px solid #304d6b;
    background: #091727;
    color: #fff;
    font: inherit;
    resize: vertical;
}

@media (max-width: 700px) {
    .map-card-actions {
        flex-wrap: wrap;
    }
}

/* Drag & drop de mapas */
.map-card {
    cursor: grab;
}

.map-card.dragging {
    opacity: .55;
    cursor: grabbing;
    border-color: #78d5ff;
}

.map-actions button {
    margin-top: 0;
}

.map-actions .button {
    display: inline-flex;
    align-items: center;
    height: 44px;
}

.map-actions button {
    height: 44px;
    padding-top: 0;
    padding-bottom: 0;
}

.map-actions {
    align-items: center;
}

/* =============================================================================
   Mensagens – conexões legadas
   ============================================================================= */
.message-connection {
    padding: 20px 0;
    border-bottom: 1px solid #223b56;
}

.message-connection + form {
    margin-top: 10px;
}

.message-connection label {
    margin-top: 12px;
}

.message-connection button {
    margin-top: 14px;
}

/* =============================================================================
   Serviços – Dashboard
   ============================================================================= */
.services-shell {
    padding: 32px;
    overflow: hidden;
}

.service-hero {
    margin-bottom: 26px;
}

.service-hero h1 {
    margin-bottom: 10px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border: 1px solid #284d68;
    border-radius: 999px;
    background: #0a1a2b;
    color: #9db5c9;
    font-size: 12px;
    font-weight: 700;
}

.live-indicator i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #45e18c;
    box-shadow: 0 0 0 4px #45e18c22, 0 0 12px #45e18c;
    animation: live-pulse 2s ease-out infinite;
}

.service-overview-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0 28px;
}

.overview-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #23445e;
    background: linear-gradient(145deg, #112b44, #0d2035);
    box-shadow: 0 12px 30px #0002;
}

.overview-card small,
.overview-card strong,
.overview-note {
    display: block;
}

.overview-card small {
    color: #9db2c7;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.overview-card strong {
    font-size: 30px;
    line-height: 1.1;
    margin: 5px 0 2px;
    color: #f2f8ff;
}

.overview-note {
    color: #718aa1;
    font-size: 12px;
}

.overview-icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 22px;
    font-weight: 800;
}

.overview-icon.blue {
    background: #1f607c;
    color: #8fe1ff;
}

.overview-icon.green {
    background: #164e3e;
    color: #80efb0;
}

.overview-icon.red {
    background: #5b2938;
    color: #ff9eaa;
}

.value-green {
    color: #7beaab !important;
}

.value-red {
    color: #ff9eaa !important;
}

/* Workspace de serviços */
.services-workspace {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.service-list-panel,
.service-detail-panel {
    border: 1px solid #23445e;
    background: #0a192a;
    border-radius: 18px;
}

.service-list-panel {
    padding: 16px;
}

.service-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 4px 5px 16px;
}

.service-list-header h2 {
    font-size: 18px;
    margin: 5px 0 0;
}

.service-count {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: #17334c;
    color: #8fdfff;
    font-size: 12px;
    font-weight: 800;
}

.service-list {
    display: grid;
    gap: 6px;
    max-height: 520px;
    overflow: auto;
    padding-right: 3px;
}

.service-list-item {
    width: 100%;
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    text-align: left;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 10px;
    background: transparent;
    color: #e8eef7;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.service-list-item:hover {
    background: #112c45;
    border-color: #2c5874;
    transform: translateX(2px);
}

.service-list-item.selected {
    background: linear-gradient(100deg, #143a56, #102a42);
    border-color: #3e83a5;
    box-shadow: inset 3px 0 #65d5f5;
}

.service-state-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #f0c45c;
    box-shadow: 0 0 10px #f0c45c;
}

.service-state-dot.up {
    background: #45e18c;
    box-shadow: 0 0 10px #45e18c;
}

.service-state-dot.down {
    background: #ff6577;
    box-shadow: 0 0 10px #ff6577;
}

.service-state-dot.unknown {
    background: #f0c45c;
}

.service-list-copy {
    min-width: 0;
}

.service-list-copy strong,
.service-list-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-list-copy strong {
    font-size: 13px;
}

.service-list-copy small {
    margin-top: 2px;
    color: #7892aa;
    font-size: 11px;
}

.service-list-latency {
    color: #a5bdd0;
    font-size: 11px;
    white-space: nowrap;
}

.service-add-link {
    display: block;
    margin: 15px 5px 2px;
    padding-top: 14px;
    border-top: 1px solid #1d374d;
    color: #76d9fa;
    font-size: 12px;
    font-weight: 700;
}

/* Painel de detalhe do serviço */
.service-detail-panel {
    padding: 24px;
    min-width: 0;
}

.service-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin: 2px 2px 23px;
}

.service-detail-header h2 {
    font-size: 26px;
    margin: 8px 0 8px;
}

.service-status-label {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: #5c4a16;
    color: #ffdc7d;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.service-status-label.up {
    background: #124935;
    color: #87f1b1;
}

.service-status-label.down {
    background: #5b2637;
    color: #ff9eaa;
}

.service-target {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #829bb0;
    font-size: 12px;
}

.service-target > span:first-child {
    color: #65d5f5;
}

.service-target code {
    color: #bfdbec;
    background: transparent;
}

.service-agent {
    padding-left: 10px;
    border-left: 1px solid #29445a;
    color: #6f8ca4;
}

.text-action {
    color: #78d5ff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* Barra de período */
.period-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 15px;
    padding: 16px 0;
    border-top: 1px solid #1d394f;
    border-bottom: 1px solid #1d394f;
}

.period-caption {
    margin: 5px 0 0;
    font-size: 12px;
}

.period-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid #284860;
    border-radius: 10px;
    background: #081724;
}

.period-tab {
    margin: 0;
    padding: 8px 12px;
    border-radius: 7px;
    background: transparent;
    color: #89a7bd;
    font-size: 12px;
    font-weight: 700;
    transition: color .18s ease, background .18s ease;
}

.period-tab:hover {
    background: #15344b;
    color: #dcf5ff;
}

.period-tab.active {
    background: #5ac8ee;
    color: #06121d;
    box-shadow: 0 3px 12px #5ac8ee44;
}

/* Métricas do serviço */
.service-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.metric-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid #23445e;
    border-radius: 13px;
    background: #0e2337;
}

.metric-label,
.metric-sub {
    display: block;
}

.metric-label {
    color: #88a5bb;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.metric-card strong {
    display: block;
    margin: 8px 0 2px;
    color: #f3f8ff;
    font-size: 24px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-sub {
    color: #6f899f;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-card.availability {
    background: linear-gradient(145deg, #103c36, #102b35);
    border-color: #2b765e;
}

.metric-card.availability strong {
    color: #83efae;
}

/* Gráfico de latência */
.chart-card {
    border: 1px solid #23445e;
    border-radius: 15px;
    background: linear-gradient(180deg, #0f2438, #0c1d2e);
    padding: 19px 18px 12px;
}

.chart-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.chart-head h3 {
    margin: 6px 0 0;
    font-size: 16px;
}

.chart-legend {
    display: flex;
    gap: 13px;
    flex-wrap: wrap;
    justify-content: flex-end;
    color: #8da9bb;
    font-size: 11px;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chart-legend i {
    display: inline-block;
    width: 18px;
    height: 3px;
    border-radius: 5px;
    background: #5ac8ee;
}

.chart-legend .legend-availability i {
    background: #45e18c;
}

.chart-wrap {
    position: relative;
    height: 290px;
    margin-top: 15px;
}

.chart-wrap svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-grid-line {
    stroke: #244258;
    stroke-width: 1;
    stroke-dasharray: 3 6;
}

.chart-axis-label {
    fill: #7893a8;
    font-size: 11px;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.chart-area {
    fill: url(#chartFill);
    fill: #5ac8ee;
    opacity: .12;
}

.chart-line {
    fill: none;
    stroke: #64d6f6;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 3px 5px #3dbadd55);
}

.chart-point {
    fill: #0c2033;
    stroke: #72defd;
    stroke-width: 2;
    cursor: crosshair;
    transition: r .15s ease;
}

.chart-point:hover {
    r: 6;
    fill: #72defd;
}

.chart-tooltip {
    position: absolute;
    z-index: 3;
    display: none;
    transform: translate(-50%, -112%);
    min-width: 120px;
    padding: 9px 11px;
    border: 1px solid #4f91ae;
    border-radius: 9px;
    background: #071521eF;
    box-shadow: 0 10px 25px #0007;
    color: #e4f7ff;
    pointer-events: none;
    font-size: 11px;
}

.chart-tooltip.visible {
    display: grid;
    gap: 3px;
}

.chart-tooltip strong {
    font-size: 11px;
}

.chart-tooltip span {
    color: #72defd;
    font-weight: 800;
}

.chart-tooltip small {
    color: #9bb3c3;
}

.chart-empty {
    position: absolute;
    inset: 25px 0 30px;
    display: none;
    place-items: center;
    align-content: center;
    gap: 5px;
    color: #7f9aaf;
    text-align: center;
}

.chart-empty.visible {
    display: grid;
}

.chart-empty strong {
    color: #bcd0df;
}

.chart-footer {
    display: flex;
    justify-content: space-between;
    color: #718ba0;
    font-size: 11px;
}

/* Rodapé de detalhe */
.detail-footer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 17px;
    padding-top: 17px;
    border-top: 1px solid #1d394f;
}

.detail-footer p {
    margin: 5px 0 0;
    color: #c1d1de;
    font-size: 12px;
}

/* Estado vazio de serviços */
.service-empty {
    display: grid;
    justify-items: center;
    text-align: center;
    padding: 70px 20px 50px;
    border: 1px dashed #315a73;
    border-radius: 17px;
    background: radial-gradient(circle at 50% 0, #12415a55, transparent 50%);
}

.service-empty h2 {
    margin: 15px 0 3px;
    font-size: 22px;
}

.service-empty p {
    max-width: 470px;
}

.empty-orb {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border: 1px solid #4eabc7;
    border-radius: 20px;
    background: #123b51;
    color: #76ddff;
    font-size: 30px;
    box-shadow: 0 0 30px #39bad733, inset 0 0 18px #52cef622;
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 #45e18c66;
    }
    70% {
        box-shadow: 0 0 0 7px #45e18c00;
    }
    100% {
        box-shadow: 0 0 0 0 #45e18c00;
    }
}

/* Responsivo – Serviços */
@media (max-width: 980px) {
    .services-workspace {
        grid-template-columns: 1fr;
    }

    .service-list {
        display: flex;
        overflow: auto;
        max-height: none;
        padding-bottom: 4px;
    }

    .service-list-item {
        min-width: 225px;
    }

    .service-add-link {
        display: inline-block;
        border-top: 0;
        margin-top: 12px;
        padding-top: 0;
    }

    .service-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .services-shell {
        padding: 22px 16px;
    }

    .service-overview-cards {
        grid-template-columns: 1fr;
    }

    .hero-actions,
    .service-detail-header,
    .period-bar,
    .chart-head {
        display: block;
    }

    .hero-actions {
        margin-top: 18px;
    }

    .hero-actions .button {
        margin-top: 12px;
    }

    .period-tabs {
        margin-top: 13px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }

    .period-tab {
        padding: 8px 4px;
    }

    .service-detail-panel {
        padding: 18px 13px;
    }

    .service-target {
        flex-wrap: wrap;
    }

    .service-agent {
        border-left: 0;
        padding-left: 0;
        width: 100%;
    }

    .text-action {
        display: inline-block;
        margin-top: 14px;
    }

    .service-metrics {
        gap: 7px;
    }

    .metric-card {
        padding: 12px 10px;
    }

    .metric-card strong {
        font-size: 19px;
    }

    .chart-legend {
        justify-content: flex-start;
        margin-top: 12px;
    }

    .chart-wrap {
        height: 240px;
    }

    .detail-footer {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .service-list-item {
        min-width: 205px;
    }
}

/* Linhas extras do gráfico */
.chart-availability-line {
    fill: none;
    stroke: #45e18c;
    stroke-width: 2;
    stroke-dasharray: 5 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .9;
}

.chart-availability-label {
    fill: #70d89b;
}

/* Busca de serviços */
.service-search {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 5px 12px;
}

.service-search input {
    height: 40px;
    padding: 9px 34px 9px 34px;
    border-radius: 11px;
    background: #081725;
    border-color: #284960;
    color: #e8f6ff;
    font-size: 12px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.service-search input:focus {
    border-color: #5ac8ee;
    box-shadow: 0 0 0 3px #5ac8ee1f;
}

.service-search-icon {
    position: absolute;
    left: 12px;
    color: #6dbed6;
    font-size: 20px;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-1px);
}

.service-search-clear {
    display: none;
    position: absolute;
    right: 5px;
    top: 4px;
    width: 31px;
    height: 31px;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: #91aabd;
    font-size: 19px;
    line-height: 1;
}

.service-search-clear.visible {
    display: block;
}

.service-search-clear:hover {
    background: #17334a;
    color: #e9fbff;
}

.service-search-empty {
    display: none;
    margin: 15px 5px;
    padding: 16px 10px;
    border: 1px dashed #315770;
    border-radius: 11px;
    color: #84a1b5;
    text-align: center;
    font-size: 12px;
}

.service-search-empty.visible {
    display: block;
}

.service-list-item[hidden] {
    display: none;
}

/* Controles de período + exportação */
.period-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.export-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid #2e7187;
    border-radius: 9px;
    background: #123c4b;
    color: #92e9ff;
    font-size: 12px;
    white-space: nowrap;
}

.export-button:hover {
    background: #185168;
    color: #d7f9ff;
}

.export-button span {
    font-size: 17px;
    line-height: 1;
}

.period-controls .period-tabs {
    flex-shrink: 0;
}

@media (max-width: 700px) {
    .period-controls {
        display: flex;
        justify-content: stretch;
        gap: 8px;
    }

    .period-controls .period-tabs {
        flex: 1;
    }

    .export-button {
        justify-content: center;
        width: 100%;
    }

    .service-search {
        margin-top: 4px;
    }
}

/* Card de perda de pacotes */
.packet-loss-card {
    background: linear-gradient(145deg, #40252c, #2e202d);
    border-color: #754050;
}

.packet-loss-card strong {
    color: #ff9cab !important;
}

.chart-legend .legend-packet-loss i {
    background: #ff7183;
}

.chart-packet-loss-line {
    fill: none;
    stroke: #ff7183;
    stroke-width: 2;
    stroke-dasharray: 2 6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .95;
}

.packet-loss {
    font-weight: bold;
    color: #c93452 !important;
}

.service-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 980px) {
    .service-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Ajustes de contenção dos valores dos cards de métricas */
.metric-card {
    min-width: 0;
    overflow: hidden;
}

.metric-card strong {
    font-size: clamp(16px, 1.8vw, 22px);
    letter-spacing: -.025em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-card.availability strong,
.metric-card.packet-loss-card strong {
    font-size: clamp(16px, 1.65vw, 21px);
}

@media (max-width: 980px) {
    .metric-card strong,
    .metric-card.availability strong,
    .metric-card.packet-loss-card strong {
        font-size: clamp(16px, 3.8vw, 22px);
    }
}

@media (max-width: 700px) {
    .metric-card strong,
    .metric-card.availability strong,
    .metric-card.packet-loss-card strong {
        font-size: clamp(15px, 5vw, 19px);
        letter-spacing: -.035em;
    }
}

/* Correção do título completo dos cards de métricas */
.service-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-label {
    white-space: normal;
    overflow: visible;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.25;
    min-height: 2.5em;
}

@media (max-width: 980px) {
    .service-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .service-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-label {
        min-height: 2.7em;
    }
}

/* Reset de histórico */
.reset-history-form {
    margin: 0;
}

.reset-history-form .reset-action {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ff9eaa;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.reset-history-form .reset-action:hover {
    color: #ffd2d8;
    text-decoration: underline;
}

/* =============================================================================
   Administração – tabela de agentes
   ============================================================================= */
.admin-agents-table {
    margin-top: 18px;
}

.admin-agents-table small {
    font-size: 12px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.table-actions form {
    margin: 0;
}

.table-actions button {
    margin: 0;
    padding: 8px 10px;
    font-size: 12px;
}

@media (max-width: 700px) {
    .table-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =============================================================================
   Central de Mensagens – interface moderna
   ============================================================================= */
.messages-page {
    max-width: 1280px;
    overflow: hidden;
    background: linear-gradient(145deg, #0d2034 0%, #0a192b 62%, #0b1e32 100%);
}

.messages-hero {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 190px;
    padding: 12px 20px 24px;
    border-bottom: 1px solid #21425d;
    overflow: hidden;
}

.messages-hero:after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -90px;
    top: -180px;
    border-radius: 50%;
    background: #30bde814;
    filter: blur(2px);
}

.messages-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 670px;
}

.messages-hero h1 {
    margin: 8px 0 9px;
    font-size: clamp(30px, 4vw, 48px);
    letter-spacing: -.045em;
}

.messages-hero p {
    max-width: 560px;
    font-size: 14px;
    line-height: 1.6;
}

.messages-hero-art {
    position: relative;
    width: 220px;
    height: 150px;
    margin-right: 42px;
}

.message-orb {
    position: absolute;
    display: grid;
    place-items: center;
    border: 1px solid #63d9ff66;
    border-radius: 50%;
    background: #123b55cc;
    color: #7de4ff;
    box-shadow: 0 0 28px #3bcdf633;
    font-size: 18px;
}

.orb-one {
    width: 62px;
    height: 62px;
    right: 30px;
    top: 32px;
}

.orb-two {
    width: 42px;
    height: 42px;
    right: 102px;
    top: 2px;
    color: #bc9cff;
    border-color: #a98cff66;
    background: #302556cc;
}

.orb-three {
    width: 25px;
    height: 25px;
    right: 13px;
    top: 108px;
    color: #77f0b2;
    border-color: #65e5ad66;
    background: #164331cc;
}

.message-signal {
    position: absolute;
    right: 56px;
    top: 62px;
    width: 112px;
    height: 52px;
    border: 1px solid #6cdcff66;
    border-left: 0;
    border-bottom: 0;
    border-radius: 0 70px 0 0;
    transform: rotate(-24deg);
    opacity: .75;
}

.message-signal:after {
    content: "";
    position: absolute;
    right: -5px;
    top: -5px;
    width: 9px;
    height: 9px;
    background: #70e6ff;
    border-radius: 50%;
    box-shadow: 0 0 15px #70e6ff;
}

/* Estatísticas de mensagens */
.message-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 22px 0;
}

.message-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid #21465e;
    border-radius: 14px;
    background: #102b42aa;
    box-shadow: inset 0 1px #ffffff08;
}

.message-stat strong {
    display: block;
    font-size: 21px;
    color: #f1f8fc;
}

.message-stat small {
    display: block;
    margin-top: 3px;
    color: #89a7bb;
    font-size: 11px;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 17px;
    background: #164966;
    color: #71e0ff;
}

.stat-icon.green {
    background: #164936;
    color: #70e5a1;
}

.stat-icon.violet {
    background: #35265a;
    color: #c3a5ff;
}

.stat-icon.amber {
    background: #57421c;
    color: #ffd16c;
}

/* Layout principal de mensagens */
.messages-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, .8fr);
    gap: 22px;
}

.message-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 4px 2px 14px;
}

.message-section-heading h2 {
    margin: 5px 0 2px;
    font-size: 21px;
}

.message-section-heading p {
    margin: 0;
    font-size: 12px;
}

.message-section-heading.compact {
    align-items: center;
}

.secure-badge {
    padding: 6px 10px;
    border: 1px solid #2b6b5b;
    border-radius: 20px;
    background: #123d37;
    color: #7ae1aa;
    font-size: 11px;
}

/* Cards de conexão */
.connection-cards {
    display: grid;
    gap: 14px;
}

.connection-card {
    padding: 18px;
    border: 1px solid #244b64;
    border-radius: 16px;
    background: linear-gradient(145deg, #122f47, #0d2237);
    box-shadow: 0 10px 28px #0002;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}

.connection-card:hover {
    transform: translateY(-2px);
    border-color: #3c7793;
    box-shadow: 0 14px 32px #0004;
}

.connection-card.is-paused {
    border-color: #574c35;
}

.connection-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 15px;
}

.connection-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.connection-brand strong,
.connection-brand span {
    display: block;
}

.connection-brand strong {
    font-size: 14px;
    color: #e9f6fc;
}

.connection-brand span {
    margin-top: 3px;
    color: #7895a8;
    font-size: 11px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1a6380, #276e7c);
    color: #a8efff;
    font-size: 18px;
}

.brand-mark.plus {
    background: #173e52;
    color: #72ddff;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #72e2a4;
    font-size: 11px;
}

.connection-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #58e59a;
    box-shadow: 0 0 10px #58e59a;
}

.is-paused .connection-status {
    color: #e5bd65;
}

.is-paused .connection-status i {
    background: #e5bd65;
    box-shadow: 0 0 10px #e5bd65;
}

.endpoint-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    margin-bottom: 15px;
    border: 1px solid #1e4159;
    border-radius: 9px;
    background: #081a2b;
    color: #77cce4;
    overflow: hidden;
}

.endpoint-pill span {
    font-size: 16px;
}

.endpoint-pill code {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #9dbaca;
    font-size: 11px;
}

.connection-form label,
.automation-form label {
    display: block;
    margin: 0 0 12px;
    color: #9fb8c8;
    font-size: 11px;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 10px;
}

.connection-form input,
.automation-form textarea,
.automation-form input {
    margin-top: 6px;
}

.secret-field {
    position: relative;
}

.secret-field input {
    padding-right: 40px;
}

.icon-button {
    position: absolute;
    right: 5px;
    top: 11px;
    width: 31px;
    height: 31px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: #63899e;
    font-size: 14px;
}

.icon-button.revealed {
    color: #74ddff;
}

.switch-line {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-top: 2px !important;
    color: #91abbc !important;
    font-weight: 500 !important;
}

.switch-line input {
    position: absolute;
    opacity: 0;
}

.switch {
    position: relative;
    width: 32px;
    height: 18px;
    border-radius: 20px;
    background: #2a455b;
    transition: .2s;
}

.switch:after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #a5bdca;
    transition: .2s;
}

.switch-line input:checked + .switch {
    background: #1e9b6b;
}

.switch-line input:checked + .switch:after {
    left: 17px;
    background: white;
}

.card-actions {
    display: flex;
    gap: 9px;
    margin-top: 14px;
}

.card-actions button {
    margin: 0;
}

.ghost-button {
    background: transparent !important;
    border: 1px solid #6e3a49 !important;
    color: #ff9da8 !important;
}

.new-connection-card {
    margin-top: 14px;
    border-style: dashed;
    background: #0d253a99;
}

.add-connection-button {
    width: 100%;
    margin-top: 4px;
    background: linear-gradient(120deg, #126c82, #189b86);
    box-shadow: 0 8px 20px #0b958544;
}

.message-empty {
    padding: 34px 20px;
    margin-bottom: 14px;
    border: 1px dashed #31566d;
    border-radius: 16px;
    text-align: center;
    background: #0d253899;
}

.message-empty > span {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: auto;
    border-radius: 13px;
    background: #153d54;
    color: #7cdef9;
    font-size: 23px;
}

.message-empty h3 {
    margin: 12px 0 4px;
}

.message-empty p {
    margin: 0;
    color: #89a4b6;
    font-size: 12px;
}

/* Painel lateral de automações */
.message-side-panel {
    padding: 20px;
    border: 1px solid #244b64;
    border-radius: 17px;
    background: linear-gradient(145deg, #102a42, #0c2034);
    align-self: start;
}

.automation-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #687f90;
    box-shadow: 0 0 0 4px #687f9022;
}

.automation-pulse.on {
    background: #5ee5a0;
    box-shadow: 0 0 0 4px #5ee5a022, 0 0 15px #5ee5a0;
}

.automation-toggle {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 13px 0;
    margin: 3px 0 17px !important;
    border-top: 1px solid #1e4058;
    border-bottom: 1px solid #1e4058;
}

.automation-toggle strong,
.automation-toggle small {
    display: block;
}

.automation-toggle strong {
    color: #e1f1f7;
    font-size: 12px;
}

.automation-toggle small {
    margin-top: 3px;
    color: #7898aa;
    font-size: 10px;
    font-weight: 400;
}

.automation-toggle input {
    display: none;
}

.automation-toggle i {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 20px;
    background: #2b475c;
    transition: .2s;
}

.automation-toggle i:after {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #afc4ce;
    transition: .2s;
}

.automation-toggle input:checked + i {
    background: #159a6b;
}

.automation-toggle input:checked + i:after {
    left: 22px;
    background: #fff;
}

.field-hint {
    display: block;
    color: #6f92a4;
    font-size: 10px;
    margin-top: -6px;
    margin-bottom: 16px;
}

.template-tabs {
    display: flex;
    gap: 3px;
    padding: 3px;
    margin: 2px 0 14px;
    border: 1px solid #22445b;
    border-radius: 10px;
    background: #091a2a;
}

.template-tab {
    flex: 1;
    padding: 8px;
    margin: 0;
    border: 0;
    background: transparent;
    color: #7595a8;
    font-size: 11px;
}

.template-tab.active {
    border-radius: 7px;
    background: #174d65;
    color: #9cecff;
    box-shadow: 0 2px 8px #0003;
}

.template-panel {
    display: none;
}

.template-panel.active {
    display: block;
}

.template-panel label {
    margin-bottom: 10px;
}

.message-preview {
    margin: 18px 0 13px;
    padding: 12px 13px;
    border: 1px solid #2a5869;
    border-radius: 11px;
    background: linear-gradient(135deg, #113b48, #102b3c);
}

.message-preview > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-refresh {
    padding: 0;
    margin: 0;
    background: transparent;
    color: #7bdeee;
    font-size: 16px;
}

.message-preview p {
    margin: 8px 0 0;
    color: #d3f4f1;
    font-size: 11px;
    line-height: 1.55;
}

.available-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 16px;
}

.available-tags span {
    width: 100%;
    margin-bottom: 2px;
    color: #7494a7;
    font-size: 10px;
}

.available-tags code {
    padding: 4px 6px;
    border-radius: 5px;
    background: #132f47;
    color: #86d8ef;
    font-size: 10px;
}

.save-alerts-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0;
    background: linear-gradient(120deg, #236bb0, #4d55bc);
    box-shadow: 0 9px 20px #334cc044;
}

.save-alerts-button span {
    font-size: 18px;
}

/* Responsivo – Mensagens */
@media (max-width: 980px) {
    .messages-layout {
        grid-template-columns: 1fr;
    }

    .message-side-panel {
        max-width: none;
    }

    .messages-hero-art {
        margin-right: 0;
    }
}

@media (max-width: 700px) {
    .messages-page {
        padding: 18px 14px;
    }

    .messages-hero {
        min-height: 150px;
        padding: 0 4px 20px;
    }

    .messages-hero-art {
        position: absolute;
        right: -55px;
        opacity: .6;
        transform: scale(.75);
    }

    .messages-hero-copy {
        max-width: 100%;
    }

    .message-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin: 15px 0;
    }

    .message-stat {
        padding: 11px 9px;
        gap: 8px;
    }

    .message-stat strong {
        font-size: 17px;
    }

    .message-stat small {
        font-size: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .connection-card,
    .message-side-panel {
        padding: 14px;
    }

    .connection-card-top {
        align-items: flex-start;
    }

    .connection-status {
        font-size: 10px;
    }

    .card-actions {
        flex-wrap: wrap;
    }

    .card-actions button {
        flex: 1;
    }

    .message-section-heading p {
        font-size: 11px;
    }
}

/* =============================================================================
   Dashboard operacional
   ============================================================================= */
.dashboard-page {
    max-width: 1280px;
    overflow: hidden;
    background: linear-gradient(145deg, #0d2034, #0b1a2c 70%, #0b2035);
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 2px 25px;
    border-bottom: 1px solid #21445e;
}

.dashboard-hero h1 {
    margin: 8px 0 7px;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: -.04em;
}

.dashboard-hero p {
    margin: 0;
    font-size: 13px;
}

.dashboard-hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-hero-actions .button {
    margin: 0;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #79dda6;
    font-size: 11px;
    white-space: nowrap;
}

.live-indicator i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #55dc92;
    box-shadow: 0 0 0 4px #55dc9222, 0 0 13px #55dc92;
}

/* KPIs do dashboard */
.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 22px 0;
}

.dashboard-kpi {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px;
    border: 1px solid #214961;
    border-radius: 15px;
    background: #102c43aa;
    box-shadow: inset 0 1px #ffffff08;
}

.dashboard-kpi > div:last-child {
    min-width: 0;
}

.dashboard-kpi span,
.dashboard-kpi small {
    display: block;
}

.dashboard-kpi span {
    color: #a6c0cf;
    font-size: 11px;
    font-weight: 600;
}

.dashboard-kpi strong {
    display: block;
    margin: 3px 0;
    font-size: 27px;
    line-height: 1;
    color: #f1f9fc;
}

.dashboard-kpi small {
    color: #7695a7;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-icon,
.quick-action-icon {
    display: grid;
    place-items: center;
    border-radius: 11px;
    font-size: 18px;
}

.kpi-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    background: #164864;
    color: #73ddff;
}

.kpi-green .kpi-icon {
    background: #164b3a;
    color: #6ce3a0;
}

.kpi-red .kpi-icon {
    background: #512b38;
    color: #ff9eaa;
}

.kpi-violet .kpi-icon {
    background: #372957;
    color: #c8aaff;
}

/* Grid principal do dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .7fr);
    gap: 18px;
}

.dashboard-main,
.dashboard-side {
    display: grid;
    align-content: start;
    gap: 18px;
}

.dashboard-card {
    border: 1px solid #234b63;
    border-radius: 16px;
    background: linear-gradient(145deg, #102b42, #0d2236);
    padding: 19px;
    box-shadow: 0 10px 28px #0002;
}

.dashboard-card-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.dashboard-card-heading h2 {
    margin: 5px 0 0;
    font-size: 19px;
}

.dashboard-date {
    color: #7896a7;
    font-size: 10px;
    padding-top: 5px;
}

.dashboard-link {
    color: #76d9f2;
    font-size: 11px;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-link:hover {
    color: #b1f0ff;
}

/* Card de saúde */
.health-content {
    display: flex;
    align-items: center;
    gap: 30px;
}

.health-ring {
    --health: 0;
    display: grid;
    place-items: center;
    width: 142px;
    height: 142px;
    flex: 0 0 142px;
    border-radius: 50%;
    background: conic-gradient(#45da93 calc(var(--health) * 1%), #213d50 0);
    position: relative;
}

.health-ring:after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: #0e263b;
}

.health-ring > div {
    position: relative;
    z-index: 1;
    text-align: center;
}

.health-ring strong,
.health-ring span {
    display: block;
}

.health-ring strong {
    font-size: 28px;
    color: #effbff;
}

.health-ring span {
    margin-top: 4px;
    color: #82a3b4;
    font-size: 10px;
}

.health-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 28px;
    flex: 1;
}

.health-breakdown div {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 7px;
}

.health-breakdown .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6f8493;
}

.health-breakdown .dot.green {
    background: #45da93;
    box-shadow: 0 0 9px #45da93;
}

.health-breakdown .dot.red {
    background: #ff687a;
}

.health-breakdown .dot.amber {
    background: #f4c961;
}

.health-breakdown span {
    color: #91abba;
    font-size: 11px;
}

.health-breakdown strong {
    color: #e6f3f8;
    font-size: 15px;
}

/* Lista de eventos */
.events-list {
    display: grid;
}

.event-row {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 11px;
    padding: 12px 0;
    border-top: 1px solid #1b3a51;
}

.event-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.event-status {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 9px;
    font-size: 16px;
}

.event-status.up {
    background: #164b3a;
    color: #6fe4a1;
}

.event-status.down {
    background: #542b38;
    color: #ff9ba5;
}

.event-copy strong,
.event-copy span,
.event-meta strong,
.event-meta span {
    display: block;
}

.event-copy strong {
    font-size: 12px;
    color: #e2f0f5;
}

.event-copy span {
    margin-top: 3px;
    color: #7694a6;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-meta {
    text-align: right;
}

.event-meta strong {
    color: #9ee8f2;
    font-size: 11px;
}

.event-meta span {
    margin-top: 3px;
    color: #718b9b;
    font-size: 10px;
}

.dashboard-empty {
    text-align: center;
    padding: 22px 10px;
    color: #7897a8;
}

.dashboard-empty span {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin: auto;
    border-radius: 12px;
    background: #153b52;
    color: #7cdef9;
    font-size: 21px;
}

.dashboard-empty strong,
.dashboard-empty small {
    display: block;
}

.dashboard-empty strong {
    margin-top: 10px;
    color: #c5dce6;
    font-size: 12px;
}

.dashboard-empty small {
    margin-top: 4px;
    font-size: 10px;
}

/* Ações rápidas */
.quick-card {
    padding-bottom: 8px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid #1b3b52;
    text-decoration: none;
}

.quick-action:first-of-type {
    border-top: 0;
}

.quick-action-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    background: #164864;
    color: #70dcff;
}

.quick-action-icon.violet {
    background: #38295a;
    color: #c6a4ff;
}

.quick-action-icon.green {
    background: #164b3a;
    color: #6de1a0;
}

.quick-action > span:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.quick-action strong,
.quick-action small {
    display: block;
}

.quick-action strong {
    font-size: 11px;
    color: #e1eff4;
}

.quick-action small {
    margin-top: 3px;
    color: #7694a6;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-action > b {
    color: #6fc9e1;
    font-size: 16px;
}

/* Card de agentes */
.agent-summary strong {
    font-size: 29px;
    color: #effbff;
}

.agent-summary strong small {
    font-size: 16px;
    color: #7795a6;
}

.agent-summary span {
    display: block;
    margin-top: 3px;
    color: #82a0b0;
    font-size: 11px;
}

.agent-progress {
    height: 7px;
    margin: 15px 0 13px;
    border-radius: 5px;
    background: #203c50;
    overflow: hidden;
}

.agent-progress i {
    display: block;
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #38c88a, #75e7ad);
}

.agent-card p {
    margin: 0 0 15px;
    font-size: 11px;
    line-height: 1.5;
}

.agent-pulse {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #5fe39a;
    box-shadow: 0 0 0 4px #5fe39a22, 0 0 14px #5fe39a;
}

.agent-pulse i {
    display: block;
}

.dashboard-page .eyebrow {
    letter-spacing: .14em;
}

/* Responsivo – Dashboard */
@media (max-width: 980px) {
    .dashboard-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-side {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

@media (max-width: 700px) {
    .dashboard-page {
        padding: 18px 14px;
    }

    .dashboard-hero {
        display: block;
        padding-bottom: 18px;
    }

    .dashboard-hero-actions {
        justify-content: space-between;
        margin-top: 17px;
    }

    .dashboard-kpis {
        gap: 8px;
        margin: 15px 0;
    }

    .dashboard-kpi {
        padding: 12px 10px;
        gap: 8px;
    }

    .dashboard-kpi strong {
        font-size: 22px;
    }

    .dashboard-kpi small {
        font-size: 9px;
    }

    .kpi-icon {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
        font-size: 15px;
    }

    .dashboard-side {
        grid-template-columns: 1fr;
    }

    .health-content {
        gap: 18px;
    }

    .health-ring {
        width: 116px;
        height: 116px;
        flex-basis: 116px;
    }

    .health-breakdown {
        gap: 11px;
    }

    .health-breakdown span {
        font-size: 10px;
    }

    .event-row {
        grid-template-columns: 28px 1fr auto;
        gap: 8px;
    }

    .event-copy span {
        max-width: 145px;
    }

    .dashboard-card {
        padding: 15px;
    }
}

/* =============================================================================
   Topologia (card separado no dashboard)
   ============================================================================= */
.topology-card {
    background: linear-gradient(145deg, #122b45, #102039);
}

.topology-summary {
    display: flex;
    align-items: center;
    gap: 28px;
}

.topology-total {
    min-width: 112px;
    padding-right: 24px;
    border-right: 1px solid #23485e;
}

.topology-total strong,
.topology-total span {
    display: block;
}

.topology-total strong {
    font-size: 35px;
    line-height: 1;
    color: #a9ddff;
}

.topology-total span {
    margin-top: 5px;
    color: #7e9bac;
    font-size: 10px;
}

.topology-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    flex: 1;
}

.topology-status div {
    display: grid;
    grid-template-columns: 9px 1fr auto;
    align-items: center;
    gap: 7px;
}

.topology-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #748997;
}

.topology-status .dot.green {
    background: #45da93;
    box-shadow: 0 0 9px #45da93;
}

.topology-status .dot.red {
    background: #ff687a;
}

.topology-status span {
    color: #91abba;
    font-size: 10px;
}

.topology-status strong {
    color: #e6f3f8;
    font-size: 14px;
}

.topology-progress {
    height: 6px;
    margin: 19px 0 11px;
    border-radius: 5px;
    background: #203c50;
    overflow: hidden;
}

.topology-progress i {
    display: block;
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #57b8ee, #8b7cff);
    transition: width .35s ease;
}

.topology-card p {
    margin: 0;
    font-size: 10px;
}

@media (max-width: 700px) {
    .topology-summary {
        gap: 15px;
    }

    .topology-total {
        min-width: 82px;
        padding-right: 14px;
    }

    .topology-total strong {
        font-size: 28px;
    }

    .topology-status {
        gap: 10px 12px;
    }
}