* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #2b2620;
  background: #faf7f2;
  margin: 0;
  padding: 24px;
}

h1 {
  font-size: 1.3rem;
  margin: 0;
}

a {
  color: #7a5c3e;
}

.login-box {
  max-width: 320px;
  margin: 80px auto;
  background: #fff;
  border: 1px solid #ddd4c4;
  border-radius: 6px;
  padding: 28px;
}

.login-box label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 12px 0 4px;
}

.login-box input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc0a8;
  border-radius: 4px;
  font-size: 0.9rem;
}

.login-box button {
  margin-top: 16px;
  width: 100%;
  padding: 9px;
  background: #7a5c3e;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.login-box .error {
  color: #a5432c;
  font-size: 0.85rem;
}

.login-box .hint {
  font-size: 0.75rem;
  color: #8a8072;
  margin-top: 16px;
}

.admin-wrap {
  max-width: 1100px;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.logout-link {
  font-size: 0.85rem;
}

.admin-header-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-link {
  font-size: 0.85rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #ddd4c4;
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee6d8;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  background: #f0e9dc;
  font-weight: 600;
}

.admin-table .empty {
  text-align: center;
  color: #8a8072;
  font-style: italic;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
}

.badge-ok {
  background: #dcecd6;
  color: #3b6b2e;
}

.badge-pending {
  background: #f5e2c8;
  color: #8a5a1e;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form {
  display: inline;
}

.actions button {
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: 4px;
  border: 1px solid #ccc0a8;
  background: #fff;
  cursor: pointer;
}

.btn-danger {
  border-color: #d99a86 !important;
  color: #a5432c;
}

.success {
  color: #3b6b2e;
  font-size: 0.9rem;
}

.error {
  color: #a5432c;
  font-size: 0.9rem;
}

.edit-form {
  background: #fff;
  border: 1px solid #ddd4c4;
  border-radius: 6px;
  padding: 20px;
  max-width: 640px;
}

.edit-form fieldset {
  border: none;
  border-top: 1px solid #eee6d8;
  padding: 14px 0;
  margin: 0;
}

.edit-form fieldset:first-of-type {
  border-top: none;
  padding-top: 0;
}

.edit-form legend {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0;
  margin-bottom: 8px;
}

.edit-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 10px 0 4px;
  color: #4a4238;
}

.edit-form input[type="text"],
.edit-form textarea,
.edit-form select,
.edit-form input[type="file"] {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid #ccc0a8;
  border-radius: 4px;
  font-size: 0.88rem;
  font-family: inherit;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 6px;
  font-weight: 400 !important;
}

.checkbox-label input {
  width: auto !important;
}

.photo-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.photo-manage-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd4c4;
  margin-bottom: 4px;
}

.photo-manage-item[draggable="true"] {
  cursor: grab;
}

.photo-manage-item.dragging {
  opacity: 0.4;
}

.photo-manage-item.drag-over {
  outline: 2px dashed #7a5c3e;
  outline-offset: 2px;
}

.photo-dropzone {
  border: 2px dashed #ccc0a8;
  border-radius: 6px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  color: #8a8072;
  font-size: 0.82rem;
  transition: border-color 0.15s, background 0.15s;
}

.photo-dropzone:hover,
.photo-dropzone.drag-over {
  border-color: #7a5c3e;
  background: #f7f3ea;
}

.photo-dropzone p {
  margin: 0;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.photo-preview-item {
  position: relative;
}

.photo-preview-item[draggable="true"] {
  cursor: grab;
}

.photo-preview-item.dragging {
  opacity: 0.4;
}

.photo-preview-item.drag-over {
  outline: 2px dashed #7a5c3e;
  outline-offset: 2px;
}

.photo-preview-item img {
  display: block;
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd4c4;
}

.photo-preview-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #d99a86;
  border-radius: 50%;
  background: #fff;
  color: #a5432c;
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-preview-remove:hover {
  background: #a5432c;
  color: #fff;
}

.btn-primary {
  margin-top: 18px;
  padding: 10px 22px;
  background: #7a5c3e;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.hint {
  font-size: 0.8rem;
  color: #8a8072;
}
