:root {
  --bg: #f6f1e8;
  --bg-2: #efe7da;
  --panel: rgba(255, 255, 255, 0.88);
  --line: #e3d7c5;
  --text: #2d241c;
  --muted: #716657;
  --brand: #8e6236;
  --brand-2: #b88954;
  --danger: #b13636;
  --success: #256b3e;
  --shadow: 0 20px 55px rgba(45, 36, 28, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(184, 137, 84, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-wrap {
  width: 100%;
  max-width: 460px;
}

.auth-card,
.panel {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.auth-card {
  padding: 28px;
}

.auth-brand h1,
.content-header h1 {
  margin: 10px 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
}

.auth-brand p,
.content-header p,
.section-head p,
.sidebar-subtitle,
.field small,
.empty-state p,
.auth-help {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  background: #f6e9da;
  color: var(--brand);
  border: 1px solid #e7d1b5;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
}

.form-grid,
.form-grid-large,
.toolbar,
.table-actions,
.form-actions,
.search-bar,
.sidebar-nav,
.sidebar-user,
.content {
  display: grid;
  gap: 16px;
}

.form-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-full {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field textarea,
.search-bar input {
  width: 100%;
  border: 1px solid #d8ccb8;
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
  outline: none;
  transition: 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.search-bar input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(184, 137, 84, 0.12);
}

.field textarea {
  resize: vertical;
}

.btn {
  border: 0;
  border-radius: 15px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 14px 24px rgba(142, 98, 54, 0.18);
}

.btn-secondary {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
}

.btn-danger {
  color: #fff;
  background: var(--danger);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.7);
}

.btn-small {
  padding: 10px 12px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
}

.alert {
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 700;
}

.alert-success {
  color: var(--success);
  background: #eef8f1;
  border: 1px solid #cfe8d7;
}

.alert-error {
  color: #8f1f1f;
  background: #fdecec;
  border: 1px solid #f4c7c7;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  padding: 28px 20px;
  border-right: 1px solid rgba(255,255,255,0.7);
  background: rgba(83, 58, 32, 0.9);
  color: #fff;
  display: grid;
  gap: 24px;
  align-content: start;
}

.sidebar-brand {
  font-size: 24px;
  font-weight: 800;
}

.sidebar-subtitle {
  color: rgba(255,255,255,0.75);
}

.sidebar-nav a {
  padding: 14px 16px;
  border-radius: 14px;
  color: rgba(255,255,255,0.85);
  border: 1px solid transparent;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  color: #fff;
}

.sidebar-user {
  margin-top: auto;
  padding: 16px;
  background: rgba(255,255,255,0.08);
  border-radius: 18px;
}

.sidebar-user small {
  color: rgba(255,255,255,0.72);
}

.content {
  padding: 28px;
}

.content-header {
  margin-bottom: 4px;
}

.panel {
  padding: 22px;
}

.toolbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 20px;
}

.search-bar {
  grid-template-columns: 1fr auto;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.table th,
.table td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.table th {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table-actions {
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
}

.table-actions form {
  margin: 0;
}

.empty-state {
  padding: 34px;
  text-align: center;
  display: grid;
  gap: 14px;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,0.72);
  padding: 22px;
  display: grid;
  gap: 18px;
}

.section-head h2 {
  margin: 0 0 6px;
}

.image-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.image-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.image-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: #f1ebe3;
}

.image-card-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.form-actions {
  grid-template-columns: auto auto;
  justify-content: end;
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 18px;
  }

  .content {
    padding: 18px;
  }

  .toolbar,
  .search-bar,
  .form-grid.cols-2,
  .form-grid.cols-3,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .panel,
  .form-section,
  .auth-card {
    padding: 18px;
  }
}
