/**
 * PontoTrack — Dashboard Premium Operacional
 * Real-time team panel + Greeting header
 */

/* ════════════════════════════════════════════════════════════
   GREETING HEADER
   ════════════════════════════════════════════════════════════ */

.dash-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.05));
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
}

.dash-greeting::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 50%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(37,99,235,0.18) 0%, transparent 60%);
  pointer-events: none;
}

.dash-greeting-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.dash-date {
  font-size: 11px;
  font-weight: 700;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 0 0 4px 0;
}

.dash-hello {
  font-size: 22px;
  font-weight: 900;
  color: #f1f5f9;
  margin: 0 0 4px 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dash-emoji {
  display: inline-block;
  animation: dashWave 2.4s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes dashWave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20%, 40% { transform: rotate(-8deg); }
}

.dash-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.dash-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  min-width: 110px;
}

.dash-clock-pulse {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  animation: dashPulse 2s infinite;
}

@keyframes dashPulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.dash-clock-icon {
  font-size: 14px;
  color: #60a5fa;
  margin-bottom: 2px;
}

.dash-time-now {
  font-size: 22px;
  font-weight: 900;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  line-height: 1;
}

.dash-time-label {
  font-size: 9px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  margin-top: 4px;
}

@media (max-width: 600px) {
  .dash-greeting {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }
  .dash-clock {
    flex-direction: row;
    gap: 10px;
    padding: 10px 14px;
    min-width: 0;
  }
  .dash-clock-icon { margin-bottom: 0; }
  .dash-time-label { margin-top: 0; align-self: center; }
  .dash-hello { font-size: 18px; }
  .dash-clock-pulse { top: 50%; right: 8px; transform: translateY(-50%); }
}

/* ════════════════════════════════════════════════════════════
   TEAM REALTIME PANEL
   ════════════════════════════════════════════════════════════ */

.team-realtime-panel {
  background: var(--surface, #0f1f3a);
  border: 1px solid var(--border, #334155);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.trp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
  flex-wrap: wrap;
}

.trp-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.trp-title h3 {
  font-size: 14px;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0;
  letter-spacing: -0.2px;
}

.trp-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  animation: dashPulse 2s infinite;
  flex-shrink: 0;
}

.trp-updated {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}

/* Pills de status */
.trp-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

@media (min-width: 600px) {
  .trp-summary { grid-template-columns: repeat(4, 1fr); }
}

.trp-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  min-width: 0;
  transition: all 0.2s;
}

.trp-pill:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.12);
}

.trp-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.trp-pill-num {
  font-size: 18px;
  font-weight: 900;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
}

.trp-pill-label {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trp-working .trp-pill-dot { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
.trp-lunch   .trp-pill-dot { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
.trp-ended   .trp-pill-dot { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
.trp-absent  .trp-pill-dot { background: #64748b; }

/* Lista de funcionários */
.trp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -2px;
  padding: 0 2px;
}

.trp-list::-webkit-scrollbar { width: 4px; }
.trp-list::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 2px; }

.trp-empty {
  text-align: center;
  padding: 32px 20px;
  color: #64748b;
}

.trp-empty i {
  font-size: 36px;
  color: rgba(100, 116, 139, 0.4);
  margin-bottom: 12px;
  display: block;
}

.trp-empty p {
  font-size: 13px;
  margin: 0;
}

.trp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  padding-left: 18px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  animation: trpSlideIn 0.3s ease-out;
}

@keyframes trpSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.trp-item:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.trp-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.trp-item.is-working::before { background: #22c55e; }
.trp-item.is-lunch::before   { background: #f59e0b; }
.trp-item.is-ended::before   { background: #ef4444; }
.trp-item.is-absent::before  { background: #64748b; }

/* Avatar */
.trp-avatar {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  border-radius: 50%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.trp-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: 50%;
}

.trp-avatar-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--surface, #0f1f3a);
}

.trp-item.is-working .trp-avatar-status { background: #22c55e; }
.trp-item.is-lunch   .trp-avatar-status { background: #f59e0b; }
.trp-item.is-ended   .trp-avatar-status { background: #ef4444; }
.trp-item.is-absent  .trp-avatar-status { background: #64748b; }

/* Info do funcionário */
.trp-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trp-name {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.trp-role {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Status à direita */
.trp-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
  min-width: 0;
  text-align: right;
}

.trp-status-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.trp-item.is-working .trp-status-label { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.trp-item.is-lunch   .trp-status-label { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.trp-item.is-ended   .trp-status-label { background: rgba(239, 68, 68, 0.12); color: #f87171; }
.trp-item.is-absent  .trp-status-label { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }

.trp-time {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 480px) {
  .team-realtime-panel { padding: 14px; border-radius: 16px; }
  .trp-summary { gap: 6px; }
  .trp-pill { padding: 8px 10px; gap: 6px; }
  .trp-pill-num { font-size: 16px; }
  .trp-pill-label { font-size: 9px; letter-spacing: 0.3px; }
  .trp-item { padding: 10px 12px 10px 16px; gap: 10px; }
  .trp-avatar {
    width: 34px !important; height: 34px !important;
    min-width: 34px !important; max-width: 34px !important;
    font-size: 12px;
  }
  .trp-avatar-status { width: 10px; height: 10px; }
  .trp-name { font-size: 12px; }
  .trp-role { font-size: 10px; }
  .trp-status-label { font-size: 8px; padding: 2px 6px; }
  .trp-time { font-size: 10px; }
}
