* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f6f7fb;
  color: #1f2937;
}

.topbar {
  background: #111827;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 20px; }
.topbar a { color: #fff; text-decoration: none; margin-left: 12px; }
.badge-role {
  background: #1f2937;
  border: 1px solid #374151;
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.layout {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 16px 30px;
  display: grid;
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  padding: 16px;
}
.card h2 { margin: 0 0 10px; }
.card h3 { margin: 18px 0 10px; }

label {
  display: block;
  margin: 10px 0 6px;
  font-weight: 600;
}
input, textarea, select, button {
  font: inherit;
}
input[type='text'], input[type='password'], input[type='file'], textarea, select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px;
}
button {
  margin-top: 12px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
}
.btn-danger {
  background: #dc2626;
  padding: 6px 10px;
  margin-top: 0;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.image-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
}
.image-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.image-placeholder {
  height: 120px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  padding: 10px 8px;
  font-size: 14px;
}
th { background: #f9fafb; }

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.btn-link {
  background: #0f766e;
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  text-decoration: none;
}

.alert {
  border-radius: 8px;
  padding: 10px;
  margin: 0;
}
.alert.success { background: #dcfce7; color: #166534; }
.alert.error { background: #fee2e2; color: #991b1b; }
.muted { color: #6b7280; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-wrap .card {
  width: 100%;
  max-width: 420px;
}
.inline-delete { margin: 0; }

@media (max-width: 900px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
