:root {
  --fsa-orange: #e87722;
  --fsa-orange-light: #f49d5c;
  --fsa-orange-dark: #c45f10;
  --bg-primary: #1a1a1a;
  --bg-card: #2a2a2a;
  --text-primary: #f5f5f5;
  --text-secondary: #b0b0b0;
  --text-dim: #707070;
  --border: #3a3a3a;
  --border-light: #444444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Outfit", sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

.dashboard {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100vh;
  padding: 10px 16px;
  gap: 8px;
}

/* ── Header compacto ── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  height: 38px;
  min-width: 64px;
  padding: 0 10px;
  border-radius: 8px;
  background: #fff;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 1px;
}

.header-divider {
  width: 1px;
  height: 34px;
  background: var(--border-light);
  margin: 0 2px;
}

.header-title h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.header-title h1 em {
  font-style: normal;
  color: var(--fsa-orange);
}

.header-title span {
  font-size: 9px;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(232, 119, 34, 0.1);
  border: 1px solid rgba(232, 119, 34, 0.35);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 9px;
  font-weight: 700;
  color: var(--fsa-orange);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--fsa-orange);
  border-radius: 50%;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(232, 119, 34, 0.6);
  }

  50% {
    opacity: 0.6;
    box-shadow: 0 0 0 6px rgba(232, 119, 34, 0);
  }
}

.clock {
  font-family: "JetBrains Mono", monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.date-display {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: right;
}

/* ── Resumo compacto ── */
.summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.summary strong {
  color: var(--text-primary);
}

/* ── Grid de setores: responsivo com auto-fill ── */
.sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
  overflow-y: auto;
  align-content: start;
  min-height: 0;
}

.sector-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
  flex-shrink: 0;
}

.sector-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.sector-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sector-pager {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  color: var(--text-dim);
}

.page-info {
  background: rgba(232, 119, 34, 0.12);
  color: var(--fsa-orange-light);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}

.page-count {
  color: var(--text-dim);
  font-weight: 400;
}

.sector-color-bar {
  width: 3px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
}

.sector-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sector-total {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  border: 1px solid;
  white-space: nowrap;
}

.sector-table-wrapper {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sector-table-wrapper::-webkit-scrollbar {
  width: 3px;
}

.sector-table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.sector-table-wrapper::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.sector-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.sector-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  padding: 3px 8px;
  text-align: left;
  font-size: 8px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  z-index: 1;
}

.sector-table tbody tr {
  border-bottom: 1px solid rgba(60, 60, 60, 0.35);
}

.sector-table tbody td {
  padding: 3px 8px;
  font-size: 11px;
  vertical-align: middle;
}

.sector-table tbody td:first-child {
  width: 100%;
  max-width: 0;
}

.sector-table thead th:first-child {
  width: 100%;
}

.sector-table thead th:last-child {
  width: 90px;
  min-width: 90px;
  text-align: right;
}

.employee-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 8px;
  color: #fff;
  flex-shrink: 0;
}

.employee-name {
  font-weight: 600;
  font-size: 11px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qty-cell {
  text-align: right;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 12px;
  color: var(--fsa-orange);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

.qty-dia {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
}

.qty-sep {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 10px;
}

.qty-mes {
  color: var(--fsa-orange);
  font-weight: 700;
  font-size: 12px;
}

.sector-table tbody td:last-child {
  width: 90px;
  min-width: 90px;
  text-align: right;
}

/* ── Footer compacto ── */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.footer-left {
  font-size: 9px;
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
}

.footer-left .fsa-mark {
  color: var(--fsa-orange);
  font-weight: 700;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: var(--text-dim);
}

.refresh-dot {
  width: 5px;
  height: 5px;
  background: var(--fsa-orange);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ── Responsivo ── */
@media (max-width: 900px) {
  body {
    overflow: auto;
    height: auto;
  }

  .dashboard {
    height: auto;
  }

  .sectors-grid {
    overflow-y: auto;
  }
}
