/* ==========================================================================
   FeedbackHub design system
   Plain CSS, no framework. Mobile-first, accessible focus states.
   ========================================================================== */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  --brand: #4338ca;
  --brand-strong: #3730a3;
  --brand-soft: #eef2ff;
  --accent: #0e7490;
  --star: #d97706;

  --success-bg: #ecfdf5;
  --success-ink: #065f46;
  --success-line: #a7f3d0;
  --error-bg: #fef2f2;
  --error-ink: #991b1b;
  --error-line: #fecaca;
  --info-bg: #eff6ff;
  --info-ink: #1e40af;
  --info-line: #bfdbfe;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 45px -20px rgba(15, 23, 42, 0.28);
  --shadow-soft: 0 8px 24px -16px rgba(15, 23, 42, 0.25);
  --ring: 0 0 0 3px rgba(67, 56, 202, 0.28);
  --ring-error: 0 0 0 3px rgba(220, 38, 38, 0.16);

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 8% -12%, #e0e7ff 0%, rgba(224, 231, 255, 0) 58%),
    radial-gradient(900px 480px at 102% -6%, #cffafe 0%, rgba(207, 250, 254, 0) 55%),
    var(--bg);
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  margin: 0 0 0.5rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 0.85rem;
}

a {
  color: var(--brand);
}

a:hover {
  color: var(--brand-strong);
}

:focus-visible {
  outline: 3px solid rgba(67, 56, 202, 0.5);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------- header --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px -8px rgba(67, 56, 202, 0.8);
}

.brand-text span {
  color: var(--brand);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #e0e7ff;
}

/* ----------------------------------------------------------------- page --- */

.page {
  flex: 1 0 auto;
  padding-top: 44px;
  padding-bottom: 64px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 40px;
  align-items: start;
}

