/* css/app.css — MARCAR PONTO — Design System Completo */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ================================================================
   TOKENS
   ================================================================ */
:root {
  /* Cores principais */
  --primary:       #7C3AED;
  --primary-light: #8B5CF6;
  --primary-dark:  #6D28D9;
  --primary-glow:  rgba(124,58,237,0.35);

  /* Status */
  --green:         #10B981;
  --green-light:   #34D399;
  --green-glow:    rgba(16,185,129,0.25);
  --amber:         #F59E0B;
  --amber-light:   #FCD34D;
  --amber-glow:    rgba(245,158,11,0.25);
  --red:           #EF4444;
  --red-light:     #F87171;
  --red-glow:      rgba(239,68,68,0.25);
  --gray:          #6B7280;

  /* Backgrounds */
  --bg:            #0A0A14;
  --bg-2:          #0F0F1E;
  --surface:       #141428;
  --surface-2:     #1C1C35;
  --surface-3:     #232340;
  --border:        rgba(124,58,237,0.12);
  --border-2:      rgba(255,255,255,0.06);

  /* Texto */
  --text:          #F1F5F9;
  --text-2:        #94A3B8;
  --text-3:        #64748B;

  /* Efeitos */
  --radius:        16px;
  --radius-sm:     10px;
  --radius-lg:     24px;
  --shadow:        0 8px 32px rgba(0,0,0,0.4);
  --shadow-card:   0 4px 24px rgba(0,0,0,0.3);
  --transition:    0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }

/* ================================================================
   TELA DE LOGIN
   ================================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(124,58,237,0.3) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 110%, rgba(16,185,129,0.15) 0%, transparent 60%),
    var(--bg);
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s var(--transition);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  box-shadow: 0 0 32px var(--primary-glow);
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 40%, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-logo p {
  color: var(--text-2);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* ================================================================
   FORMS
   ================================================================ */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder { color: var(--text-3); }

select.form-control { cursor: pointer; }

/* ================================================================
   BOTÕES
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  padding: 0.7rem 1.25rem;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}
.btn:hover::after { background: rgba(255,255,255,0.08); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(124,58,237,0.5); }

.btn-success {
  background: linear-gradient(135deg, #059669, var(--green));
  color: #fff;
  box-shadow: 0 4px 20px var(--green-glow);
}

.btn-danger {
  background: linear-gradient(135deg, #DC2626, var(--red));
  color: #fff;
  box-shadow: 0 4px 20px var(--red-glow);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover { color: var(--text); border-color: var(--primary-light); }

.btn-full { width: 100%; }

.btn-lg { padding: 1rem 1.5rem; font-size: 1rem; border-radius: var(--radius); }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ================================================================
   LAYOUT PRINCIPAL (APP)
   ================================================================ */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,20,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-2);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header .logo {
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-header .logo span {
  background: linear-gradient(135deg, var(--primary-light), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

/* Main content */
.app-main {
  flex: 1;
  padding: 1.25rem;
  padding-bottom: 5rem;
}

/* Bottom Nav */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(20,20,40,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-2);
  display: flex;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  gap: 0.25rem;
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  transition: color var(--transition);
  position: relative;
}

.nav-item .icon { font-size: 1.3rem; transition: transform var(--transition); }
.nav-item:hover { color: var(--text-2); }
.nav-item:hover .icon { transform: translateY(-2px); }
.nav-item.active { color: var(--primary-light); }
.nav-item.active .icon { transform: translateY(-2px); }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card-sm { padding: 1rem; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}

/* ================================================================
   STATUS BADGE
   ================================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2s infinite;
}

.badge-green  { color: var(--green);  background: rgba(16,185,129,0.12); }
.badge-amber  { color: var(--amber);  background: rgba(245,158,11,0.12); }
.badge-red    { color: var(--red);    background: rgba(239,68,68,0.12); }
.badge-gray   { color: var(--gray);   background: rgba(107,114,128,0.12); }
.badge-purple { color: var(--primary-light); background: var(--primary-glow); }

.badge-green::before  { animation: none; }
.badge-amber::before  { animation: none; }
.badge-gray::before   { animation: none; }

/* ================================================================
   CLOCK
   ================================================================ */
.clock-display {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.clock-time {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #fff 30%, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.clock-date {
  font-size: 0.85rem;
  color: var(--text-2);
  margin-top: 0.5rem;
  text-transform: capitalize;
}

/* ================================================================
   BOTÕES DE PONTO
   ================================================================ */
.punch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
  margin: 1rem 0;
}

.punch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.4rem 1rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  background: var(--surface-2);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.punch-btn .punch-icon {
  font-size: 2rem;
  transition: transform var(--transition);
}

.punch-btn:hover:not(:disabled) .punch-icon { transform: scale(1.15); }

/* Entrada */
.punch-btn.entrada {
  border-color: rgba(16,185,129,0.3);
  background: linear-gradient(145deg, rgba(16,185,129,0.12), rgba(16,185,129,0.05));
}
.punch-btn.entrada.next-action {
  border-color: var(--green);
  background: linear-gradient(145deg, rgba(16,185,129,0.25), rgba(16,185,129,0.1));
  box-shadow: 0 0 24px var(--green-glow), inset 0 0 20px rgba(16,185,129,0.05);
  animation: glow-green 2s ease-in-out infinite;
}

/* Almoço saída */
.punch-btn.almoco_saida {
  border-color: rgba(245,158,11,0.3);
  background: linear-gradient(145deg, rgba(245,158,11,0.12), rgba(245,158,11,0.05));
}
.punch-btn.almoco_saida.next-action {
  border-color: var(--amber);
  background: linear-gradient(145deg, rgba(245,158,11,0.25), rgba(245,158,11,0.1));
  box-shadow: 0 0 24px var(--amber-glow), inset 0 0 20px rgba(245,158,11,0.05);
}

/* Almoço volta */
.punch-btn.almoco_volta {
  border-color: rgba(16,185,129,0.3);
  background: linear-gradient(145deg, rgba(16,185,129,0.12), rgba(16,185,129,0.05));
}
.punch-btn.almoco_volta.next-action {
  border-color: var(--green);
  background: linear-gradient(145deg, rgba(16,185,129,0.25), rgba(16,185,129,0.1));
  box-shadow: 0 0 24px var(--green-glow);
}

/* Saída */
.punch-btn.saida {
  border-color: rgba(239,68,68,0.3);
  background: linear-gradient(145deg, rgba(239,68,68,0.12), rgba(239,68,68,0.05));
}
.punch-btn.saida.next-action {
  border-color: var(--red);
  background: linear-gradient(145deg, rgba(239,68,68,0.25), rgba(239,68,68,0.1));
  box-shadow: 0 0 24px var(--red-glow);
}

.punch-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

/* Loading state */
.punch-btn.loading {
  pointer-events: none;
}
.punch-btn.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%);
  animation: shimmer 1s infinite;
}

