/* ========================================
   FormPesquisa — Main Stylesheet
   ======================================== */

:root {
  --primary: #06603b;
  --primary-dark: #034b2e;
  --primary-light: #e0f2e9;
  --secondary: #8cc067;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;

  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;

  --sidebar-w: 240px;
  --topbar-h: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, .08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, .12);

  --transition: .2s ease;
}

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

html {
  font-size: 16px;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

/* ========================================
   UTILITIES
   ======================================== */
.hidden {
  display: none !important;
}

.mt-3 {
  margin-top: 1rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.overflow-x {
  overflow-x: auto;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: .35rem .75rem;
  font-size: .8rem;
}

.btn-lg {
  padding: .75rem 1.5rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: .75rem;
  font-size: 1rem;
}

.btn-icon {
  padding: .45rem .6rem;
}

/* ========================================
   LOGIN PAGE
   ======================================== */
body.login-page {
  background: linear-gradient(135deg, #06603b 0%, #034b2e 50%, #8cc067 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-screen {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
}

.login-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.login-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  animation: float 8s infinite ease-in-out;
}

.login-shape.s1 {
  width: 500px;
  height: 500px;
  top: -200px;
  left: -100px;
  animation-delay: 0s;
}

.login-shape.s2 {
  width: 350px;
  height: 350px;
  bottom: -100px;
  right: -80px;
  animation-delay: 2s;
}

.login-shape.s3 {
  width: 200px;
  height: 200px;
  top: 50%;
  left: 50%;
  animation-delay: 4s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

.login-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .3);
  position: relative;
  z-index: 1;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(6, 96, 59, .4);
}

.login-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}

.login-header p {
  font-size: .9rem;
  color: var(--text-secondary);
  margin-top: .3rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.form-group label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 96, 59, .12);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

.select-lg {
  font-size: 1rem;
  padding: .75rem 1rem;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 2.8rem;
}

.toggle-pw {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: .9rem;
  padding: .2rem;
}

.toggle-pw:hover {
  color: var(--text);
}

.login-error {
  background: #fef2f2;
  color: var(--danger);
  padding: .6rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid #fecaca;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.login-hint {
  margin-top: 1.5rem;
  padding: .9rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  color: var(--text-secondary);
  border: 1px dashed var(--border);
  text-align: center;
}

.login-hint p {
  line-height: 1.8;
}

/* ========================================
   APP SHELL
   ======================================== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "sidebar topbar" "sidebar content";
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  grid-area: sidebar;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1.25rem 1rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
}

.sidebar-brand i {
  font-size: 1.4rem;
}

.sidebar-nav {
  padding: .75rem .75rem 0;
  flex: 1;
}

.nav-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
  padding: .5rem .5rem .3rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  margin-bottom: .1rem;
}

.nav-item i {
  font-size: .95rem;
  width: 18px;
  text-align: center;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-footer {
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: .73rem;
  color: var(--text-secondary);
}

.btn-logout {
  color: var(--text-light);
  font-size: 1rem;
  padding: .4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-logout:hover {
  color: var(--danger);
  background: #fef2f2;
}

/* ---- TOPBAR ---- */
.topbar {
  grid-area: topbar;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.menu-toggle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  padding: .4rem;
  display: none;
}

.page-title {
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
}

.badge-role {
  font-size: .75rem;
  font-weight: 600;
  padding: .3rem .8rem;
  border-radius: 99px;
  background: var(--primary-light);
  color: var(--primary);
}

.badge-role.user {
  background: #d1fae5;
  color: #065f46;
}

/* ---- CONTENT ---- */
.page-content {
  grid-area: content;
  padding: 1.5rem;
  overflow-y: auto;
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.card-header h3 {
  font-size: .95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}

/* ========================================
   PAGE HEADER
   ======================================== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
}

.page-subtitle {
  font-size: .875rem;
  color: var(--text-secondary);
  margin-top: .2rem;
}

/* ========================================
   STATS GRID
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  flex-shrink: 0;
}

.bg-blue {
  background: linear-gradient(135deg, #4f46e5, #818cf8);
}

.bg-green {
  background: linear-gradient(135deg, #10b981, #34d399);
}

.bg-purple {
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
}

.bg-orange {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.stat-label {
  font-size: .8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

/* ========================================
   FORMS LIST
   ======================================== */
.forms-table {
  width: 100%;
  border-collapse: collapse;
}

.forms-table th,
.forms-table td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}

.forms-table th {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
  background: var(--bg);
}

.forms-table tr:last-child td {
  border-bottom: none;
}

.forms-table tr:hover td {
  background: #f8fafc;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
}

.badge-active {
  background: #d1fae5;
  color: #065f46;
}

.badge-inactive {
  background: #f1f5f9;
  color: var(--text-secondary);
}

.badge-admin {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-user {
  background: #fef3c7;
  color: #92400e;
}

.actions-cell {
  display: flex;
  gap: .4rem;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-light);
  font-size: .9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}

.empty-state i {
  font-size: 2.5rem;
}

.empty-state.small {
  padding: 1.25rem;
  font-size: .82rem;
}

.empty-state.small i {
  font-size: 1.5rem;
}

/* ========================================
   FORMS GRID (user)
   ======================================== */
.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.form-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(6, 96, 59, .15);
  transform: translateY(-2px);
}

