* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #f7f5f1;
  color: #262421;
}
.topbar {
  background: #2e2a25;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
}
.topbar .brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}
.topbar nav a {
  color: #e8e4dc;
  text-decoration: none;
  margin-left: 18px;
  font-size: 14px;
}
.topbar nav a:hover { text-decoration: underline; }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

h1 { margin-top: 0; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

a.button, button {
  background: #8a6d3b;
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
}
button.danger { background: #a33d3d; }
button:hover, a.button:hover { opacity: 0.9; }

input[type=text], input[type=password], input[type=number], input[type=date],
textarea, select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc5b8;
  border-radius: 5px;
  font-size: 14px;
  margin-top: 4px;
  background: #fff;
}

label {
  font-weight: 600;
  font-size: 13px;
  color: #4a463f;
}

fieldset {
  border: 1px solid #ddd7c9;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 16px 0;
  background: #fffdfa;
}
legend {
  font-weight: 700;
  padding: 0 6px;
  color: #6b5a35;
}

.field-block { margin-bottom: 14px; }

.order-form button.primary, .add-subject-form button {
  margin-top: 10px;
}

table.order-table, table.subject-table, table.detail-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background: #fff;
}
table.order-table th, table.order-table td,
table.subject-table th, table.subject-table td,
table.detail-table th, table.detail-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eae6db;
  text-align: left;
  font-size: 14px;
}
table.detail-table th { width: 35%; color: #555; }
tr.inactive { opacity: 0.5; }

.badge {
  padding: 3px 8px;
  border-radius: 4px;
  background: #eee7d8;
  font-size: 12px;
}
tr.status-in-progress .badge { background: #fce7b8; }
tr.status-done .badge { background: #cdeecb; }

.hint { color: #6a655c; font-size: 13px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.search-form { display: flex; gap: 8px; }
.search-form input { width: 220px; }

.status-form { margin-bottom: 16px; }
.status-form select { width: auto; display: inline-block; }

.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-grid img { max-width: 180px; border-radius: 6px; border: 1px solid #ddd; }

.empty { color: #777; }
.error { color: #a33d3d; font-weight: 600; }

/* Login page */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #2e2a25;
}
.login-box {
  background: #fff;
  padding: 32px 36px;
  border-radius: 10px;
  width: 320px;
  text-align: center;
}
.login-box h1 { font-size: 20px; }
.login-box button { width: 100%; margin-top: 14px; }