/* ================================================================
   TIMELINE DE PONTOS
   ================================================================ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0;
  position: relative;
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 18px;
  top: 48px;
  width: 2px;
  height: calc(100% - 10px);
  background: var(--border-2);
}

.timeline-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.timeline-dot.green  { background: var(--green-glow);  border: 2px solid var(--green); }
.timeline-dot.amber  { background: var(--amber-glow);  border: 2px solid var(--amber); }
.timeline-dot.red    { background: var(--red-glow);    border: 2px solid var(--red); }

.timeline-content { flex: 1; }
.timeline-label { font-size: 0.8rem; color: var(--text-2); font-weight: 500; }
.timeline-time  { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.timeline-time.suspicious { color: var(--amber); }

/* ================================================================
   SCORE
   ================================================================ */
.score-ring {
  position: relative;
  width: 80px; height: 80px;
}

.score-ring svg {
  transform: rotate(-90deg);
}

.score-ring circle {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
}

.score-ring .track { stroke: var(--surface-2); }
.score-ring .fill  { stroke: var(--primary-light); transition: stroke-dashoffset 1s ease; }

.score-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.score-label { font-size: 0.6rem; color: var(--text-3); font-weight: 500; margin-top: 1px; }

/* ================================================================
   STAT CARDS
   ================================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, #fff, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}

/* ================================================================
   TABELA DE HISTÓRICO
   ================================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

thead th {
  background: var(--surface-2);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-2);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-2);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

tbody td {
  padding: 0.7rem 1rem;
  color: var(--text);
  white-space: nowrap;
}

.td-muted { color: var(--text-3); }
.td-success { color: var(--green); font-weight: 600; }
.td-danger  { color: var(--red);   font-weight: 600; }
.td-warning { color: var(--amber); font-weight: 600; }

/* ================================================================
   ADMIN LAYOUT DESKTOP
   ================================================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
  max-width: 100%;
}

.admin-sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border-2);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-2);
}

.sidebar-logo h2 {
  font-size: 1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-2);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  width: 100%;
  text-align: left;
  transition: all var(--transition);
}

.sidebar-nav-item:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav-item.active { background: var(--primary-glow); color: var(--primary-light); }
.sidebar-nav-item .icon { font-size: 1.1rem; }

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border-2);
}

.admin-content {
  flex: 1;
  margin-left: 240px;
  padding: 2rem;
  min-height: 100vh;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
}

/* Metric cards no admin */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.metric-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.metric-icon.green  { background: var(--green-glow);  }
.metric-icon.amber  { background: var(--amber-glow);  }
.metric-icon.red    { background: var(--red-glow);    }
.metric-icon.purple { background: var(--primary-glow); }

