:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #172126;
  --muted: #66747c;
  --line: #dbe3e7;
  --accent: #0c7a68;
  --accent-dark: #07584c;
  --soft: #eef7f4;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand { font-weight: 700; font-size: 20px; }
.sub, .hint, small { color: var(--muted); }
nav { display: flex; gap: 10px; }
nav a, a { color: var(--accent-dark); text-decoration: none; font-weight: 600; }

main { max-width: 1180px; margin: 26px auto 60px; padding: 0 20px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 18px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
h1, h2 { margin: 0 0 16px; letter-spacing: 0; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats div { background: var(--soft); border: 1px solid #d2ebe4; border-radius: 8px; padding: 14px; }
.stats span { display: block; font-size: 28px; font-weight: 700; color: var(--accent-dark); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 13px; }

.form label { display: block; margin: 16px 0 7px; font-weight: 700; }
input, textarea {
  width: 100%;
  border: 1px solid #c8d3d8;
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
}
textarea { resize: vertical; }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.choice {
  display: flex !important;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 0 !important;
}
.choice input { width: auto; margin-top: 3px; }
.choice small { display: block; margin-top: 4px; font-weight: 400; }

.quality-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.quality-head, .quality-row { display: grid; grid-template-columns: 2fr 1fr 1.5fr; gap: 0; }
.quality-head span { background: #eef2f3; padding: 10px; font-weight: 700; color: var(--muted); }
.quality-row input { border-radius: 0; border-width: 1px 1px 0 0; }
.quality-row input:last-child { border-right: 0; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-dark); }
.button.danger { background: #b42318; border-color: #b42318; color: #fff; }
.button.danger:hover { background: #8f1b13; }
.actions { display: flex; gap: 10px; margin-top: 22px; }
.actions.compact { margin-top: 0; align-items: center; }
.row-actions { display: flex; gap: 12px; align-items: center; }
.row-actions form, .actions form { margin: 0; }
.link-danger {
  border: 0;
  background: transparent;
  color: #b42318;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
}
.notice { background: #fff7da; border: 1px solid #ecd27a; border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; }

@media (max-width: 760px) {
  .topbar, .panel-head { align-items: flex-start; flex-direction: column; }
  nav { flex-wrap: wrap; }
  .grid.two, .grid.three, .stats { grid-template-columns: 1fr; }
  .quality-head, .quality-row { grid-template-columns: 1fr; }
}
