/* =========================================
   INTERPARTNER — Controle de Ponto
   Paleta oficial extraída do site institucional
   ========================================= */

:root {
  /* Cores Interpartner */
  --ip-green: #008D45;
  --ip-green-dark: #006B33;
  --ip-green-darker: #004F25;
  --ip-green-light: #E8F5EE;
  --ip-green-soft: #F4FAF6;

  /* Neutros */
  --white: #FFFFFF;
  --bg: #F6F8F7;
  --surface: #FFFFFF;
  --border: #E8ECEE;
  --border-strong: #CFD6DB;
  --text: #1A2F23;
  --text-2: #475467;
  --text-3: #8A95A0;

  /* Status */
  --info: #2563EB;
  --warn: #F59E0B;
  --error: #DC2626;
  --success: #10B981;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow: 0 4px 14px rgba(16,24,40,.08);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.10);

  /* Layout */
  --sidebar-w: 260px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Montserrat', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* ========== LAYOUT ========== */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--ip-green-darker) 0%, var(--ip-green-dark) 60%, var(--ip-green) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;          /* permite que filhos com overflow funcionem */
  overflow: hidden;        /* contém o nav scrollável */
}

.sidebar-brand {
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  flex-shrink: 0;
}
.sidebar-brand img {
  width: 78px;
  max-width: 100%;
  height: auto;
  display: block;
  opacity: .92;
}
.sidebar-brand .brand-name {
  margin-top: 10px;
  font-size: 18px; font-weight: 800; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 6px;
  line-height: 1;
}
.sidebar-brand .brand-mark {
  display: inline-block;
  font-size: 15px;
  opacity: .85;
}
.sidebar-brand small {
  display: block; margin-top: 4px;
  font-size: 9.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; opacity: .62;
  line-height: 1.4;
}
.badge-mini {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255,255,255,.18);
  font-size: 8.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase;
  vertical-align: middle;
}

.nav {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}
.nav::-webkit-scrollbar { width: 5px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav-section {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.42);
  padding: 14px 14px 4px;
}
.nav-section:first-child { padding-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px;
  border-radius: 7px;
  color: rgba(255,255,255,.82);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all .12s;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active {
  background: rgba(255,255,255,.16);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #fff;
}
.nav-item .ico {
  width: 16px;
  text-align: center;
  font-size: 12px;
  opacity: .85;
}
.nav-item.active .ico { opacity: 1; }

.sidebar-foot {
  flex-shrink: 0;
  padding: 12px 22px 14px;
  border-top: 1px solid rgba(255,255,255,.10);
  font-size: 9.5px;
  opacity: .65;
  line-height: 1.55;
  letter-spacing: .01em;
}
.sidebar-foot strong { font-size: 10px; letter-spacing: .06em; }

.main {
  padding: 28px 36px 60px;
  max-width: 1480px;
}

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}

.demo-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: #78350F;
}
.demo-banner strong { font-weight: 700; }
.demo-ico {
  width: 26px; height: 26px;
  background: #FDE68A;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.demo-tag {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  color: #92400E;
  padding: 3px 8px;
  background: rgba(255,255,255,.65);
  border-radius: 999px;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.btn-back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 14px;
  transition: all .15s;
}
.btn-back:hover {
  border-color: var(--ip-green);
  color: var(--ip-green-dark);
  transform: translateX(-2px);
  box-shadow: 0 2px 8px rgba(0,141,69,.12);
}
.btn-back span { font-size: 16px; line-height: 1; }
.page-head h1 {
  font-size: 26px; font-weight: 700; letter-spacing: -.01em;
  color: var(--text);
}
.page-head .sub {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 13px;
}
.page-head .actions { display: flex; gap: 10px; }

/* ========== COMPONENTES ========== */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  transition: all .15s;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--ip-green);
  color: #fff;
}
.btn-primary:hover { background: var(--ip-green-dark); transform: translateY(-1px); }
.btn-ghost {
  background: var(--white);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--ip-green); color: var(--ip-green-dark); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.card-sub { font-size: 12px; color: var(--text-3); }

/* KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--ip-green); opacity: .85;
}
.kpi-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-3);
}
.kpi-value {
  font-size: 26px; font-weight: 700; color: var(--text);
  margin: 6px 0 4px; letter-spacing: -.02em;
}
.kpi-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 500;
  color: var(--text-2);
}
.kpi-delta.up { color: #B45309; }     /* warn suave em vez de vermelho */
.kpi-delta.down { color: var(--ip-green-dark); }
.kpi-delta.neutral { color: var(--text-2); }

.kpi.alert::before { background: var(--warn); }
.kpi.danger::before { background: var(--error); opacity: .75; }
.kpi.success::before { background: var(--success); }

/* Botão de ajuda nos indicadores */
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ip-green-light);
  color: var(--ip-green-dark);
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
  transition: all .15s;
  cursor: help;
}
.info-btn:hover {
  background: var(--ip-green);
  color: #fff;
  transform: scale(1.1);
}

/* Highlight pulsante para card destacado */
@keyframes pulseHighlight {
  0%, 100% { box-shadow: 0 0 0 3px var(--ip-green), 0 0 28px rgba(0,141,69,.4); }
  50%      { box-shadow: 0 0 0 6px var(--ip-green), 0 0 40px rgba(0,141,69,.6); }
}

/* Modal de explicação de indicador */
.tip-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,19,.45);
  z-index: 999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.tip-overlay.active { display: flex; }
.tip-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 80px);
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: tipIn .25s ease;
  margin: auto 0;
  box-sizing: border-box;
}
@keyframes tipIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.tip-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.tip-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--ip-green-light);
  color: var(--ip-green-dark);
  border-radius: 999px;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.tip-title {
  font-size: 20px; font-weight: 700;
  color: var(--text);
  margin: 8px 0 14px;
  letter-spacing: -.01em;
}
.tip-section { margin-bottom: 14px; }
.tip-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ip-green-dark);
  margin-bottom: 4px;
}
.tip-section p {
  font-size: 13px; color: var(--text-2); line-height: 1.55;
}
.tip-example {
  background: var(--ip-green-soft);
  border-left: 3px solid var(--ip-green);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12.5px; color: var(--text);
  font-family: 'Montserrat', monospace;
}
/* Formulário de justificativa */
.just-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.just-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.just-field.full { grid-column: 1 / -1; }
.just-lbl {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-3);
}
.just-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #FAFBFC;
  transition: border-color .12s, background .12s;
}
.just-input:focus {
  outline: none;
  border-color: var(--ip-green);
  background: #fff;
}
.just-input[type="file"] {
  padding: 7px 8px;
  background: #fff;
  font-size: 11px;
}
.just-input[type="file"]::-webkit-file-upload-button {
  background: var(--ip-green-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ip-green-dark);
  cursor: pointer;
  margin-right: 8px;
}
textarea.just-input { resize: vertical; min-height: 56px; }

.tip-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #F1F4F6;
  color: var(--text-2);
  font-size: 16px; font-weight: 700;
}
.tip-close:hover { background: #E5E9EC; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }
.badge.green { background: var(--ip-green-light); color: var(--ip-green-darker); }
.badge.green .badge-dot { background: var(--ip-green); }
.badge.gray { background: #EEF1F4; color: var(--text-2); }
.badge.gray .badge-dot { background: var(--text-3); }
.badge.warn { background: #FEF3C7; color: #92400E; }
.badge.warn .badge-dot { background: var(--warn); }
.badge.danger { background: #FEE2E2; color: #991B1B; }
.badge.danger .badge-dot { background: var(--error); }
.badge.info { background: #DBEAFE; color: #1E40AF; }
.badge.info .badge-dot { background: var(--info); }

/* Tabelas */
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.tbl th {
  text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-3);
  padding: 12px 18px;
  background: var(--ip-green-soft);
  border-bottom: 1px solid var(--border);
}
.tbl td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--ip-green-soft); cursor: pointer; }
.tbl tbody tr:last-child td { border-bottom: none; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ip-green-light);
  color: var(--ip-green-darker);
  font-weight: 700;
  font-size: 13px;
  margin-right: 10px;
  flex-shrink: 0;
}
.avatar.lg { width: 60px; height: 60px; font-size: 20px; }
.avatar.xl { width: 84px; height: 84px; font-size: 28px; }

.name-cell { display: flex; align-items: center; }
.name-cell .name { font-weight: 600; color: var(--text); }
.name-cell .meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Filtros */
.filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 18px;
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  flex: 1; max-width: 360px;
}
.search input { flex: 1; border: none; outline: none; font-size: 13px; }

