/* Timesheet - component styles. Layout and spacing come from Tailwind utilities.
   Plain CSS (no @apply): the Tailwind Play CDN only compiles inline blocks.
   Loaded before the Tailwind CDN, so utility classes override these on conflict. */

/* ---------- Base ---------- */
html { scroll-padding-top: 5rem; }
html.dark { color-scheme: dark; }

:focus-visible {
  outline: 2px solid #1f8a3e;
  outline-offset: 2px;
  border-radius: 0.25rem;
}
.dark :focus-visible { outline-color: #4cc274; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, ::before, ::after { animation: none !important; transition: none !important; }
}

/* ---------- Navigation ---------- */
.nav-link {
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: #475569;
  transition: color .15s, background-color .15s;
}
.nav-link:hover { background-color: #f1f5f9; color: #0f172a; }
.nav-link.active { background-color: #f0fdf4; color: #17702f; }
.dark .nav-link { color: #cbd5e1; }
.dark .nav-link:hover { background-color: #1e293b; color: #fff; }
.dark .nav-link.active { background-color: rgb(76 194 116 / .15); color: #86efac; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  min-height: 2.75rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  transition: color .15s, background-color .15s;
}
.btn:disabled { cursor: not-allowed; opacity: .6; }

.btn-primary { background-color: #1f8a3e; color: #fff; box-shadow: 0 1px 2px rgb(31 138 62 / .3); }
.btn-primary:hover { background-color: #17702f; }

.btn-secondary { border: 1px solid #cbd5e1; background-color: #fff; color: #1e293b; }
.btn-secondary:hover { background-color: #f8fafc; }
.dark .btn-secondary { border-color: #334155; background-color: #1e293b; color: #f1f5f9; }
.dark .btn-secondary:hover { background-color: #334155; }

/* ---------- Card / eyebrow ---------- */
.card {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background-color: #fff;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / .05);
}
.dark .card { border-color: #1e293b; background-color: #0f172a; }

.eyebrow {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1f8a3e;
}
.dark .eyebrow { color: #4cc274; }

/* ---------- Forms ---------- */
.field {
  display: block;
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #cbd5e1;
  background-color: #fff;
  padding: 0.75rem 1rem;
  color: #0f172a;
}
.field::placeholder { color: #94a3b8; }
.field:focus { border-color: #1f8a3e; box-shadow: none; }
.field.is-invalid { border-color: #dc2626; }
.dark .field { border-color: #334155; background-color: #1e293b; color: #f8fafc; }
.dark .field::placeholder { color: #64748b; }
.dark .field.is-invalid { border-color: #f87171; }

.field-error { margin-top: 0.375rem; font-size: 0.875rem; line-height: 1.25rem; color: #b91c1c; }
.dark .field-error { color: #f87171; }

/* ---------- Hero grid backdrop ---------- */
.bg-grid {
  background-image:
    linear-gradient(to right, rgb(15 23 42 / .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(15 23 42 / .05) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse at top, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at top, #000 30%, transparent 75%);
}
.dark .bg-grid {
  background-image:
    linear-gradient(to right, rgb(255 255 255 / .06) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 255 255 / .06) 1px, transparent 1px);
}

/* ---------- PJAX loading UI ---------- */
.loading-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 40vh;
  font-size: 0.95rem;
  color: #64748b;
  animation: pjax-fade-in .2s ease .15s both; /* skip flash on fast loads */
}
.loading-text::before {
  content: "";
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid #e2e8f0;
  border-top-color: #1f8a3e;
  border-radius: 50%;
  animation: pjax-spin .7s linear infinite;
}
.dark .loading-text { color: #94a3b8; }
.dark .loading-text::before { border-color: #334155; border-top-color: #4cc274; }
@keyframes pjax-spin { to { transform: rotate(360deg); } }
@keyframes pjax-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .loading-text { animation: none; }
  .loading-text::before { animation-duration: 1.5s; }
}
