/* Scoped styles for Perusahaans views (table + form)
   Uses CSS variables defined in app/assets/tailwind/application.css
*/

.perusahaans-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

.perusahaans-table th,
.perusahaans-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.perusahaans-table thead th {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  text-align: left;
  font-weight: 600;
}

.perusahaans-table tbody tr:nth-child(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

.perusahaans-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.perusahaans-table .actions a {
  text-decoration: none;
}

/* Turbo frame form wrapper */
#perusahaan_form {
  display: block;
  margin-top: 1rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
}

#perusahaan_form .field {
  margin-bottom: 0.75rem;
}

#perusahaan_form label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

#perusahaan_form input[type="text"],
#perusahaan_form textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
}

#perusahaan_form input[type="submit"],
#perusahaan_form button[type="submit"] {
  background: var(--color-btn-new);
  color: var(--color-primary-foreground);
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
}

@media (max-width: 640px) {
  .perusahaans-table thead { display: none; }
  .perusahaans-table, .perusahaans-table tbody, .perusahaans-table tr, .perusahaans-table td {
    display: block;
    width: 100%;
  }
  .perusahaans-table tr { margin-bottom: 0.75rem; }
  .perusahaans-table td { text-align: right; padding-left: 50%; position: relative; }
  .perusahaans-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 0.75rem;
    width: 45%;
    text-align: left;
    font-weight: 600;
  }
}
