:root {
  color-scheme: dark;
  --employee-bg: #07111f;
  --employee-card: rgba(15, 23, 42, 0.82);
  --employee-card-soft: rgba(255, 255, 255, 0.055);
  --employee-border: rgba(148, 163, 184, 0.18);
  --employee-text: #f8fafc;
  --employee-muted: #a8b5c8;
  --employee-green: #22c55e;
  --employee-green-dark: #15803d;
  --employee-red: #ef4444;
  --employee-red-dark: #b91c1c;
  --employee-yellow: #facc15;
  --employee-blue: #60a5fa;
  --employee-shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
}

body.employee-page {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 12% 12%, rgba(37, 99, 235, 0.24), transparent 34%),
    radial-gradient(circle at 88% 88%, rgba(34, 197, 94, 0.12), transparent 30%),
    linear-gradient(145deg, #07111f 0%, #0f1f38 52%, #0b1730 100%);
  color: var(--employee-text);
  overflow-x: hidden;
}

body.employee-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.35), transparent 75%);
}

.employee-shell {
  position: relative;
  width: min(100%, 520px);
  z-index: 1;
}

.employee-portal {
  width: 100%;
  max-width: none;
  padding: 26px;
  border-radius: 28px;
  border: 1px solid var(--employee-border);
  background: linear-gradient(180deg, rgba(15, 23, 42, .92), rgba(10, 18, 33, .88));
  box-shadow: var(--employee-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-align: left;
}

.employee-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.employee-brand .logo {
  width: 76px;
  margin: 0;
  padding: 7px;
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,.22);
}

.employee-brand-copy {
  min-width: 0;
}

.employee-eyebrow {
  margin: 0 0 4px;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.employee-page h1 {
  margin: 0;
  font-size: clamp(22px, 5vw, 29px);
  letter-spacing: -.025em;
}

.employee-page .subtitle {
  margin: 6px 0 0;
  color: var(--employee-muted);
  font-size: 14px;
  line-height: 1.45;
}

.employee-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 18px;
}

.employee-page .clock-card {
  margin: 0;
  padding: 17px 18px;
  border: 1px solid rgba(96, 165, 250, .16);
  background: linear-gradient(145deg, rgba(30, 64, 175, .18), rgba(255,255,255,.035));
  border-radius: 18px;
}

.employee-page #liveTime {
  margin: 0;
  font-size: clamp(30px, 8vw, 40px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
}

.employee-page #liveDate {
  margin-top: 4px;
  color: #bfdbfe;
  font-size: 13px;
}

.employee-ready-pill {
  align-self: stretch;
  min-width: 98px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--employee-border);
  border-radius: 18px;
  background: var(--employee-card-soft);
  color: var(--employee-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.employee-ready-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #64748b;
  box-shadow: 0 0 0 5px rgba(100, 116, 139, .12);
}

.employee-ready-pill.ready .employee-ready-dot {
  background: var(--employee-green);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, .12);
}

.employee-form-card {
  padding: 18px;
  border: 1px solid var(--employee-border);
  background: rgba(255,255,255,.035);
  border-radius: 20px;
}

.employee-field {
  margin-bottom: 14px;
}

.employee-field:last-of-type {
  margin-bottom: 16px;
}

.employee-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .025em;
}

.employee-field-hint {
  color: #7f8da3;
  font-weight: 600;
  letter-spacing: 0;
}

.employee-page select,
.employee-page input {
  width: 100%;
  max-width: none;
  height: 52px;
  margin: 0;
  padding: 0 15px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .28);
  background: rgba(2, 6, 23, .54);
  color: #f8fafc;
  font-size: 16px;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.employee-page select:focus,
.employee-page input:focus {
  border-color: rgba(96, 165, 250, .9);
  background: rgba(2, 6, 23, .72);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .15);
  outline: none;
}

.employee-page select:disabled,
.employee-page input:disabled {
  opacity: .7;
  cursor: wait;
}

.employee-page option {
  color: #0f172a;
}