.tabs {
  display: inline-flex;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.tab {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  transition: all .12s;
}
.tab.active { background: var(--ip-green); color: #fff; }

/* ========== DASHBOARD ========== */

.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}
.dash-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* Heatmap elegante */
.heatmap-wrap { margin-top: 16px; }
.heatmap, .heatmap-head {
  display: grid;
  grid-template-columns: 170px repeat(31, minmax(0, 1fr)) 76px;
  gap: 4px;
  align-items: center;
}
.heatmap { row-gap: 4px; }
.heatmap-head {
  font-size: 9.5px;
  color: var(--text-3);
  text-align: center;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: .02em;
}
.heatmap-head .dow {
  padding: 3px 0;
}
.heatmap-head .dow.weekend { color: var(--text-3); opacity: .55; }
.heatmap-head .dow.sat-h { color: #92400E; font-weight: 800; }
.heatmap-head .dow.today {
  background: var(--ip-green);
  color: #fff;
  border-radius: 4px;
  font-weight: 800;
}
.heatmap .cell.sat-cell { background: #FCD34D; box-shadow: inset 0 0 0 1px rgba(180,83,9,.25); }
.heatmap .cell.sat-cell:hover { background: #FBBF24; }
.heatmap-head .row-label-head, .heatmap-head .total-head {
  text-align: left;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.heatmap-head .total-head { text-align: right; padding-right: 4px; }

.heatmap .row-label {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 8px 2px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  border-radius: 6px;
  transition: background .12s, color .12s;
}
.heatmap .row-label:hover { background: var(--ip-green-soft); color: var(--ip-green-dark); }
.heatmap .row-label .mini-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--ip-green-light);
  color: var(--ip-green-darker);
  font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.heatmap .row-label .nome {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.heatmap .cell {
  height: 22px;
  min-width: 0;
  border-radius: 3px;
  background: #F4F6F8;
  position: relative;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
/* Paleta suavizada — passos de saturação menores */
.heatmap .cell.l0 { background: #F1F4F6; }
.heatmap .cell.l1 { background: #DEF0E5; }
.heatmap .cell.l2 { background: #B3DEC2; }
.heatmap .cell.l3 { background: #7FC79A; }
.heatmap .cell.l4 { background: #4EAD73; }
.heatmap .cell.absent { background: #FBC9C9; }
.heatmap .cell.weekend { background: #FAFBFC; opacity: .5; cursor: default; }
.heatmap .cell.today-col { box-shadow: inset 0 -2px 0 var(--ip-green); }
.heatmap .cell:not(.weekend):hover {
  transform: scale(1.35);
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0,141,69,.25), 0 0 0 1.5px var(--white);
  border-radius: 4px;
}
.heatmap .total-cell {
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  padding-right: 4px;
}
.heatmap .total-cell .he {
  display: block;
  font-size: 9px;
  color: var(--warn);
  font-weight: 600;
  margin-top: 1px;
}
.legend {
  display: flex; gap: 14px; margin-top: 12px;
  font-size: 11px; color: var(--text-2);
  align-items: center;
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-box { width: 12px; height: 12px; border-radius: 3px; }

/* Bar chart */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; margin-top: 14px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar { width: 100%; background: var(--ip-green); border-radius: 4px 4px 0 0; min-height: 4px; transition: all .2s; }
.bar.warn { background: var(--warn); }
.bar.danger { background: var(--error); }
.bar:hover { opacity: .8; }
.bar-label { font-size: 10px; color: var(--text-3); font-weight: 500; }
.bar-value { font-size: 10px; color: var(--text); font-weight: 700; }

/* Alertas lista */
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: 8px;
  background: #FFFBEB;
}
.alert-item.danger { border-left-color: var(--error); background: #FEF2F2; }
.alert-item.info { border-left-color: var(--info); background: #EFF6FF; }
.alert-icon {
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(245,158,11,.15); color: var(--warn);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.alert-item.danger .alert-icon { background: rgba(220,38,38,.12); color: var(--error); }
.alert-item.info .alert-icon { background: rgba(37,99,235,.12); color: var(--info); }
.alert-body { flex: 1; }
.alert-title { font-weight: 600; font-size: 13px; }
.alert-text { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.alert-meta { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ========== PERFIL ========== */
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
  align-items: stretch;
}
.profile-grid > .card { min-width: 0; overflow: hidden; }

.profile-today {
  text-align: right;
  background: rgba(255,255,255,.14);
  border-radius: 10px;
  padding: 10px 14px;
  flex-shrink: 0;
}
.profile-today .today-label {
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; opacity: .82;
}
.profile-today .today-time {
  font-size: 17px; font-weight: 700;
  margin-top: 4px; letter-spacing: -.01em;
}
.profile-today .today-meta {
  font-size: 11px; opacity: .80; margin-top: 3px;
}

.hex-card { padding-bottom: 24px; overflow: visible; }
.hex-card svg {
  width: 100%;
  height: auto;
  max-width: 460px;
  display: block;
  margin: 8px auto 0;
  overflow: visible;
}

/* Sparkline grande */
.spark-lg {
  display: flex; align-items: flex-end; gap: 14px;
  height: 140px;
  margin-top: 18px;
  padding: 0 8px;
}
.spark-col {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.spark-col .spark-val {
  font-size: 11px; font-weight: 700; color: var(--text);
}
.spark-col .spark-bar {
  width: 100%; max-width: 38px;
  min-height: 4px;
  border-radius: 5px 5px 0 0;
  transition: opacity .12s;
}
.spark-col:hover .spark-bar { opacity: .85; }
.spark-col .spark-lbl {
  font-size: 10.5px; color: var(--text-3); font-weight: 700;
  margin-top: 2px;
  text-transform: uppercase; letter-spacing: .04em;
}

/* Lista de ações */
.action-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 12px;
}
.action-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.45;
}
.action-item .action-ico {
  flex-shrink: 0;
  font-size: 14px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.6);
  border-radius: 6px;
  font-weight: 700;
}
.action-item .action-txt { flex: 1; font-weight: 500; }

@media (max-width: 1100px) {
  .profile-grid { grid-template-columns: 1fr; }
}


.profile-head {
  background: linear-gradient(135deg, var(--ip-green) 0%, var(--ip-green-dark) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex; align-items: center; gap: 22px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.profile-head::after {
  content: ''; position: absolute; right: -60px; bottom: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,.10) 0%, transparent 70%);
}
.profile-head .avatar { width: 90px; height: 90px; font-size: 32px; background: rgba(255,255,255,.20); color: #fff; }
.profile-head h2 { font-size: 24px; letter-spacing: -.01em; }
.profile-head .role { font-size: 14px; opacity: .9; margin-top: 4px; }
.profile-head .pills { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.profile-head .pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: 11.5px; font-weight: 600;
}

.profile-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); font-weight: 600;
  margin-bottom: 14px;
}
.profile-back:hover { color: var(--ip-green-dark); }

.info-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px;
  margin-bottom: 18px;
}
.info-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px; }
.info-list div .lbl { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.info-list div .val { font-size: 13px; color: var(--text); margin-top: 2px; font-weight: 500; }
.info-list div .val.muted { color: var(--text-3); font-style: italic; }

/* Calendário (3 meses, compacto) */
.cal-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.cal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 10px 10px;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cal-grid { align-content: start; }
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  gap: 6px;
  flex-wrap: wrap;
}
.cal-month {
  font-size: 12px; font-weight: 700; color: var(--text);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.cal-month .year { color: var(--text-3); font-weight: 600; margin-left: 2px; font-size: 11px; }
.cal-stats { display: flex; gap: 4px; flex-wrap: wrap; }
.cal-stat {
  font-size: 9.5px; font-weight: 700;
  padding: 2px 6px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 2px;
  line-height: 1.4;
}
.cal-stat .num { font-weight: 800; }
.cal-stat.ok { background: var(--ip-green-light); color: var(--ip-green-darker); }
.cal-stat.he { background: #FEF08A; color: #713F12; }
.cal-stat.atraso { background: #FFD9C2; color: #7C2D12; }
.cal-stat.incons { background: #EDE9FE; color: #5B21B6; }
.cal-stat.miss { background: #FEE2E2; color: #991B1B; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 26px;
  column-gap: 2px;
  row-gap: 2px;
}
.cal-dow {
  font-size: 8.5px; color: var(--text-3); text-align: center; font-weight: 700;
  padding: 0 0 4px; text-transform: uppercase; letter-spacing: .04em;
  line-height: 1;
}
.cal-day {
  min-width: 0;
  border-radius: 4px;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  color: var(--text-2);
  background: #F4F6F8;
  position: relative;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  line-height: 1;
}
.cal-day:not(.empty):not(.future):not(.weekend):hover {
  transform: scale(1.14);
  z-index: 4;
  box-shadow: 0 6px 14px rgba(0,141,69,.28);
}
.cal-day.empty { background: transparent; cursor: default; }
.cal-day.ok {
  background: linear-gradient(135deg, #C6EAD5 0%, #92D9B0 100%);
  color: #0B5B30; font-weight: 700;
}
.cal-day.he {
  background: linear-gradient(135deg, #FDE047 0%, #F5B70A 100%);
  color: #6B3D09; font-weight: 800;
}
.cal-day.atraso {
  background: linear-gradient(135deg, #FB923C 0%, #EA6A1A 100%);
  color: #4A1A05; font-weight: 800;
}
.cal-day.atraso::after { background: #7C2D12; }
/* Esquecimento de batida (par incompleto) — cor própria, distinta de HE e atraso */
.cal-day.incons {
  background: linear-gradient(135deg, #C4B5FD 0%, #9B7DF5 100%);
  color: #3B0F8A; font-weight: 800;
}
.cal-day.incons::after { background: #4C1D95; }
/* Fora do período de contrato (antes da admissão / após demissão) — neutro, não é falta */
.cal-day.na {
  background: repeating-linear-gradient(45deg, #EEF1F3, #EEF1F3 4px, #E4E8EB 4px, #E4E8EB 8px);
  color: #AEB6BC; cursor: default; font-weight: 500;
}
/* Letra/sinal no canto superior do dia — reforça a cor (não depender só dela) */
.cal-day { position: relative; }
.cd-tag {
  position: absolute; top: 0px; left: 3px;
  font-size: 9.5px; line-height: 1.1; font-weight: 900; opacity: .92;
  pointer-events: none; letter-spacing: -0.3px;
}
.cal-day.miss {
  background: linear-gradient(135deg, #FB7185 0%, #EF4444 100%);
  color: #fff; font-weight: 800;
}
.cal-day.weekend {
  background: #DDE3E7;
  color: #5C6B77;
  cursor: default;
  font-weight: 500;
}
.cal-day.holiday {
  background: linear-gradient(135deg, #CFFAFE 0%, #5EE2EF 100%);
  color: #0E5C6B; font-weight: 700; cursor: default;
}
.cal-day.justif {
  background: linear-gradient(135deg, #93C5FD 0%, #4F95F0 100%);
  color: #11296B;
  font-weight: 800;
}
.cal-day.justif::after { background: #1D4ED8; }
.cal-day.future { background: #F7F9FA; color: #C8CFD4; cursor: default; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--ip-green), 0 0 0 2px var(--ip-green-light); }
/* Indicador inferior de status */
.cal-day::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 3px; border-radius: 50%;
  background: transparent;
}
.cal-day.he::after { background: #CA8A04; }
.cal-day.miss::after { background: #DC2626; }

/* Popover de dia */
.day-pop {
  position: fixed;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  width: 260px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 998;
  animation: tipIn .18s ease;
}
.day-pop-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.day-pop-date { font-size: 13px; font-weight: 700; color: var(--text); }
.day-pop-status { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }
.day-pop-row {
  display: flex; justify-content: space-between;
  font-size: 12px;
  padding: 5px 0;
}
.day-pop-row .lbl { color: var(--text-3); }
.day-pop-row .val { color: var(--text); font-weight: 600; }
.day-pop-batidas {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 4px; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.day-pop-batida {
  font-size: 11px; padding: 4px 6px;
  background: var(--ip-green-soft);
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
  color: var(--ip-green-dark);
}
.day-pop-batida.empty { background: #F1F4F6; color: var(--text-3); font-style: italic; }

/* Timeline */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding: 8px 0; }
.tl-item::before {
  content: ''; position: absolute; left: -22px; top: 13px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ip-green); border: 3px solid var(--white);
  box-shadow: 0 0 0 1px var(--border);
}
.tl-item.warn::before { background: var(--warn); }
.tl-item.danger::before { background: var(--error); }
.tl-date { font-size: 11px; color: var(--text-3); font-weight: 600; }
.tl-title { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 2px; }
.tl-text { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Mini chart */
.spark {
  display: flex; align-items: flex-end; gap: 2px; height: 36px;
}
.spark-bar {
  flex: 1; background: var(--ip-green); border-radius: 1px;
  min-height: 2px;
}

/* ========== TOUR INTERATIVO ========== */
.tour-overlay {
  position: fixed; inset: 0;
  z-index: 1000;
  display: none;
  pointer-events: none;
}
.tour-overlay.active { display: block; }
/* 4 painéis de cobertura escurecem ao redor do alvo */
.tour-mask {
  position: fixed;
  background: rgba(15,23,19,.62);
  pointer-events: auto;
  transition: all .3s cubic-bezier(.4,.0,.2,1);
}
.tour-spotlight {
  position: fixed;
  border-radius: 10px;
  background: transparent;
  border: 3px solid var(--ip-green);
  box-shadow: 0 0 0 4px rgba(0,141,69,.20), 0 0 30px rgba(0,141,69,.55);
  transition: all .3s cubic-bezier(.4,.0,.2,1);
  pointer-events: none;
}
.tour-bubble {
  position: fixed;
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 20px;
  width: 340px;
  box-shadow: var(--shadow-lg);
  z-index: 1002;
  pointer-events: auto;
}
.tour-mask { z-index: 1000; }
.tour-spotlight { z-index: 1001; }
.tour-bubble .step { font-size: 11px; font-weight: 700; color: var(--ip-green); letter-spacing: .08em; text-transform: uppercase; }
.tour-bubble h4 { font-size: 16px; margin: 4px 0 8px; color: var(--text); }
.tour-bubble p { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.tour-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.tour-dots { display: flex; gap: 5px; }
.tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.tour-dot.active { background: var(--ip-green); }
.tour-buttons { display: flex; gap: 8px; }
.tour-btn {
  padding: 6px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
}
.tour-btn.primary { background: var(--ip-green); color: #fff; }
.tour-btn.ghost { color: var(--text-2); }

/* Empty state / loading */
.empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-3);
}
.empty-ico {
  font-size: 42px; margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .dash-grid-3 { grid-template-columns: 1fr; }
  .cal-container { grid-template-columns: 1fr; }
}
