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

/* Reset escopado: substitui o '* { ... }' + 'body { ... }' do mockup
   pra evitar colidir com MainLayout/NavMenu/outras telas. Aplicado
   apenas dentro dos 3 containers da página /workstations.
   O `overflow:hidden + height:100vh` do mockup ficava no body; aqui
   o `.ws-machine-view` já tem `min-height: calc(100vh - 140px); overflow: hidden`,
   então o efeito é equivalente. */
.ws-page-header, .ws-machine-view, .ws-global-view { box-sizing: border-box; }
.ws-page-header *, .ws-machine-view *, .ws-global-view * { box-sizing: border-box; margin: 0; padding: 0; }

/* === Page === */
.ws-page-header { padding: 20px 24px 0; }
.ws-page-title { font-size: 22px; font-weight: 700; }
.ws-page-subtitle { font-size: 13px; color: #888; margin: 4px 0 16px; }

/* === Top-level toggle === */
.ws-top-toggle { display: flex; gap: 0; margin-bottom: 20px; }
.ws-top-btn { padding: 10px 24px; font-size: 13px; font-weight: 600; border: 1.5px solid #e0e0e0; background: #fff; cursor: pointer; font-family: inherit; transition: all 0.15s; color: #666; }
.ws-top-btn:first-child { border-radius: 8px 0 0 8px; }
.ws-top-btn:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.ws-top-btn.active { background: #5c6bc0; border-color: #5c6bc0; color: #fff; }

/* === Machine view (sidebar + detail) === */
.ws-machine-view { display: flex; height: calc(100vh - 140px); margin: 0 24px; border: 1px solid #eee; border-radius: 12px; background: #fff; overflow: hidden; }

/* === Sidebar === */
.ws-sidebar { width: 340px; border-right: 1px solid #eee; display: flex; flex-direction: column; flex-shrink: 0; height: 100%; }
.ws-sidebar-header { padding: 12px; border-bottom: 1px solid #eee; flex-shrink: 0; }
.ws-sidebar-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ws-sidebar-title { font-size: 13px; font-weight: 600; color: #888; }
.ws-sidebar-count { font-size: 11px; color: #bbb; }
.ws-sidebar-filters { display: flex; gap: 4px; margin-bottom: 8px; }
.ws-filter-pill { padding: 4px 10px; border: 1.5px solid #e0e0e0; border-radius: 14px; font-size: 10px; font-weight: 600; cursor: pointer; background: #fff; font-family: inherit; transition: all 0.15s; }
.ws-filter-pill:hover { border-color: #bbb; }
.ws-filter-pill.active { background: #e8eaf6; border-color: #5c6bc0; color: #3949ab; }
.ws-sidebar-search { width: 100%; padding: 7px 10px; border: 1.5px solid #e0e0e0; border-radius: 6px; font-size: 12px; outline: none; font-family: inherit; }
.ws-sidebar-search:focus { border-color: #5c6bc0; }
.ws-sidebar-list { flex: 1; overflow-y: auto; min-height: 0; }

.ws-item { padding: 10px 12px; border-bottom: 1px solid #f5f5f5; cursor: pointer; transition: background 0.1s; display: flex; gap: 8px; }
.ws-item:hover { background: #f8f8ff; }
.ws-item.active { background: #eef0ff; border-left: 3px solid #5c6bc0; }
.ws-item-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.ws-item-dot.online { background: #4caf50; }
.ws-item-dot.offline { background: #e0e0e0; }
.ws-item-dot.stale { background: #f9a825; }
.ws-item-body { flex: 1; min-width: 0; }
.ws-item-name { font-size: 12px; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.ws-item-user { font-size: 10px; color: #888; }
.ws-item-meta { display: flex; gap: 12px; margin-top: 2px; }
.ws-item-meta-row { font-size: 9px; color: #aaa; }
.ws-item-meta-label { color: #bbb; }
.ws-item-meta-value { color: #888; font-family: 'JetBrains Mono', monospace; }
.ws-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.ws-item-badge { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.ws-item-badge.pending { background: #fff3e0; color: #e65100; }
.ws-item-badge.ok { background: #e8f5e9; color: #2e7d32; }
.ws-item-badge.delayed { background: #ffebee; color: #c62828; }
.ws-item-version { font-size: 8px; color: #ccc; font-family: 'JetBrains Mono', monospace; }

/* === Main detail === */
.ws-detail { flex: 1; padding: 20px; overflow-y: auto; }
.ws-machine-name { font-size: 18px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.ws-machine-user { font-size: 12px; color: #888; margin-top: 2px; }

/* === Stats === */
.ws-stats { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.ws-stat { border: 1px solid #eee; border-radius: 8px; padding: 10px 14px; min-width: 130px; flex: 1; }
.ws-stat-label { font-size: 9px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: 0.04em; }
.ws-stat-value { font-size: 16px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; font-family: 'JetBrains Mono', monospace; }
.ws-stat-value.green { color: #2e7d32; background: transparent; }
.ws-stat-value.orange { color: #e65100; background: transparent; }
.ws-stat-value.red { color: #c62828; background: transparent; }
.ws-stat-sub { font-size: 9px; color: #bbb; margin-top: 1px; }

/* === Tabs === */
.ws-tabs { display: flex; gap: 0; border-bottom: 2px solid #eee; margin-bottom: 16px; }
.ws-tab { padding: 8px 16px; font-size: 12px; font-weight: 500; color: #888; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; }
.ws-tab:hover { color: #555; }
.ws-tab.active { color: #5c6bc0; border-bottom-color: #5c6bc0; font-weight: 600; }
.ws-tab-count { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 6px; margin-left: 4px; }
.ws-tab-count.orange { background: #fff3e0; color: #e65100; }
.ws-tab-count.green { background: #e8f5e9; color: #2e7d32; }

/* === File table === */
.ws-file-table { width: 100%; border-collapse: collapse; }
.ws-file-table th { font-size: 10px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: 0.03em; text-align: left; padding: 6px 10px; border-bottom: 1.5px solid #eee; }
.ws-file-table td { font-size: 11px; padding: 8px 10px; border-bottom: 1px solid #f5f5f5; }
.ws-file-table tr:hover { background: #fafafa; }
.ws-file-name { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: #333; word-break: break-all; }
.ws-file-status { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.ws-file-status.pendente { background: #fff3e0; color: #e65100; }
.ws-file-status.recebido { background: #e8f5e9; color: #2e7d32; }
.ws-file-status.atrasado { background: #ffebee; color: #c62828; }
.ws-file-time { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: #888; }
.ws-file-delivery { font-family: 'JetBrains Mono', monospace; font-size: 10px; }
.ws-file-delivery.fast { color: #2e7d32; }
.ws-file-delivery.slow { color: #e65100; }
.ws-file-delivery.na { color: #ddd; }

/* === GLOBAL VIEW === */
/* No mockup este div nasce com display:none e o JS toggle adicionava
   inline 'display:block' no click. Aqui o Razor controla visibilidade
   via @if(_topView=="global"); quando o else-branch renderiza, o div já
   deve aparecer — REMOVIDO display:none que estava deixando a Visão
   global invisível mesmo quando o branch ativava. */
.ws-global-view { margin: 0 24px; height: calc(100vh - 140px); overflow-y: auto; }
.ws-global-stats { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.ws-global-stat { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 16px 20px; min-width: 160px; flex: 1; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.ws-global-stat-label { font-size: 10px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: 0.04em; }
.ws-global-stat-value { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ws-global-stat-sub { font-size: 11px; color: #bbb; margin-top: 2px; }

.ws-global-section { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.ws-global-section-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.ws-global-section-title .ws-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }

.ws-global-updated { font-size: 11px; color: #bbb; margin-bottom: 20px; display: flex; align-items: center; gap: 4px; }

/* === Health grid === */
.ws-health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.ws-health-card { border: 1px solid #eee; border-radius: 8px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.ws-health-card.alert { border-left: 3px solid #e53935; }
.ws-health-card.warning { border-left: 3px solid #f9a825; }
.ws-health-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ws-health-dot.online { background: #4caf50; }
.ws-health-dot.stale { background: #f9a825; }
.ws-health-dot.offline { background: #e0e0e0; }
.ws-health-info { flex: 1; min-width: 0; }
.ws-health-name { font-size: 12px; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.ws-health-meta { font-size: 10px; color: #999; }
.ws-health-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; flex-shrink: 0; }

.ws-empty { text-align: center; padding: 40px; color: #ccc; font-size: 13px; }

/* === Filter bar (Login/Máquina + ações). Estilos passados pelo Severo
   em /mnt/dados/telas via prompt — substituem a antiga ws-toolbar que
   tinha sumido junto com a reescrita literal do CSS do mockup. === */
.ws-filter-bar { display: flex; align-items: center; gap: 8px; padding: 0 24px 12px; flex-wrap: wrap; }
.ws-filter-bar input { padding: 8px 12px; border: 1.5px solid #e0e0e0; border-radius: 6px; font-size: 13px; font-family: inherit; outline: none; width: 160px; }
.ws-filter-bar input:focus { border-color: #5c6bc0; }
.ws-filter-bar .btn-apply { padding: 8px 18px; background: #5c6bc0; color: #fff; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ws-filter-bar .btn-text { padding: 8px 12px; background: none; border: none; color: #888; font-size: 13px; cursor: pointer; }
.ws-filter-bar .btn-outline { padding: 8px 16px; border: 1.5px solid #e0e0e0; border-radius: 6px; background: #fff; font-size: 12px; font-weight: 600; color: #555; cursor: pointer; }

/* Antes havia aqui um bump local de z-index para .mud-popover/picker (1500)
   para o datepicker do Geo tab ficar acima do mapa Leaflet. Foi promovido
   para regra global em rksam-app-shell.css (10000) pra cobrir outras telas
   também e ficar bem acima dos painéis Leaflet/canvas que escalam até ~1000. */
