:root {
  --bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #111827;
  --primary-contrast: #ffffff;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}
.muted {
  color: var(--muted);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
  margin-left: 50px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  width: 600px;
  justify-self: center;
  margin: 0 auto;
}

.search-box .icon {
  width: 16px;
  height: 16px;
  color: #666;
  flex-shrink: 0;
}

.search-box input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
  background: transparent;
  color: #333;
}

.btn {
  border: 1px solid var(--line);
  background: #f9fafb;
  color: #111827;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
}
.btn:hover {
  background: #f3f4f6;
}
.btn.primary {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
  margin-right: 50px;
}
.btn.primary:hover {
  filter: brightness(0.95);
}
.btn.simpan {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
  margin-right: 10px;
}
.btn.edit {
  background: #3b82f6;
  color: #fff;
  border: 1px solid #3b82f6;
  margin-right: 10px;
}

.btn.edit:hover {
  background: #2563eb;
}

.btn.hapus {
  background: #ef4444;
  color: #fff;
  border: 1px solid #ef4444;
  margin-right: 10px;
}

.btn.hapus:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.table-responsive {
  width: 100%;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  text-align: left;
  font-size: 14px;
  color: #374151;
  border-bottom: 1px solid var(--line);
  padding: 10px;
}
tbody td {
  border-top: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
  font-size: 14px;
}
tbody tr:hover {
  background: #fafafa;
}
td.actions {
  white-space: nowrap;
  gap: 0px;
}
.thumb {
  width: 54px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
}

dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: min(720px, 96vw);
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.25);
}
#bookForm {
  padding: 16px;
}
#bookForm h3 {
  margin: 0 0 12px 0;
}
.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
.grid .col-span-2 {
  grid-column: span 2;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
input,
select,
textarea {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  background: #fff;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #dbeafe;
  border-color: #93c5fd;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  margin-top: 6px;
}

/* Responsive */
@media (max-width: 760px) {
  .app-header {
    flex-wrap: wrap;
    gap: 10px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}
