:root {
  --bg: #f4f1ea;
  --panel: #fffdf8;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #dfd6c7;
  --accent: #a64b2a;
  --accent-dark: #7a341d;
  --success: #1f7a5a;
  --warn: #b7791f;
  --danger: #b83232;
  --shadow: 0 20px 45px rgba(69, 45, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 209, 163, 0.38), transparent 30%),
    linear-gradient(180deg, #f7f3ec 0%, var(--bg) 100%);
  color: var(--ink);
}

a {
  color: inherit;
}

code,
pre,
select,
input,
button {
  font: inherit;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.brand {
  font-size: 28px;
  font-weight: 700;
  text-decoration: none;
}

.subtitle,
.muted {
  color: var(--muted);
}

.content,
.stack {
  display: grid;
  gap: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(166, 75, 42, 0.12);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-card {
  max-width: 420px;
  margin: 8vh auto 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

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

.field-grow {
  flex: 1;
}

.filters,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
}

.button {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-dark);
}

.button-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.button-danger {
  background: var(--danger);
}

.button-danger:hover {
  background: #932626;
}

.text-link {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.space-card {
  min-width: 240px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(166, 75, 42, 0.1), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(166, 75, 42, 0.12);
}

.space-value {
  font-size: 28px;
  font-weight: 700;
}

.tiny-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(184, 50, 50, 0.08);
  color: var(--danger);
}

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

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

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(223, 214, 199, 0.7);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.empty {
  text-align: center;
  color: var(--muted);
}

.status-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-transform: lowercase;
}

.status-new {
  background: rgba(183, 121, 31, 0.12);
  color: var(--warn);
}

.status-in_progress {
  background: rgba(166, 75, 42, 0.12);
  color: var(--accent-dark);
}

.status-done {
  background: rgba(31, 122, 90, 0.12);
  color: var(--success);
}

.status-rejected {
  background: rgba(184, 50, 50, 0.12);
  color: var(--danger);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

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

.photo-card img,
.photo-missing {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-missing {
  display: grid;
  place-items: center;
  background: #f5efe4;
  color: var(--muted);
  padding: 16px;
}

pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  background: #f8f4ed;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

@media (max-width: 720px) {
  .page-shell {
    padding: 16px;
  }

  .topbar,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .button,
  .button-secondary {
    width: 100%;
  }
}
