/* ==========================================================================
   Área do funcionário — login + dashboard
   ========================================================================== */
.dash-body {
  min-height: 100vh;
  background: radial-gradient(120% 140% at 78% -10%, #0E5C4A 0%, var(--navy-dark) 46%, var(--navy-deeper) 100%);
  font-family: var(--font-body);
  color: var(--ice-2);
  padding: 32px 20px 60px;
}

.dash-wrap { max-width: 880px; margin: 0 auto; }

.dash-back {
  display: inline-block;
  color: var(--cyan-soft);
  font-size: 13.5px;
  margin-bottom: 28px;
}
.dash-back:hover { color: var(--white); }

/* Login */
.dash-login {
  max-width: 380px;
  margin: 60px auto 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  box-shadow: var(--shadow-card-lg);
}
.dash-logo { margin-bottom: 18px; }
.dash-login h1 { font-family: var(--font-body); font-size: 22px; font-weight: 800; color: var(--white); margin: 0 0 6px; }
.dash-sub { font-size: 13.5px; color: var(--cyan-soft); margin: 0 0 26px; }

.dash-login-form { display: flex; flex-direction: column; gap: 16px; text-align: left; }
.dash-login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--cyan-soft); }
.dash-login-form input {
  font: inherit;
  font-size: 15px;
  color: var(--white);
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.dash-login-form input:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
.dash-login-form .btn { margin-top: 6px; width: 100%; justify-content: center; }
.dash-login-form .btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.dash-error {
  color: #FF9B8A;
  background: rgba(196,60,60,0.14);
  border: 1px solid rgba(196,60,60,0.35);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin: 0;
}

/* Dashboard */
.dash-panel { padding-top: 8px; }
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.dash-head h1 { font-size: 24px; font-weight: 800; color: var(--white); margin: 0 0 4px; }
.dash-head-actions { display: flex; gap: 10px; flex-shrink: 0; }
.dash-refresh, .dash-logout {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ice-2);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.dash-refresh { width: 36px; height: 36px; padding: 0; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.dash-refresh:hover, .dash-logout:hover { background: rgba(255,255,255,0.12); }
.dash-refresh.is-loading { animation: dash-spin 0.8s linear infinite; }
@keyframes dash-spin { to { transform: rotate(360deg); } }

/* Filtro de período */
.date-picker { position: relative; display: inline-block; margin-bottom: 20px; }

.date-picker-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--white);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
}
.date-picker-trigger:hover { background: rgba(255,255,255,0.1); }
.date-picker-trigger .icon { width: 15px; height: 15px; color: var(--orange); }

.date-picker-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 50;
  width: 320px;
  background: var(--navy-dark);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-lg);
  padding: 18px;
}

.date-picker-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.date-pill {
  font: inherit;
  font-size: 12.5px;
  color: var(--ice-2);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
}
.date-pill:hover { background: rgba(255,255,255,0.12); }
.date-pill.is-active { background: var(--orange); border-color: var(--orange); color: var(--white); font-weight: 600; }

.date-picker-range {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.date-picker-range-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.date-picker-range-field span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--cyan-soft); }
.date-picker-range-field strong { font-size: 13.5px; font-weight: 600; color: var(--white); }

.date-picker-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.date-picker-cal-head span { font-size: 13.5px; font-weight: 700; color: var(--white); }
.date-cal-nav {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: var(--ice-2);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 50%;
  cursor: pointer;
}
.date-cal-nav:hover { background: rgba(255,255,255,0.12); }

.date-picker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.date-picker-weekdays span { text-align: center; font-size: 10.5px; color: var(--cyan-soft); }

.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 2px;
}
.cal-day {
  position: relative;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 12.5px;
  color: var(--ice-2);
  background: none;
  border: none;
  cursor: pointer;
}
.cal-day::before {
  content: "";
  position: absolute;
  inset: 3px 0;
  z-index: 0;
  border-radius: 999px;
}
.cal-day span { position: relative; z-index: 1; }
.cal-day:disabled { color: rgba(255,255,255,0.22); cursor: not-allowed; }
.cal-day.is-outside { visibility: hidden; }
.cal-day.is-today span { text-decoration: underline; text-underline-offset: 3px; }
.cal-day.is-in-range::before { background: rgba(242,135,28,0.18); border-radius: 0; }
.cal-day.is-range-start::before, .cal-day.is-range-end::before { background: var(--orange); }
.cal-day.is-range-start span, .cal-day.is-range-end span { color: var(--white); font-weight: 700; }
.cal-day.is-range-start::before { border-radius: 999px 0 0 999px; }
.cal-day.is-range-end::before { border-radius: 0 999px 999px 0; }
.cal-day.is-range-start.is-range-end::before { border-radius: 999px; }
.cal-day:not(:disabled):not(.is-range-start):not(.is-range-end):hover::before { background: rgba(255,255,255,0.1); border-radius: 999px; }

