/* ── Typography & Body ─────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f0f0f0;
  color: #333;
}

h1, h2, .card-title {
  font-family: Georgia, 'Times New Roman', serif;
  color: #1f5a6d;
}

/* ── Cards ─────────────────────────────────────────── */
.card {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}

/* ── Buttons ───────────────────────────────────────── */
.btn-primary {
  background-color: #20a0a8;
  border-color: #20a0a8;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: #1a8a90;
  border-color: #1a8a90;
}
.btn-primary:disabled {
  background-color: #ccc;
  border-color: #ccc;
}
.btn-primary:focus { box-shadow: 0 0 0 3px rgba(31,90,109,0.25); }

.btn-outline-primary {
  color: #20a0a8;
  border-color: #20a0a8;
}
.btn-outline-primary:hover {
  background-color: #20a0a8;
  border-color: #20a0a8;
}

/* ── Form labels ───────────────────────────────────── */
.form-label {
  font-size: 18px;
  font-weight: 600;
  color: #1f5a6d;
}

/* ── Text inputs ───────────────────────────────────── */
.form-control {
  background: #fafafa;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 16px;
  padding: 10px 12px;
  caret-color: #20a0a8;
}
.form-control:focus {
  background: #ffffff;
  border-color: #999;
  box-shadow: 0 0 0 2px rgba(31,90,109,0.12);
}
.form-control::placeholder { color: #999; }

/* ── Checkboxes ────────────────────────────────────── */
.form-check-input {
  border-radius: 2px !important;
  accent-color: #1f5a6d;
}
.form-check-input:focus { box-shadow: 0 0 0 2px rgba(31,90,109,0.15); }
.form-check-input:checked { background-color: #1f5a6d; border-color: #1f5a6d; }

/* ── Checkbox item rows (quiz form) ────────────────── */
.check-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fafafa;
  margin-bottom: 4px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  padding: 10px 8px;
  border-radius: 2px;
  transition: background 0.15s;
}
.check-row:hover { background: #f0f0f0; }
.check-row.disabled { opacity: 0.45; }

.check-row .form-check-input {
  margin-right: 12px;
  margin-top: 3px;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}
.item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.check-row .form-check-label {
  font-size: 18px;
  font-weight: 400;
  cursor: pointer;
  margin-bottom: 0;
  line-height: 1.3;
}
.check-row .item-meta {
  font-size: 14px;
  color: #aaa;
}

/* ── Section headers (quiz) ────────────────────────── */
.section-header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1f5a6d;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 5px;
  margin: 20px 0 8px;
}

/* ── Text clarification field ──────────────────────── */
.text-clarify {
  margin: 4px 0 2px 40px;
}

/* ── "Other" free-text section ─────────────────────── */
.other-section {
  margin-top: 24px;
  padding: 14px;
  border: 1px dashed #c0d8de;
  border-radius: 4px;
  background: #f4fbfc;
}
.other-section-hint {
  font-size: 14px;
  color: #555;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* ── Tables ────────────────────────────────────────── */
.table th {
  color: #1f5a6d;
  font-size: 15px;
  font-weight: 600;
}
.table td { font-size: 15px; vertical-align: middle; }
.table-section td {
  background: #e8f4f6 !important;
  color: #1f5a6d;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Tabs ──────────────────────────────────────────── */
.nav-tabs .nav-link { color: #555; font-size: 16px; }
.nav-tabs .nav-link.active {
  color: #1f5a6d;
  font-weight: 600;
  border-bottom-color: #20a0a8 !important;
}
.nav-tabs .nav-link:hover:not(.active) { color: #1f5a6d; }

/* ── Admin inline editable ─────────────────────────── */
[contenteditable=true]:focus {
  outline: none;
  background: #f0f9fa;
  border-radius: 2px;
  padding: 1px 4px;
}

/* ── Page header ───────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* ── Confirmed page ────────────────────────────────── */
.success-card { text-align: center; padding: 24px 8px; }
.success-card .icon { font-size: 52px; margin-bottom: 12px; }
.answer-card {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  padding: 14px 18px;
  text-align: left;
  margin: 0 auto 20px;
  max-width: 360px;
  font-size: 14px;
  line-height: 1.8;
}
.answer-card strong { color: #1f5a6d; }

/* ── Summary section ───────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 540px) {
  .summary-grid { grid-template-columns: 1fr; }
}
.summary-card {
  border: 1px solid #d4e8ec;
  border-radius: 6px;
  overflow: hidden;
}
.summary-card-header {
  background: #1f5a6d;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
}
.summary-item {
  padding: 8px 12px;
  border-bottom: 1px solid #eef4f6;
}
.summary-item:last-child { border-bottom: none; }
.summary-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.summary-item-name { font-size: 13px; }
.summary-item-label { font-size: 12px; white-space: nowrap; }
.summary-full .summary-item-label { color: #1f7a3c; }
.summary-partial .summary-item-label { color: #c07000; }
.summary-empty .summary-item-label { color: #c0392b; }
.summary-bar-track {
  height: 5px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}
.summary-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: #20a0a8;
  transition: width 0.3s;
}
.summary-full .summary-bar-fill { background: #1f7a3c; }
.summary-empty .summary-bar-fill { background: #e0e0e0; }

/* ── Food / Services tab table ─────────────────────── */
.items-tab-table .item-name-cell {
  font-weight: 500;
  vertical-align: top;
  padding-top: 8px;
}
.items-tab-table .item-row-first td,
.items-tab-table .item-row-cont td { vertical-align: middle; }
.items-tab-table .item-row-cont td { border-top: 1px dashed #e0e0e0 !important; }
.items-tab-table .item-row-empty td { color: #aaa; }
.items-tab-table .item-group-a td { background: #fff; }
.items-tab-table .item-group-b td { background: #edfaf2; }

.qty-cell { vertical-align: middle !important; }
.qty-count { font-size: 16px; font-weight: 600; color: #1f5a6d; line-height: 1.2; }
.qty-count.qty-full { color: #1f7a3c; }
.qty-limit { font-size: 11px; color: #999; }

.slot-num { color: #999; font-size: 12px; min-width: 18px; display: inline-block; }
.slot-needed {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 3px;
  padding: 1px 7px;
}

/* ── Participant rows (results) ────────────────────── */
tr.participant-first td { border-top: 2px solid #c8dde2 !important; }
tr.participant-cont td { border-top: 1px dashed #e0e0e0 !important; }
tr.participant-first td,
tr.participant-cont td { background: #f9fdfd; }
tr.participant-first td:first-child,
tr.participant-first td:nth-child(2) { background: #f0f7f9; font-weight: 500; }
.choice-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  border-radius: 3px;
  padding: 1px 5px;
  margin-right: 4px;
  vertical-align: middle;
}
.choice-badge-food    { background: #d97706; } /* янтарный — еда */
.choice-badge-service { background: #6d4aab; } /* фиолетовый — служение */
.choice-badge-other   { background: #20a0a8; } /* бирюзовый — другое */

/* ── History detail summary ────────────────────────── */
.hist-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}
.hist-summary-total {
  background: #1f5a6d;
  color: #fff;
  border-radius: 8px;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}
.hist-total-num { font-size: 28px; font-weight: 700; line-height: 1; }
.hist-total-label { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.hist-summary-section {
  border: 1px solid #d4e8ec;
  border-radius: 6px;
  overflow: hidden;
  min-width: 180px;
  flex: 1;
}
.hist-sec-name {
  background: #e8f4f6;
  color: #1f5a6d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
}
.hist-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  border-top: 1px solid #eef4f6;
  font-size: 13px;
  gap: 8px;
}
.hist-item-name { flex: 1; }
.hist-item-stat { white-space: nowrap; font-size: 12px; }
.hist-item-full .hist-item-stat  { color: #1f7a3c; }
.hist-item-partial .hist-item-stat { color: #c07000; }
.hist-item-empty .hist-item-stat  { color: #aaa; }

/* ── Admin sort buttons ────────────────────────────── */
.sort-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 1px 6px;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  line-height: 1.4;
}
.sort-btn:hover { background: #f0f0f0; }
