* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #1e293b;
  background-color: #0f172a;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(245, 158, 11, 0.15), transparent 30%),
    radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.15), transparent 30%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  background-attachment: fixed;
}

.container { width: 100%; max-width: 580px; margin: 0 auto; padding: 16px; }
.admin-container { max-width: 980px; }

header {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  max-width: 980px;
  margin: 0 auto;
  gap: 12px;
}

.logo-box { display: flex; align-items: center; gap: 12px; }

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.logo-text h1 { font-size: 15px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.logo-text p { font-size: 11px; color: #64748b; }

.card {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 12px;
}

.location-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.title { font-size: 22px; font-weight: 800; color: #0f172a; margin-bottom: 8px; }
.subtitle { font-size: 13px; color: #64748b; line-height: 1.5; margin-bottom: 24px; }
.form-group { margin-bottom: 22px; }
.label { display: block; font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 10px; }

.ratings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 480px) { .ratings-grid { grid-template-columns: repeat(4, 1fr); } }

.rating-option input { position: absolute; opacity: 0; pointer-events: none; }

.rating-card {
  padding: 14px 8px;
  text-align: center;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.rating-card .emoji { font-size: 26px; margin-bottom: 4px; display: block; }
.rating-card .text { font-size: 12px; font-weight: 600; color: #475569; }

.rating-option input:checked + .rating-card {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
}

.rating-option input:checked + .rating-card .text { color: #b45309; font-weight: 700; }

textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1.5px solid #e2e8f0;
  font-size: 14px;
  resize: none;
  outline: none;
  background: #f8fafc;
  font-family: inherit;
}

textarea:focus { border-color: #f59e0b; background: #ffffff; }

.btn-submit {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}

.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

footer {
  text-align: center;
  padding: 20px 16px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
}

.footer-text { font-size: 12px; color: #cbd5e1; line-height: 1.5; }
.footer-text strong { color: #f8fafc; }

.admin-link-btn {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.hidden { display: none !important; }

.modal-content {
  background: white;
  border-radius: 24px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.qr-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
@media (min-width: 720px) { .qr-grid { grid-template-columns: repeat(3, 1fr); } }

.qr-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-card .badge { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 8px; margin-bottom: 6px; }
.qr-box { background: white; padding: 8px; border-radius: 14px; border: 1px solid #e2e8f0; margin: 10px 0; }

.btn-secondary {
  background: #0f172a;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-secondary:hover { background: #1e293b; }
.btn-logout { background: #ef4444; }
.btn-logout:hover { background: #dc2626; }

.btn-download {
  background: #e2e8f0;
  color: #1e293b;
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
}

.btn-excel {
  background: #10b981;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
@media (min-width: 640px) { .dashboard-grid { grid-template-columns: repeat(4, 1fr); } }

.stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-title { font-size: 11px; color: #64748b; font-weight: 600; margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 800; color: #0f172a; }
.stat-sub { font-size: 10px; color: #94a3b8; margin-top: 2px; }

.controls-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}

@media (min-width: 768px) {
  .controls-bar { flex-direction: row; justify-content: space-between; align-items: center; }
}

.filter-pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filter-pills::-webkit-scrollbar { display: none; }

.pill-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: white;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.pill-btn.active { background: #0f172a; color: white; border-color: #0f172a; }

.sort-box { display: flex; align-items: center; gap: 8px; }
.sort-box label { font-size: 11px; font-weight: 600; color: #64748b; white-space: nowrap; }

.sort-select {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: white;
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  outline: none;
  cursor: pointer;
}

.table-container { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 16px; background: white; }

table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
th {
  background: #f8fafc;
  padding: 12px 14px;
  color: #64748b;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; color: #334155; }

.btn-delete-row {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
}

/* ===== Индикатор LIVE (SSE) ===== */
@keyframes live-pulse {
  0%   { opacity: 1;   transform: scale(1); }
  50%  { opacity: 0.4; transform: scale(0.8); }
  100% { opacity: 1;   transform: scale(1); }
}

/* ===== Средний балл по столовым ===== */
.per-point-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  .per-point-grid { grid-template-columns: repeat(3, 1fr); }
}

.per-point-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.per-point-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
}

.per-point-name {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  line-height: 1.3;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.per-point-avg {
  font-size: 26px;
  font-weight: 800;
  color: #d97706;
  line-height: 1;
}

.per-point-count {
  font-size: 10px;
  color: #94a3b8;
}