.date-picker-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.date-clear {
  font: inherit;
  font-size: 12.5px;
  color: var(--cyan-soft);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.date-clear:hover { color: var(--white); }

.dash-warnings {
  font-size: 12.5px;
  color: #E8C275;
  background: rgba(232,194,117,0.1);
  border: 1px solid rgba(232,194,117,0.3);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin: 0 0 16px;
  line-height: 1.5;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-tile {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-label { font-size: 12.5px; color: var(--cyan-soft); line-height: 1.3; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--white); font-variant-numeric: proportional-nums; }
.stat-value--live { color: var(--orange); }
.stat-value--live::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  margin-right: 8px;
  vertical-align: middle;
  animation: dash-pulse 1.6s ease-in-out infinite;
}
@keyframes dash-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.dash-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 22px 24px 24px;
}
.dash-card h2 { font-size: 15px; font-weight: 700; color: var(--white); margin: 0 0 18px; }

.bar-list { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 60px; align-items: center; gap: 12px; }
.bar-row-label { font-size: 13px; color: var(--ice-2); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row-track {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 999px;
  height: 18px;
  max-height: 18px;
  overflow: hidden;
}
.bar-row-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange-hover), var(--orange));
  box-shadow: 0 0 10px -1px rgba(242,135,28,0.7);
  width: 0;
}
.bar-row-value { font-size: 14px; font-weight: 700; color: var(--white); text-align: right; font-variant-numeric: tabular-nums; }

.dash-table-details { margin-top: 18px; }
.dash-table-details summary { color: var(--cyan-soft); font-size: 12.5px; cursor: pointer; }
.dash-table-details summary:hover { color: var(--white); }
.dash-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.dash-table th, .dash-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,0.08); color: var(--ice-2); }
.dash-table td:last-child, .dash-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.dash-empty { color: var(--cyan-soft); font-size: 13.5px; padding: 8px 0; }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dash-card--wide { grid-column: 1 / -1; }

/* Gráficos de coluna (dia da semana / horário) */
.col-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 140px;
  padding-top: 8px;
}
.col-chart--hours { gap: 4px; }
.col-bar-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  cursor: default;
}
.col-bar-track {
  width: 100%;
  max-width: 26px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px 4px 0 0;
}
.col-chart--hours .col-bar-track { max-width: 12px; }
.col-bar-fill {
  width: 100%;
  height: 2px;
  min-height: 2px;
  background: linear-gradient(180deg, var(--orange), var(--orange-hover));
  box-shadow: 0 0 8px -1px rgba(242,135,28,0.7);
  border-radius: 4px 4px 0 0;
}
.col-bar-wrap:hover .col-bar-fill, .col-bar-wrap:focus-visible .col-bar-fill { background: var(--cyan); box-shadow: 0 0 8px -1px rgba(79,174,104,0.7); }
.col-bar-label { font-size: 11px; color: var(--cyan-soft); white-space: nowrap; }
.col-chart--hours .col-bar-label { font-size: 9px; }
.col-chart--hours .col-bar-wrap:nth-child(n):not(:nth-child(3n+1)) .col-bar-label { visibility: hidden; }

.chart-tooltip {
  position: fixed;
  z-index: 200;
  background: var(--navy-deeper);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--white);
  pointer-events: none;
  box-shadow: var(--shadow-card-lg);
  transform: translate(-50%, -100%);
  white-space: nowrap;
}

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

@media (max-width: 520px) {
  .bar-row { grid-template-columns: 96px 1fr 46px; }
  .date-picker-panel { width: calc(100vw - 40px); left: 50%; transform: translateX(-50%); }
}