.intro {
  position: sticky;
  top: 96px;
  padding-top: 8px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 11px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: rgba(238, 242, 255, 0.9);
  color: var(--brand-strong);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro h1 {
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  margin-bottom: 14px;
}

.lede {
  font-size: 1.06rem;
  color: var(--ink-soft);
  max-width: 46ch;
}

.checklist {
  list-style: none;
  margin: 22px 0;
  padding: 0;
  display: grid;
  gap: 11px;
}

.checklist li {
  position: relative;
  padding-left: 32px;
  color: var(--ink-soft);
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 800;
}

.privacy-note {
  margin-top: 26px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(236, 254, 255, 0.7);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.privacy-note strong {
  color: var(--ink);
}

/* ----------------------------------------------------------------- card --- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px;
}

.form-card h2 {
  font-size: 1.5rem;
}

.muted {
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.req {
  color: #b91c1c;
  font-weight: 700;
}

.optional {
  margin-left: 4px;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

/* ---------------------------------------------------------------- fields --- */

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

.field {
  margin: 0 0 18px;
}

label,
legend {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}

textarea {
  min-height: 132px;
  resize: vertical;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 2px),
    calc(100% - 15px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #dc2626;
  box-shadow: var(--ring-error);
}

.hint {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.field-error {
  margin: 7px 0 0;
  color: var(--error-ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.field-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.counter {
  flex: none;
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- rating --- */

.rating-field {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
  min-width: 0;
}

.rating-field legend {
  padding: 0;
}

.stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 6px;
  margin: 4px 0 2px;
}

.star-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.star-label {
  margin: 0;
  font-size: 40px;
  line-height: 1;
  color: var(--line-strong);
  cursor: pointer;
  transition: color 0.12s ease, transform 0.12s ease;
  user-select: none;
}

.star-label:hover {
  transform: translateY(-2px);
}

.stars .star-label:hover,
.stars .star-label:hover ~ .star-label,
.stars .star-input:checked ~ .star-label {
  color: var(--star);
}

.star-input:focus-visible + .star-label {
  outline: 3px solid rgba(67, 56, 202, 0.5);
  outline-offset: 3px;
  border-radius: 8px;
}

.stars[aria-invalid="true"] {
  outline: 2px solid rgba(220, 38, 38, 0.45);
  outline-offset: 7px;
  border-radius: 8px;
}

/* ---------------------------------------------------------------- button --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), #4f46e5 55%, var(--accent));
  color: #fff;
  box-shadow: 0 14px 28px -16px rgba(67, 56, 202, 0.85);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: progress;
  filter: saturate(0.8);
  opacity: 0.9;
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.is-busy .spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------- status --- */

.form-status {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.form-status.success {
  background: var(--success-bg);
  border-color: var(--success-line);
  color: var(--success-ink);
}

.form-status.error {
  background: var(--error-bg);
  border-color: var(--error-line);
  color: var(--error-ink);
}

.form-status.info {
  background: var(--info-bg);
  border-color: var(--info-line);
  color: var(--info-ink);
}

.submit-note {
  margin: 10px 0 0;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.hp {
  position: absolute !important;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------------------------------------------------------------- footer --- */

.site-footer {
  flex: none;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  padding-bottom: 18px;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.footer-inner p {
  margin: 0;
}

/* ----------------------------------------------------------- placeholders --- */

.placeholder-page {
  display: grid;
  place-items: center;
  padding: 72px 0;
}

.placeholder-card {
  max-width: 560px;
  text-align: center;
}

.placeholder-card .badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.placeholder-card p {
  color: var(--ink-soft);
}

.placeholder-card .btn {
  width: auto;
  margin-top: 8px;
  padding-inline: 22px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* -------------------------------------------------------------- responsive --- */

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .intro {
    position: static;
    padding-top: 0;
  }

  .lede {
    max-width: none;
  }

  .page {
    padding-top: 30px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .container {
    padding: 0 16px;
  }

  .header-inner {
    min-height: 62px;
  }

  .card {
    padding: 22px 18px;
    border-radius: var(--radius);
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .star-label {
    font-size: 36px;
  }

  .field-meta {
    flex-direction: column;
    gap: 0;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ------------------------------------------------------------- admin auth --- */

.auth-page {
  flex: 1 0 auto;
  display: grid;
  place-items: center;
  padding-top: 56px;
  padding-bottom: 72px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
}

.auth-card h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.1rem);
}

.auth-lede {
  max-width: none;
  font-size: 0.98rem;
}

.auth-note {
  margin: 20px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.auth-links {
  margin: 16px 0 0;
  font-size: 0.88rem;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 76px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.password-toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.nav-user {
  display: inline-block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.btn-compact {
  width: auto;
  padding: 8px 14px;
  font-size: 0.84rem;
}

/* ------------------------------------------------------------ dashboard --- */

.dashboard-page {
  padding-top: 38px;
}

.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-head h1 {
  font-size: clamp(1.8rem, 3.6vw, 2.4rem);
}

.dashboard-head .lede {
  max-width: 62ch;
  margin-bottom: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 8px 0 24px;
}

.stat-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.stat-label {
  margin: 0 0 6px;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-value {
  margin: 0;
  color: var(--ink);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-positive .stat-value {
  color: var(--success-ink);
}

.stat-negative .stat-value {
  color: var(--error-ink);
}

.recent-card {
  padding: 24px 26px;
}

.recent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.recent-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.feedback-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.feedback-table th,
.feedback-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.feedback-table th {
  background: var(--surface-soft);
  color: var(--ink-muted);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.feedback-table tbody tr:last-child td {
  border-bottom: 0;
}

.feedback-table tbody tr:hover {
  background: #fbfcff;
}

.cell-rating {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-comment {
  max-width: 340px;
  color: var(--ink-soft);
}

.cell-actions {
  white-space: nowrap;
}

.btn-delete {
  border: 1px solid rgba(161, 29, 29, 0.28);
  background: #fff5f5;
  color: #a11d1d;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-delete:hover {
  background: #ffe9e9;
}

.btn-delete:focus-visible {
  outline: 2px solid #a11d1d;
  outline-offset: 2px;
}

.btn-delete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.empty-cell {
  padding: 24px 12px !important;
  text-align: center !important;
  color: var(--ink-muted);
}

@media (max-width: 900px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-head {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .auth-page {
    padding-top: 30px;
    padding-bottom: 48px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 1.7rem;
  }

  .site-nav {
    gap: 4px;
  }

  .nav-user {
    display: none;
  }

  .recent-card {
    padding: 18px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------- dashboard analytics --- */

.dashboard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.dashboard-meta .muted {
  margin: 0;
}

.demo-badge {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid #fde68a;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-card {
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
}

.filter-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.filter-head h2 {
  margin: 0;
  font-size: 1.14rem;
}

.filter-head .muted {
  margin: 2px 0 0;
}

.text-button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 16px;
}

.filter-grid .field:first-child {
  grid-column: span 2;
}

.filter-grid input,
.filter-grid select {
  padding-top: 9px;
  padding-bottom: 9px;
  font-size: 0.9rem;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.filter-submit {
  width: auto;
  padding: 10px 22px;
  font-size: 0.9rem;
}

.filter-actions .btn-secondary {
  font-size: 0.9rem;
}

.rating-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 24px;
}

.rating-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.rating-label {
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.rating-value {
  color: var(--ink);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.rating-five { border-left-color: #059669; }
.rating-four { border-left-color: #0e7490; }
.rating-three { border-left-color: #d97706; }
.rating-two { border-left-color: #ea580c; }
.rating-one { border-left-color: #dc2626; }

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  min-width: 0;
  padding: 20px 22px;
  box-shadow: var(--shadow-soft);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.08rem;
}

.panel-head .muted {
  margin: 2px 0 0;
  font-size: 0.82rem;
}

.panel-badge {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.chart-box {
  width: 100%;
}

.rating-chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 230px;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.chart-bar { fill: var(--brand); }
.chart-bar-5 { fill: #059669; }
.chart-bar-4 { fill: #0e7490; }
.chart-bar-3 { fill: #d97706; }
.chart-bar-2 { fill: #ea580c; }
.chart-bar-1 { fill: #dc2626; }

.chart-count {
  fill: var(--ink);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
}

.chart-axis-label {
  fill: var(--ink-muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
}

.chart-empty-label {
  fill: var(--ink-muted);
  font-family: var(--font);
  font-size: 13px;
}

.chart-empty {
  margin: 18px 0;
  color: var(--ink-muted);
  font-size: 0.86rem;
  list-style: none;
}

.category-chart {
  display: grid;
  gap: 12px;
}

.category-row {
  min-width: 0;
}

.category-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.category-label {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count {
  flex: none;
  color: var(--ink-muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.category-track {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.category-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.event-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: event-rank;
}

.event-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.event-item:last-child {
  border-bottom: 0;
}

.event-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-name::before {
  counter-increment: event-rank;
  content: counter(event-rank) ". ";
  color: var(--brand);
  font-weight: 800;
}

.event-meta {
  flex: none;
  color: var(--ink-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.recent-head .muted {
  margin: 2px 0 0;
}

.feedback-table {
  min-width: 820px;
}

.cell-date,
.cell-rating {
  white-space: nowrap;
}

.cell-student {
  display: block;
  font-weight: 600;
}

.cell-sub {
  display: block;
  color: var(--ink-muted);
  font-size: 0.74rem;
}

.cell-event {
  max-width: 200px;
}

.category-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.category-excellent {
  background: var(--success-bg);
  border-color: var(--success-line);
  color: var(--success-ink);
}

.category-good {
  background: var(--info-bg);
  border-color: var(--info-line);
  color: var(--info-ink);
}

.category-average {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.category-poor {
  background: var(--error-bg);
  border-color: var(--error-line);
  color: var(--error-ink);
}

.category-suggestions {
  background: #faf5ff;
  border-color: #e9d5ff;
  color: #6b21a8;
}

.table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
}

.page-info {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.pagination {
  display: flex;
  gap: 8px;
}

.pagination .btn-secondary:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.dashboard-page .form-status {
  margin: 0 0 18px;
}

.demo-access {
  margin-top: 22px;
  padding: 16px;
  border: 1px dashed #c7d2fe;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
}

.demo-access-title {
  margin: 0 0 4px;
  color: var(--brand-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.demo-access-copy {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.demo-btn {
  width: 100%;
}

@media (max-width: 900px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rating-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid .field:first-child {
    grid-column: span 1;
  }

  .filter-head,
  .table-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .rating-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rating-stat {
    padding: 10px 12px;
  }

  .filter-actions,
  .filter-submit,
  .filter-actions .btn-secondary {
    width: 100%;
  }

  .dashboard-actions {
    width: 100%;
  }

  .dashboard-actions .btn-secondary {
    width: 100%;
  }
}

.site-nav {
  flex-wrap: nowrap;
}

.nav-link,
.site-nav .btn-secondary {
  flex: none;
  white-space: nowrap;
}