.employee-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.employee-action-button,
.employee-page .missed-button {
  position: relative;
  min-height: 58px;
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -.01em;
  box-shadow: 0 11px 24px rgba(0,0,0,.17);
  transform: translateZ(0);
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease, opacity .14s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.employee-action-button:hover,
.employee-page .missed-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.employee-action-button:active,
.employee-page .missed-button:active {
  transform: translateY(1px) scale(.995);
}

.employee-action-button:disabled,
.employee-page .missed-button:disabled {
  opacity: .58;
  transform: none;
  filter: none;
  cursor: wait;
}

.employee-page .clock-in {
  background: linear-gradient(145deg, #22c55e, #15803d);
  color: white;
}

.employee-page .clock-out {
  background: linear-gradient(145deg, #ef4444, #b91c1c);
  color: white;
}

.employee-button-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.employee-secondary-row {
  margin-top: 12px;
}

.employee-page .missed-button {
  min-height: 48px;
  background: rgba(250, 204, 21, .10);
  color: #fde68a;
  border: 1px solid rgba(250, 204, 21, .24);
  box-shadow: none;
  font-size: 14px;
}

.employee-status-card {
  min-height: 72px;
  margin-top: 16px;
  padding: 14px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 17px;
  border: 1px solid var(--employee-border);
  background: rgba(255,255,255,.035);
  transition: border-color .16s ease, background .16s ease;
}

.employee-status-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(148,163,184,.1);
  color: #cbd5e1;
  font-size: 18px;
  font-weight: 900;
}

.employee-status-copy {
  min-width: 0;
}

.employee-status-label {
  margin: 0 0 3px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}

#status {
  min-height: 0;
  margin: 0;
  color: #f8fafc !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.employee-status-card.success {
  border-color: rgba(34,197,94,.34);
  background: rgba(34,197,94,.075);
}

.employee-status-card.success .employee-status-icon {
  color: #86efac;
  background: rgba(34,197,94,.14);
}

.employee-status-card.error {
  border-color: rgba(248,113,113,.34);
  background: rgba(239,68,68,.075);
}

.employee-status-card.error .employee-status-icon {
  color: #fca5a5;
  background: rgba(239,68,68,.14);
}

.employee-status-card.processing {
  border-color: rgba(96,165,250,.3);
  background: rgba(59,130,246,.07);
}

.employee-status-card.processing .employee-status-icon {
  color: #93c5fd;
  background: rgba(59,130,246,.14);
}

.employee-status-card.processing .employee-status-icon::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(147,197,253,.32);
  border-top-color: #93c5fd;
  border-radius: 999px;
  animation: employee-spin .72s linear infinite;
}

.employee-status-card.processing .employee-status-symbol {
  display: none;
}

.employee-footer-note {
  margin: 14px 2px 0;
  color: #718096;
  text-align: center;
  font-size: 11px;
  line-height: 1.45;
}

@keyframes employee-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 560px) {
  body.employee-page {
    padding: 14px;
    place-items: start center;
  }

  .employee-shell {
    margin: max(4px, env(safe-area-inset-top)) 0 max(4px, env(safe-area-inset-bottom));
  }

  .employee-portal {
    padding: 20px 17px;
    border-radius: 24px;
  }

  .employee-brand {
    gap: 12px;
    margin-bottom: 16px;
  }

  .employee-brand .logo {
    width: 64px;
    border-radius: 14px;
  }

  .employee-top-grid {
    grid-template-columns: 1fr 80px;
    gap: 9px;
  }

  .employee-page .clock-card {
    padding: 15px;
  }

  .employee-ready-pill {
    min-width: 0;
  }

  .employee-form-card {
    padding: 15px;
  }

  .employee-actions {
    gap: 9px;
  }

  .employee-action-button {
    min-height: 62px;
    padding: 10px 8px;
  }
}

@media (max-width: 360px) {
  .employee-actions {
    grid-template-columns: 1fr;
  }

  .employee-ready-pill {
    display: none;
  }

  .employee-top-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 900px) and (min-height: 700px) {
  .employee-shell {
    width: min(100%, 560px);
  }

  .employee-portal {
    padding: 30px;
  }

  .employee-action-button {
    min-height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .employee-page *,
  .employee-page *::before,
  .employee-page *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .employee-action-button:hover,
  .employee-page .missed-button:hover {
    transform: none;
  }
}