.metric-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-2);
  font-weight: 500;
  margin-top: 0.2rem;
}

/* Employee list cards */
.employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.employee-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color var(--transition), transform var(--transition);
  cursor: pointer;
}

.employee-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.employee-info { flex: 1; min-width: 0; }
.employee-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.employee-cargo {
  font-size: 0.78rem;
  color: var(--text-2);
  margin-top: 0.15rem;
}

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-title { font-size: 1.1rem; font-weight: 700; }

.modal-close {
  background: var(--surface-2);
  border: none;
  color: var(--text-2);
  font-size: 1.2rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--red-glow); color: var(--red); }

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
.toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  width: 90%;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow);
  animation: slideDown 0.3s ease;
  pointer-events: all;
}

.toast.success { border-color: var(--green);  background: rgba(16,185,129,0.1); }
.toast.error   { border-color: var(--red);    background: rgba(239,68,68,0.1); }
.toast.warning { border-color: var(--amber);  background: rgba(245,158,11,0.1); }
.toast.info    { border-color: var(--primary-light); background: var(--primary-glow); }

.toast-dismiss { animation: slideDown 0.3s ease reverse forwards; }

/* ================================================================
   LOADING / SKELETON
   ================================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ================================================================
   RANKING
   ================================================================ */
.ranking-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-2);
}

.ranking-item:last-child { border-bottom: none; }

.ranking-pos {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.ranking-pos.gold   { background: linear-gradient(135deg, #F59E0B, #FCD34D); color: #000; }
.ranking-pos.silver { background: linear-gradient(135deg, #94A3B8, #CBD5E1); color: #000; }
.ranking-pos.bronze { background: linear-gradient(135deg, #92400E, #D97706); color: #fff; }
.ranking-pos.other  { background: var(--surface-2); color: var(--text-2); }

.ranking-name { flex: 1; font-weight: 600; font-size: 0.875rem; }
.ranking-score {
  font-weight: 800;
  font-size: 0.875rem;
  background: linear-gradient(135deg, #fff, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ================================================================
   PWA INSTALL BANNER
   ================================================================ */
.pwa-banner {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 50;
  box-shadow: 0 -4px 32px var(--primary-glow);
  animation: slideUp 0.4s ease;
}

.pwa-banner.hidden { display: none; }
.pwa-banner-text { flex: 1; font-size: 0.85rem; font-weight: 500; }
.pwa-banner-text strong { display: block; margin-bottom: 0.1rem; }

/* ================================================================
   UTILITIES
   ================================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border-2); margin: 1rem 0; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.72rem; }
.text-muted { color: var(--text-2); }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.text-warning { color: var(--amber); }
.font-bold { font-weight: 700; }

/* ================================================================
   ANIMAÇÕES
   ================================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

@keyframes glow-green {
  0%, 100% { box-shadow: 0 0 24px var(--green-glow), inset 0 0 20px rgba(16,185,129,0.05); }
  50%       { box-shadow: 0 0 40px rgba(16,185,129,0.5), inset 0 0 30px rgba(16,185,129,0.1); }
}

@keyframes punch-success {
  0%  { transform: scale(1); }
  40% { transform: scale(0.93); }
  70% { transform: scale(1.04); }
  100%{ transform: scale(1); }
}

.anim-punch { animation: punch-success 0.4s ease; }

/* ================================================================
   RESPONSIVE — ADMIN USA TODA LARGURA
   ================================================================ */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  
  .admin-sidebar.open {
    transform: translateX(0);
  }
  
  .admin-content {
    margin-left: 0;
    padding: 1rem;
  }
  
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .employee-grid {
    grid-template-columns: 1fr;
  }
  
  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .clock-time { font-size: 2.8rem; }
  .punch-grid { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .punch-btn  { padding: 1.1rem 0.75rem; }
  .punch-btn .punch-icon { font-size: 1.7rem; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
}

/* Sidebar overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 199;
}

@media (max-width: 768px) {
  .sidebar-overlay.open { display: block; }
}