.form-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.form-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.form-card p {
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.form-card-meta {
  font-size: .78rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* ========================================
   FILL FORM
   ======================================== */
.fill-form-card {
  max-width: 700px;
  margin: 0 auto;
}

.fill-form-header {
  padding: 1.5rem 1.5rem 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
}

.fill-form-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
}

.fill-form-header p {
  font-size: .875rem;
  opacity: .85;
  margin-top: .3rem;
}

.question-block {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}

.question-block:last-child {
  border-bottom: none;
}

.question-label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .65rem;
  display: flex;
  gap: .4rem;
  align-items: flex-start;
}

.question-num {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  margin-top: .05rem;
}

.required-star {
  color: var(--danger);
  margin-left: .2rem;
}

.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  font-size: .875rem;
  color: var(--text);
  background: var(--surface);
}

.radio-option:hover,
.checkbox-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.radio-option input,
.checkbox-option input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.radio-option.selected,
.checkbox-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}

.q-answer,
.q-justification-val {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  transition: all var(--transition);
  outline: none;
  font-family: inherit;
}

.q-answer:focus,
.q-justification-val:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 96, 59, 0.15);
}

.q-justification-val {
  resize: vertical;
  min-height: 80px;
}

/* ========================================
   FORM BUILDER
   ======================================== */
.questions-builder {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: .5rem;
}

.question-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
  background: var(--bg);
  position: relative;
}

.question-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .65rem;
}

.question-item-type {
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 99px;
  background: var(--primary-light);
  color: var(--primary);
}

.question-item-actions {
  display: flex;
  gap: .3rem;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: .5rem;
}

.option-row {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.option-row input[type="text"] {
  flex: 1;
}

/* ========================================
   MODALS
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .15s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp .2s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-lg {
  max-width: 720px;
}

.modal-sm {
  max-width: 380px;
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.modal-close {
  color: var(--text-secondary);
  font-size: 1rem;
  padding: .3rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  padding: .9rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-actions {
  display: flex;
  gap: .5rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
}

.toggle-label input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* ========================================
   RESULTS & CHARTS
   ======================================== */
.results-summary-bar {
  display: flex;
  gap: 1px;
  overflow: hidden;
}

.results-summary-bar .card-body {
  display: none;
}

.summary-item {
  flex: 1;
  padding: 1rem 1.25rem;
  text-align: center;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.summary-item:last-child {
  border-right: none;
}

.summary-label {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
}

.summary-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  display: block;
  margin-top: .2rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.chart-card h4 {
  font-size: .875rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--text);
}

.result-card-header {
  margin-bottom: 1rem;
}

.result-card-header h4 {
  margin-bottom: .4rem;
}

.result-card-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.result-type-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 99px;
  background: var(--primary-light);
  color: var(--primary);
}

.result-count {
  font-size: .78rem;
  color: var(--text-secondary);
}

.result-bars-container {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.result-bar-row {}

.result-bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .3rem;
  gap: .5rem;
}

.result-bar-text {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}

.result-bar-stats {
  font-size: .78rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.result-bar-stats strong {
  color: var(--text);
  font-weight: 700;
}

.result-bar-track {
  width: 100%;
  height: 28px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.result-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width .5s ease;
  min-width: 2px;
}

.text-responses-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-height: 250px;
  overflow-y: auto;
  padding: .25rem 0;
}

.text-response-item {
  padding: .55rem .85rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  color: var(--text);
  border-left: 3px solid var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text-response-count {
  font-size: .75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: .1rem .45rem;
  border-radius: 99px;
}

/* Responses Table */
.resp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  min-width: 600px;
}

.resp-table th,
.resp-table td {
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.resp-table th {
  background: var(--bg);
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-secondary);
}

.resp-table tr:last-child td {
  border-bottom: none;
}

.resp-table tr:hover td {
  background: #f8fafc;
}

/* ========================================
   RECENT FORMS (dashboard)
   ======================================== */
.recent-forms-list {
  display: flex;
  flex-direction: column;
}

.recent-form-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
}

.recent-form-item:last-child {
  border-bottom: none;
}

.recent-form-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.recent-form-info {
  flex: 1;
  min-width: 0;
}

.recent-form-info h4 {
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-form-info p {
  font-size: .78rem;
  color: var(--text-secondary);
}

/* ========================================
   TOAST
   ======================================== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  background: #1e293b;
  color: #fff;
  padding: .8rem 1.2rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn .25s ease;
  max-width: 360px;
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.error .toast-icon {
  color: var(--danger);
}

.toast.warning .toast-icon {
  color: var(--warning);
}

@keyframes slideIn {
  from {
    transform: translateX(100px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ========================================
   SUCCESS SCREEN
   ======================================== */
.success-screen {
  text-align: center;
  padding: 3rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #d1fae5;
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.success-screen h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.success-screen p {
  font-size: .875rem;
  color: var(--text-secondary);
  max-width: 360px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "content";
  }

  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    width: var(--sidebar-w);
    z-index: 50;
    transition: left var(--transition);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(0, 0, 0, .3);
    display: none;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .menu-toggle {
    display: flex;
  }

  .topbar {
    padding: 0 1rem;
  }

  .page-content {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .results-summary-bar {
    flex-direction: column;
  }

  .summary-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .summary-item:last-child {
    border-bottom: none;
  }

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

  .modal-lg {
    max-width: 100%;
  }
}

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

  .login-card {
    padding: 1.75rem 1.25rem;
  }
}