* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
[hidden] { display: none !important; }

/* ============ Feedback page (iPad) ============ */
.feedback-body {
  background: #0f172a;
  color: #f8fafc;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.feedback-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 32px 48px;
}
.feedback-header {
  text-align: center;
  margin: 24px 0 32px;
}
.feedback-header h1 {
  font-size: 48px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.5px;
}
.feedback-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-content: center;
}
.feedback-button {
  font-size: 36px;
  font-weight: 600;
  padding: 48px 24px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  cursor: pointer;
  min-height: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  transition: transform 80ms ease, background 80ms ease;
  word-break: break-word;
}
.feedback-button:active {
  transform: scale(0.97);
  background: linear-gradient(135deg, #3730a3, #6d28d9);
}
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 28px;
  opacity: 0.7;
}
.thanks-overlay {
  position: fixed;
  inset: 0;
  background: #16a34a;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: pop 220ms ease;
}
.smiley { font-size: 240px; line-height: 1; }
.thanks-text { margin-top: 24px; font-size: 56px; font-weight: 600; }
@keyframes pop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ============ Admin ============ */
.admin-body {
  background: #f1f5f9;
  color: #0f172a;
  min-height: 100vh;
}
.admin-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header h1 { margin: 0; font-size: 20px; }
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-header-actions form { margin: 0; }
.link-button {
  background: none;
  border: none;
  cursor: pointer;
  color: #475569;
  font-size: 14px;
  text-decoration: none;
}
.link-button:hover { color: #0f172a; }

.admin-main {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card h2 { margin: 0 0 8px; font-size: 18px; }
.hint { color: #64748b; font-size: 13px; margin: 0 0 16px; }

.options-list { list-style: none; padding: 0; margin: 0 0 16px; }
.option-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: box-shadow 200ms ease, opacity 200ms ease;
}
.option-row.inactive { opacity: 0.5; }
.option-row.dragging { opacity: 0.4; }
.option-row.flash { box-shadow: 0 0 0 2px #22c55e; }
.drag-handle {
  cursor: grab;
  color: #94a3b8;
  user-select: none;
  text-align: center;
  font-size: 16px;
  letter-spacing: -2px;
}
.option-label {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}
.active-toggle {
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.save-btn, .delete-btn, #add-option-btn,
#stats-apply, #stats-clear, #reset-feedbacks {
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.save-btn { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.delete-btn { color: #b91c1c; border-color: #fecaca; }
.danger { color: #b91c1c; border-color: #fecaca; }
.add-option { display: flex; gap: 8px; }
.add-option input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
}
.add-option button { padding: 8px 16px; background: #4f46e5; color: #fff; border-color: #4f46e5; }

.stats-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.stats-controls .spacer { flex: 1; }
.stats-controls label {
  font-size: 13px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stats-controls input[type=datetime-local] {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
}
.total { font-size: 14px; color: #334155; margin: 8px 0 16px; }
.total #stats-total { font-weight: 700; font-size: 20px; color: #0f172a; }
.charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
.chart-wrap { min-height: 280px; position: relative; }

@media (max-width: 720px) {
  .charts { grid-template-columns: 1fr; }
  .option-row { grid-template-columns: 24px 1fr auto; row-gap: 8px; }
  .option-row .save-btn, .option-row .delete-btn { grid-column: span 1; }
  .option-row .active-toggle { grid-column: 2 / 4; }
}

/* ============ Login ============ */
.login-card {
  max-width: 360px;
  margin: 80px auto;
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.login-card h1 { margin-top: 0; font-size: 22px; }
.login-card label {
  display: block;
  font-size: 13px;
  color: #475569;
  margin: 16px 0 6px;
}
.login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
}
.login-card button {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}
.login-card .error {
  color: #b91c1c;
  font-size: 13px;
  margin-top: 12px;
}
