/* Form Laporan Staff — gaya shadcn/ui (implementasi CSS vanilla).
   Design token shadcn (mode terang, netral): background, foreground,
   card, muted, border, input, primary, destructive, ring, radius. */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --destructive: 0 84.2% 60.2%;
  --ring: 240 5.9% 10%;
  --radius: 0.5rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
}

.container.wide { max-width: 960px; }

.hidden { display: none; }

/* --- Card ala shadcn --- */
.card {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-header {
  padding: 1.5rem 1.5rem 0;
}

.card-header h1 {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
}

.card-header .subtitle {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.card-content {
  padding: 1.5rem;
}

h1 {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 0.25rem;
}

.subtitle {
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

/* --- Field: label kecil medium + jarak konsisten --- */
.field { margin-bottom: 1rem; }
.field:last-of-type { margin-bottom: 0; }

label {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  margin: 0 0 0.5rem;
}

/* --- Input / select gaya shadcn --- */
input[type="text"],
input[type="password"],
input[type="date"],
select {
  display: flex;
  width: 100%;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  outline: none;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: hsl(var(--muted-foreground));
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring) / 0.2);
}

input[type="file"] {
  width: 100%;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.hint {
  display: block;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.25rem;
  margin-top: 0.5rem;
}

/* --- Tombol gaya shadcn --- */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  width: 100%;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  border: none;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

button:hover { opacity: 0.9; }

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

form button[type="submit"] { margin-top: 1.5rem; }

.status {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  min-height: 1.25rem;
}

.status.ok { color: #16a34a; }
.status.err { color: hsl(var(--destructive)); }

/* --- Halaman admin --- */
.card.login { padding: 1.5rem; }
.card.login label { margin-top: 0; }
.card.login button { margin-top: 1rem; }

.card.filters {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.filters .field { margin-bottom: 0.75rem; }

.filters .actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.filters .actions button { width: auto; flex: 1; }

.table-wrap {
  overflow-x: auto;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.25rem;
  caption-side: bottom;
}

th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  white-space: nowrap;
}

th {
  height: 3rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: hsl(var(--muted) / 0.5); }

td a {
  color: hsl(var(--foreground));
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (min-width: 640px) {
  .filters .filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
  }
  .filters .field { margin-bottom: 0; }
}
