/* ================= WKM PLANTÃO — APP DO COLABORADOR (MOBILE-FIRST PREMIUM) ================= */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --bg-main: #060A11;
  --bg-surface: #0B1220;
  --bg-card: #101A2D;
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: clip;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  background-image:
    radial-gradient(ellipse 90% 45% at 50% -15%, rgba(245, 158, 11, 0.12), transparent),
    radial-gradient(ellipse 60% 35% at 90% 100%, rgba(16, 185, 129, 0.06), transparent);
  color: #F8FAFC;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: clip;
  overflow-y: visible;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace !important;
  font-variant-numeric: tabular-nums;
}

@media screen and (max-width: 768px) {
  input, select, textarea { font-size: 16px !important; }
}

@keyframes pFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.p-fade { animation: pFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

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

.p-card {
  background: linear-gradient(180deg, #111C31 0%, #0D1627 100%);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.p-hero {
  background: linear-gradient(135deg, #121E36 0%, #0B1220 55%, rgba(217, 119, 6, 0.14) 100%);
  border: 1px solid rgba(245, 158, 11, 0.28);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(251, 191, 36, 0.12);
}

.p-btn-gold {
  background: linear-gradient(180deg, #F59E0B 0%, #D97706 100%);
  color: #060A11;
  font-weight: 800;
  border: 1px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
  transition: transform 0.12s ease, filter 0.15s ease;
}
.p-btn-gold:active { transform: scale(0.97); }
.p-btn-gold:hover:not(:disabled) { filter: brightness(1.07); }
.p-btn-gold:disabled { opacity: 0.5; cursor: not-allowed; }

.p-input {
  width: 100%;
  background: #060A11;
  border: 1px solid #2A3950;
  border-radius: 0.85rem;
  padding: 0.72rem 0.9rem;
  color: #F8FAFC;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.p-input:focus {
  outline: none;
  border-color: #F59E0B;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.p-header {
  padding-top: max(0.75rem, calc(var(--sat) + 0.45rem));
  background: rgba(11, 18, 32, 0.92);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.p-bottom-nav {
  padding-bottom: max(0.5rem, var(--sab));
  background: rgba(11, 18, 32, 0.96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  -webkit-user-select: none;
  user-select: none;
}

.p-nav-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  min-height: 54px;
  color: #94A3B8;
  font-size: 0.67rem;
  font-weight: 700;
  border-radius: 0.85rem;
  transition: color 0.15s ease, transform 0.12s ease;
}
.p-nav-item:active { transform: scale(0.92); }
.p-nav-item.active { color: #FBBF24; }
.p-nav-item.active::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 3px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.7);
}

.p-cal-cell {
  aspect-ratio: 1 / 1;
  border-radius: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-weight: 800;
  font-size: 0.82rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.p-cal-cell:active { transform: scale(0.94); }
.p-cal-trabalho { background: rgba(245, 158, 11, 0.16); border-color: rgba(245, 158, 11, 0.45); color: #FDE68A; }
.p-cal-cobertura { background: rgba(14, 165, 233, 0.18); border-color: rgba(14, 165, 233, 0.48); color: #7DD3FC; }
.p-cal-folga { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.22); color: #A7F3D0; }
.p-cal-ferias { background: rgba(139, 92, 246, 0.18); border-color: rgba(139, 92, 246, 0.45); color: #DDD6FE; }
.p-cal-atestado { background: rgba(244, 63, 94, 0.16); border-color: rgba(244, 63, 94, 0.45); color: #FDA4AF; }
.p-cal-substituido { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.3); color: #CBD5E1; }
.p-cal-selected { box-shadow: 0 0 0 2px #F59E0B; transform: scale(1.03); }

@media (max-width: 639px) {
  #portalModalDialog {
    border-top-left-radius: 1.5rem !important;
    border-top-right-radius: 1.5rem !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    padding-bottom: var(--sab);
    animation: pSheet 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  #portalModalDialog::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 9999px;
    background: rgba(148, 163, 184, 0.35);
    margin: 9px auto 2px;
    flex-shrink: 0;
  }
}

.p-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 9999px;
  background: #060A11;
  border: 1px solid rgba(148, 163, 184, 0.16);
  overflow: hidden;
}
.p-progress-fill { height: 100%; border-radius: 9999px; transition: width 0.35s ease; }

.badge-amber   { background: rgba(217, 119, 6, 0.18);  color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.42); }
.badge-emerald { background: rgba(16, 185, 129, 0.16); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.38); }
.badge-sky     { background: rgba(14, 165, 233, 0.16); color: #38BDF8; border: 1px solid rgba(14, 165, 233, 0.38); }
.badge-rose    { background: rgba(244, 63, 94, 0.16);  color: #FB7185; border: 1px solid rgba(244, 63, 94, 0.40); }
.badge-violet  { background: rgba(139, 92, 246, 0.16); color: #C4B5FD; border: 1px solid rgba(139, 92, 246, 0.38); }
.badge-slate   { background: rgba(148, 163, 184, 0.12); color: #CBD5E1; border: 1px solid rgba(148, 163, 184, 0.28); }
