/* ===== Protrack365 — sistema de design compartilhado ===== */

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

:root {
  /* Cores base */
  --bg: #f2f3f6;
  --surface: #ffffff;
  --surface-alt: #eceef2;
  --border: #e1e4ea;
  --border-strong: #cbd1db;
  --text: #12151c;
  --text-muted: #5c6472;
  --text-faint: #8991a1;

  /* Acento e semântica */
  --accent: #2f5ff5;
  --accent-strong: #1f45d1;
  --accent-soft: #e8edff;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --success-strong: #14532d;
  --warning: #d97706;
  --warning-soft: #fef1d6;
  --warning-strong: #7c3d05;
  --danger: #dc2626;
  --danger-soft: #fde3e2;
  --danger-strong: #7f1d1d;
  --neutral-soft: #eef0f3;
  --neutral-strong: #334155;

  /* Header / navegação */
  --header-bg: #0a0f1c;
  --header-bg-2: #10182c;
  --header-text: #e7eaf3;
  --header-text-muted: #8c95ab;

  /* Forma */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 10px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.05);
  --shadow-header: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 4px 16px rgba(0, 0, 0, 0.18);

  --font-ui: 'Manrope', -apple-system, Segoe UI, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
header.app-header {
  background: linear-gradient(155deg, var(--header-bg-2) 0%, var(--header-bg) 65%);
  color: var(--header-text);
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-header);
  position: relative;
  z-index: 5;
}
header.app-header::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47, 95, 245, 0.55), transparent);
}
header.app-header .brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
header.app-header .app-logo {
  height: 26px;
  width: auto;
  display: block;
}
header.app-header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
header.app-header h1::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 95, 245, 0.25);
  flex-shrink: 0;
}
header.app-header .nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
header.app-header a.nav-link {
  color: var(--header-text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}
header.app-header a.nav-link:hover {
  color: var(--header-text);
  background: rgba(255, 255, 255, 0.06);
}
header.app-header a.nav-link.active {
  color: #fff;
  background: rgba(47, 95, 245, 0.22);
}
header.app-header button.btn-logout {
  margin-left: 10px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--header-text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-ui);
  transition: background 0.15s ease, border-color 0.15s ease;
}
header.app-header button.btn-logout:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

#workerHealth {
  font-size: 12px;
  font-weight: 600;
  color: var(--header-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-right: 6px;
}

/* ===== Cartões de resumo ===== */
.summary { display: flex; gap: 14px; padding: 22px 28px 4px; }
.summary .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  min-width: 170px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.summary .card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 85%);
}
.summary .card .value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.summary .card .label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ===== Filtros ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 28px;
  align-items: end;
  background: var(--surface);
  margin: 16px 28px 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.filters label {
  display: flex;
  flex-direction: column;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  gap: 6px;
}
.filters input, .filters select {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}
.filters input:focus, .filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filters input::placeholder { color: var(--text-faint); }
.filters .filter-actions { display: flex; gap: 8px; }

/* ===== Botões ===== */
.btn {
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--font-ui);
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: white; box-shadow: 0 2px 6px rgba(47, 95, 245, 0.28); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--neutral-soft); color: var(--neutral-strong); }
.btn-ghost:hover { background: var(--border-strong); }
.btn-small {
  padding: 5px 11px;
  font-size: 12px;
  background: var(--neutral-strong);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
}
.btn-small:hover { background: #1e293b; }

/* ===== Tabela ===== */
table {
  width: calc(100% - 56px);
  margin: 18px 28px 28px;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
th, td { padding: 12px 16px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--border); }
th {
  background: var(--surface-alt);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s ease; }
tbody tr:hover { background: var(--surface-alt); }

#empty { padding: 48px; text-align: center; color: var(--text-faint); font-size: 14px; }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* ===== Monospace (IMEI, dados técnicos) ===== */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
